http://codereview.chromium.org/125185/diff/1/6 File src/x64/codegen-x64.cc (right):
http://codereview.chromium.org/125185/diff/1/6#newcode670 Line 670: __ cmpq(rax, Immediate(0xc0000000)); On 2009/06/17 09:37:11, Lasse Reichstein wrote: > On 2009/06/17 08:27:48, William Hesse wrote: > > cmpl, and many previous instructions should be changed. > Should be cmpq, to get sign extension on the immediate. No, we need both negative and positive numbers to become negative by subtracting this negative number. Only a 32-bit addition of this 32-bit number will work, that sets the sign flag based on bit 31 of the result. cmpl is the correct instruction, that takes 32-bit operands, does the 32-bit math, and sets the bits based on the 32-bit result, then stores the zero-extended result in the register (but cmp does not store its result). For addl and subl, where you want the result to be sign-extended, do a real sign-extension operation after the tests. It may be that zero-extended smis and sign-extended smis can be mixed together, if we only every look at their low 32 bits. http://codereview.chromium.org/125185 --~--~---------~--~----~------------~-------~--~----~ v8-dev mailing list [email protected] http://groups.google.com/group/v8-dev -~----------~----~----~----~------~----~------~--~---
