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#newcode3596
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.cc#newcode3603
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.cc#newcode3619
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.cc#newcode3621
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.cc#newcode3626
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.cc#newcode3629
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'.
https://codereview.chromium.org/145273005/
--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
---
You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.