Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(12)

Issue 150093: X64: Implement unary subtraction, ObjectPair. 350 tests still fail. (Closed)

Created:
11 years, 5 months ago by William Hesse
Modified:
9 years, 7 months ago
Reviewers:
Lasse Reichstein
CC:
v8-dev
Visibility:
Public.

Description

X64: Implement unary subtraction, ObjectPair. 350 tests still fail. Committed: http://code.google.com/p/v8/source/detail?r=2304

Patch Set 1 #

Total comments: 6

Patch Set 2 : '' #

Unified diffs Side-by-side diffs Delta from patch set Stats (+114 lines, -17 lines) Patch
M src/runtime.cc View 1 1 chunk +14 lines, -6 lines 0 comments Download
M src/x64/codegen-x64.cc View 1 5 chunks +100 lines, -11 lines 0 comments Download

Messages

Total messages: 3 (0 generated)
William Hesse
I checked the generated assembly code, and ObjectPair does the right thing on X64. It ...
11 years, 5 months ago (2009-06-30 09:08:24 UTC) #1
Lasse Reichstein
LGTM w/ comments. http://codereview.chromium.org/150093/diff/1/2 File src/runtime.cc (right): http://codereview.chromium.org/150093/diff/1/2#newcode4491 Line 4491: return result; // Should be ...
11 years, 5 months ago (2009-06-30 10:55:26 UTC) #2
William Hesse
11 years, 5 months ago (2009-06-30 12:11:50 UTC) #3
http://codereview.chromium.org/150093/diff/1/2
File src/runtime.cc (right):

http://codereview.chromium.org/150093/diff/1/2#newcode4491
Line 4491: return result;  // Should be returned in rax and rdx, in AMD-x64-abi.
On 2009/06/30 10:55:26, Lasse Reichstein wrote:
> Make comment saying that it hasn't been tested in MSVC.
> Or use ifdefs using __GCC__ or __MSVC__ to not enable it.
> 
> Have you tested whether a struct also works in 32-bit mode? (I assume it
doesn't
> or it would have been used already).

Done.

http://codereview.chromium.org/150093/diff/1/3
File src/x64/codegen-x64.cc (right):

http://codereview.chromium.org/150093/diff/1/3#newcode5471
Line 5471: __ j(overflow, &undo);
On 2009/06/30 10:55:26, Lasse Reichstein wrote:
> Will this work? If rax is a smi, then 0 - rax will not overflow a 64-bit
signed
> subtraction.
> 
> If we have a Smi, we only need to special case zero and kMinSmiValue (aka
> -0x80000000). A single testl(rax, 0x7fffffff) should be able to do that. After
> that, we can just use neg(rax).
> 
> 

Replaced with subl, which will overflow.  We need to be able to restore rax from
rdx, which is why we use rdx.

http://codereview.chromium.org/150093/diff/1/3#newcode5475
Line 5475: __ j(zero, &done);
On 2009/06/30 10:55:26, Lasse Reichstein wrote:
> How can it not be smi tagged if we subtract a smi tagged number from zero?

Done.

Powered by Google App Engine
This is Rietveld 408576698