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<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>;
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 InstFormatNDS_BRANCH_10 : InstFormat<27>;
61+ def InstFormatOther : InstFormat<31>;
7062
7163
7264class RISCVVConstraint<bits<3> val> {
@@ -201,50 +193,50 @@ class RVInstCommon<dag outs, dag ins, string opcodestr, string argstr,
201193 let AsmString = opcodestr # !if(!empty(argstr), "", "\t" # argstr);
202194 let Pattern = pattern;
203195
204- let TSFlags{5 -0} = format.Value;
196+ let TSFlags{4 -0} = format.Value;
205197
206198 // Defaults
207199 RISCVVConstraint RVVConstraint = NoConstraint;
208- let TSFlags{8-6 } = RVVConstraint.Value;
200+ let TSFlags{7-5 } = RVVConstraint.Value;
209201
210202 bits<3> VLMul = 0;
211- let TSFlags{11-9 } = VLMul;
203+ let TSFlags{10-8 } = VLMul;
212204
213205 bit IsTiedPseudo = 0;
214- let TSFlags{12 } = IsTiedPseudo;
206+ let TSFlags{11 } = IsTiedPseudo;
215207
216208 bit HasSEWOp = 0;
217- let TSFlags{13 } = HasSEWOp;
209+ let TSFlags{12 } = HasSEWOp;
218210
219211 bit HasVLOp = 0;
220- let TSFlags{14 } = HasVLOp;
212+ let TSFlags{13 } = HasVLOp;
221213
222214 bit HasVecPolicyOp = 0;
223- let TSFlags{15 } = HasVecPolicyOp;
215+ let TSFlags{14 } = HasVecPolicyOp;
224216
225217 bit IsRVVWideningReduction = 0;
226- let TSFlags{16 } = IsRVVWideningReduction;
218+ let TSFlags{15 } = IsRVVWideningReduction;
227219
228220 bit UsesMaskPolicy = 0;
229- let TSFlags{17 } = UsesMaskPolicy;
221+ let TSFlags{16 } = UsesMaskPolicy;
230222
231223 // Indicates that the result can be considered sign extended from bit 31. Some
232224 // instructions with this flag aren't W instructions, but are either sign
233225 // extended from a smaller size, always outputs a small integer, or put zeros
234226 // in bits 63:31. Used by the SExtWRemoval pass.
235227 bit IsSignExtendingOpW = 0;
236- let TSFlags{18 } = IsSignExtendingOpW;
228+ let TSFlags{17 } = IsSignExtendingOpW;
237229
238230 bit HasRoundModeOp = 0;
239- let TSFlags{19 } = HasRoundModeOp;
231+ let TSFlags{18 } = HasRoundModeOp;
240232
241233 // This is only valid when HasRoundModeOp is set to 1. HasRoundModeOp is set
242234 // to 1 for vector fixed-point or floating-point intrinsics. This bit is
243235 // processed under pass 'RISCVInsertReadWriteCSR' pass to distinguish between
244236 // fixed-point / floating-point instructions and emit appropriate read/write
245237 // to the correct CSR.
246238 bit UsesVXRM = 0;
247- let TSFlags{20 } = UsesVXRM;
239+ let TSFlags{19 } = UsesVXRM;
248240
249241 // Indicates whether these instructions can partially overlap between source
250242 // registers and destination registers according to the vector spec.
@@ -253,19 +245,19 @@ class RVInstCommon<dag outs, dag ins, string opcodestr, string argstr,
253245 // 2 -> narrowing case
254246 // 3 -> widening case
255247 bits<2> TargetOverlapConstraintType = 0;
256- let TSFlags{22-21 } = TargetOverlapConstraintType;
248+ let TSFlags{21-20 } = TargetOverlapConstraintType;
257249
258250 // Most vector instructions are elementwise, but some may depend on the value
259251 // of VL (e.g. vslide1down.vx), and others may depend on the VL and mask
260252 // (e.g. vredsum.vs, viota.m). Mark these instructions so that peepholes avoid
261253 // changing their VL and/or mask.
262254 EltDeps ElementsDependOn = EltDepsNone;
263- let TSFlags{23 } = ElementsDependOn.VL;
264- let TSFlags{24 } = ElementsDependOn.Mask;
255+ let TSFlags{22 } = ElementsDependOn.VL;
256+ let TSFlags{23 } = ElementsDependOn.Mask;
265257
266258 // Indicates the EEW of a vector instruction's destination operand.
267259 EEW DestEEW = EEWSEWx1;
268- let TSFlags{26-25 } = DestEEW.Value;
260+ let TSFlags{25-24 } = DestEEW.Value;
269261}
270262
271263class RVInst<dag outs, dag ins, string opcodestr, string argstr,
0 commit comments