Bug 669564 - XMM6 and XMM7 aren't scratch register on Win64 ABI. r=bhackett1024
authorMakoto Kato <m_kato@ga2.so-net.ne.jp>
Thu, 07 Jul 2011 16:34:19 +0900
changeset 75185 d870a3d2a5ffd67a11d374dc0f26ae16886bbbe6
parent 75184 104b182daf70ee2e5542803810a864a0cddc509a
child 75186 9863e9639d801e9abb7e77a65e44981bb1c29f5b
push id2
push userbsmedberg@mozilla.com
push dateFri, 19 Aug 2011 14:38:13 +0000
reviewersbhackett1024
bugs669564
milestone8.0a1
Bug 669564 - XMM6 and XMM7 aren't scratch register on Win64 ABI. r=bhackett1024
js/src/methodjit/MachineRegs.h
--- a/js/src/methodjit/MachineRegs.h
+++ b/js/src/methodjit/MachineRegs.h
@@ -348,28 +348,35 @@ struct Registers {
         return true;
     }
 
     /* Floating point registers. */
 
     typedef JSC::MacroAssembler::FPRegisterID FPRegisterID;
 
 #if defined(JS_CPU_X86) || defined(JS_CPU_X64)
+#ifdef _WIN64
+    /* scrach registers of Win64 ABI are xmm0-xmm5 */
+    static const uint32 TotalFPRegisters = 5;
+#else
     static const uint32 TotalFPRegisters = 7;
+#endif
     static const uint32 TempFPRegs = (
           (1 << JSC::X86Registers::xmm0)
         | (1 << JSC::X86Registers::xmm1)
         | (1 << JSC::X86Registers::xmm2)
         | (1 << JSC::X86Registers::xmm3)
         | (1 << JSC::X86Registers::xmm4)
-        | (1 << JSC::X86Registers::xmm5)
+#ifndef _WIN64
         | (1 << JSC::X86Registers::xmm6)
+        | (1 << JSC::X86Registers::xmm7)
+#endif
         ) << TotalRegisters;
     /* For shuffling FP values around, or loading GPRs into a FP reg. */
-    static const FPRegisterID FPConversionTemp = JSC::X86Registers::xmm7;
+    static const FPRegisterID FPConversionTemp = JSC::X86Registers::xmm5;
 #elif defined(JS_CPU_ARM)
     static const uint32 TotalFPRegisters = 3;
     static const uint32 TempFPRegs = (
           (1 << JSC::ARMRegisters::d0)
         | (1 << JSC::ARMRegisters::d1)
         | (1 << JSC::ARMRegisters::d2)
         ) << TotalRegisters;
     static const FPRegisterID FPConversionTemp = JSC::ARMRegisters::d3;