[llvm] 9f5da55 - [SystemZ] Support bare nop instructions

Jonas Paulsson via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 30 02:25:25 PDT 2020


Author: Jonas Paulsson
Date: 2020-09-30T11:23:41+02:00
New Revision: 9f5da55f5d9299a76a4dfb67ef0324dbc1900826

URL: https://github.com/llvm/llvm-project/commit/9f5da55f5d9299a76a4dfb67ef0324dbc1900826
DIFF: https://github.com/llvm/llvm-project/commit/9f5da55f5d9299a76a4dfb67ef0324dbc1900826.diff

LOG: [SystemZ]  Support bare nop instructions

Add support of "nop" and "nopr" (without operands) to assembler.

Review: Ulrich Weigand

Added: 
    

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

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Target/SystemZ/SystemZInstrInfo.td b/llvm/lib/Target/SystemZ/SystemZInstrInfo.td
index d5d56ecf6e47..a2e207aedcde 100644
--- a/llvm/lib/Target/SystemZ/SystemZInstrInfo.td
+++ b/llvm/lib/Target/SystemZ/SystemZInstrInfo.td
@@ -101,10 +101,14 @@ let isBranch = 1, isTerminator = 1, isBarrier = 1 in {
   }
 }
 
-// NOPs.  These are again variants of the conditional branches,
-// with the condition mask set to "never".
+// NOPs.  These are again variants of the conditional branches, with the
+// condition mask set to "never".  NOP_bare can't be an InstAlias since it
+// would need R0D hard coded which is not part of ADDR64BitRegClass.
 def NOP  : InstAlias<"nop\t$XBD", (BCAsm 0, bdxaddr12only:$XBD), 0>;
+let isAsmParserOnly = 1, hasNoSchedulingInfo = 1, M1 = 0, XBD2 = 0 in
+  def NOP_bare  : InstRXb<0x47,(outs), (ins), "nop", []>;
 def NOPR : InstAlias<"nopr\t$R", (BCRAsm 0, GR64:$R), 0>;
+def NOPR_bare : InstAlias<"nopr", (BCRAsm 0, R0D), 0>;
 
 // Fused compare-and-branch instructions.
 //

diff  --git a/llvm/test/MC/SystemZ/insn-good.s b/llvm/test/MC/SystemZ/insn-good.s
index 07f721bfa5e4..f75db59211b3 100644
--- a/llvm/test/MC/SystemZ/insn-good.s
+++ b/llvm/test/MC/SystemZ/insn-good.s
@@ -12284,10 +12284,14 @@
 	niy	524287(%r15), 42
 
 #CHECK: bc	0, 0                    # encoding: [0x47,0x00,0x00,0x00]
+#CHECK: nop                             # encoding: [0x47,0x00,0x00,0x00]
 #CHECK: bcr	0, %r7                  # encoding: [0x07,0x07]
+#CHECK: bcr	0, %r0                  # encoding: [0x07,0x00]
 
 	nop	0
+	nop
 	nopr	%r7
+	nopr
 
 #CHECK: nr	%r0, %r0                # encoding: [0x14,0x00]
 #CHECK: nr	%r0, %r15               # encoding: [0x14,0x0f]


        


More information about the llvm-commits mailing list