@@ -3551,24 +3551,34 @@ GenTree* Lowering::LowerHWIntrinsicCreate(GenTreeHWIntrinsic* node)
3551
3551
}
3552
3552
}
3553
3553
3554
- if (simdSize == 32 )
3554
+ if (simdSize > 16 )
3555
3555
{
3556
- // We're creating a Vector256 scalar so we need to treat the original op as Vector128,
3557
- // we need to unsafely extend up to Vector256 (which is actually safe since the 128-bit
3558
- // op will zero extend up to 256-bits), and then we need to replace the original use
3559
- // with the new TYP_SIMD32 node.
3556
+ assert((simdSize == 32) || (simdSize == 64));
3557
+
3558
+ // We're creating a Vector256/512 scalar so we need to treat the original op as Vector128,
3559
+ // we need to unsafely extend up to Vector256/512 (which is actually safe since the 128-bit
3560
+ // op will zero extend up to 256/512-bits), and then we need to replace the original use
3561
+ // with the new TYP_SIMD32/64 node.
3560
3562
3561
3563
node->ChangeType(TYP_SIMD16);
3562
3564
node->SetSimdSize(16);
3563
3565
LowerNode(node);
3564
3566
3565
- tmp2 = comp->gtNewSimdHWIntrinsicNode(TYP_SIMD32, node, NI_Vector128_ToVector256Unsafe, simdBaseJitType,
3566
- 16);
3567
-
3568
3567
LIR::Use use;
3569
3568
bool foundUse = BlockRange().TryGetUse(node, &use);
3569
+
3570
+ tmp2 = comp->gtNewSimdHWIntrinsicNode(TYP_SIMD32, node, NI_Vector128_ToVector256Unsafe, simdBaseJitType,
3571
+ 16);
3570
3572
BlockRange().InsertAfter(node, tmp2);
3571
3573
3574
+ if (simdSize == 64)
3575
+ {
3576
+ tmp3 = comp->gtNewSimdHWIntrinsicNode(TYP_SIMD64, tmp2, NI_Vector256_ToVector512Unsafe,
3577
+ simdBaseJitType, 32);
3578
+ BlockRange().InsertAfter(tmp2, tmp3);
3579
+ tmp2 = tmp3;
3580
+ }
3581
+
3572
3582
if (foundUse)
3573
3583
{
3574
3584
use.ReplaceWith(tmp2);
0 commit comments