[SystemZ] Support bare nop instructions
authorJonas Paulsson <paulsson@linux.vnet.ibm.com>
Thu, 24 Sep 2020 15:24:29 +0000 (17:24 +0200)
committerJonas Paulsson <paulsson@linux.vnet.ibm.com>
Wed, 30 Sep 2020 09:23:41 +0000 (11:23 +0200)
Add support of "nop" and "nopr" (without operands) to assembler.

Review: Ulrich Weigand

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

index d5d56ec..a2e207a 100644 (file)
@@ -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.
 //
index 07f721b..f75db59 100644 (file)
        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]