Revision: 19237
Author:   [email protected]
Date:     Mon Feb 10 17:18:24 2014 UTC
Log:      A64: Fix addition of external value and int32.

[email protected], [email protected]

Review URL: https://codereview.chromium.org/152683005
http://code.google.com/p/v8/source/detail?r=19237

Modified:
 /branches/experimental/a64/src/a64/lithium-a64.cc
 /branches/experimental/a64/src/a64/lithium-a64.h
 /branches/experimental/a64/src/a64/lithium-codegen-a64.cc

=======================================
--- /branches/experimental/a64/src/a64/lithium-a64.cc Mon Feb 10 17:01:19 2014 UTC +++ /branches/experimental/a64/src/a64/lithium-a64.cc Mon Feb 10 17:18:24 2014 UTC
@@ -856,7 +856,7 @@
     ASSERT(!instr->CheckFlag(HValue::kCanOverflow));
     LOperand* left = UseRegisterAtStart(instr->left());
     LOperand* right = UseRegisterOrConstantAtStart(instr->right());
-    return DefineAsRegister(new(zone()) LAddI(left, right));
+    return DefineAsRegister(new(zone()) LAddE(left, right));
   } else if (instr->representation().IsDouble()) {
     return DoArithmeticD(Token::ADD, instr);
   } else {
=======================================
--- /branches/experimental/a64/src/a64/lithium-a64.h Mon Feb 10 17:01:19 2014 UTC +++ /branches/experimental/a64/src/a64/lithium-a64.h Mon Feb 10 17:18:24 2014 UTC
@@ -42,6 +42,7 @@

 #define LITHIUM_CONCRETE_INSTRUCTION_LIST(V)    \
   V(AccessArgumentsAt)                          \
+  V(AddE)                                       \
   V(AddI)                                       \
   V(AddS)                                       \
   V(Allocate)                                   \
@@ -562,6 +563,21 @@
 };


+class LAddE V8_FINAL : public LTemplateInstruction<1, 2, 0> {
+ public:
+  LAddE(LOperand* left, LOperand* right) {
+    inputs_[0] = left;
+    inputs_[1] = right;
+  }
+
+  LOperand* left() { return inputs_[0]; }
+  LOperand* right() { return inputs_[1]; }
+
+  DECLARE_CONCRETE_INSTRUCTION(AddE, "add-e")
+  DECLARE_HYDROGEN_ACCESSOR(Add)
+};
+
+
 class LAddI V8_FINAL : public LTemplateInstruction<1, 2, 0> {
  public:
   LAddI(LOperand* left, LOperand* right) {
=======================================
--- /branches/experimental/a64/src/a64/lithium-codegen-a64.cc Mon Feb 10 17:01:19 2014 UTC +++ /branches/experimental/a64/src/a64/lithium-codegen-a64.cc Mon Feb 10 17:18:24 2014 UTC
@@ -1417,6 +1417,18 @@
     __ Ldr(result, MemOperand(arguments, temp, UXTW, kPointerSizeLog2));
   }
 }
+
+
+void LCodeGen::DoAddE(LAddE* instr) {
+  Register result = ToRegister(instr->result());
+  Register left = ToRegister(instr->left());
+  Operand right = (instr->right()->IsConstantOperand())
+      ? ToInteger32(LConstantOperand::cast(instr->right()))
+      : Operand(ToRegister32(instr->right()), SXTW);
+
+  ASSERT(!instr->hydrogen()->CheckFlag(HValue::kCanOverflow));
+  __ Add(result, left, right);
+}


 void LCodeGen::DoAddI(LAddI* instr) {

--
--
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.

Reply via email to