[llvm-commits] [llvm] r128220 - in /llvm/trunk: lib/Target/ARM/Disassembler/ARMDisassemblerCore.cpp test/MC/Disassembler/ARM/invalid-CPS3p-arm.txt test/MC/Disassembler/ARM/invalid-VLDMSDB-arm.txt
Johnny Chen
johnny.chen at apple.com
Thu Mar 24 10:04:23 PDT 2011
Author: johnny
Date: Thu Mar 24 12:04:22 2011
New Revision: 128220
URL: http://llvm.org/viewvc/llvm-project?rev=128220&view=rev
Log:
Add comments to the handling of opcode CPS3p to reject invalid instruction encoding,
a test case of invalid CPS3p encoding and one for invalid VLDMSDB due to regs out of range.
Added:
llvm/trunk/test/MC/Disassembler/ARM/invalid-CPS3p-arm.txt
llvm/trunk/test/MC/Disassembler/ARM/invalid-VLDMSDB-arm.txt
Modified:
llvm/trunk/lib/Target/ARM/Disassembler/ARMDisassemblerCore.cpp
Modified: llvm/trunk/lib/Target/ARM/Disassembler/ARMDisassemblerCore.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/Disassembler/ARMDisassemblerCore.cpp?rev=128220&r1=128219&r2=128220&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ARM/Disassembler/ARMDisassemblerCore.cpp (original)
+++ llvm/trunk/lib/Target/ARM/Disassembler/ARMDisassemblerCore.cpp Thu Mar 24 12:04:22 2011
@@ -2946,6 +2946,8 @@
// of optional arguments is implemented.
if (Opcode == ARM::CPS3p) {
// Let's reject impossible imod values by returning false.
+ // AsmPrinter cannot handle imod=0b00, plus (imod=0b00,M=1,iflags!=0) is an
+ // invalid combination, so we just check for imod=0b00 here.
if (slice(insn, 19, 18) == 0 || slice(insn, 19, 18) == 1)
return false;
MI.addOperand(MCOperand::CreateImm(slice(insn, 19, 18))); // imod
Added: llvm/trunk/test/MC/Disassembler/ARM/invalid-CPS3p-arm.txt
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/Disassembler/ARM/invalid-CPS3p-arm.txt?rev=128220&view=auto
==============================================================================
--- llvm/trunk/test/MC/Disassembler/ARM/invalid-CPS3p-arm.txt (added)
+++ llvm/trunk/test/MC/Disassembler/ARM/invalid-CPS3p-arm.txt Thu Mar 24 12:04:22 2011
@@ -0,0 +1,4 @@
+# RUN: llvm-mc --disassemble %s -triple=arm-apple-darwin9 |& grep {invalid instruction encoding}
+
+# invalid (imod, M, iflags) combination
+0x93 0x1c 0x02 0xf1
Added: llvm/trunk/test/MC/Disassembler/ARM/invalid-VLDMSDB-arm.txt
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/Disassembler/ARM/invalid-VLDMSDB-arm.txt?rev=128220&view=auto
==============================================================================
--- llvm/trunk/test/MC/Disassembler/ARM/invalid-VLDMSDB-arm.txt (added)
+++ llvm/trunk/test/MC/Disassembler/ARM/invalid-VLDMSDB-arm.txt Thu Mar 24 12:04:22 2011
@@ -0,0 +1,4 @@
+# RUN: llvm-mc --disassemble %s -triple=arm-apple-darwin9 |& grep {invalid instruction encoding}
+
+# core registers out of range
+0xa5 0xba 0x52 0xed
More information about the llvm-commits
mailing list