* set the bit mask, used for modulus by power-of-2 in a way, that is independent

from the sign of the divisor (so that negative powers of 2 can be supported as
  well in the future)

git-svn-id: trunk@36928 -
This commit is contained in:
nickysn 2017-08-17 15:19:37 +00:00
parent 92510ebe08
commit 910e1eccc8

View File

@ -574,7 +574,7 @@ implementation
exit;
shiftval:=left.resultdef.size*8-1;
dec(tordconstnode(right).value.uvalue);
tordconstnode(right).value.uvalue:=qword((qword(1) shl power)-1);
result:=internalstatements(statements);
temp:=ctempcreatenode.create(left.resultdef,left.resultdef.size,tt_persistent,true);
@ -618,7 +618,7 @@ implementation
end
else
begin
dec(tordconstnode(right).value.uvalue);
tordconstnode(right).value.uvalue:=qword((qword(1) shl power)-1);
result := caddnode.create(andn,left,right);
end;
{ left and right are reused }