[llvm] r264875 - [SystemZ] Add nop and nopr InstAliases.

Jonas Paulsson via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 30 09:11:59 PDT 2016


Author: jonpa
Date: Wed Mar 30 11:11:58 2016
New Revision: 264875

URL: http://llvm.org/viewvc/llvm-project?rev=264875&view=rev
Log:
[SystemZ] Add nop and nopr InstAliases.

For compatability with GAS, nop and nopr are recognized as alises for
bc and bcr, respectively. A mask of 0 turns these instructions
effectively into no-operations.

Reviewed by Ulrich Weigand.

Modified:
    llvm/trunk/lib/Target/SystemZ/SystemZInstrInfo.td
    llvm/trunk/test/MC/SystemZ/insn-good.s

Modified: llvm/trunk/lib/Target/SystemZ/SystemZInstrInfo.td
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/SystemZ/SystemZInstrInfo.td?rev=264875&r1=264874&r2=264875&view=diff
==============================================================================
--- llvm/trunk/lib/Target/SystemZ/SystemZInstrInfo.td (original)
+++ llvm/trunk/lib/Target/SystemZ/SystemZInstrInfo.td Wed Mar 30 11:11:58 2016
@@ -67,10 +67,15 @@ let isBranch = 1, isTerminator = 1, Uses
                       "brc\t$R1, $I2", []>;
   def AsmBRCL : InstRIL<0xC04, (outs), (ins imm32zx4:$R1, brtarget32:$I2),
                         "brcl\t$R1, $I2", []>;
+  def AsmBC : InstRX<0x47, (outs), (ins imm32zx4:$R1, bdxaddr12only:$XBD2),
+                     "bc\t$R1, $XBD2", []>;
   def AsmBCR : InstRR<0x07, (outs), (ins imm32zx4:$R1, GR64:$R2),
                       "bcr\t$R1, $R2", []>;
 }
 
+def AsmNop  : InstAlias<"nop\t$XBD", (AsmBC 0, bdxaddr12only:$XBD), 0>;
+def AsmNopR : InstAlias<"nopr\t$R", (AsmBCR 0, GR64:$R), 0>;
+
 // Fused compare-and-branch instructions.  As for normal branches,
 // we handle these instructions internally in their raw CRJ-like form,
 // but use assembly macros like CRJE when writing them out.

Modified: llvm/trunk/test/MC/SystemZ/insn-good.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/SystemZ/insn-good.s?rev=264875&r1=264874&r2=264875&view=diff
==============================================================================
--- llvm/trunk/test/MC/SystemZ/insn-good.s (original)
+++ llvm/trunk/test/MC/SystemZ/insn-good.s Wed Mar 30 11:11:58 2016
@@ -6931,6 +6931,12 @@
 	niy	524287(%r1), 42
 	niy	524287(%r15), 42
 
+#CHECK: bc	0, 0                    # encoding: [0x47,0x00,0x00,0x00]
+#CHECK: bcr	0, %r7                  # encoding: [0x07,0x07]
+
+	nop	0
+	nopr	%r7
+
 #CHECK: nr	%r0, %r0                # encoding: [0x14,0x00]
 #CHECK: nr	%r0, %r15               # encoding: [0x14,0x0f]
 #CHECK: nr	%r15, %r0               # encoding: [0x14,0xf0]




More information about the llvm-commits mailing list