MoveLeft / MoveRight special cases

Jay Michael <[email protected]>
Newsgroups gmane.comp.compilers.gpc
Message-ID <[email protected]>
     The procedures MoveLeft and MoveRight start with a test for whether special case code will be useful/possible.

procedure MoveLeft (const Source; var Dest; Count: SizeType);
  if (Count >= SizeOf (LongestCard))
  and not (pDst - pSrc in [0 .. 2 * SizeOf (TWord) - 1]) then

procedure MoveRight (const Source; var Dest; Count: SizeType);
  if (Count >= SizeOf (LongestCard))
  and not (pSrc - pDst in [0 .. 2 * SizeOf (TWord) - 1]) then

     Procedure Move calls MoveRight when the address of the source is less than the source of the destination, so the difference will always be negative (except when source and destination are the same address), so the difference will never be in the range [0..2*SizeOf(TWord)-1].

     Shouldn't those differences be reversed?

     Shouldn't the threshold be either SizeOf(LongestCard) in both clauses, or 2*SizeOf(TWord) in both clauses?

_______________________________________________
Gpc mailing list
[email protected]
https://www.g-n-u.de/mailman/listinfo/gpc
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.