summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTanner Gooding <tagoo@outlook.com>2018-07-26 13:46:48 -0700
committerTanner Gooding <tagoo@outlook.com>2018-07-26 19:07:50 -0700
commite61e50db63a1ca5a23428d17d76fb879dab690da (patch)
tree550f9ed9f50a6f30145a24ea9502e0902bc02d55 /src
parente7c696cd18e648da4eeadc43fbc3e4ad3639eb7d (diff)
downloadcoreclr-e61e50db63a1ca5a23428d17d76fb879dab690da.tar.gz
coreclr-e61e50db63a1ca5a23428d17d76fb879dab690da.tar.bz2
coreclr-e61e50db63a1ca5a23428d17d76fb879dab690da.zip
Fixing the x86 hwintrinsics to not assert for invalid generic types.
Diffstat (limited to 'src')
-rw-r--r--src/jit/hwintrinsicxarch.cpp16
1 files changed, 10 insertions, 6 deletions
diff --git a/src/jit/hwintrinsicxarch.cpp b/src/jit/hwintrinsicxarch.cpp
index 700962413f..9032138e31 100644
--- a/src/jit/hwintrinsicxarch.cpp
+++ b/src/jit/hwintrinsicxarch.cpp
@@ -721,11 +721,8 @@ GenTree* Compiler::impHWIntrinsic(NamedIntrinsic intrinsic,
if (baseType == TYP_UNKNOWN) // the second argument is not a vector
{
baseType = JITtype2varType(strip(info.compCompHnd->getArgType(sig, secondArg, &secondArgClass)));
- assert(baseType != TYP_STRUCT);
}
}
-
- assert(baseType != TYP_UNKNOWN);
}
if ((HWIntrinsicInfo::IsOneTypeGeneric(intrinsic) || HWIntrinsicInfo::IsTwoTypeGeneric(intrinsic)) &&
@@ -1204,15 +1201,22 @@ GenTree* Compiler::impAvxOrAvx2Intrinsic(NamedIntrinsic intrinsic,
case NI_AVX_SetAllVector256:
{
baseType = getBaseTypeOfSIMDType(sig->retTypeSigClass);
+ if (!varTypeIsArithmetic(baseType))
+ {
+ retNode = impUnsupportedHWIntrinsic(CORINFO_HELP_THROW_TYPE_NOT_SUPPORTED, method, sig, mustExpand);
+ }
#ifdef _TARGET_X86_
// TODO-XARCH: support long/ulong on 32-bit platfroms
- if (varTypeIsLong(baseType))
+ else if (varTypeIsLong(baseType))
{
return impUnsupportedHWIntrinsic(CORINFO_HELP_THROW_PLATFORM_NOT_SUPPORTED, method, sig, mustExpand);
}
#endif
- GenTree* arg = impPopStack().val;
- retNode = gtNewSimdHWIntrinsicNode(TYP_SIMD32, arg, NI_AVX_SetAllVector256, baseType, 32);
+ else
+ {
+ GenTree* arg = impPopStack().val;
+ retNode = gtNewSimdHWIntrinsicNode(TYP_SIMD32, arg, NI_AVX_SetAllVector256, baseType, 32);
+ }
break;
}