@@ -463,6 +463,8 @@ void CodeGen::genHWIntrinsic(GenTreeHWIntrinsic* node)
463
463
regNumber embMaskOp3Reg = REG_NA;
464
464
regNumber falseReg = op3Reg;
465
465
466
+ insOpts optEmb = opt;
467
+
466
468
switch (intrinEmbMask.numOperands )
467
469
{
468
470
case 3 :
@@ -505,7 +507,7 @@ void CodeGen::genHWIntrinsic(GenTreeHWIntrinsic* node)
505
507
case NI_Sve_ConvertToInt32:
506
508
case NI_Sve_ConvertToUInt32:
507
509
{
508
- opt = intrinEmbMask.baseType == TYP_DOUBLE ? INS_OPTS_D_TO_S : INS_OPTS_SCALABLE_S;
510
+ optEmb = intrinEmbMask.baseType == TYP_DOUBLE ? INS_OPTS_D_TO_S : INS_OPTS_SCALABLE_S;
509
511
break ;
510
512
}
511
513
@@ -534,7 +536,7 @@ void CodeGen::genHWIntrinsic(GenTreeHWIntrinsic* node)
534
536
// If falseValue is zero, just zero out those lanes of targetReg using `movprfx`
535
537
// and /Z
536
538
GetEmitter ()->emitIns_R_R_R (INS_sve_movprfx, emitSize, targetReg, maskReg, targetReg,
537
- opt, soptEmb );
539
+ opt);
538
540
}
539
541
}
540
542
else if (emitter::isVectorRegister (embMaskOp1Reg) && (targetReg == embMaskOp1Reg))
@@ -545,7 +547,7 @@ void CodeGen::genHWIntrinsic(GenTreeHWIntrinsic* node)
545
547
546
548
// We cannot use use `movprfx` here to move falseReg to targetReg because that will
547
549
// overwrite the value of embMaskOp1Reg which is present in targetReg.
548
- GetEmitter ()->emitIns_R_R_R (insEmbMask, emitSize, targetReg, maskReg, embMaskOp1Reg, opt ,
550
+ GetEmitter ()->emitIns_R_R_R (insEmbMask, emitSize, targetReg, maskReg, embMaskOp1Reg, optEmb ,
549
551
soptEmb);
550
552
551
553
GetEmitter ()->emitIns_R_R_R_R (INS_sve_sel, emitSize, targetReg, maskReg, targetReg,
@@ -560,7 +562,8 @@ void CodeGen::genHWIntrinsic(GenTreeHWIntrinsic* node)
560
562
}
561
563
}
562
564
563
- GetEmitter ()->emitIns_R_R_R (insEmbMask, emitSize, targetReg, maskReg, embMaskOp1Reg, opt, soptEmb);
565
+ GetEmitter ()->emitIns_R_R_R (insEmbMask, emitSize, targetReg, maskReg, embMaskOp1Reg, optEmb,
566
+ soptEmb);
564
567
break ;
565
568
}
566
569
@@ -578,7 +581,7 @@ void CodeGen::genHWIntrinsic(GenTreeHWIntrinsic* node)
578
581
579
582
// Finally, perform the actual "predicated" operation so that `targetReg` is the first operand
580
583
// and `embMaskOp2Reg` is the second operand.
581
- GetEmitter ()->emitIns_R_R_R (insEmbMask, emitSize, targetReg, maskReg, embMaskOp2Reg, opt );
584
+ GetEmitter ()->emitIns_R_R_R (insEmbMask, emitSize, targetReg, maskReg, embMaskOp2Reg, optEmb );
582
585
}
583
586
else if (targetReg != falseReg)
584
587
{
@@ -593,7 +596,7 @@ void CodeGen::genHWIntrinsic(GenTreeHWIntrinsic* node)
593
596
// If the embedded instruction supports optional mask operation, use the "unpredicated"
594
597
// version of the instruction, followed by "sel" to select the active lanes.
595
598
GetEmitter ()->emitIns_R_R_R (insEmbMask, emitSize, targetReg, embMaskOp1Reg,
596
- embMaskOp2Reg, opt );
599
+ embMaskOp2Reg, optEmb );
597
600
}
598
601
else
599
602
{
@@ -608,7 +611,7 @@ void CodeGen::genHWIntrinsic(GenTreeHWIntrinsic* node)
608
611
GetEmitter ()->emitIns_R_R (INS_sve_movprfx, EA_SCALABLE, targetReg, embMaskOp1Reg);
609
612
610
613
GetEmitter ()->emitIns_R_R_R (insEmbMask, emitSize, targetReg, maskReg, embMaskOp2Reg,
611
- opt );
614
+ optEmb );
612
615
}
613
616
614
617
GetEmitter ()->emitIns_R_R_R_R (INS_sve_sel, emitSize, targetReg, maskReg, targetReg,
@@ -625,13 +628,13 @@ void CodeGen::genHWIntrinsic(GenTreeHWIntrinsic* node)
625
628
626
629
// Finally, perform the actual "predicated" operation so that `targetReg` is the first operand
627
630
// and `embMaskOp2Reg` is the second operand.
628
- GetEmitter ()->emitIns_R_R_R (insEmbMask, emitSize, targetReg, maskReg, embMaskOp2Reg, opt );
631
+ GetEmitter ()->emitIns_R_R_R (insEmbMask, emitSize, targetReg, maskReg, embMaskOp2Reg, optEmb );
629
632
}
630
633
else
631
634
{
632
635
// Just perform the actual "predicated" operation so that `targetReg` is the first operand
633
636
// and `embMaskOp2Reg` is the second operand.
634
- GetEmitter ()->emitIns_R_R_R (insEmbMask, emitSize, targetReg, maskReg, embMaskOp2Reg, opt );
637
+ GetEmitter ()->emitIns_R_R_R (insEmbMask, emitSize, targetReg, maskReg, embMaskOp2Reg, optEmb );
635
638
}
636
639
637
640
break ;
@@ -800,7 +803,7 @@ void CodeGen::genHWIntrinsic(GenTreeHWIntrinsic* node)
800
803
801
804
// Finally, perform the desired operation.
802
805
GetEmitter ()->emitIns_R_R_R_R (insEmbMask, emitSize, targetReg, maskReg, embMaskOp2Reg,
803
- embMaskOp3Reg, opt );
806
+ embMaskOp3Reg, optEmb );
804
807
805
808
break ;
806
809
}
@@ -2139,9 +2142,7 @@ void CodeGen::genHWIntrinsic(GenTreeHWIntrinsic* node)
2139
2142
2140
2143
case NI_Sve_ExtractAfterLastScalar:
2141
2144
case NI_Sve_ExtractLastScalar:
2142
- assert (HWIntrinsicInfo::IsEmbeddedMaskForScalarResultOperation (intrin.id ));
2143
- assert (op1Reg != REG_NA); // this is the embedded mask
2144
- assert (op2Reg != REG_NA);
2145
+ assert (HWIntrinsicInfo::IsEmbeddedMaskForScalarResult (intrin.id ));
2145
2146
2146
2147
if (varTypeIsFloating (node))
2147
2148
{
0 commit comments