Skip to content
This repository was archived by the owner on Mar 28, 2020. It is now read-only.

Commit 5254fb9

Browse files
committed
[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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@264875 91177308-0d34-0410-b5e6-96231b3b80d8
1 parent e0d3b85 commit 5254fb9

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

lib/Target/SystemZ/SystemZInstrInfo.td

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,10 +67,15 @@ let isBranch = 1, isTerminator = 1, Uses = [CC] in {
6767
"brc\t$R1, $I2", []>;
6868
def AsmBRCL : InstRIL<0xC04, (outs), (ins imm32zx4:$R1, brtarget32:$I2),
6969
"brcl\t$R1, $I2", []>;
70+
def AsmBC : InstRX<0x47, (outs), (ins imm32zx4:$R1, bdxaddr12only:$XBD2),
71+
"bc\t$R1, $XBD2", []>;
7072
def AsmBCR : InstRR<0x07, (outs), (ins imm32zx4:$R1, GR64:$R2),
7173
"bcr\t$R1, $R2", []>;
7274
}
7375

76+
def AsmNop : InstAlias<"nop\t$XBD", (AsmBC 0, bdxaddr12only:$XBD), 0>;
77+
def AsmNopR : InstAlias<"nopr\t$R", (AsmBCR 0, GR64:$R), 0>;
78+
7479
// Fused compare-and-branch instructions. As for normal branches,
7580
// we handle these instructions internally in their raw CRJ-like form,
7681
// but use assembly macros like CRJE when writing them out.

test/MC/SystemZ/insn-good.s

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6931,6 +6931,12 @@
69316931
niy 524287(%r1), 42
69326932
niy 524287(%r15), 42
69336933

6934+
#CHECK: bc 0, 0 # encoding: [0x47,0x00,0x00,0x00]
6935+
#CHECK: bcr 0, %r7 # encoding: [0x07,0x07]
6936+
6937+
nop 0
6938+
nopr %r7
6939+
69346940
#CHECK: nr %r0, %r0 # encoding: [0x14,0x00]
69356941
#CHECK: nr %r0, %r15 # encoding: [0x14,0x0f]
69366942
#CHECK: nr %r15, %r0 # encoding: [0x14,0xf0]

0 commit comments

Comments
 (0)