@@ -159,7 +159,7 @@ template <class BaseT> class RISCVSnippetGenerator : public BaseT {
159159 ELEN = STI.checkFeatures (" +zve64x" ) ? 64 : 32 ;
160160
161161 std::string ZvlQuery;
162- for (unsigned I = 5U , Size = ( 1 << I); I < 17U ; ++I, Size <<= 1 ) {
162+ for (unsigned Size = 32 ; Size <= 65536 ; Size *= 2 ) {
163163 ZvlQuery = " +zvl" ;
164164 raw_string_ostream SS (ZvlQuery);
165165 SS << Size << " b" ;
@@ -460,15 +460,21 @@ void RISCVSnippetGenerator<BaseT>::annotateWithVType(
460460 if (HasRMOp) {
461461 VTypeOperands.insert (&Instr.Operands [RISCVII::getVLOpNum (MIDesc) - 1 ]);
462462
463- // If we're not enumerating all rounding modes,
464- // use zero (rne in FRM and rnu in VXRM) as the default
465- // mode.
466- RoundingModes = {0U };
467- if (EnumerateRoundingModes) {
468- RoundingModes.append ({1 , 2 , 3 });
469- if (!UsesVXRM)
470- // FRM values 5 and 6 are currently reserved.
471- RoundingModes.append ({4 , 7 });
463+ if (UsesVXRM) {
464+ // Use RNU as the default VXRM.
465+ RoundingModes = {RISCVVXRndMode::RNU};
466+ if (EnumerateRoundingModes)
467+ RoundingModes.append (
468+ {RISCVVXRndMode::RNE, RISCVVXRndMode::RDN, RISCVVXRndMode::ROD});
469+ } else {
470+ if (EnumerateRoundingModes)
471+ RoundingModes = {RISCVFPRndMode::RNE, RISCVFPRndMode::RTZ,
472+ RISCVFPRndMode::RDN, RISCVFPRndMode::RUP,
473+ RISCVFPRndMode::RMM};
474+ else
475+ // If we're not enumerating FRM, use DYN to instruct
476+ // RISCVInsertReadWriteCSRPass to insert nothing.
477+ RoundingModes = {RISCVFPRndMode::DYN};
472478 }
473479 } else {
474480 RoundingModes = {std::nullopt };
@@ -647,12 +653,12 @@ static std::vector<MCInst> loadFP64RegBits32(const MCSubtargetInfo &STI,
647653 return Instrs;
648654}
649655
650- // NOTE: Alternatively, we can use BitVector here, but the number of RVV MC
651- // opcodes is just a small portion of the entire opcode space, so I thought it
652- // would be a waste of space to use BitVector.
653- static SmallSet<unsigned , 16 > RVVMCOpcodesWithPseudos;
654-
655656class ExegesisRISCVTarget : public ExegesisTarget {
657+ // NOTE: Alternatively, we can use BitVector here, but the number of RVV MC
658+ // opcodes is just a small portion of the entire opcode space, so I thought it
659+ // would be a waste of space to use BitVector.
660+ mutable SmallSet<unsigned , 16 > RVVMCOpcodesWithPseudos;
661+
656662public:
657663 ExegesisRISCVTarget ();
658664
0 commit comments