Rename and simplify SSE3_4 to SSE4
authorFei Peng <fei.peng@intel.com>
Mon, 30 Oct 2017 18:32:08 +0000 (11:32 -0700)
committerFei Peng <fei.peng@intel.com>
Mon, 30 Oct 2017 18:32:08 +0000 (11:32 -0700)
src/jit/compiler.cpp
src/jit/compiler.h
src/jit/emit.h
src/jit/emitxarch.cpp
src/jit/emitxarch.h
src/jit/simd.cpp

index 5c20a87e5f913d98866543aa89ee6ed80bafa9fb..515912c6732023bc16fb026228dd8f02de4e0761 100644 (file)
@@ -2510,12 +2510,13 @@ void Compiler::compSetProcessor()
     CLANG_FORMAT_COMMENT_ANCHOR;
 
 #ifdef _TARGET_XARCH_
-    opts.compCanUseSSE3_4 = false;
-    if (!jitFlags.IsSet(JitFlags::JIT_FLAG_PREJIT) && jitFlags.IsSet(JitFlags::JIT_FLAG_USE_SSE3_4))
+    opts.compCanUseSSE4 = false;
+    if (!jitFlags.IsSet(JitFlags::JIT_FLAG_PREJIT) && jitFlags.IsSet(JitFlags::JIT_FLAG_USE_SSE41) &&
+        jitFlags.IsSet(JitFlags::JIT_FLAG_USE_SSE42))
     {
         if (JitConfig.EnableSSE3_4() != 0)
         {
-            opts.compCanUseSSE3_4 = true;
+            opts.compCanUseSSE4 = true;
         }
     }
 
@@ -2538,9 +2539,9 @@ void Compiler::compSetProcessor()
             codeGen->getEmitter()->SetContainsAVX(false);
             codeGen->getEmitter()->SetContains256bitAVX(false);
         }
-        else if (opts.compCanUseSSE3_4)
+        else if (opts.compCanUseSSE4)
         {
-            codeGen->getEmitter()->SetUseSSE3_4(true);
+            codeGen->getEmitter()->SetUseSSE4(true);
         }
     }
 #endif // _TARGET_XARCH_
index 5eaec8b3ada86ebd8508ced3f51ac277f5320f21..e9c87b89df27d9a398af9fd1e177c901d340cfc1 100644 (file)
@@ -7364,7 +7364,7 @@ private:
             return SIMD_AVX2_Supported;
         }
 
-        if (CanUseSSE3_4())
+        if (CanUseSSE4())
         {
             return SIMD_SSE4_Supported;
         }
@@ -7851,10 +7851,10 @@ private:
     }
 
     // Whether SSE3, SSE3, SSE4.1 and SSE4.2 is available
-    bool CanUseSSE3_4() const
+    bool CanUseSSE4() const
     {
 #ifdef _TARGET_XARCH_
-        return opts.compCanUseSSE3_4;
+        return opts.compCanUseSSE4;
 #else
         return false;
 #endif
@@ -7983,10 +7983,10 @@ public:
         bool compUseFCOMI;
         bool compUseCMOV;
 #ifdef _TARGET_XARCH_
-        bool compCanUseSSE2;   // Allow CodeGen to use "movq XMM" instructions
-        bool compCanUseSSE3_4; // Allow CodeGen to use SSE3, SSSE3, SSE4.1 and SSE4.2 instructions
-        bool compCanUseAVX;    // Allow CodeGen to use AVX 256-bit vectors for SIMD operations
-#endif                         // _TARGET_XARCH_
+        bool compCanUseSSE2; // Allow CodeGen to use "movq XMM" instructions
+        bool compCanUseSSE4; // Allow CodeGen to use SSE3, SSSE3, SSE4.1 and SSE4.2 instructions
+        bool compCanUseAVX;  // Allow CodeGen to use AVX 256-bit vectors for SIMD operations
+#endif                       // _TARGET_XARCH_
 
 #ifdef _TARGET_XARCH_
         uint64_t compSupportsISA;
index c2b52818616f336c10cd315bae610dea8b2a55ee..34e87b020485c294e52dc202f7c15eaceb5eb113 100644 (file)
@@ -427,7 +427,7 @@ public:
 #endif // DEBUG
 
 #ifdef _TARGET_XARCH_
-        SetUseSSE3_4(false);
+        SetUseSSE4(false);
         SetUseAVX(false);
 #endif // _TARGET_XARCH_
     }
