From 7294acfe60984d70dcbd6ba50beec80d1d23a582 Mon Sep 17 00:00:00 2001 From: sivarv Date: Mon, 17 Oct 2016 17:20:30 -0700 Subject: [PATCH] Vector.ctor(T val) is not recognized for ubyte/byte/short/ushort when the arg is a local of small int type (e.g. method args). Commit migrated from https://github.com/dotnet/coreclr/commit/2632e674b99f189b44050ac3acd6739d63b23b95 --- src/coreclr/src/jit/simd.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/coreclr/src/jit/simd.cpp b/src/coreclr/src/jit/simd.cpp index 1f0c867..a9450b7 100644 --- a/src/coreclr/src/jit/simd.cpp +++ b/src/coreclr/src/jit/simd.cpp @@ -525,7 +525,8 @@ const SIMDIntrinsicInfo* Compiler::getSIMDIntrinsicInfo(CORINFO_CLASS_HANDLE* in // We don't check anything in that case. if (!isThisPtr || !isNewObj) { - GenTreePtr arg = impStackTop(stackIndex).val; + GenTreePtr arg = impStackTop(stackIndex).val; + var_types argType = arg->TypeGet(); var_types expectedArgType; if (argIndex < fixedArgCnt) @@ -540,6 +541,7 @@ const SIMDIntrinsicInfo* Compiler::getSIMDIntrinsicInfo(CORINFO_CLASS_HANDLE* in { // The type of the argument will be genActualType(*baseType). expectedArgType = genActualType(*baseType); + argType = genActualType(argType); } } else @@ -547,7 +549,6 @@ const SIMDIntrinsicInfo* Compiler::getSIMDIntrinsicInfo(CORINFO_CLASS_HANDLE* in expectedArgType = *baseType; } - var_types argType = arg->TypeGet(); if (!isThisPtr && argType == TYP_I_IMPL) { // The reference implementation has a constructor that takes a pointer. -- 2.7.4