Reviewers: jochen, ulan,
Description:
ARM64: Fix LCodeGen::ToOperand32.
This fixes the following generated code sequence:
movn w1, #0 // Synthesize -1.
cmp w0, w1
With a properly-constructed Operand, the MacroAssembler can optimize it
as follows:
cmn w0, #1
BUG=
Please review this at https://codereview.chromium.org/253513003/
SVN Base: https://v8.googlecode.com/svn/branches/bleeding_edge
Affected files (+2, -3 lines):
M src/arm64/lithium-codegen-arm64.cc
Index: src/arm64/lithium-codegen-arm64.cc
diff --git a/src/arm64/lithium-codegen-arm64.cc
b/src/arm64/lithium-codegen-arm64.cc
index
8f5b811820e04e45f1c88a9963a61c2532f94a24..5fb562448bd0d54735543cc880ffd00d80f107c4
100644
--- a/src/arm64/lithium-codegen-arm64.cc
+++ b/src/arm64/lithium-codegen-arm64.cc
@@ -1235,9 +1235,8 @@ Operand LCodeGen::ToOperand32(LOperand* op,
IntegerSignedness signedness) {
Representation r = chunk_->LookupLiteralRepresentation(const_op);
if (r.IsInteger32()) {
ASSERT(constant->HasInteger32Value());
- return Operand(signedness == SIGNED_INT32
- ? constant->Integer32Value()
- : static_cast<uint32_t>(constant->Integer32Value()));
+ int64_t value = constant->Integer32Value();
+ return (signedness == SIGNED_INT32) ? value : value & kWRegMask;
} else {
// Other constants not implemented.
Abort(kToOperand32UnsupportedImmediate);
--
--
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/d/optout.