1 # RUN: llvm-mc -triple s390x-unknown-unknown -mcpu=z13 --show-encoding %s | FileCheck %s
3 # RUN: llvm-mc -triple s390x-unknown-unknown -filetype=obj -mcpu=z13 %s | \
4 # RUN: llvm-objdump -d - --mcpu=z13 | FileCheck %s -check-prefix=CHECK-REL
6 # Test relocations that can be lowered by the integrated assembler.
11 # CHECK: vl %v0, b-a # encoding: [0xe7,0x00,0b0000AAAA,A,0x00,0x06]
12 # CHECK-NEXT: # fixup A - offset: 2, value: b-a, kind: FK_390_U12Imm
13 # CHECK-REL: e7 00 00 04 00 06 vl %v0, 4
17 # CHECK: vl %v0, b-a(%r1) # encoding: [0xe7,0x00,0b0001AAAA,A,0x00,0x06]
18 # CHECK-NEXT: # fixup A - offset: 2, value: b-a, kind: FK_390_U12Imm
19 # CHECK-REL: e7 00 10 04 00 06 vl %v0, 4(%r1)
23 # CHECK: .insn vrx,253987186016262,%v0,b-a(%r1),3 # encoding: [0xe7,0x00,0b0001AAAA,A,0x30,0x06]
24 # CHECK-NEXT: # fixup A - offset: 2, value: b-a, kind: FK_390_U12Imm
25 # CHECK-REL: e7 00 10 04 30 06 vl %v0, 4(%r1), 3
27 .insn vrx,0xe70000000006,%v0,b-a(%r1),3 # vl
30 # CHECK: lmg %r6, %r15, b-a # encoding: [0xeb,0x6f,0b0000AAAA,A,A,0x04]
31 # CHECK-NEXT: # fixup A - offset: 2, value: b-a, kind: FK_390_S20Imm
32 # CHECK-REL: eb 6f 00 04 00 04 lmg %r6, %r15, 4
36 # CHECK: lmg %r6, %r15, b-a(%r1) # encoding: [0xeb,0x6f,0b0001AAAA,A,A,0x04]
37 # CHECK-NEXT: # fixup A - offset: 2, value: b-a, kind: FK_390_S20Imm
38 # CHECK-REL: eb 6f 10 04 00 04 lmg %r6, %r15, 4(%r1)
40 lmg
%r6, %r15, b-
a(%r1)
42 # CHECK: .insn siy,258385232527441,b-a(%r15),240 # encoding: [0xeb,0xf0,0b1111AAAA,A,A,0x51]
43 # CHECK-NEXT: # fixup A - offset: 2, value: b-a, kind: FK_390_S20Imm
44 # CHECK-REL: eb f0 f0 04 00 51 tmy 4(%r15), 240
46 .insn siy,0xeb0000000051,b-a(%r15),240 # tmy
49 # CHECK: la %r14, b-a # encoding: [0x41,0xe0,0b0000AAAA,A]
50 # CHECK-NEXT: # fixup A - offset: 2, value: b-a, kind: FK_390_U12Imm
51 # CHECK-REL: 41 e0 00 04 la %r14, 4
55 # CHECK: la %r14, b-a(%r1) # encoding: [0x41,0xe0,0b0001AAAA,A]
56 # CHECK-NEXT: # fixup A - offset: 2, value: b-a, kind: FK_390_U12Imm
57 # CHECK-REL: 41 e0 10 04 la %r14, 4(%r1)
61 # CHECK: la %r14, b-a(%r1,%r2) # encoding: [0x41,0xe1,0b0010AAAA,A]
62 # CHECK-NEXT: # fixup A - offset: 2, value: b-a, kind: FK_390_U12Imm
63 # CHECK-REL: 41 e1 20 04 la %r14, 4(%r1,%r2)
65 la %r14, b-
a(%r1, %r2)
67 # CHECK: .insn vrx,253987186016262,%v2,b-a(%r2,%r3),3 # encoding: [0xe7,0x22,0b0011AAAA,A,0x30,0x06]
68 # CHECK-NEXT: # fixup A - offset: 2, value: b-a, kind: FK_390_U12Imm
69 # CHECK-REL: e7 22 30 04 30 06 vl %v2, 4(%r2,%r3), 3
71 .insn vrx,0xe70000000006,%v2,b-a(%r2, %r3),3 # vl
74 # CHECK: lg %r14, b-a # encoding: [0xe3,0xe0,0b0000AAAA,A,A,0x04]
75 # CHECK-NEXT: # fixup A - offset: 2, value: b-a, kind: FK_390_S20Imm
76 # CHECK-REL: e3 e0 00 04 00 04 lg %r14, 4
80 # CHECK: lg %r14, b-a(%r1) # encoding: [0xe3,0xe0,0b0001AAAA,A,A,0x04]
81 # CHECK-NEXT: # fixup A - offset: 2, value: b-a, kind: FK_390_S20Imm
82 # CHECK-REL: e3 e0 10 04 00 04 lg %r14, 4(%r1)
86 # CHECK: lg %r14, b-a(%r1,%r2) # encoding: [0xe3,0xe1,0b0010AAAA,A,A,0x04]
87 # CHECK-NEXT: # fixup A - offset: 2, value: b-a, kind: FK_390_S20Imm
88 # CHECK-REL: e3 e1 20 04 00 04 lg %r14, 4(%r1,%r2)
90 lg
%r14, b-
a(%r1, %r2)
92 # CHECK: .insn rxy,260584255783013,%f1,b-a(%r2,%r15) # encoding: [0xed,0x12,0b1111AAAA,A,A,0x65]
93 # CHECK-NEXT: # fixup A - offset: 2, value: b-a, kind: FK_390_S20Imm
94 # CHECK-REL: ed 12 f0 04 00 65 ldy %f1, 4(%r2,%r15)
96 .insn rxy,0xed0000000065,%f1,b-a(%r2,%r15) # ldy
99 # CHECK: tp b-a(16) # encoding: [0xeb,0xf0,0b0000AAAA,A,0x00,0xc0]
100 # CHECK-NEXT: # fixup A - offset: 2, value: b-a, kind: FK_390_U12Imm
101 # CHECK-REL: eb f0 00 04 00 c0 tp 4(16)
105 # CHECK: tp b-a(16,%r1) # encoding: [0xeb,0xf0,0b0001AAAA,A,0x00,0xc0]
106 # CHECK-NEXT: # fixup A - offset: 2, value: b-a, kind: FK_390_U12Imm
107 # CHECK-REL: eb f0 10 04 00 c0 tp 4(16,%r1)
113 # CHECK: mvc c-b(1,%r1), b-a(%r1) # encoding: [0xd2,0x00,0b0001AAAA,A,0b0001BBBB,B]
114 # CHECK-NEXT: # fixup A - offset: 2, value: c-b, kind: FK_390_U12Imm
115 # CHECK-NEXT: # fixup B - offset: 4, value: b-a, kind: FK_390_U12Imm
116 # CHECK-REL: d2 00 10 08 10 04 mvc 8(1,%r1), 4(%r1)
118 mvc c-
b(1,%r1), b-
a(%r1)
121 # CHECK: mvo c-b(16,%r1), b-a(1,%r2) # encoding: [0xf1,0xf0,0b0001AAAA,A,0b0010BBBB,B]
122 # CHECK-NEXT: # fixup A - offset: 2, value: c-b, kind: FK_390_U12Imm
123 # CHECK-NEXT: # fixup B - offset: 4, value: b-a, kind: FK_390_U12Imm
124 # CHECK-REL: f1 f0 10 08 20 04 mvo 8(16,%r1), 4(1,%r2)
126 mvo c-
b(16,%r1), b-
a(1,%r2)
129 # CHECK: srp b-a(1,%r1), b-a(%r15), 0 # encoding: [0xf0,0x00,0b0001AAAA,A,0b1111BBBB,B]
130 # CHECK-NEXT: # fixup A - offset: 2, value: b-a, kind: FK_390_U12Imm
131 # CHECK-NEXT: # fixup B - offset: 4, value: b-a, kind: FK_390_U12Imm
132 # CHECK-REL: f0 00 10 04 f0 04 srp 4(1,%r1), 4(%r15), 0
134 srp b-
a(1,%r1), b-
a(%r15), 0
138 # CHECK: mvck c-b(%r2,%r1), b-a, %r3 # encoding: [0xd9,0x23,0b0001AAAA,A,0b0000BBBB,B]
139 # CHECK-NEXT: # fixup A - offset: 2, value: c-b, kind: FK_390_U12Imm
140 # CHECK-NEXT: # fixup B - offset: 4, value: b-a, kind: FK_390_U12Imm
141 # CHECK-REL: d9 23 10 08 00 04 mvck 8(%r2,%r1), 4, %r3
143 mvck c-
b(%r2,%r1), b-
a, %r3
145 # CHECK: .insn ss,238594023227392,c-b(%r2,%r1),b-a,%r3 # encoding: [0xd9,0x23,0b0001AAAA,A,0b0000BBBB,B]
146 # CHECK-NEXT: # fixup A - offset: 2, value: c-b, kind: FK_390_U12Imm
147 # CHECK-NEXT: # fixup B - offset: 4, value: b-a, kind: FK_390_U12Imm
148 # CHECK-REL: d9 23 10 08 00 04 mvck 8(%r2,%r1), 4, %r3
150 .insn ss,0xd90000000000,c-b(%r2,%r1),b-a,%r3 # mvck
153 # CHECK: lmd %r2, %r4, b-a(%r1), c-b(%r1) # encoding: [0xef,0x24,0b0001AAAA,A,0b0001BBBB,B]
154 # CHECK-NEXT: # fixup A - offset: 2, value: b-a, kind: FK_390_U12Imm
155 # CHECK-NEXT: # fixup B - offset: 4, value: c-b, kind: FK_390_U12Imm
156 # CHECK-REL: ef 24 10 04 10 08 lmd %r2, %r4, 4(%r1), 8(%r1)
158 lmd
%r2, %r4, b-
a(%r1), c-
b(%r1)
161 # CHECK: pka c-b(%r15), b-a(256,%r15) # encoding: [0xe9,0xff,0b1111AAAA,A,0b1111BBBB,B]
162 # CHECK-NEXT: # fixup A - offset: 2, value: c-b, kind: FK_390_U12Imm
163 # CHECK-NEXT: # fixup B - offset: 4, value: b-a, kind: FK_390_U12Imm
164 # CHECK-REL: e9 ff f0 08 f0 04 pka 8(%r15), 4(256,%r15)
166 pka c-
b(%r15), b-
a(256,%r15)
169 # CHECK: strag c-b(%r1), b-a(%r15) # encoding: [0xe5,0x02,0b0001AAAA,A,0b1111BBBB,B]
170 # CHECK-NEXT: # fixup A - offset: 2, value: c-b, kind: FK_390_U12Imm
171 # CHECK-NEXT: # fixup B - offset: 4, value: b-a, kind: FK_390_U12Imm
172 # CHECK-REL: e5 02 10 08 f0 04 strag 8(%r1), 4(%r15)
174 strag c-
b(%r1), b-
a(%r15)
176 # CHECK: .insn sse,251796752695296,c-b(%r1),b-a(%r15) # encoding: [0xe5,0x02,0b0001AAAA,A,0b1111BBBB,B]
177 # CHECK-NEXT: # fixup A - offset: 2, value: c-b, kind: FK_390_U12Imm
178 # CHECK-NEXT: # fixup B - offset: 4, value: b-a, kind: FK_390_U12Imm
179 # CHECK-REL: e5 02 10 08 f0 04 strag 8(%r1), 4(%r15)
181 .insn sse,0xe50200000000,c-b(%r1),b-a(%r15) # strag
184 # CHECK: ectg b-a, b-a(%r15), %r2 # encoding: [0xc8,0x21,0b0000AAAA,A,0b1111BBBB,B]
185 # CHECK-NEXT: # fixup A - offset: 2, value: b-a, kind: FK_390_U12Imm
186 # CHECK-NEXT: # fixup B - offset: 4, value: b-a, kind: FK_390_U12Imm
187 # CHECK-REL: c8 21 00 04 f0 04 ectg 4, 4(%r15), %r2
189 ectg b-
a, b-
a(%r15), %r2
191 # CHECK: .insn ssf,219906620522496,b-a,b-a(%r15),%r2 # encoding: [0xc8,0x21,0b0000AAAA,A,0b1111BBBB,B]
192 # CHECK-NEXT: # fixup A - offset: 2, value: b-a, kind: FK_390_U12Imm
193 # CHECK-NEXT: # fixup B - offset: 4, value: b-a, kind: FK_390_U12Imm
194 # CHECK-REL: c8 21 00 04 f0 04 ectg 4, 4(%r15), %r2
196 .insn ssf,0xc80100000000,b-a,b-a(%r15),%r2 # ectg
199 # CHECK: vgeg %v0, b-a(%v0,%r1), 0 # encoding: [0xe7,0x00,0b0001AAAA,A,0x00,0x12]
200 # CHECK-NEXT: # fixup A - offset: 2, value: b-a, kind: FK_390_U12Imm
201 # CHECK-REL: e7 00 10 04 00 12 vgeg %v0, 4(%v0,%r1), 0
203 vgeg
%v0
, b-
a(%v0
,%r1), 0