[llvm-commits] [llvm] r138306 - in /llvm/trunk/lib/Target/ARM: ARMInstrFormats.td Disassembler/ARMDisassembler.cpp

Owen Anderson resistor at mac.com
Mon Aug 22 16:44:04 PDT 2011


Author: resistor
Date: Mon Aug 22 18:44:04 2011
New Revision: 138306

URL: http://llvm.org/viewvc/llvm-project?rev=138306&view=rev
Log:
Reject invalid imod values in t2CPS instructions.

Modified:
    llvm/trunk/lib/Target/ARM/ARMInstrFormats.td
    llvm/trunk/lib/Target/ARM/Disassembler/ARMDisassembler.cpp

Modified: llvm/trunk/lib/Target/ARM/ARMInstrFormats.td
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMInstrFormats.td?rev=138306&r1=138305&r2=138306&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ARM/ARMInstrFormats.td (original)
+++ llvm/trunk/lib/Target/ARM/ARMInstrFormats.td Mon Aug 22 18:44:04 2011
@@ -134,6 +134,7 @@
 // ARM imod and iflag operands, used only by the CPS instruction.
 def imod_op : Operand<i32> {
   let PrintMethod = "printCPSIMod";
+  let DecoderMethod = "DecodeCPSIMod";
 }
 
 def ProcIFlagsOperand : AsmOperandClass {

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=138306&r1=138305&r2=138306&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ARM/Disassembler/ARMDisassembler.cpp (original)
+++ llvm/trunk/lib/Target/ARM/Disassembler/ARMDisassembler.cpp Mon Aug 22 18:44:04 2011
@@ -179,7 +179,8 @@
                                uint64_t Address, const void *Decoder);
 static DecodeStatus DecodeVMOVRRS(llvm::MCInst &Inst, unsigned Insn,
                                uint64_t Address, const void *Decoder);
-
+static DecodeStatus DecodeCPSIMod(llvm::MCInst &Inst, unsigned Insn,
+                               uint64_t Address, const void *Decoder);
 
 static DecodeStatus DecodeThumbAddSpecialReg(llvm::MCInst &Inst, uint16_t Insn,
                                uint64_t Address, const void *Decoder);
@@ -3240,3 +3241,11 @@
 
   return S;
 }
+
+static DecodeStatus DecodeCPSIMod(llvm::MCInst &Inst, unsigned Val,
+                                 uint64_t Address, const void *Decoder) {
+  if (Val == 0x1) return Fail;
+  Inst.addOperand(MCOperand::CreateImm(Val));
+  return Success;
+}
+





More information about the llvm-commits mailing list