diff --git a/src/coreclr/jit/assertionprop.cpp b/src/coreclr/jit/assertionprop.cpp index 4e0e708be326c6..9f9a1dcfd10fa7 100644 --- a/src/coreclr/jit/assertionprop.cpp +++ b/src/coreclr/jit/assertionprop.cpp @@ -164,6 +164,35 @@ bool IntegralRange::Contains(int64_t value) const case GT_CAST: return ForCastOutput(node->AsCast()); +#if defined(FEATURE_HW_INTRINSICS) + case GT_HWINTRINSIC: + switch (node->AsHWIntrinsic()->GetHWIntrinsicId()) + { +#if defined(TARGET_XARCH) + case NI_BMI1_TrailingZeroCount: + case NI_BMI1_X64_TrailingZeroCount: + case NI_LZCNT_LeadingZeroCount: + case NI_LZCNT_X64_LeadingZeroCount: + case NI_POPCNT_PopCount: + case NI_POPCNT_X64_PopCount: +#elif defined(TARGET_ARM64) + case NI_AdvSimd_PopCount: + case NI_AdvSimd_LeadingZeroCount: + case NI_AdvSimd_LeadingSignCount: + case NI_ArmBase_LeadingZeroCount: + case NI_ArmBase_Arm64_LeadingZeroCount: + case NI_ArmBase_Arm64_LeadingSignCount: +#else +#error Unsupported platform +#endif + // TODO-Casts: specify more precise ranges once "IntegralRange" supports them. + return {SymbolicIntegerValue::Zero, SymbolicIntegerValue::ByteMax}; + default: + break; + } + break; +#endif // defined(FEATURE_HW_INTRINSICS) + default: break; }