Revision: 25156
Author:   [email protected]
Date:     Wed Nov  5 14:04:10 2014 UTC
Log: Version 3.30.34 (based on 813b071b3059081f42bd85ee3078b4d677a0eb14)
https://code.google.com/p/v8/source/detail?r=25156

Modified:
 /trunk/src/compiler/x64/instruction-selector-x64.cc
 /trunk/src/version.cc
 /trunk/src/x87/interface-descriptors-x87.cc
 /trunk/src/x87/lithium-codegen-x87.cc
 /trunk/src/x87/macro-assembler-x87.cc
 /trunk/src/x87/macro-assembler-x87.h
 /trunk/test/unittests/compiler/x64/instruction-selector-x64-unittest.cc

=======================================
--- /trunk/src/compiler/x64/instruction-selector-x64.cc Tue Nov 4 01:04:58 2014 UTC +++ /trunk/src/compiler/x64/instruction-selector-x64.cc Wed Nov 5 14:04:10 2014 UTC
@@ -320,6 +320,17 @@


 void InstructionSelector::VisitWord64Shl(Node* node) {
+  X64OperandGenerator g(this);
+  Int64BinopMatcher m(node);
+ if ((m.left().IsChangeInt32ToInt64() || m.left().IsChangeUint32ToUint64()) &&
+      m.right().IsInRange(32, 63)) {
+ // There's no need to sign/zero-extend to 64-bit if we shift out the upper
+    // 32 bits anyway.
+    Emit(kX64Shl, g.DefineSameAsFirst(node),
+         g.UseRegister(m.left().node()->InputAt(0)),
+         g.UseImmediate(m.right().node()));
+    return;
+  }
   VisitWord64Shift(this, node, kX64Shl);
 }

=======================================
--- /trunk/src/version.cc       Wed Nov  5 01:04:48 2014 UTC
+++ /trunk/src/version.cc       Wed Nov  5 14:04:10 2014 UTC
@@ -34,7 +34,7 @@
 // system so their names cannot be changed without changing the scripts.
 #define MAJOR_VERSION     3
 #define MINOR_VERSION     30
-#define BUILD_NUMBER      33
+#define BUILD_NUMBER      34
 #define PATCH_LEVEL       0
 // Use 1 for candidates and 0 otherwise.
 // (Boolean macro values are not supported by all preprocessors.)
=======================================
--- /trunk/src/x87/interface-descriptors-x87.cc Wed Oct  1 00:05:35 2014 UTC
+++ /trunk/src/x87/interface-descriptors-x87.cc Wed Nov  5 14:04:10 2014 UTC
@@ -153,6 +153,15 @@
   Register registers[] = {esi, eax, ebx};
   data->Initialize(arraysize(registers), registers, NULL);
 }
+
+
+void AllocateHeapNumberDescriptor::Initialize(
+    CallInterfaceDescriptorData* data) {
+  // register state
+  // esi -- context
+  Register registers[] = {esi};
+  data->Initialize(arraysize(registers), registers, nullptr);
+}


 void ArrayConstructorConstantArgCountDescriptor::Initialize(
=======================================
--- /trunk/src/x87/lithium-codegen-x87.cc       Wed Oct 22 07:27:53 2014 UTC
+++ /trunk/src/x87/lithium-codegen-x87.cc       Wed Nov  5 14:04:10 2014 UTC
@@ -2272,6 +2272,8 @@
   if (instr->op() != Token::MOD) {
     X87PrepareBinaryOp(left, right, result);
   }
+  // Set the precision control to double-precision.
+  __ X87SetFPUCW(0x027F);
   switch (instr->op()) {
     case Token::ADD:
       __ fadd_i(1);
@@ -2306,12 +2308,8 @@
       break;
   }

- // Only always explicitly storing to memory to force the round-down for double
-  // arithmetic.
-  __ lea(esp, Operand(esp, -kDoubleSize));
-  __ fstp_d(Operand(esp, 0));
-  __ fld_d(Operand(esp, 0));
-  __ lea(esp, Operand(esp, kDoubleSize));
+  // Restore the default value of control word.
+  __ X87SetFPUCW(0x037F);
 }


