[mips] [IAS] Add support for the BNEZL and BEQZL pseudo-instructions.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234401 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Toma Tabacu 2015-04-08 12:15:05 +00:00
parent 541279fdf9
commit f716ca43ca
2 changed files with 10 additions and 0 deletions

View File

@ -1594,8 +1594,12 @@ def : MipsInstAlias<"b $offset", (BEQ ZERO, ZERO, brtarget:$offset), 0>;
} }
def : MipsInstAlias<"bnez $rs,$offset", def : MipsInstAlias<"bnez $rs,$offset",
(BNE GPR32Opnd:$rs, ZERO, brtarget:$offset), 0>; (BNE GPR32Opnd:$rs, ZERO, brtarget:$offset), 0>;
def : MipsInstAlias<"bnezl $rs,$offset",
(BNEL GPR32Opnd:$rs, ZERO, brtarget:$offset), 0>;
def : MipsInstAlias<"beqz $rs,$offset", def : MipsInstAlias<"beqz $rs,$offset",
(BEQ GPR32Opnd:$rs, ZERO, brtarget:$offset), 0>; (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<"syscall", (SYSCALL 0), 1>;
def : MipsInstAlias<"break", (BREAK 0, 0), 1>; def : MipsInstAlias<"break", (BREAK 0, 0), 1>;

View File

@ -68,9 +68,15 @@
# CHECK: beql $9, $6, 1332 # CHECK: beql $9, $6, 1332
# CHECK-NOT: nop # CHECK-NOT: nop
beql $9,$6,1332 beql $9,$6,1332
# CHECK: beql $9, $zero, 1332
# CHECK-NOT: nop
beqzl $9,1332
# CHECK: bnel $9, $6, 1332 # CHECK: bnel $9, $6, 1332
# CHECK-NOT: nop # CHECK-NOT: nop
bnel $9,$6,1332 bnel $9,$6,1332
# CHECK: bnel $9, $zero, 1332
# CHECK-NOT: nop
bnezl $9,1332
# CHECK: bgezl $6, 1332 # CHECK: bgezl $6, 1332
# CHECK-NOT: nop # CHECK-NOT: nop
bgezl $6,1332 bgezl $6,1332