mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-20 20:49:49 +02:00
* tshlshrnode.simplify: in the case of 16-bit or 8-bit shl/shr, AND the right
side constant with 31 (instead of 15 or 7), because that's how the 16-bit and 8-bit x86 shl/shr instructions behave (even on 16-bit CPUs like 286). The change does not affect 32-bit and 64-bit platforms, because there the shift is always done in at least 32 bits. git-svn-id: trunk@27638 -
This commit is contained in:
parent
0d3bccaa1b
commit
a17797f3ca
@ -592,11 +592,7 @@ implementation
|
||||
begin
|
||||
{ shl/shr are unsigned operations, so cut off upper bits }
|
||||
case resultdef.size of
|
||||
1:
|
||||
rvalue:=tordconstnode(right).value and byte($7);
|
||||
2:
|
||||
rvalue:=tordconstnode(right).value and byte($f);
|
||||
4:
|
||||
1,2,4:
|
||||
rvalue:=tordconstnode(right).value and byte($1f);
|
||||
8:
|
||||
rvalue:=tordconstnode(right).value and byte($3f);
|
||||
|
Loading…
Reference in New Issue
Block a user