mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-13 15:39:29 +02:00
+ mask only the low bits that matter for the const of OP_ROL and OP_ROR in
tcg.optimize_op_const() git-svn-id: trunk@36036 -
This commit is contained in:
parent
a4e26a7222
commit
e79f49a2b4
@ -1545,11 +1545,26 @@ implementation
|
||||
if a = 0 then
|
||||
op:=OP_NONE;
|
||||
end;
|
||||
OP_SAR,OP_SHL,OP_SHR,OP_ROL,OP_ROR:
|
||||
OP_SAR,OP_SHL,OP_SHR:
|
||||
begin
|
||||
if a = 0 then
|
||||
op:=OP_NONE;
|
||||
if a = 0 then
|
||||
op:=OP_NONE;
|
||||
end;
|
||||
OP_ROL,OP_ROR:
|
||||
begin
|
||||
case size of
|
||||
OS_64,OS_S64:
|
||||
a:=a and 63;
|
||||
OS_32,OS_S32:
|
||||
a:=a and 31;
|
||||
OS_16,OS_S16:
|
||||
a:=a and 15;
|
||||
OS_8,OS_S8:
|
||||
a:=a and 7;
|
||||
end;
|
||||
if a = 0 then
|
||||
op:=OP_NONE;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user