2727// Format specifies the encoding used by the instruction. This is used by
2828// RISCVMCCodeEmitter to determine which form of fixup to use. These
2929// definitions must be kept in-sync with RISCVBaseInfo.h.
30- class InstFormat<bits<5> val> {
31- bits<5> Value = val;
32- }
33- def InstFormatPseudo : InstFormat<0>;
34- def InstFormatR : InstFormat<1>;
35- def InstFormatR4 : InstFormat<2>;
36- def InstFormatI : InstFormat<3>;
37- def InstFormatS : InstFormat<4>;
38- def InstFormatB : InstFormat<5>;
39- def InstFormatU : InstFormat<6>;
40- def InstFormatJ : InstFormat<7>;
41- def InstFormatCR : InstFormat<8>;
42- def InstFormatCI : InstFormat<9>;
43- def InstFormatCSS : InstFormat<10>;
44- def InstFormatCIW : InstFormat<11>;
45- def InstFormatCL : InstFormat<12>;
46- def InstFormatCS : InstFormat<13>;
47- def InstFormatCA : InstFormat<14>;
48- def InstFormatCB : InstFormat<15>;
49- def InstFormatCJ : InstFormat<16>;
50- def InstFormatCU : InstFormat<17>;
51- def InstFormatCLB : InstFormat<18>;
52- def InstFormatCLH : InstFormat<19>;
53- def InstFormatCSB : InstFormat<20>;
54- def InstFormatCSH : InstFormat<21>;
55- def InstFormatQC_EAI : InstFormat<22>;
56- def InstFormatQC_EI : InstFormat<23>;
57- def InstFormatQC_EB : InstFormat<24>;
58- def InstFormatQC_EJ : InstFormat<25>;
59- def InstFormatQC_ES : InstFormat<26>;
60- def InstFormatOther : InstFormat<31>;
30+ class InstFormat<bits<6> val> {
31+ bits<6> Value = val;
32+ }
33+ def InstFormatPseudo : InstFormat<0>;
34+ def InstFormatR : InstFormat<1>;
35+ def InstFormatR4 : InstFormat<2>;
36+ def InstFormatI : InstFormat<3>;
37+ def InstFormatS : InstFormat<4>;
38+ def InstFormatB : InstFormat<5>;
39+ def InstFormatU : InstFormat<6>;
40+ def InstFormatJ : InstFormat<7>;
41+ def InstFormatCR : InstFormat<8>;
42+ def InstFormatCI : InstFormat<9>;
43+ def InstFormatCSS : InstFormat<10>;
44+ def InstFormatCIW : InstFormat<11>;
45+ def InstFormatCL : InstFormat<12>;
46+ def InstFormatCS : InstFormat<13>;
47+ def InstFormatCA : InstFormat<14>;
48+ def InstFormatCB : InstFormat<15>;
49+ def InstFormatCJ : InstFormat<16>;
50+ def InstFormatCU : InstFormat<17>;
51+ def InstFormatCLB : InstFormat<18>;
52+ def InstFormatCLH : InstFormat<19>;
53+ def InstFormatCSB : InstFormat<20>;
54+ def InstFormatCSH : InstFormat<21>;
55+ def InstFormatQC_EAI : InstFormat<22>;
56+ def InstFormatQC_EI : InstFormat<23>;
57+ def InstFormatQC_EB : InstFormat<24>;
58+ def InstFormatQC_EJ : InstFormat<25>;
59+ def InstFormatQC_ES : InstFormat<26>;
60+ def InstFormatNDS_BRANCH_10 : InstFormat<27>;
61+ def InstFormatNDS_GPREL_18S0_I : InstFormat<28>;
62+ def InstFormatNDS_GPREL_17S1_I : InstFormat<29>;
63+ def InstFormatNDS_GPREL_17S2_I : InstFormat<30>;
64+ def InstFormatNDS_GPREL_17S3_I : InstFormat<31>;
65+ def InstFormatNDS_GPREL_18S0_S : InstFormat<32>;
66+ def InstFormatNDS_GPREL_17S1_S : InstFormat<33>;
67+ def InstFormatNDS_GPREL_17S2_S : InstFormat<34>;
68+ def InstFormatNDS_GPREL_17S3_S : InstFormat<35>;
69+ def InstFormatOther : InstFormat<63>;
6170
6271
6372class RISCVVConstraint<bits<3> val> {
@@ -192,50 +201,50 @@ class RVInstCommon<dag outs, dag ins, string opcodestr, string argstr,
192201 let AsmString = opcodestr # !if(!empty(argstr), "", "\t" # argstr);
193202 let Pattern = pattern;
194203
195- let TSFlags{4 -0} = format.Value;
204+ let TSFlags{5 -0} = format.Value;
196205
197206 // Defaults
198207 RISCVVConstraint RVVConstraint = NoConstraint;
199- let TSFlags{7-5 } = RVVConstraint.Value;
208+ let TSFlags{8-6 } = RVVConstraint.Value;
200209
201210 bits<3> VLMul = 0;
202- let TSFlags{10-8 } = VLMul;
211+ let TSFlags{11-9 } = VLMul;
203212
204213 bit IsTiedPseudo = 0;
205- let TSFlags{11 } = IsTiedPseudo;
214+ let TSFlags{12 } = IsTiedPseudo;
206215
207216 bit HasSEWOp = 0;
208- let TSFlags{12 } = HasSEWOp;
217+ let TSFlags{13 } = HasSEWOp;
209218
210219 bit HasVLOp = 0;
211- let TSFlags{13 } = HasVLOp;
220+ let TSFlags{14 } = HasVLOp;
212221
213222 bit HasVecPolicyOp = 0;
214- let TSFlags{14 } = HasVecPolicyOp;
223+ let TSFlags{15 } = HasVecPolicyOp;
215224
216225 bit IsRVVWideningReduction = 0;
217- let TSFlags{15 } = IsRVVWideningReduction;
226+ let TSFlags{16 } = IsRVVWideningReduction;
218227
219228 bit UsesMaskPolicy = 0;
220- let TSFlags{16 } = UsesMaskPolicy;
229+ let TSFlags{17 } = UsesMaskPolicy;
221230
222231 // Indicates that the result can be considered sign extended from bit 31. Some
223232 // instructions with this flag aren't W instructions, but are either sign
224233 // extended from a smaller size, always outputs a small integer, or put zeros
225234 // in bits 63:31. Used by the SExtWRemoval pass.
226235 bit IsSignExtendingOpW = 0;
227- let TSFlags{17 } = IsSignExtendingOpW;
236+ let TSFlags{18 } = IsSignExtendingOpW;
228237
229238 bit HasRoundModeOp = 0;
230- let TSFlags{18 } = HasRoundModeOp;
239+ let TSFlags{19 } = HasRoundModeOp;
231240
232241 // This is only valid when HasRoundModeOp is set to 1. HasRoundModeOp is set
233242 // to 1 for vector fixed-point or floating-point intrinsics. This bit is
234243 // processed under pass 'RISCVInsertReadWriteCSR' pass to distinguish between
235244 // fixed-point / floating-point instructions and emit appropriate read/write
236245 // to the correct CSR.
237246 bit UsesVXRM = 0;
238- let TSFlags{19 } = UsesVXRM;
247+ let TSFlags{20 } = UsesVXRM;
239248
240249 // Indicates whether these instructions can partially overlap between source
241250 // registers and destination registers according to the vector spec.
@@ -244,19 +253,19 @@ class RVInstCommon<dag outs, dag ins, string opcodestr, string argstr,
244253 // 2 -> narrowing case
245254 // 3 -> widening case
246255 bits<2> TargetOverlapConstraintType = 0;
247- let TSFlags{21-20 } = TargetOverlapConstraintType;
256+ let TSFlags{22-21 } = TargetOverlapConstraintType;
248257
249258 // Most vector instructions are elementwise, but some may depend on the value
250259 // of VL (e.g. vslide1down.vx), and others may depend on the VL and mask
251260 // (e.g. vredsum.vs, viota.m). Mark these instructions so that peepholes avoid
252261 // changing their VL and/or mask.
253262 EltDeps ElementsDependOn = EltDepsNone;
254- let TSFlags{22 } = ElementsDependOn.VL;
255- let TSFlags{23 } = ElementsDependOn.Mask;
263+ let TSFlags{23 } = ElementsDependOn.VL;
264+ let TSFlags{24 } = ElementsDependOn.Mask;
256265
257266 // Indicates the EEW of a vector instruction's destination operand.
258267 EEW DestEEW = EEWSEWx1;
259- let TSFlags{25-24 } = DestEEW.Value;
268+ let TSFlags{26-25 } = DestEEW.Value;
260269}
261270
262271class RVInst<dag outs, dag ins, string opcodestr, string argstr,
0 commit comments