mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-30 05:24:22 +00:00
ARM: add fstmx and fldmx instructions for assembly
These instructions are deprecated oddities, but we still need to be able to disassemble (and reassemble) them if and when they're encountered. Patch by Amaury de la Vieuville. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183011 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -1150,6 +1150,13 @@ static DecodeStatus DecodeSPRRegListOperand(MCInst &Inst, unsigned Val,
|
||||
unsigned Vd = fieldFromInstruction(Val, 8, 5);
|
||||
unsigned regs = fieldFromInstruction(Val, 0, 8);
|
||||
|
||||
// In case of unpredictable encoding, tweak the operands.
|
||||
if (regs == 0 || (Vd + regs) > 32) {
|
||||
regs = Vd + regs > 32 ? 32 - Vd : regs;
|
||||
regs = std::max( 1u, regs);
|
||||
S = MCDisassembler::SoftFail;
|
||||
}
|
||||
|
||||
if (!Check(S, DecodeSPRRegisterClass(Inst, Vd, Address, Decoder)))
|
||||
return MCDisassembler::Fail;
|
||||
for (unsigned i = 0; i < (regs - 1); ++i) {
|
||||
@ -1165,9 +1172,15 @@ static DecodeStatus DecodeDPRRegListOperand(MCInst &Inst, unsigned Val,
|
||||
DecodeStatus S = MCDisassembler::Success;
|
||||
|
||||
unsigned Vd = fieldFromInstruction(Val, 8, 5);
|
||||
unsigned regs = fieldFromInstruction(Val, 0, 8);
|
||||
unsigned regs = fieldFromInstruction(Val, 1, 7);
|
||||
|
||||
regs = regs >> 1;
|
||||
// In case of unpredictable encoding, tweak the operands.
|
||||
if (regs == 0 || regs > 16 || (Vd + regs) > 32) {
|
||||
regs = Vd + regs > 32 ? 32 - Vd : regs;
|
||||
regs = std::max( 1u, regs);
|
||||
regs = std::min(16u, regs);
|
||||
S = MCDisassembler::SoftFail;
|
||||
}
|
||||
|
||||
if (!Check(S, DecodeDPRRegisterClass(Inst, Vd, Address, Decoder)))
|
||||
return MCDisassembler::Fail;
|
||||
|
Reference in New Issue
Block a user