Revision: 16989
Author:   mvstan...@chromium.org
Date:     Fri Sep 27 12:43:37 2013 UTC
Log:      Avoid using double temp register explicitly in lithium codegen

BUG=
R=mvstan...@chromium.org

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

Modified:
 /branches/bleeding_edge/src/ia32/lithium-codegen-ia32.cc
 /branches/bleeding_edge/src/ia32/lithium-ia32.h
 /branches/bleeding_edge/src/x64/lithium-codegen-x64.cc
 /branches/bleeding_edge/src/x64/macro-assembler-x64.cc

=======================================
--- /branches/bleeding_edge/src/ia32/lithium-codegen-ia32.cc Tue Sep 24 09:31:07 2013 UTC +++ /branches/bleeding_edge/src/ia32/lithium-codegen-ia32.cc Fri Sep 27 12:43:37 2013 UTC
@@ -5741,6 +5741,7 @@

   ASSERT(instr->unclamped()->Equals(instr->result()));
   Register input_reg = ToRegister(instr->unclamped());
+  XMMRegister temp_xmm_reg = ToDoubleRegister(instr->temp_xmm());
   XMMRegister xmm_scratch = double_scratch0();
   Label is_smi, done, heap_number;

@@ -5761,7 +5762,7 @@
   // Heap number
   __ bind(&heap_number);
__ movdbl(xmm_scratch, FieldOperand(input_reg, HeapNumber::kValueOffset));
-  __ ClampDoubleToUint8(xmm_scratch, xmm1, input_reg);
+  __ ClampDoubleToUint8(xmm_scratch, temp_xmm_reg, input_reg);
   __ jmp(&done, Label::kNear);

   // smi
=======================================
--- /branches/bleeding_edge/src/ia32/lithium-ia32.h Mon Sep 23 18:57:32 2013 UTC +++ /branches/bleeding_edge/src/ia32/lithium-ia32.h Fri Sep 27 12:43:37 2013 UTC
@@ -2508,12 +2508,13 @@

 class LClampTToUint8 V8_FINAL : public LTemplateInstruction<1, 1, 1> {
  public:
-  LClampTToUint8(LOperand* value, LOperand* temp) {
+  LClampTToUint8(LOperand* value, LOperand* temp_xmm) {
     inputs_[0] = value;
-    temps_[0] = temp;
+    temps_[0] = temp_xmm;
   }

   LOperand* unclamped() { return inputs_[0]; }
+  LOperand* temp_xmm() { return temps_[0]; }

   DECLARE_CONCRETE_INSTRUCTION(ClampTToUint8, "clamp-t-to-uint8")
 };
=======================================
--- /branches/bleeding_edge/src/x64/lithium-codegen-x64.cc Tue Sep 24 09:31:07 2013 UTC +++ /branches/bleeding_edge/src/x64/lithium-codegen-x64.cc Fri Sep 27 12:43:37 2013 UTC
@@ -4523,16 +4523,17 @@
   Label slow;
   Register reg = ToRegister(instr->value());
   Register tmp = reg.is(rax) ? rcx : rax;
+  XMMRegister temp_xmm = ToDoubleRegister(instr->temp());

   // Preserve the value of all registers.
   PushSafepointRegistersScope scope(this);

   Label done;
-  // Load value into xmm1 which will be preserved across potential call to
+ // Load value into temp_xmm which will be preserved across potential call to // runtime (MacroAssembler::EnterExitFrameEpilogue preserves only allocatable
   // XMM registers on x64).
   XMMRegister xmm_scratch = double_scratch0();
-  __ LoadUint32(xmm1, reg, xmm_scratch);
+  __ LoadUint32(temp_xmm, reg, xmm_scratch);

   if (FLAG_inline_new) {
     __ AllocateHeapNumber(reg, tmp, &slow);
@@ -4550,10 +4551,10 @@
   CallRuntimeFromDeferred(Runtime::kAllocateHeapNumber, 0, instr);
   if (!reg.is(rax)) __ movq(reg, rax);

-  // Done. Put the value in xmm1 into the value of the allocated heap
+  // Done. Put the value in temp_xmm into the value of the allocated heap
   // number.
   __ bind(&done);
-  __ movsd(FieldOperand(reg, HeapNumber::kValueOffset), xmm1);
+  __ movsd(FieldOperand(reg, HeapNumber::kValueOffset), temp_xmm);
   __ StoreToSafepointRegisterSlot(reg, reg);
 }

=======================================
--- /branches/bleeding_edge/src/x64/macro-assembler-x64.cc Fri Sep 27 07:46:52 2013 UTC +++ /branches/bleeding_edge/src/x64/macro-assembler-x64.cc Fri Sep 27 12:43:37 2013 UTC
@@ -3738,7 +3738,7 @@
 #endif
   // Optionally save all XMM registers.
   if (save_doubles) {
-    int space = XMMRegister::kMaxNumRegisters * kDoubleSize +
+    int space = XMMRegister::kMaxNumAllocatableRegisters * kDoubleSize +
         arg_stack_space * kPointerSize;
     subq(rsp, Immediate(space));
     int offset = -2 * kPointerSize;

--
--
v8-dev mailing list
v8-dev@googlegroups.com
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 v8-dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to