=======================================
--- /trunk/src/x87/macro-assembler-x87.cc       Mon Oct 20 08:53:36 2014 UTC
+++ /trunk/src/x87/macro-assembler-x87.cc       Wed Nov  5 14:04:10 2014 UTC
@@ -765,6 +765,13 @@
   fldcw(MemOperand(esp, 0));
   add(esp, Immediate(kPointerSize));
 }
+
+
+void MacroAssembler::X87SetFPUCW(int cw) {
+  push(Immediate(cw));
+  fldcw(MemOperand(esp, 0));
+  add(esp, Immediate(kPointerSize));
+}


 void MacroAssembler::AssertNumber(Register object) {
=======================================
--- /trunk/src/x87/macro-assembler-x87.h        Tue Oct 14 07:51:07 2014 UTC
+++ /trunk/src/x87/macro-assembler-x87.h        Wed Nov  5 14:04:10 2014 UTC
@@ -425,6 +425,7 @@
   void FXamSign();
   void X87CheckIA();
   void X87SetRC(int rc);
+  void X87SetFPUCW(int cw);

   void ClampUint8(Register reg);
   void ClampTOSToUint8(Register result_reg);
=======================================
--- /trunk/test/unittests/compiler/x64/instruction-selector-x64-unittest.cc Tue Nov 4 01:04:58 2014 UTC +++ /trunk/test/unittests/compiler/x64/instruction-selector-x64-unittest.cc Wed Nov 5 14:04:10 2014 UTC
@@ -322,6 +322,48 @@
   EXPECT_EQ(s.ToVreg(n), s.ToVreg(s[0]->Output()));
   EXPECT_TRUE(s.IsFixed(s[0]->OutputAt(0), rdx));
 }
+
+
+// -----------------------------------------------------------------------------
+// Word64Shl.
+
+
+TEST_F(InstructionSelectorTest, Word64ShlWithChangeInt32ToInt64) {
+  TRACED_FORRANGE(int64_t, x, 32, 63) {
+    StreamBuilder m(this, kMachInt64, kMachInt32);
+    Node* const p0 = m.Parameter(0);
+ Node* const n = m.Word64Shl(m.ChangeInt32ToInt64(p0), m.Int64Constant(x));
+    m.Return(n);
+    Stream s = m.Build();
+    ASSERT_EQ(1U, s.size());
+    EXPECT_EQ(kX64Shl, s[0]->arch_opcode());
+    ASSERT_EQ(2U, s[0]->InputCount());
+    EXPECT_EQ(s.ToVreg(p0), s.ToVreg(s[0]->InputAt(0)));
+    EXPECT_EQ(x, s.ToInt32(s[0]->InputAt(1)));
+    ASSERT_EQ(1U, s[0]->OutputCount());
+    EXPECT_TRUE(s.IsSameAsFirst(s[0]->Output()));
+    EXPECT_EQ(s.ToVreg(n), s.ToVreg(s[0]->Output()));
+  }
+}
+
+
+TEST_F(InstructionSelectorTest, Word64ShlWithChangeUint32ToUint64) {
+  TRACED_FORRANGE(int64_t, x, 32, 63) {
+    StreamBuilder m(this, kMachInt64, kMachUint32);
+    Node* const p0 = m.Parameter(0);
+ Node* const n = m.Word64Shl(m.ChangeUint32ToUint64(p0), m.Int64Constant(x));
+    m.Return(n);
+    Stream s = m.Build();
+    ASSERT_EQ(1U, s.size());
+    EXPECT_EQ(kX64Shl, s[0]->arch_opcode());
+    ASSERT_EQ(2U, s[0]->InputCount());
+    EXPECT_EQ(s.ToVreg(p0), s.ToVreg(s[0]->InputAt(0)));
+    EXPECT_EQ(x, s.ToInt32(s[0]->InputAt(1)));
+    ASSERT_EQ(1U, s[0]->OutputCount());
+    EXPECT_TRUE(s.IsSameAsFirst(s[0]->Output()));
+    EXPECT_EQ(s.ToVreg(n), s.ToVreg(s[0]->Output()));
+  }
+}

 }  // namespace compiler
 }  // namespace internal

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

Reply via email to