Revision: 13605
Author:   [email protected]
Date:     Wed Feb  6 03:54:27 2013
Log:      Small improvement in x64 assembler

Review URL: https://chromiumcodereview.appspot.com/12177012
Patch from Zheng Z. Liu <[email protected]>.
http://code.google.com/p/v8/source/detail?r=13605

Modified:
 /branches/bleeding_edge/src/x64/assembler-x64.cc
 /branches/bleeding_edge/src/x64/macro-assembler-x64.cc

=======================================
--- /branches/bleeding_edge/src/x64/assembler-x64.cc Wed Jan 23 08:29:48 2013 +++ /branches/bleeding_edge/src/x64/assembler-x64.cc Wed Feb 6 03:54:27 2013
@@ -1505,13 +1505,12 @@
 void Assembler::movq(Register dst, int64_t value, RelocInfo::Mode rmode) {
   // Non-relocatable values might not need a 64-bit representation.
   if (RelocInfo::IsNone(rmode)) {
-    // Sadly, there is no zero or sign extending move for 8-bit immediates.
-    if (is_int32(value)) {
+    if (is_uint32(value)) {
+      movl(dst, Immediate(static_cast<int32_t>(value)));
+      return;
+    } else if (is_int32(value)) {
       movq(dst, Immediate(static_cast<int32_t>(value)));
       return;
-    } else if (is_uint32(value)) {
-      movl(dst, Immediate(static_cast<int32_t>(value)));
-      return;
     }
// Value cannot be represented by 32 bits, so do a full 64 bit immediate
     // value.
=======================================
--- /branches/bleeding_edge/src/x64/macro-assembler-x64.cc Mon Feb 4 04:01:59 2013 +++ /branches/bleeding_edge/src/x64/macro-assembler-x64.cc Wed Feb 6 03:54:27 2013
@@ -2909,25 +2909,16 @@
   Set(result_reg, 255);
   bind(&done);
 }
-
-
-static double kUint32Bias =
-    static_cast<double>(static_cast<uint32_t>(0xFFFFFFFF)) + 1;


 void MacroAssembler::LoadUint32(XMMRegister dst,
                                 Register src,
                                 XMMRegister scratch) {
-  Label done;
-  cmpl(src, Immediate(0));
-  movq(kScratchRegister,
-       reinterpret_cast<int64_t>(&kUint32Bias),
-       RelocInfo::NONE64);
-  movsd(scratch, Operand(kScratchRegister, 0));
-  cvtlsi2sd(dst, src);
-  j(not_sign, &done, Label::kNear);
-  addsd(dst, scratch);
-  bind(&done);
+  if (FLAG_debug_code) {
+    cmpq(src, Immediate(0xffffffff));
+    Assert(below_equal, "input GPR is expected to have upper32 cleared");
+  }
+  cvtqsi2sd(dst, src);
 }


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