mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-11-24 19:29:27 +01:00
+ also check for negative powers of 2 in the mod by power-of-2 constant x86 optimization, since the sign of the divisor is ignored by the 'mod' operation
git-svn-id: trunk@36797 -
This commit is contained in:
parent
4b00414183
commit
b6c3329f20
@ -510,9 +510,9 @@ interface
|
||||
end;
|
||||
end;
|
||||
end
|
||||
{ unsigned modulus by a power-of-2 constant? }
|
||||
{ unsigned modulus by a (+/-)power-of-2 constant? }
|
||||
else if (nodetype=modn) and (right.nodetype=ordconstn) and
|
||||
ispowerof2(tordconstnode(right).value,power) and
|
||||
isabspowerof2(tordconstnode(right).value,power) and
|
||||
not(is_signed(left.resultdef)) then
|
||||
begin
|
||||
emit_const_reg(A_AND,opsize,(aint(1) shl power)-1,hreg1);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user