Skip to content

Commit

Permalink
Add suport for unpredicatble cases of the cmp, tst, teq and cmnz ARM …
Browse files Browse the repository at this point in the history
…instructions in the disassembler.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@154999 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
sbaranga-arm committed Apr 18, 2012
1 parent 4bb87cb commit 9e71231
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 2 deletions.
12 changes: 10 additions & 2 deletions lib/Target/ARM/ARMInstrInfo.td
Original file line number Diff line number Diff line change
Expand Up @@ -1187,6 +1187,8 @@ multiclass AI1_cmp_irs<bits<4> opcod, string opc,
let Inst{19-16} = Rn;
let Inst{15-12} = 0b0000;
let Inst{11-0} = imm;

let Unpredictable{15-12} = 0b1111;
}
def rr : AI1<opcod, (outs), (ins GPR:$Rn, GPR:$Rm), DPFrm, iir,
opc, "\t$Rn, $Rm",
Expand All @@ -1200,6 +1202,8 @@ multiclass AI1_cmp_irs<bits<4> opcod, string opc,
let Inst{15-12} = 0b0000;
let Inst{11-4} = 0b00000000;
let Inst{3-0} = Rm;

let Unpredictable{15-12} = 0b1111;
}
def rsi : AI1<opcod, (outs),
(ins GPR:$Rn, so_reg_imm:$shift), DPSoRegImmFrm, iis,
Expand All @@ -1214,11 +1218,13 @@ multiclass AI1_cmp_irs<bits<4> opcod, string opc,
let Inst{11-5} = shift{11-5};
let Inst{4} = 0;
let Inst{3-0} = shift{3-0};

let Unpredictable{15-12} = 0b1111;
}
def rsr : AI1<opcod, (outs),
(ins GPR:$Rn, so_reg_reg:$shift), DPSoRegRegFrm, iis,
(ins GPRnopc:$Rn, so_reg_reg:$shift), DPSoRegRegFrm, iis,
opc, "\t$Rn, $shift",
[(opnode GPR:$Rn, so_reg_reg:$shift)]> {
[(opnode GPRnopc:$Rn, so_reg_reg:$shift)]> {
bits<4> Rn;
bits<12> shift;
let Inst{25} = 0;
Expand All @@ -1230,6 +1236,8 @@ multiclass AI1_cmp_irs<bits<4> opcod, string opc,
let Inst{6-5} = shift{6-5};
let Inst{4} = 1;
let Inst{3-0} = shift{3-0};

let Unpredictable{15-12} = 0b1111;
}

}
Expand Down
30 changes: 30 additions & 0 deletions test/MC/Disassembler/ARM/unpredictable-AI1cmp-arm.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# RUN: llvm-mc --disassemble %s -triple=armv7-linux-gnueabi |& FileCheck %s

# CHECK: potentially undefined
# CHECK: 0x01 0x10 0x50 0x03
0x01 0x10 0x50 0x03

# CHECK: potentially undefined
# CHECK: 0x82 0x10 0x50 0x01
0x82 0x10 0x50 0x01

# CHECK: potentially undefined
# CHECK: 0x02 0x10 0x50 0x01
0x02 0x10 0x50 0x01

# CHECK: potentially undefined
# CHECK: 0x1f 0x01 0x52 0x01
0x1f 0x01 0x52 0x01

# CHECK: potentially undefined
# CHECK: 0x10 0x11 0x52 0x01
0x10 0x11 0x52 0x01

# CHECK: potentially undefined
# CHECK: 0x10 0x0f 0x51 0x01
0x10 0x0f 0x51 0x01

# CHECK: potentially undefined
# CHECK: 0x10 0x01 0x5f 0x01
0x10 0x01 0x5f 0x01

0 comments on commit 9e71231

Please sign in to comment.