TM: move cmov_available setting into nj arch backends where appropriate
authorVladimir Vukicevic <vladimir@pobox.com>
Tue, 30 Sep 2008 17:15:09 -0700
changeset 20014 affae1cacdc36432b0eda4b2c91379d71052f30a
parent 20013 3daa02cc94caee4d4322323df07cc67961830da7
child 20016 33c1b3c0c44a493f295d1c12f0135d81894f0951
push id2577
push userbrendan@mozilla.com
push dateWed, 01 Oct 2008 04:35:27 +0000
treeherdermozilla-central@a613924403d6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
milestone1.9.1b1pre
TM: move cmov_available setting into nj arch backends where appropriate
js/src/jstracer.cpp
js/src/nanojit/NativeARM.cpp
js/src/nanojit/Nativei386.cpp
--- a/js/src/jstracer.cpp
+++ b/js/src/jstracer.cpp
@@ -2851,19 +2851,16 @@ extern void
 js_InitJIT(JSTraceMonitor *tm)
 {
 #if defined NANOJIT_IA32
     if (!did_we_check_sse2) {
         avmplus::AvmCore::cmov_available =
         avmplus::AvmCore::sse2_available = js_CheckForSSE2();
         did_we_check_sse2 = true;
     }
-#elif defined NANOJIT_AMD64
-    avmplus::AvmCore::cmov_available =
-    avmplus::AvmCore::sse2_available = true;
 #endif
     if (!tm->fragmento) {
         JS_ASSERT(!tm->globalSlots && !tm->globalTypeMap && !tm->recoveryDoublePool);
         Fragmento* fragmento = new (&gc) Fragmento(core, 24);
         verbose_only(fragmento->labels = new (&gc) LabelMap(core, NULL);)
         fragmento->assm()->setCallTable(builtins);
         tm->fragmento = fragmento;
         tm->globalSlots = new (&gc) SlotList();
--- a/js/src/nanojit/NativeARM.cpp
+++ b/js/src/nanojit/NativeARM.cpp
@@ -64,17 +64,17 @@ const char* regNames[] = {"r0","r1","r2"
 
 const Register Assembler::argRegs[] = { R0, R1, R2, R3 };
 const Register Assembler::retRegs[] = { R0, R1 };
 
 void
 Assembler::nInit(AvmCore*)
 {
     // all ARMs have conditional move
-    has_cmov = true;
+    avmplus::AvmCore::cmov_available = true;
 }
 
 NIns*
 Assembler::genPrologue(RegisterMask needSaving)
 {
     /**
      * Prologue
      */
--- a/js/src/nanojit/Nativei386.cpp
+++ b/js/src/nanojit/Nativei386.cpp
@@ -78,16 +78,20 @@ namespace nanojit
 	const Register Assembler::argRegs[] = { RDI, RSI, RDX, RCX, R8, R9 };
 #endif
 	const Register Assembler::retRegs[] = { RAX, RDX };
 #endif
 
 	void Assembler::nInit(AvmCore* core)
 	{
         OSDep::getDate();
+#ifdef NANOJIT_ADM64
+        avmplus::AvmCore::cmov_available =
+        avmplus::AvmCore::sse2_available = true;
+#endif
 	}
 
 	NIns* Assembler::genPrologue(RegisterMask needSaving)
 	{
 		/**
 		 * Prologue
 		 */
 		uint32_t stackNeeded = STACK_GRANULARITY * _activation.highwatermark;