[llvm-commits] [llvm] r138000 - in /llvm/trunk: lib/Target/ARM/Disassembler/ARMDisassembler.cpp test/MC/Disassembler/ARM/arm-tests.txt
Owen Anderson
resistor at mac.com
Thu Aug 18 15:31:18 PDT 2011
Author: resistor
Date: Thu Aug 18 17:31:17 2011
New Revision: 138000
URL: http://llvm.org/viewvc/llvm-project?rev=138000&view=rev
Log:
Fix the decoding of RFE instruction. RFEs have the load bit set, while SRSs have it unset.
Modified:
llvm/trunk/lib/Target/ARM/Disassembler/ARMDisassembler.cpp
llvm/trunk/test/MC/Disassembler/ARM/arm-tests.txt
Modified: llvm/trunk/lib/Target/ARM/Disassembler/ARMDisassembler.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/Disassembler/ARMDisassembler.cpp?rev=138000&r1=137999&r2=138000&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ARM/Disassembler/ARMDisassembler.cpp (original)
+++ llvm/trunk/lib/Target/ARM/Disassembler/ARMDisassembler.cpp Thu Aug 18 17:31:17 2011
@@ -1274,31 +1274,65 @@
if (pred == 0xF) {
switch (Inst.getOpcode()) {
- case ARM::STMDA:
+ case ARM::LDMDA:
Inst.setOpcode(ARM::RFEDA);
break;
- case ARM::STMDA_UPD:
+ case ARM::LDMDA_UPD:
Inst.setOpcode(ARM::RFEDA_UPD);
break;
- case ARM::STMDB:
+ case ARM::LDMDB:
Inst.setOpcode(ARM::RFEDB);
break;
- case ARM::STMDB_UPD:
+ case ARM::LDMDB_UPD:
Inst.setOpcode(ARM::RFEDB_UPD);
break;
- case ARM::STMIA:
+ case ARM::LDMIA:
Inst.setOpcode(ARM::RFEIA);
break;
- case ARM::STMIA_UPD:
+ case ARM::LDMIA_UPD:
Inst.setOpcode(ARM::RFEIA_UPD);
break;
- case ARM::STMIB:
+ case ARM::LDMIB:
Inst.setOpcode(ARM::RFEIB);
break;
- case ARM::STMIB_UPD:
+ case ARM::LDMIB_UPD:
Inst.setOpcode(ARM::RFEIB_UPD);
break;
+ case ARM::STMDA:
+ Inst.setOpcode(ARM::SRSDA);
+ break;
+ case ARM::STMDA_UPD:
+ Inst.setOpcode(ARM::SRSDA_UPD);
+ break;
+ case ARM::STMDB:
+ Inst.setOpcode(ARM::SRSDB);
+ break;
+ case ARM::STMDB_UPD:
+ Inst.setOpcode(ARM::SRSDB_UPD);
+ break;
+ case ARM::STMIA:
+ Inst.setOpcode(ARM::SRSIA);
+ break;
+ case ARM::STMIA_UPD:
+ Inst.setOpcode(ARM::SRSIA_UPD);
+ break;
+ case ARM::STMIB:
+ Inst.setOpcode(ARM::SRSIB);
+ break;
+ case ARM::STMIB_UPD:
+ Inst.setOpcode(ARM::SRSIB_UPD);
+ break;
+ default:
+ CHECK(S, Fail);
}
+
+ // For stores (which become SRS's, the only operand is the mode.
+ if (fieldFromInstruction32(Insn, 20, 1) == 0) {
+ Inst.addOperand(
+ MCOperand::CreateImm(fieldFromInstruction32(Insn, 0, 4)));
+ return S;
+ }
+
return DecodeRFEInstruction(Inst, Insn, Address, Decoder);
}
Modified: llvm/trunk/test/MC/Disassembler/ARM/arm-tests.txt
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/Disassembler/ARM/arm-tests.txt?rev=138000&r1=137999&r2=138000&view=diff
==============================================================================
--- llvm/trunk/test/MC/Disassembler/ARM/arm-tests.txt (original)
+++ llvm/trunk/test/MC/Disassembler/ARM/arm-tests.txt Thu Aug 18 17:31:17 2011
@@ -311,3 +311,6 @@
# CHECK: strheq r0, [r0, -r0]
0xb0 0x00 0x00 0x01
+
+# CHECK: rfedb #4!
+0x14 0x0 0x32 0xf9
More information about the llvm-commits
mailing list