Revision: 19279
Author:   [email protected]
Date:     Tue Feb 11 12:58:23 2014 UTC
Log: A64: When truncating to an int, store the result in a 64bit register

We don't check later one whether the result is 32bit or 64bit, so we end
up using an undefined value otherwise.

BUG=none
[email protected], [email protected], [email protected]
TEST=mjsunit/sin-cos.js
LOG=n

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

Modified:
 /branches/experimental/a64/src/a64/lithium-codegen-a64.cc
 /branches/experimental/a64/src/a64/macro-assembler-a64.cc
 /branches/experimental/a64/src/a64/macro-assembler-a64.h
 /branches/experimental/a64/test/cctest/test-assembler-a64.cc

=======================================
--- /branches/experimental/a64/src/a64/lithium-codegen-a64.cc Tue Feb 11 10:58:46 2014 UTC +++ /branches/experimental/a64/src/a64/lithium-codegen-a64.cc Tue Feb 11 12:58:23 2014 UTC
@@ -5493,7 +5493,7 @@
                     ToRegister(instr->temp2()),
                     instr->tag_result()
                         ? MacroAssembler::SMI
-                        : MacroAssembler::INT32_IN_W);
+                        : MacroAssembler::INT32);
 }


=======================================
--- /branches/experimental/a64/src/a64/macro-assembler-a64.cc Tue Feb 11 08:35:55 2014 UTC +++ /branches/experimental/a64/src/a64/macro-assembler-a64.cc Tue Feb 11 12:58:23 2014 UTC
@@ -2544,14 +2544,7 @@

   Bind(&tag);
   switch (format) {
-    case INT32_IN_W:
-      // There is nothing to do; the upper 32 bits are undefined.
-      if (emit_debug_code()) {
-        __ Mov(scratch1, 0x55555555);
-        __ Bfi(result, scratch1, 32, 32);
-      }
-      break;
-    case INT32_IN_X:
+    case INT32:
       Sxtw(result, result);
       break;
     case SMI:
=======================================
--- /branches/experimental/a64/src/a64/macro-assembler-a64.h Mon Feb 10 17:01:19 2014 UTC +++ /branches/experimental/a64/src/a64/macro-assembler-a64.h Tue Feb 11 12:58:23 2014 UTC
@@ -1094,13 +1094,9 @@
   // ---- Floating point helpers ----

   enum ECMA262ToInt32Result {
- // Provide an untagged int32_t which can be read using result.W(). That is,
-    // the upper 32 bits of result are undefined.
-    INT32_IN_W,
-
// Provide an untagged int32_t which can be read using the 64-bit result
     // register. The int32_t result is sign-extended.
-    INT32_IN_X,
+    INT32,

     // Tag the int32_t result as a smi.
     SMI
@@ -1111,7 +1107,7 @@
                       DoubleRegister input,
                       Register scratch1,
                       Register scratch2,
-                      ECMA262ToInt32Result format = INT32_IN_X);
+                      ECMA262ToInt32Result format = INT32);

   // As ECMA262ToInt32, but operate on a HeapNumber.
   void HeapNumberECMA262ToInt32(Register result,
@@ -1119,7 +1115,7 @@
                                 Register scratch1,
                                 Register scratch2,
                                 DoubleRegister double_scratch,
-                                ECMA262ToInt32Result format = INT32_IN_X);
+                                ECMA262ToInt32Result format = INT32);

   // ---- Code generation helpers ----

=======================================
--- /branches/experimental/a64/test/cctest/test-assembler-a64.cc Mon Feb 10 09:15:49 2014 UTC +++ /branches/experimental/a64/test/cctest/test-assembler-a64.cc Tue Feb 11 12:58:23 2014 UTC
@@ -9352,21 +9352,15 @@

   __ Fmov(d0, input);

-  __ ECMA262ToInt32(x0, d0, x10, x11, MacroAssembler::INT32_IN_W);
-  __ ECMA262ToInt32(x1, d0, x10, x11, MacroAssembler::INT32_IN_X);
+  __ ECMA262ToInt32(x1, d0, x10, x11, MacroAssembler::INT32);
   __ ECMA262ToInt32(x2, d0, x10, x11, MacroAssembler::SMI);

- // The upper bits of INT32_IN_W are undefined, so make sure we don't try to
-  // test them.
-  __ Mov(w0, w0);
-
   END();

   RUN();

   int64_t expected64 = expected;

-  ASSERT_EQUAL_32(expected, w0);
   ASSERT_EQUAL_64(expected64, x1);
   ASSERT_EQUAL_64(expected64 << kSmiShift | kSmiTag, x2);

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