Skip to content

Commit

Permalink
[mips] [IAS] Add support for the BNEZL and BEQZL pseudo-instructions.
Browse files Browse the repository at this point in the history
Summary:
They are of the form "bnezl/beqzl $rs, offset" and expand to "bnel/beql $rs, $zero, offset".

These instructions are used in Linux inline assembly.

Reviewers: dsanders

Reviewed By: dsanders

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D8540

llvm-svn: 234401
  • Loading branch information
Toma Tabacu committed Apr 8, 2015
1 parent 7230f80 commit 91fc0b3
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
4 changes: 4 additions & 0 deletions llvm/lib/Target/Mips/MipsInstrInfo.td
Expand Up @@ -1594,8 +1594,12 @@ def : MipsInstAlias<"b $offset", (BEQ ZERO, ZERO, brtarget:$offset), 0>;
}
def : MipsInstAlias<"bnez $rs,$offset",
(BNE GPR32Opnd:$rs, ZERO, brtarget:$offset), 0>;
def : MipsInstAlias<"bnezl $rs,$offset",
(BNEL GPR32Opnd:$rs, ZERO, brtarget:$offset), 0>;
def : MipsInstAlias<"beqz $rs,$offset",
(BEQ GPR32Opnd:$rs, ZERO, brtarget:$offset), 0>;
def : MipsInstAlias<"beqzl $rs,$offset",
(BEQL GPR32Opnd:$rs, ZERO, brtarget:$offset), 0>;
def : MipsInstAlias<"syscall", (SYSCALL 0), 1>;

def : MipsInstAlias<"break", (BREAK 0, 0), 1>;
Expand Down
6 changes: 6 additions & 0 deletions llvm/test/MC/Mips/mips-jump-delay-slots.s
Expand Up @@ -68,9 +68,15 @@
# CHECK: beql $9, $6, 1332
# CHECK-NOT: nop
beql $9,$6,1332
# CHECK: beql $9, $zero, 1332
# CHECK-NOT: nop
beqzl $9,1332
# CHECK: bnel $9, $6, 1332
# CHECK-NOT: nop
bnel $9,$6,1332
# CHECK: bnel $9, $zero, 1332
# CHECK-NOT: nop
bnezl $9,1332
# CHECK: bgezl $6, 1332
# CHECK-NOT: nop
bgezl $6,1332
Expand Down

0 comments on commit 91fc0b3

Please sign in to comment.