[NFC][RemoveDIs] Prefer iterators over inst-pointers in InstCombine
[llvm-project.git] / llvm / test / MC / SystemZ / reloc-absolute.s
blob0369be8183ae2f8576e550b2454e2d90fb496884
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.
8 .text
10 ## BD12
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
14 .align 16
15 vl %v0, b-a
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)
20 .align 16
21 vl %v0, b-a(%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
26 .align 16
27 .insn vrx,0xe70000000006,%v0,b-a(%r1),3 # vl
29 ## BD20
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
33 .align 16
34 lmg %r6, %r15, b-a
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)
39 .align 16
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
45 .align 16
46 .insn siy,0xeb0000000051,b-a(%r15),240 # tmy
48 ## BDX12
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
52 .align 16
53 la %r14, b-a
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)
58 .align 16
59 la %r14, b-a(%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)
64 .align 16
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
70 .align 16
71 .insn vrx,0xe70000000006,%v2,b-a(%r2, %r3),3 # vl
73 ##BDX20
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
77 .align 16
78 lg %r14, b-a
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)
83 .align 16
84 lg %r14, b-a(%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)
89 .align 16
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)
95 .align 16
96 .insn rxy,0xed0000000065,%f1,b-a(%r2,%r15) # ldy
98 ##BD12L4
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)
102 .align 16
103 tp b-a(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)
108 .align 16
109 tp b-a(16, %r1)
111 ##BD12L8
112 #SSa
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)
117 .align 16
118 mvc c-b(1,%r1), b-a(%r1)
120 #SSb
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)
125 .align 16
126 mvo c-b(16,%r1), b-a(1,%r2)
128 #SSc
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
133 .align 16
134 srp b-a(1,%r1), b-a(%r15), 0
136 ##BDR12
137 #SSd
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
142 .align 16
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
149 .align 16
150 .insn ss,0xd90000000000,c-b(%r2,%r1),b-a,%r3 # mvck
152 #SSe
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)
157 .align 16
158 lmd %r2, %r4, b-a(%r1), c-b(%r1)
160 #SSf
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)
165 .align 16
166 pka c-b(%r15), b-a(256,%r15)
168 #SSE
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)
173 .align 16
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)
180 .align 16
181 .insn sse,0xe50200000000,c-b(%r1),b-a(%r15) # strag
183 #SSF
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
188 .align 16
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
195 .align 16
196 .insn ssf,0xc80100000000,b-a,b-a(%r15),%r2 # ectg
198 ##BDV12
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
202 .align 16
203 vgeg %v0, b-a(%v0,%r1), 0
205 .type a,@object
206 .local a
207 .comm a,4,4
208 .type b,@object
209 .local b
210 .comm b,8,4
211 .type c,@object
212 .local c
213 .comm c,4,4