@@ -114,32 +114,38 @@ def unrelated: Instruction {
114
114
// For 'baz' we only assigned ModeB for it, so it will be presented
115
115
// as '0' in the tables of ModeA, ModeC and Default Mode.
116
116
// ENCODER-LABEL: static const uint64_t InstBits[] = {
117
- // ENCODER: UINT64_C(2), UINT64_C(0), // bar
118
- // ENCODER: UINT64_C(0), UINT64_C(0), // baz
119
- // ENCODER: UINT64_C(8), UINT64_C(0), // foo
120
- // ENCODER: UINT64_C(2), UINT64_C(0), // unrelated
117
+ // ENCODER-NEXT: UINT64_C(2), UINT64_C(0), // bar
118
+ // ENCODER-NEXT: UINT64_C(0), UINT64_C(0), // baz
119
+ // ENCODER-NEXT: UINT64_C(8), UINT64_C(0), // foo
120
+ // ENCODER-NEXT: UINT64_C(2), UINT64_C(0), // unrelated
121
+ // ENCODER-NEXT: };
121
122
// ENCODER-LABEL: static const uint64_t InstBits_ModeA[] = {
122
- // ENCODER: UINT64_C(2), UINT64_C(0), // bar
123
- // ENCODER: UINT64_C(0), UINT64_C(0), // baz
124
- // ENCODER: UINT64_C(12), UINT64_C(0), // foo
125
- // ENCODER: UINT64_C(2), UINT64_C(0), // unrelated
123
+ // ENCODER-NEXT: UINT64_C(2), UINT64_C(0), // bar
124
+ // ENCODER-NEXT: UINT64_C(0), UINT64_C(0), // baz
125
+ // ENCODER-NEXT: UINT64_C(12), UINT64_C(0), // foo
126
+ // ENCODER-NEXT: UINT64_C(2), UINT64_C(0), // unrelated
127
+ // ENCODER-NEXT: };
126
128
// ENCODER-LABEL: static const uint64_t InstBits_ModeB[] = {
127
- // ENCODER: UINT64_C(2), UINT64_C(0), // bar
128
- // ENCODER: UINT64_C(12), UINT64_C(0), // baz
129
- // ENCODER: UINT64_C(0), UINT64_C(211106232532992), // foo
130
- // ENCODER: UINT64_C(2), UINT64_C(0), // unrelated
129
+ // ENCODER-NEXT: UINT64_C(2), UINT64_C(0), // bar
130
+ // ENCODER-NEXT: UINT64_C(12), UINT64_C(0), // baz
131
+ // ENCODER-NEXT: UINT64_C(0), UINT64_C(211106232532992), // foo
132
+ // ENCODER-NEXT: UINT64_C(2), UINT64_C(0), // unrelated
133
+ // ENCODER-NEXT: };
131
134
// ENCODER-LABEL: static const uint64_t InstBits_ModeC[] = {
132
- // ENCODER: UINT64_C(2), UINT64_C(0), // bar
133
- // ENCODER: UINT64_C(0), UINT64_C(0), // baz
134
- // ENCODER: UINT64_C(12582915), UINT64_C(0), // foo
135
- // ENCODER: UINT64_C(2), UINT64_C(0), // unrelated
136
-
135
+ // ENCODER-NEXT: UINT64_C(2), UINT64_C(0), // bar
136
+ // ENCODER-NEXT: UINT64_C(0), UINT64_C(0), // baz
137
+ // ENCODER-NEXT: UINT64_C(12582915), UINT64_C(0), // foo
138
+ // ENCODER-NEXT: UINT64_C(2), UINT64_C(0), // unrelated
139
+ // ENCODER-NEXT: };
137
140
138
141
// ENCODER: const uint64_t *InstBitsByHw;
142
+ // ENCODER: constexpr unsigned FirstSupportedOpcode
139
143
// ENCODER: const unsigned opcode = MI.getOpcode();
144
+ // ENCODER: if (opcode < FirstSupportedOpcode)
145
+ // ENCODER: unsigned TableIndex = opcode - FirstSupportedOpcode
140
146
// ENCODER: if (Scratch.getBitWidth() != 128)
141
147
// ENCODER: Scratch = Scratch.zext(128);
142
- // ENCODER: Inst = APInt(128, ArrayRef(InstBits + opcode * 2, 2));
148
+ // ENCODER: Inst = APInt(128, ArrayRef(InstBits + TableIndex * 2, 2));
143
149
// ENCODER: APInt &Value = Inst;
144
150
// ENCODER: APInt &op = Scratch;
145
151
// ENCODER: switch (opcode) {
@@ -155,7 +161,7 @@ def unrelated: Instruction {
155
161
// ENCODER: case 2: InstBitsByHw = InstBits_ModeB; break;
156
162
// ENCODER: case 3: InstBitsByHw = InstBits_ModeC; break;
157
163
// ENCODER: };
158
- // ENCODER: Inst = APInt(128, ArrayRef(InstBitsByHw + opcode * 2, 2));
164
+ // ENCODER: Inst = APInt(128, ArrayRef(InstBitsByHw + TableIndex * 2, 2));
159
165
// ENCODER: Value = Inst;
160
166
// ENCODER: switch (HwMode) {
161
167
// ENCODER: default: llvm_unreachable("Unhandled HwMode");
@@ -189,7 +195,7 @@ def unrelated: Instruction {
189
195
// ENCODER: default: llvm_unreachable("Unknown hardware mode!"); break;
190
196
// ENCODER: case 2: InstBitsByHw = InstBits_ModeB; break;
191
197
// ENCODER: };
192
- // ENCODER: Inst = APInt(128, ArrayRef(InstBitsByHw + opcode * 2, 2));
198
+ // ENCODER: Inst = APInt(128, ArrayRef(InstBitsByHw + TableIndex * 2, 2));
193
199
// ENCODER: Value = Inst;
194
200
// ENCODER: switch (HwMode) {
195
201
// ENCODER: default: llvm_unreachable("Unhandled HwMode");
0 commit comments