Thumb2 BFC was insufficiently encoded.
authorJohnny Chen <johnny.chen@apple.com>
Fri, 15 Apr 2011 22:52:15 +0000 (22:52 +0000)
committerJohnny Chen <johnny.chen@apple.com>
Fri, 15 Apr 2011 22:52:15 +0000 (22:52 +0000)
rdar://problem/9292717

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129619 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/ARM/ARMInstrThumb2.td
lib/Target/ARM/Disassembler/ThumbDisassemblerCore.h
test/MC/Disassembler/ARM/thumb-tests.txt

index 50065f9f1a0da020c2c3998d2cb508de60775121..ad6888c5b6090bf0526aa8217351ad3bdd86cac2 100644 (file)
@@ -2130,10 +2130,12 @@ def t2BFC : T2BitFI<(outs rGPR:$Rd), (ins rGPR:$src, bf_inv_mask_imm:$imm),
                 IIC_iUNAsi, "bfc", "\t$Rd, $imm",
                 [(set rGPR:$Rd, (and rGPR:$src, bf_inv_mask_imm:$imm))]> {
   let Inst{31-27} = 0b11110;
+  let Inst{26} = 0; // should be 0.
   let Inst{25} = 1;
   let Inst{24-20} = 0b10110;
   let Inst{19-16} = 0b1111; // Rn
   let Inst{15} = 0;
+  let Inst{5} = 0; // should be 0.
 
   bits<10> imm;
   let msb{4-0} = imm{9-5};
index c7964e05e44fa1f90a9fa6ca4de16db8049c81bd..8d39982f5640d055683527357e96eb34ac5a316a 100644 (file)
@@ -1616,7 +1616,7 @@ static bool DisassembleThumb2Sat(MCInst &MI, unsigned Opcode, uint32_t insn,
 // o t2ADDri12, t2SUBri12: Rs Rn imm12
 // o t2LEApcrel (ADR): Rs imm12
 // o t2BFC (BFC): Rs Ro(TIED_TO) bf_inv_mask_imm
-// o t2BFI (BFI) (Currently not defined in LLVM as of Jan-07-2010)
+// o t2BFI (BFI): Rs Ro(TIED_TO) Rn bf_inv_mask_imm
 // o t2MOVi16: Rs imm16
 // o t2MOVTi16: Rs imm16
 // o t2SBFX (SBFX): Rs Rn lsb width
index 8352b5e1197d72ea49a813d727bd56e4df1dcce8..39030a8b3761ddf5cd49966988f31194d4370842 100644 (file)
@@ -12,6 +12,9 @@
 # CHECK:       bgt.w   #-16
 0x3f 0xf7 0xf8 0xaf
 
+# CHECK:       bfc     r0, #10, #10
+0x6f 0xf3 0x93 0x20
+
 # CHECK:       bfi     r2, r10, #0, #1
 0x6a 0xf3 0x00 0x02