From 486a9fdb3fe0b1ae331a8b88b7c08f3bfe5bce5e Mon Sep 17 00:00:00 2001 From: "Jacob.Bramley@arm.com" Date: Fri, 25 Apr 2014 14:07:45 +0000 Subject: [PATCH] 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= R=ulan@chromium.org Review URL: https://codereview.chromium.org/253513003 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@20989 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- src/arm64/lithium-codegen-arm64.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/arm64/lithium-codegen-arm64.cc b/src/arm64/lithium-codegen-arm64.cc index 8f5b811..0a44c7d 100644 --- a/src/arm64/lithium-codegen-arm64.cc +++ b/src/arm64/lithium-codegen-arm64.cc @@ -1235,9 +1235,9 @@ 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(constant->Integer32Value())); + return (signedness == SIGNED_INT32) + ? Operand(constant->Integer32Value()) + : Operand(static_cast(constant->Integer32Value())); } else { // Other constants not implemented. Abort(kToOperand32UnsupportedImmediate); -- 2.7.4