diff options
Diffstat (limited to 'src/jit/compiler.cpp')
-rw-r--r-- | src/jit/compiler.cpp | 27 |
1 files changed, 26 insertions, 1 deletions
diff --git a/src/jit/compiler.cpp b/src/jit/compiler.cpp index 8093a7defc..6813f6b787 100644 --- a/src/jit/compiler.cpp +++ b/src/jit/compiler.cpp @@ -2366,6 +2366,7 @@ void Compiler::compSetProcessor() if (!jitFlags.IsSet(JitFlags::JIT_FLAG_PREJIT)) { +#ifdef FEATURE_CORECLR if (JitConfig.EnableHWIntrinsic()) { opts.setSupportedISA(InstructionSet_Base); @@ -2478,6 +2479,29 @@ void Compiler::compSetProcessor() #endif // _TARGET_AMD64_ } } +#else // !FEATURE_CORECLR + // If this is not FEATURE_CORECLR, the only flags supported by the VM are AVX and AVX2. + // Furthermore, the only two configurations supported by the desktop JIT are SSE2 and AVX2, + // so if the latter is set, we also check all the in-between options. + // Note that the EnableSSE2 and EnableSSE flags are only checked by HW Intrinsic code, + // so the System.Numerics.Vector support doesn't depend on those flags. + // However, if any of these are disabled, we will not enable AVX2. + // + if (jitFlags.IsSet(JitFlags::JIT_FLAG_USE_AVX) && jitFlags.IsSet(JitFlags::JIT_FLAG_USE_AVX2) && + (JitConfig.EnableAVX2() != 0) && (JitConfig.EnableAVX() != 0) && (JitConfig.EnableSSE42() != 0) && + (JitConfig.EnableSSE41() != 0) && (JitConfig.EnableSSSE3() != 0) && (JitConfig.EnableSSE3() != 0) && + (JitConfig.EnableSSE2() != 0) && (JitConfig.EnableSSE() != 0) && (JitConfig.EnableSSE3_4() != 0)) + { + opts.setSupportedISA(InstructionSet_SSE); + opts.setSupportedISA(InstructionSet_SSE2); + opts.setSupportedISA(InstructionSet_SSE3); + opts.setSupportedISA(InstructionSet_SSSE3); + opts.setSupportedISA(InstructionSet_SSE41); + opts.setSupportedISA(InstructionSet_SSE42); + opts.setSupportedISA(InstructionSet_AVX); + opts.setSupportedISA(InstructionSet_AVX2); + } +#endif // !FEATURE_CORECLR } if (!compIsForInlining()) @@ -2490,7 +2514,8 @@ void Compiler::compSetProcessor() codeGen->getEmitter()->SetContains256bitAVX(false); } } -#endif +#endif // _TARGET_XARCH_ + #if defined(_TARGET_ARM64_) // There is no JitFlag for Base instructions handle manually opts.setSupportedISA(InstructionSet_Base); |