@@ -119,10 +119,6 @@ class ExegesisAArch64Target : public ExegesisTarget {
119
119
ExegesisAArch64Target ()
120
120
: ExegesisTarget(AArch64CpuPfmCounters, AArch64_MC::isOpcodeAvailable) {}
121
121
122
- Error randomizeTargetMCOperand (const Instruction &Instr, const Variable &Var,
123
- MCOperand &AssignedValue,
124
- const BitVector &ForbiddenRegs) const override ;
125
-
126
122
private:
127
123
std::vector<MCInst> setRegTo (const MCSubtargetInfo &STI, MCRegister Reg,
128
124
const APInt &Value) const override {
@@ -186,56 +182,6 @@ class ExegesisAArch64Target : public ExegesisTarget {
186
182
}
187
183
};
188
184
189
- Error ExegesisAArch64Target::randomizeTargetMCOperand (
190
- const Instruction &Instr, const Variable &Var, MCOperand &AssignedValue,
191
- const BitVector &ForbiddenRegs) const {
192
- const Operand &Op = Instr.getPrimaryOperand (Var);
193
- const auto OperandType = Op.getExplicitOperandInfo ().OperandType ;
194
- // NOTE: To resolve "Not all operands were initialized by snippet generator"
195
- // Requires OperandType to be defined for such opcode's operands in AArch64
196
- // tablegen files. And omit introduced OperandType(s).
197
-
198
- // Hacky temporary fix works by defaulting all OPERAND_UNKNOWN to
199
- // immediate value 0, but this introduce illegal instruction error for below
200
- // system instructions will need to be omitted with OperandType or opcode
201
- // specific values to avoid generating invalid encodings or unreliable
202
- // benchmark results for these system-level instructions.
203
- // Implement opcode-specific immediate value handling for system instrs:
204
- // - MRS/MSR: Use valid system register encodings (e.g., NZCV, FPCR, FPSR)
205
- // - MSRpstatesvcrImm1: Use valid PSTATE field encodings (e.g., SPSel,
206
- // DAIFSet)
207
- // - SYSLxt/SYSxt: Use valid system instruction encodings with proper
208
- // CRn/CRm/op values
209
- // - UDF: Use valid undefined instruction immediate ranges (0-65535)
210
-
211
- switch (OperandType) {
212
- // MSL (Masking Shift Left) imm operand for 32-bit splatted SIMD constants
213
- // Correspond to AArch64InstructionSelector::tryAdvSIMDModImm321s()
214
- case llvm::AArch64::OPERAND_SHIFT_MSL: {
215
- // There are two valid encodings:
216
- // - Type 7: imm at [15:8], [47:40], shift = 264 (0x108) → msl #8
217
- // - Type 8: imm at [23:16], [55:48], shift = 272 (0x110) → msl #16
218
- // Corresponds AArch64_AM::encodeAdvSIMDModImmType7()
219
- // But, v2s_msl and v4s_msl instructions accept either form,
220
- // Thus, Arbitrarily chosing 264 (msl #8) for simplicity.
221
- AssignedValue = MCOperand::createImm (264 );
222
- return Error::success ();
223
- }
224
- case llvm::AArch64::OPERAND_IMPLICIT_IMM_0:
225
- AssignedValue = MCOperand::createImm (0 );
226
- return Error::success ();
227
- case MCOI::OperandType::OPERAND_PCREL:
228
- AssignedValue = MCOperand::createImm (8 );
229
- return Error::success ();
230
- default :
231
- break ;
232
- }
233
-
234
- return make_error<Failure>(
235
- Twine (" Unimplemented operand type: MCOI::OperandType:" )
236
- .concat (Twine (static_cast <int >(OperandType))));
237
- }
238
-
239
185
} // namespace
240
186
241
187
static ExegesisTarget *getTheExegesisAArch64Target () {
0 commit comments