summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohnny Chen <johnny.chen@apple.com>2011-04-15 22:52:15 +0000
committerJohnny Chen <johnny.chen@apple.com>2011-04-15 22:52:15 +0000
commit3a96122c4ae4e7727ba976a9f658626c18997689 (patch)
tree152c29065ab1f0130e5a388bcdf273cdc874d339
parenta704bc9354d8b03fd98da9bd7de5ae1dc49af961 (diff)
downloadllvm-3a96122c4ae4e7727ba976a9f658626c18997689.tar.gz
llvm-3a96122c4ae4e7727ba976a9f658626c18997689.tar.bz2
llvm-3a96122c4ae4e7727ba976a9f658626c18997689.tar.xz
Thumb2 BFC was insufficiently encoded.
rdar://problem/9292717 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129619 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/Target/ARM/ARMInstrThumb2.td2
-rw-r--r--lib/Target/ARM/Disassembler/ThumbDisassemblerCore.h2
-rw-r--r--test/MC/Disassembler/ARM/thumb-tests.txt3
3 files changed, 6 insertions, 1 deletions
diff --git a/lib/Target/ARM/ARMInstrThumb2.td b/lib/Target/ARM/ARMInstrThumb2.td
index 50065f9f1a..ad6888c5b6 100644
--- a/lib/Target/ARM/ARMInstrThumb2.td
+++ b/lib/Target/ARM/ARMInstrThumb2.td
@@ -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};
diff --git a/lib/Target/ARM/Disassembler/ThumbDisassemblerCore.h b/lib/Target/ARM/Disassembler/ThumbDisassemblerCore.h
index c7964e05e4..8d39982f56 100644
--- a/lib/Target/ARM/Disassembler/ThumbDisassemblerCore.h
+++ b/lib/Target/ARM/Disassembler/ThumbDisassemblerCore.h
@@ -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
diff --git a/test/MC/Disassembler/ARM/thumb-tests.txt b/test/MC/Disassembler/ARM/thumb-tests.txt
index 8352b5e119..39030a8b37 100644
--- a/test/MC/Disassembler/ARM/thumb-tests.txt
+++ b/test/MC/Disassembler/ARM/thumb-tests.txt
@@ -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