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

Issue 145273005: A64: Implement LMathFloorOfDiv and enable the instruction in hydrogen (Closed)

Created:
6 years, 11 months ago by jochen (gone - plz use gerrit)
Modified:
6 years, 11 months ago
CC:
v8-dev
Visibility:
Public.

Description

A64: Implement LMathFloorOfDiv and enable the instruction in hydrogen BUG=314606 R=ulan@chromium.org, baptiste.afsa@arm.com Committed: https://code.google.com/p/v8/source/detail?r=18780

Patch Set 1 #

Total comments: 7
Unified diffs Side-by-side diffs Delta from patch set Stats (+103 lines, -2 lines) Patch
M src/a64/lithium-a64.h View 2 chunks +20 lines, -0 lines 0 comments Download
M src/a64/lithium-a64.cc View 1 chunk +39 lines, -1 line 0 comments Download
M src/a64/lithium-codegen-a64.cc View 1 chunk +43 lines, -0 lines 7 comments Download
M src/hydrogen-instructions.cc View 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 5 (0 generated)
jochen (gone - plz use gerrit)
plz review
6 years, 11 months ago (2014-01-23 12:58:50 UTC) #1
ulan
lgtm, let's use 'A64:' as a cl prefix.
6 years, 11 months ago (2014-01-23 13:42:54 UTC) #2
jochen (gone - plz use gerrit)
Committed patchset #1 manually as r18780 (presubmit successful).
6 years, 11 months ago (2014-01-23 13:53:26 UTC) #3
baptiste.afsa1
https://codereview.chromium.org/145273005/diff/1/src/a64/lithium-codegen-a64.cc File src/a64/lithium-codegen-a64.cc (right): https://codereview.chromium.org/145273005/diff/1/src/a64/lithium-codegen-a64.cc#newcode3627 src/a64/lithium-codegen-a64.cc:3627: __ Cmp(remainder, 0); You can merge this two instructions ...
6 years, 11 months ago (2014-01-23 13:54:19 UTC) #4
jbramley
6 years, 11 months ago (2014-01-23 14:15:12 UTC) #5
Message was sent while issue was closed.
https://codereview.chromium.org/145273005/diff/1/src/a64/lithium-codegen-a64.cc
File src/a64/lithium-codegen-a64.cc (right):

https://codereview.chromium.org/145273005/diff/1/src/a64/lithium-codegen-a64....
src/a64/lithium-codegen-a64.cc:3596: const Register remainder =
ToRegister32(instr->temp());
We don't usually declare these as 'const'. If we're going to start doing that,
we should probably make a big change and do them all at once.

https://codereview.chromium.org/145273005/diff/1/src/a64/lithium-codegen-a64....
src/a64/lithium-codegen-a64.cc:3603: __ Cmp(left, kMinInt);
This will generate two instructions because cmp can't take the immediate
0x8000...00. Instead, use Cmp(left, 1); the V flag will be set if (and only if)
left was kMinInt. In context:

__ Cmp(left, 1);
__ Ccmp(right, -1, ZFlag, vs);
DeoptimizeIf(eq, ...);

https://codereview.chromium.org/145273005/diff/1/src/a64/lithium-codegen-a64....
src/a64/lithium-codegen-a64.cc:3619: __ Sdiv(result, left, right);
This can't cause an exception on ARM, so it can go right at the top to
speculatively calculate the result before we've checked for x/0, kMinInt/-1 and
the like.

https://codereview.chromium.org/145273005/diff/1/src/a64/lithium-codegen-a64....
src/a64/lithium-codegen-a64.cc:3621: __ Eor(remainder, left, Operand(right));
We have an implicit constructor for Operand (for simple registers and constants)
so you can just write 'right'.

https://codereview.chromium.org/145273005/diff/1/src/a64/lithium-codegen-a64....
src/a64/lithium-codegen-a64.cc:3626: __ Sub(remainder, remainder, left);
You can use Msub here instead of Mul and Sub:
__ Msub(remainder, result, right, left);

This produces a result with the opposite sign (left - result * right) but that's
fine for a compare-with-zero.

https://codereview.chromium.org/145273005/diff/1/src/a64/lithium-codegen-a64....
src/a64/lithium-codegen-a64.cc:3629: __ Sub(result, result, Operand(1));
We have an implicit constructor for Operand (for simple registers and constants)
so you can just write '1'.

Powered by Google App Engine
This is Rietveld 408576698