mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-11-03 10:29:37 +01: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
|
if a = 0 then
|
||||||
op:=OP_NONE;
|
op:=OP_NONE;
|
||||||
end;
|
end;
|
||||||
OP_SAR,OP_SHL,OP_SHR,OP_ROL,OP_ROR:
|
OP_SAR,OP_SHL,OP_SHR:
|
||||||
begin
|
begin
|
||||||
if a = 0 then
|
if a = 0 then
|
||||||
op:=OP_NONE;
|
op:=OP_NONE;
|
||||||
end;
|
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;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user