summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTanner Gooding <tagoo@outlook.com>2019-05-21 15:53:19 -0700
committerGitHub <noreply@github.com>2019-05-21 15:53:19 -0700
commit2b4b230cdf44d0c25df004660f18c4290e9deb72 (patch)
tree1c15d56751d2d3a53f05e35d91dbdf9868c68aea
parent26533de63976cb34eb1224c903128e398ca887d9 (diff)
downloadcoreclr-2b4b230cdf44d0c25df004660f18c4290e9deb72.tar.gz
coreclr-2b4b230cdf44d0c25df004660f18c4290e9deb72.tar.bz2
coreclr-2b4b230cdf44d0c25df004660f18c4290e9deb72.zip
Fixing EnableSSE3_4=0 and EnableHWIntrinsic=0 to control the right things (#24649)
* Ensure we check JitConfig.EnableSSE3_4 when determining the max supported vector size * Ensure that EnableHWIntrinsic=0 doesn't impact the supported ISAs * Applying formatting patch * Moving jitstress-isas-x86 to the 600m timeout group
-rw-r--r--eng/test-job.yml4
-rw-r--r--src/jit/compiler.cpp128
-rw-r--r--src/jit/ee_il_dll.cpp4
-rw-r--r--src/jit/hwintrinsicxarch.cpp9
4 files changed, 73 insertions, 72 deletions
diff --git a/eng/test-job.yml b/eng/test-job.yml
index 010b0300c8..cd778b62ff 100644
--- a/eng/test-job.yml
+++ b/eng/test-job.yml
@@ -94,9 +94,9 @@ jobs:
timeoutInMinutes: 240
${{ if eq(parameters.testGroup, 'outerloop') }}:
timeoutInMinutes: 360
- ${{ if in(parameters.testGroup, 'outerloop-jitstress', 'outerloop-jitstress-isas-arm', 'outerloop-jitstress-isas-x86', 'outerloop-jitstressregs-x86', 'outerloop-jitstressregs', 'outerloop-jitstress2-jitstressregs', 'outerloop-gcstress0x3-gcstress0xc') }}:
+ ${{ if in(parameters.testGroup, 'outerloop-jitstress', 'outerloop-jitstress-isas-arm', 'outerloop-jitstressregs-x86', 'outerloop-jitstressregs', 'outerloop-jitstress2-jitstressregs', 'outerloop-gcstress0x3-gcstress0xc') }}:
timeoutInMinutes: 480
- ${{ if in(parameters.testGroup, 'outerloop-gcstress-extra', 'outerloop-r2r-extra') }}:
+ ${{ if in(parameters.testGroup, 'outerloop-jitstress-isas-x86', 'outerloop-gcstress-extra', 'outerloop-r2r-extra') }}:
timeoutInMinutes: 600
steps:
diff --git a/src/jit/compiler.cpp b/src/jit/compiler.cpp
index 9aabc19bb5..4c4a90d937 100644
--- a/src/jit/compiler.cpp
+++ b/src/jit/compiler.cpp
@@ -2250,76 +2250,76 @@ void Compiler::compSetProcessor()
// Dummy ISAs for simplifying the JIT code
opts.setSupportedISA(InstructionSet_Vector128);
opts.setSupportedISA(InstructionSet_Vector256);
+ }
- if (JitConfig.EnableSSE())
- {
- opts.setSupportedISA(InstructionSet_SSE);
+ if (JitConfig.EnableSSE())
+ {
+ opts.setSupportedISA(InstructionSet_SSE);
#ifdef _TARGET_AMD64_
- opts.setSupportedISA(InstructionSet_SSE_X64);
+ opts.setSupportedISA(InstructionSet_SSE_X64);
#endif // _TARGET_AMD64_
- if (JitConfig.EnableSSE2())
- {
- opts.setSupportedISA(InstructionSet_SSE2);
+ if (JitConfig.EnableSSE2())
+ {
+ opts.setSupportedISA(InstructionSet_SSE2);
#ifdef _TARGET_AMD64_
- opts.setSupportedISA(InstructionSet_SSE2_X64);
+ opts.setSupportedISA(InstructionSet_SSE2_X64);
#endif // _TARGET_AMD64_
- if (jitFlags.IsSet(JitFlags::JIT_FLAG_USE_AES) && JitConfig.EnableAES())
- {
- opts.setSupportedISA(InstructionSet_AES);
- }
+ if (jitFlags.IsSet(JitFlags::JIT_FLAG_USE_AES) && JitConfig.EnableAES())
+ {
+ opts.setSupportedISA(InstructionSet_AES);
+ }
- if (jitFlags.IsSet(JitFlags::JIT_FLAG_USE_PCLMULQDQ) && JitConfig.EnablePCLMULQDQ())
- {
- opts.setSupportedISA(InstructionSet_PCLMULQDQ);
- }
+ if (jitFlags.IsSet(JitFlags::JIT_FLAG_USE_PCLMULQDQ) && JitConfig.EnablePCLMULQDQ())
+ {
+ opts.setSupportedISA(InstructionSet_PCLMULQDQ);
+ }
- // We need to additionaly check that COMPlus_EnableSSE3_4 is set, as that
- // is a prexisting config flag that controls the SSE3+ ISAs
- if (jitFlags.IsSet(JitFlags::JIT_FLAG_USE_SSE3) && JitConfig.EnableSSE3() && JitConfig.EnableSSE3_4())
+ // We need to additionaly check that COMPlus_EnableSSE3_4 is set, as that
+ // is a prexisting config flag that controls the SSE3+ ISAs
+ if (jitFlags.IsSet(JitFlags::JIT_FLAG_USE_SSE3) && JitConfig.EnableSSE3() && JitConfig.EnableSSE3_4())
+ {
+ opts.setSupportedISA(InstructionSet_SSE3);
+
+ if (jitFlags.IsSet(JitFlags::JIT_FLAG_USE_SSSE3) && JitConfig.EnableSSSE3())
{
- opts.setSupportedISA(InstructionSet_SSE3);
+ opts.setSupportedISA(InstructionSet_SSSE3);
- if (jitFlags.IsSet(JitFlags::JIT_FLAG_USE_SSSE3) && JitConfig.EnableSSSE3())
+ if (jitFlags.IsSet(JitFlags::JIT_FLAG_USE_SSE41) && JitConfig.EnableSSE41())
{
- opts.setSupportedISA(InstructionSet_SSSE3);
+ opts.setSupportedISA(InstructionSet_SSE41);
+#ifdef _TARGET_AMD64_
+ opts.setSupportedISA(InstructionSet_SSE41_X64);
+#endif // _TARGET_AMD64_
- if (jitFlags.IsSet(JitFlags::JIT_FLAG_USE_SSE41) && JitConfig.EnableSSE41())
+ if (jitFlags.IsSet(JitFlags::JIT_FLAG_USE_SSE42) && JitConfig.EnableSSE42())
{
- opts.setSupportedISA(InstructionSet_SSE41);
+ opts.setSupportedISA(InstructionSet_SSE42);
#ifdef _TARGET_AMD64_
- opts.setSupportedISA(InstructionSet_SSE41_X64);
+ opts.setSupportedISA(InstructionSet_SSE42_X64);
#endif // _TARGET_AMD64_
- if (jitFlags.IsSet(JitFlags::JIT_FLAG_USE_SSE42) && JitConfig.EnableSSE42())
+ if (jitFlags.IsSet(JitFlags::JIT_FLAG_USE_POPCNT) && JitConfig.EnablePOPCNT())
{
- opts.setSupportedISA(InstructionSet_SSE42);
+ opts.setSupportedISA(InstructionSet_POPCNT);
#ifdef _TARGET_AMD64_
- opts.setSupportedISA(InstructionSet_SSE42_X64);
+ opts.setSupportedISA(InstructionSet_POPCNT_X64);
#endif // _TARGET_AMD64_
+ }
+
+ if (jitFlags.IsSet(JitFlags::JIT_FLAG_USE_AVX) && JitConfig.EnableAVX())
+ {
+ opts.setSupportedISA(InstructionSet_AVX);
- if (jitFlags.IsSet(JitFlags::JIT_FLAG_USE_POPCNT) && JitConfig.EnablePOPCNT())
+ if (jitFlags.IsSet(JitFlags::JIT_FLAG_USE_FMA) && JitConfig.EnableFMA())
{
- opts.setSupportedISA(InstructionSet_POPCNT);
-#ifdef _TARGET_AMD64_
- opts.setSupportedISA(InstructionSet_POPCNT_X64);
-#endif // _TARGET_AMD64_
+ opts.setSupportedISA(InstructionSet_FMA);
}
- if (jitFlags.IsSet(JitFlags::JIT_FLAG_USE_AVX) && JitConfig.EnableAVX())
+ if (jitFlags.IsSet(JitFlags::JIT_FLAG_USE_AVX2) && JitConfig.EnableAVX2())
{
- opts.setSupportedISA(InstructionSet_AVX);
-
- if (jitFlags.IsSet(JitFlags::JIT_FLAG_USE_FMA) && JitConfig.EnableFMA())
- {
- opts.setSupportedISA(InstructionSet_FMA);
- }
-
- if (jitFlags.IsSet(JitFlags::JIT_FLAG_USE_AVX2) && JitConfig.EnableAVX2())
- {
- opts.setSupportedISA(InstructionSet_AVX2);
- }
+ opts.setSupportedISA(InstructionSet_AVX2);
}
}
}
@@ -2327,34 +2327,34 @@ void Compiler::compSetProcessor()
}
}
}
+ }
- if (jitFlags.IsSet(JitFlags::JIT_FLAG_USE_LZCNT) && JitConfig.EnableLZCNT())
- {
- opts.setSupportedISA(InstructionSet_LZCNT);
+ if (jitFlags.IsSet(JitFlags::JIT_FLAG_USE_LZCNT) && JitConfig.EnableLZCNT())
+ {
+ opts.setSupportedISA(InstructionSet_LZCNT);
#ifdef _TARGET_AMD64_
- opts.setSupportedISA(InstructionSet_LZCNT_X64);
+ opts.setSupportedISA(InstructionSet_LZCNT_X64);
#endif // _TARGET_AMD64_
- }
+ }
- // We currently need to also check that AVX is supported as that controls the support for the VEX encoding
- // in the emitter.
- if (jitFlags.IsSet(JitFlags::JIT_FLAG_USE_BMI1) && JitConfig.EnableBMI1() && compSupports(InstructionSet_AVX))
- {
- opts.setSupportedISA(InstructionSet_BMI1);
+ // We currently need to also check that AVX is supported as that controls the support for the VEX encoding
+ // in the emitter.
+ if (jitFlags.IsSet(JitFlags::JIT_FLAG_USE_BMI1) && JitConfig.EnableBMI1() && compSupports(InstructionSet_AVX))
+ {
+ opts.setSupportedISA(InstructionSet_BMI1);
#ifdef _TARGET_AMD64_
- opts.setSupportedISA(InstructionSet_BMI1_X64);
+ opts.setSupportedISA(InstructionSet_BMI1_X64);
#endif // _TARGET_AMD64_
- }
+ }
- // We currently need to also check that AVX is supported as that controls the support for the VEX encoding
- // in the emitter.
- if (jitFlags.IsSet(JitFlags::JIT_FLAG_USE_BMI2) && JitConfig.EnableBMI2() && compSupports(InstructionSet_AVX))
- {
- opts.setSupportedISA(InstructionSet_BMI2);
+ // We currently need to also check that AVX is supported as that controls the support for the VEX encoding
+ // in the emitter.
+ if (jitFlags.IsSet(JitFlags::JIT_FLAG_USE_BMI2) && JitConfig.EnableBMI2() && compSupports(InstructionSet_AVX))
+ {
+ opts.setSupportedISA(InstructionSet_BMI2);
#ifdef _TARGET_AMD64_
- opts.setSupportedISA(InstructionSet_BMI2_X64);
+ opts.setSupportedISA(InstructionSet_BMI2_X64);
#endif // _TARGET_AMD64_
- }
}
#else // !FEATURE_CORECLR
if (!jitFlags.IsSet(JitFlags::JIT_FLAG_PREJIT))
diff --git a/src/jit/ee_il_dll.cpp b/src/jit/ee_il_dll.cpp
index 10afb50065..882c9bcbca 100644
--- a/src/jit/ee_il_dll.cpp
+++ b/src/jit/ee_il_dll.cpp
@@ -404,8 +404,8 @@ unsigned CILJit::getMaxIntrinsicSIMDVectorLength(CORJIT_FLAGS cpuCompileFlags)
// disabling SSE also disables SSE2 through AVX2), we need to check each ISA in the hierarchy to
// ensure that AVX2 is actually supported. Otherwise, we will end up getting asserts downstream.
if ((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.EnableSSE41() != 0) && (JitConfig.EnableSSSE3() != 0) && (JitConfig.EnableSSE3_4() != 0) &&
+ (JitConfig.EnableSSE3() != 0) && (JitConfig.EnableSSE2() != 0) && (JitConfig.EnableSSE() != 0))
{
if (GetJitTls() != nullptr && JitTls::GetCompiler() != nullptr)
{
diff --git a/src/jit/hwintrinsicxarch.cpp b/src/jit/hwintrinsicxarch.cpp
index bb224f9a17..7835454e70 100644
--- a/src/jit/hwintrinsicxarch.cpp
+++ b/src/jit/hwintrinsicxarch.cpp
@@ -715,17 +715,18 @@ GenTree* Compiler::addRangeCheckIfNeeded(NamedIntrinsic intrinsic, GenTree* last
// Arguments:
// isa - Instruction set
// Return Value:
-// true if
+// true if EnableHWIntrinsic=true and
// - isa is a scalar ISA
// - isa is a SIMD ISA and featureSIMD=true
// - isa is fully implemented or EnableIncompleteISAClass=true
bool Compiler::compSupportsHWIntrinsic(InstructionSet isa)
{
- return (featureSIMD || HWIntrinsicInfo::isScalarIsa(isa)) && (
+ return JitConfig.EnableHWIntrinsic() && (featureSIMD || HWIntrinsicInfo::isScalarIsa(isa)) &&
+ (
#ifdef DEBUG
- JitConfig.EnableIncompleteISAClass() ||
+ JitConfig.EnableIncompleteISAClass() ||
#endif
- HWIntrinsicInfo::isFullyImplementedIsa(isa));
+ HWIntrinsicInfo::isFullyImplementedIsa(isa));
}
//------------------------------------------------------------------------