[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.

llvm-svn: 264875
This commit is contained in:
Jonas Paulsson 2016-03-30 16:11:58 +00:00
parent b64d86ff8e
commit f76123386a
2 changed files with 11 additions and 0 deletions

View File

@ -67,10 +67,15 @@ let isBranch = 1, isTerminator = 1, Uses = [CC] in {
"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.

View File

@ -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]