Skip to content

Commit bb5509f

Browse files
sstefan1gerekon
authored andcommitted
[Xtensa][MC] Add _bnez.n and _beqz.n alias instructions
1 parent 9f00800 commit bb5509f

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

llvm/lib/Target/Xtensa/XtensaInstrInfo.td

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -804,6 +804,9 @@ let isBranch = 1, isTerminator = 1 in {
804804
}
805805
}
806806

807+
def : InstAlias<"_beqz.n\t$s, $target", (BEQZ_N AR:$s, brtarget:$target)>, Requires<[HasDensity]>;
808+
def : InstAlias<"_bnez.n\t$s, $target", (BNEZ_N AR:$s, brtarget:$target)>, Requires<[HasDensity]>;
809+
807810
def ILL_N : RRRN_Inst<0x0D, (outs), (ins),
808811
"ill.n", []>, Requires<[HasDensity]> {
809812
let r = 0xF;

llvm/test/MC/Xtensa/code_density.s

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,16 @@ beqz.n a3, LBL1
2929
# CHECK: encoding: [0xcc'A',0x03'A']
3030
bnez.n a3, LBL1
3131

32+
# Instruction format BRI6
33+
# CHECK-INST: bnez.n a5, LBL0
34+
# CHECK: encoding: [0xcc'A',0x05'A']
35+
_bnez.n a5, LBL0
36+
37+
# Instruction format BRI6
38+
# CHECK-INST: beqz.n a5, LBL0
39+
# CHECK: encoding: [0x8c'A',0x05'A']
40+
_beqz.n a5, LBL0
41+
3242
# Instruction format RRRN
3343
# CHECK-INST: ill.n
3444
# CHECK: encoding: [0x6d,0xf0]

0 commit comments

Comments
 (0)