@@ -180,28 +180,14 @@ Error ExegesisAArch64Target::randomizeTargetMCOperand(
180180 // MSL (Masking Shift Left) imm operand for 32-bit splatted SIMD constants
181181 // Correspond to AArch64InstructionSelector::tryAdvSIMDModImm321s()
182182 case llvm::AArch64::OPERAND_MSL_SHIFT: {
183- unsigned Opcode = Instr.getOpcode ();
184- switch (Opcode) {
185- case AArch64::MOVIv2s_msl:
186- case AArch64::MVNIv2s_msl:
187- // Type 7: Pattern 0x00 0x00 abcdefgh 0xFF 0x00 0x00 abcdefgh 0xFF
188- // Creates 2-element 32-bit vector with 8-bit imm at positions [15:8] &
189- // [47:40] Shift value 264 (0x108) for Type 7 pattern encoding Corresponds
190- // to AArch64_AM::encodeAdvSIMDModImmType7()
183+ // There are two valid encodings:
184+ // - Type 7: imm at [15:8], [47:40], shift = 264 (0x108) → msl #8
185+ // - Type 8: imm at [23:16], [55:48], shift = 272 (0x110) → msl #16
186+ // Corresponds AArch64_AM::encodeAdvSIMDModImmType7()
187+ // But, v2s_msl and v4s_msl instructions accept either form,
188+ // Thus, Arbitrarily chosing 264 (msl #8) for simplicity.
191189 AssignedValue = MCOperand::createImm (264 );
192190 return Error::success ();
193- case AArch64::MOVIv4s_msl:
194- case AArch64::MVNIv4s_msl:
195- // Type 8: Pattern 0x00 abcdefgh 0xFF 0xFF 0x00 abcdefgh 0xFF 0xFF
196- // Creates 4-element 32-bit vector with 8-bit imm at positions [23:16] &
197- // [55:48] Shift value 272 (0x110) for Type 8 pattern encoding Corresponds
198- // to AArch64_AM::encodeAdvSIMDModImmType8()
199- AssignedValue = MCOperand::createImm (272 );
200- return Error::success ();
201- default :
202- return make_error<Failure>(
203- Twine (" Unsupported MSL shift opcode: " ).concat (Twine (Opcode)));
204- }
205191 }
206192 case MCOI::OperandType::OPERAND_PCREL:
207193 case MCOI::OperandType::OPERAND_FIRST_TARGET:
0 commit comments