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

Toma Tabacu toma.tabacu at imgtec.com
Mon Mar 23 05:48:35 PDT 2015


Hi dsanders,

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.

http://reviews.llvm.org/D8540

Files:
  lib/Target/Mips/MipsInstrInfo.td
  test/MC/Mips/mips-jump-delay-slots.s

Index: lib/Target/Mips/MipsInstrInfo.td
===================================================================
--- lib/Target/Mips/MipsInstrInfo.td
+++ lib/Target/Mips/MipsInstrInfo.td
@@ -1596,8 +1596,12 @@
 }
 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>;
Index: test/MC/Mips/mips-jump-delay-slots.s
===================================================================
--- test/MC/Mips/mips-jump-delay-slots.s
+++ test/MC/Mips/mips-jump-delay-slots.s
@@ -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

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D8540.22460.patch
Type: text/x-patch
Size: 1404 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150323/dcf436a9/attachment.bin>


More information about the llvm-commits mailing list