27
27
// Format specifies the encoding used by the instruction. This is used by
28
28
// RISCVMCCodeEmitter to determine which form of fixup to use. These
29
29
// 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>;
70
62
71
63
72
64
class RISCVVConstraint<bits<3> val> {
@@ -201,50 +193,50 @@ class RVInstCommon<dag outs, dag ins, string opcodestr, string argstr,
201
193
let AsmString = opcodestr # !if(!empty(argstr), "", "\t" # argstr);
202
194
let Pattern = pattern;
203
195
204
- let TSFlags{5 -0} = format.Value;
196
+ let TSFlags{4 -0} = format.Value;
205
197
206
198
// Defaults
207
199
RISCVVConstraint RVVConstraint = NoConstraint;
208
- let TSFlags{8-6 } = RVVConstraint.Value;
200
+ let TSFlags{7-5 } = RVVConstraint.Value;
209
201
210
202
bits<3> VLMul = 0;
211
- let TSFlags{11-9 } = VLMul;
203
+ let TSFlags{10-8 } = VLMul;
212
204
213
205
bit IsTiedPseudo = 0;
214
- let TSFlags{12 } = IsTiedPseudo;
206
+ let TSFlags{11 } = IsTiedPseudo;
215
207
216
208
bit HasSEWOp = 0;
217
- let TSFlags{13 } = HasSEWOp;
209
+ let TSFlags{12 } = HasSEWOp;
218
210
219
211
bit HasVLOp = 0;
220
- let TSFlags{14 } = HasVLOp;
212
+ let TSFlags{13 } = HasVLOp;
221
213
222
214
bit HasVecPolicyOp = 0;
223
- let TSFlags{15 } = HasVecPolicyOp;
215
+ let TSFlags{14 } = HasVecPolicyOp;
224
216
225
217
bit IsRVVWideningReduction = 0;
226
- let TSFlags{16 } = IsRVVWideningReduction;
218
+ let TSFlags{15 } = IsRVVWideningReduction;
227
219
228
220
bit UsesMaskPolicy = 0;
229
- let TSFlags{17 } = UsesMaskPolicy;
221
+ let TSFlags{16 } = UsesMaskPolicy;
230
222
231
223
// Indicates that the result can be considered sign extended from bit 31. Some
232
224
// instructions with this flag aren't W instructions, but are either sign
233
225
// extended from a smaller size, always outputs a small integer, or put zeros
234
226
// in bits 63:31. Used by the SExtWRemoval pass.
235
227
bit IsSignExtendingOpW = 0;
236
- let TSFlags{18 } = IsSignExtendingOpW;
228
+ let TSFlags{17 } = IsSignExtendingOpW;
237
229
238
230
bit HasRoundModeOp = 0;
239
- let TSFlags{19 } = HasRoundModeOp;
231
+ let TSFlags{18 } = HasRoundModeOp;
240
232
241
233
// This is only valid when HasRoundModeOp is set to 1. HasRoundModeOp is set
242
234
// to 1 for vector fixed-point or floating-point intrinsics. This bit is
243
235
// processed under pass 'RISCVInsertReadWriteCSR' pass to distinguish between
244
236
// fixed-point / floating-point instructions and emit appropriate read/write
245
237
// to the correct CSR.
246
238
bit UsesVXRM = 0;
247
- let TSFlags{20 } = UsesVXRM;
239
+ let TSFlags{19 } = UsesVXRM;
248
240
249
241
// Indicates whether these instructions can partially overlap between source
250
242
// registers and destination registers according to the vector spec.
@@ -253,19 +245,19 @@ class RVInstCommon<dag outs, dag ins, string opcodestr, string argstr,
253
245
// 2 -> narrowing case
254
246
// 3 -> widening case
255
247
bits<2> TargetOverlapConstraintType = 0;
256
- let TSFlags{22-21 } = TargetOverlapConstraintType;
248
+ let TSFlags{21-20 } = TargetOverlapConstraintType;
257
249
258
250
// Most vector instructions are elementwise, but some may depend on the value
259
251
// of VL (e.g. vslide1down.vx), and others may depend on the VL and mask
260
252
// (e.g. vredsum.vs, viota.m). Mark these instructions so that peepholes avoid
261
253
// changing their VL and/or mask.
262
254
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;
265
257
266
258
// Indicates the EEW of a vector instruction's destination operand.
267
259
EEW DestEEW = EEWSEWx1;
268
- let TSFlags{26-25 } = DestEEW.Value;
260
+ let TSFlags{25-24 } = DestEEW.Value;
269
261
}
270
262
271
263
class RVInst<dag outs, dag ins, string opcodestr, string argstr,
0 commit comments