index ee0afd0f7f243669b9aa562bce696cbd1718dba0..1f3c91da2d1477715d96a12ca58e7e64442cafff 100644 (file)
@@ -136,10 +136,10 @@ bool emitter::Is4ByteAVXInstruction(instruction ins)
 bool emitter::Is4ByteSSE4Instruction(instruction ins)
 {
 #ifdef LEGACY_BACKEND
-    // On legacy backend SSE3_4 is not enabled.
+    // On legacy backend SSE4 is not enabled.
     return false;
 #else
-    return UseSSE3_4() && IsSSE4Instruction(ins) && EncodedBySSE38orSSE3A(ins);
+    return UseSSE4() && IsSSE4Instruction(ins) && EncodedBySSE38orSSE3A(ins);
 #endif
 }
 
@@ -3813,7 +3813,7 @@ void emitter::emitIns_R_R_I(instruction ins, emitAttr attr, regNumber reg1, regN
         // AVX: 3 byte VEX prefix + 1 byte opcode + 1 byte ModR/M + 1 byte immediate
         // SSE4: 4 byte opcode + 1 byte ModR/M + 1 byte immediate
         // SSE2: 3 byte opcode + 1 byte ModR/M + 1 byte immediate
-        sz = (UseAVX() || UseSSE3_4()) ? 6 : 5;
+        sz = (UseAVX() || UseSSE4()) ? 6 : 5;
     }
 
 #ifdef _TARGET_AMD64_
index 25053b3e49caa2d003751ff24467741b78b92468..f7e1e6bb7f0b1b582993bddb3b3fe99dec9f9b7f 100644 (file)
@@ -94,14 +94,14 @@ code_t AddRexXPrefix(instruction ins, code_t code);
 code_t AddRexBPrefix(instruction ins, code_t code);
 code_t AddRexPrefix(instruction ins, code_t code);
 
-bool useSSE3_4Encodings;
-bool UseSSE3_4()
+bool useSSE4Encodings;
+bool UseSSE4()
 {
-    return useSSE3_4Encodings;
+    return useSSE4Encodings;
 }
-void SetUseSSE3_4(bool value)
+void SetUseSSE4(bool value)
 {
-    useSSE3_4Encodings = value;
+    useSSE4Encodings = value;
 }
 bool EncodedBySSE38orSSE3A(instruction ins);
 bool Is4ByteSSE4Instruction(instruction ins);
index b85d97c1ac5cd3975a92ab340642cd18f9ddea03..bb33fcd63652d6e337b82c8a1ee930a6bb2710f7 100644 (file)
@@ -1200,7 +1200,7 @@ GenTreePtr Compiler::impSIMDAbs(CORINFO_CLASS_HANDLE typeHnd, var_types baseType
         assert(getSIMDSupportLevel() >= SIMD_SSE4_Supported);
         if (baseType == TYP_LONG)
         {
-            // SSE3_4/AVX2 don't support abs on long type vector.
+            // SSE4/AVX2 don't support abs on long type vector.
             useConditionalSelect = true;
         }
     }
@@ -1410,7 +1410,7 @@ GenTreePtr Compiler::impSIMDMinMax(SIMDIntrinsicID      intrinsicId,
     // For other integer types we compute min/max as follows
     //
     // int32/uint32 (SSE2)
-    // int64/uint64 (SSE2&SSE3_4):
+    // int64/uint64 (SSE2&SSE4):
     //       compResult        = (op1 < op2) in case of Min
     //                           (op1 > op2) in case of Max
     //       Min/Max(op1, op2) = Select(compResult, op1, op2)