Revision: 19120
Author:   [email protected]
Date:     Wed Feb  5 19:56:52 2014 UTC
Log:      A64: Truncate booleans to 0 or 1 in LTaggedToI.

[email protected]

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

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

=======================================
--- /branches/experimental/a64/src/a64/lithium-codegen-a64.cc Wed Feb 5 19:41:46 2014 UTC +++ /branches/experimental/a64/src/a64/lithium-codegen-a64.cc Wed Feb 5 19:56:52 2014 UTC
@@ -5210,7 +5210,7 @@
   if (instr->truncating()) {
     Register output = ToRegister(instr->result());
     Register scratch2 = ToRegister(temp2);
-    Label check_bools, undefined;
+    Label check_bools;

     // If it's not a heap number, jump to undefined check.
__ JumpIfNotRoot(scratch1, Heap::kHeapNumberMapRootIndex, &check_bools);
@@ -5222,15 +5222,18 @@

     __ Bind(&check_bools);

-    TODO_UNIMPLEMENTED("LTaggedToI: Truncate booleans to 0 or 1.");
+    Register true_root = output;
+    Register false_root = scratch2;
+    __ LoadTrueFalseRoots(true_root, false_root);
+    __ Cmp(scratch1, true_root);
+    __ Cset(output, eq);
+    __ Ccmp(scratch1, false_root, ZFlag, ne);
+    __ B(eq, &done);

-    // Check for undefined. Undefined is converted to zero for truncating
+    // Output contains zero, undefined is converted to zero for truncating
     // conversions.
-    __ Bind(&undefined);
-
     DeoptimizeIfNotRoot(input, Heap::kUndefinedValueRootIndex,
                         instr->environment());
-    __ Mov(output, 0);
   } else {
     Register output = ToRegister32(instr->result());

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