Correctly handle variable argument SIMDScalar (#26421) (#26778)
authorCarol Eidt <carol.eidt@microsoft.com>
Mon, 14 Oct 2019 20:23:46 +0000 (13:23 -0700)
committerGitHub <noreply@github.com>
Mon, 14 Oct 2019 20:23:46 +0000 (13:23 -0700)
* Correctly handle variable argument SIMDScalar

Fix #26286

src/jit/hwintrinsiccodegenxarch.cpp

index 42dba82..84d1fd3 100644 (file)
@@ -125,7 +125,16 @@ void CodeGen::genHWIntrinsic(GenTreeHWIntrinsic* node)
                     if ((ival != -1) && varTypeIsFloating(baseType))
                     {
                         assert((ival >= 0) && (ival <= 127));
-                        genHWIntrinsic_R_RM_I(node, ins, (int8_t)ival);
+                        if ((category == HW_Category_SIMDScalar) && HWIntrinsicInfo::CopiesUpperBits(intrinsicId))
+                        {
+                            assert(!op1->isContained());
+                            emit->emitIns_SIMD_R_R_R_I(ins, simdSize, targetReg, op1Reg, op1Reg,
+                                                       static_cast<int8_t>(ival));
+                        }
+                        else
+                        {
+                            genHWIntrinsic_R_RM_I(node, ins, static_cast<int8_t>(ival));
+                        }
                     }
                     else if ((category == HW_Category_SIMDScalar) && HWIntrinsicInfo::CopiesUpperBits(intrinsicId))
                     {