Skip to content

Commit

Permalink
Return nullptr from impSimdAsHWIntrinsic if the baseline ISA has been…
Browse files Browse the repository at this point in the history
… marked as disabled (dotnet#37272)
  • Loading branch information
tannergooding authored Jun 2, 2020
1 parent 6e51500 commit ec6bec4
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/coreclr/src/jit/simdashwintrinsic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,22 @@ GenTree* Compiler::impSimdAsHWIntrinsic(NamedIntrinsic intrinsic,
return nullptr;
}

#if defined(TARGET_XARCH)
CORINFO_InstructionSet minimumIsa = InstructionSet_SSE2;
#elif defined(TARGET_ARM64)
CORINFO_InstructionSet minimumIsa = InstructionSet_AdvSimd;
#else
#error Unsupported platform
#endif // !TARGET_XARCH && !TARGET_ARM64

if (!compOpportunisticallyDependsOn(minimumIsa))
{
// The user disabled support for the baseline ISA so
// don't emit any SIMD intrinsics as they all require
// this at a minimum
return nullptr;
}

CORINFO_CLASS_HANDLE argClass = NO_CLASS_HANDLE;
var_types retType = JITtype2varType(sig->retType);
var_types baseType = TYP_UNKNOWN;
Expand Down

0 comments on commit ec6bec4

Please sign in to comment.