Vector<T>.ctor(T val) is not recognized for ubyte/byte/short/ushort
authorsivarv <sivarv@microsoft.com>
Tue, 18 Oct 2016 00:20:30 +0000 (17:20 -0700)
committersivarv <sivarv@microsoft.com>
Tue, 18 Oct 2016 00:52:26 +0000 (17:52 -0700)
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

index 1f0c867..a9450b7 100644 (file)
@@ -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.