]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - test/ELF/aarch64-cortex-a53-843419-recognize.s
Vendor import of lld trunk r338150:
[FreeBSD/FreeBSD.git] / test / ELF / aarch64-cortex-a53-843419-recognize.s
1 // REQUIRES: aarch64
2 // RUN: llvm-mc -filetype=obj -triple=aarch64-none-linux %s -o %t.o
3 // RUN: ld.lld -fix-cortex-a53-843419 -verbose %t.o -o %t2 2>&1 | FileCheck -check-prefix CHECK-PRINT %s
4 // RUN: llvm-objdump -triple=aarch64-linux-gnu -d %t2 | FileCheck %s -check-prefixes=CHECK,CHECK-FIX
5 // RUN: ld.lld %t.o -o %t3
6 // RUN: llvm-objdump -triple=aarch64-linux-gnu -d %t3 | FileCheck %s -check-prefixes=CHECK,CHECK-NOFIX
7 // Test cases for Cortex-A53 Erratum 843419
8 // See ARM-EPM-048406 Cortex_A53_MPCore_Software_Developers_Errata_Notice.pdf
9 // for full erratum details.
10 // In Summary
11 // 1.)
12 // ADRP (0xff8 or 0xffc).
13 // 2.)
14 // - load or store single register or either integer or vector registers.
15 // - STP or STNP of either vector or vector registers.
16 // - Advanced SIMD ST1 store instruction.
17 // - Must not write Rn.
18 // 3.) optional instruction, can't be a branch, must not write Rn, may read Rn.
19 // 4.) A load or store instruction from the Load/Store register unsigned
20 // immediate class using Rn as the base register.
21
22 // Each section contains a sequence of instructions that should be recognized
23 // as erratum 843419. The test cases cover the major variations such as:
24 // - adrp starts at 0xfff8 or 0xfffc.
25 // - Variations in instruction class for instruction 2.
26 // - Optional instruction 3 present or not.
27 // - Load or store for instruction 4.
28
29 // CHECK-PRINT: detected cortex-a53-843419 erratum sequence starting at 21FF8 in unpatched output.
30 // CHECK: t3_ff8_ldr:
31 // CHECK-NEXT:    21ff8:        e0 01 00 f0     adrp    x0, #258048
32 // CHECK-NEXT:    21ffc:        21 00 40 f9     ldr             x1, [x1]
33 // CHECK-FIX:     22000:        03 c8 00 14     b       #204812
34 // CHECK-NOFIX:   22000:        00 00 40 f9     ldr             x0, [x0]
35 // CHECK-NEXT:    22004:        c0 03 5f d6     ret
36         .section .text.01, "ax", %progbits
37         .balign 4096
38         .globl t3_ff8_ldr
39         .type t3_ff8_ldr, %function
40         .space 4096 - 8
41 t3_ff8_ldr:
42         adrp x0, dat1
43         ldr x1, [x1, #0]
44         ldr x0, [x0, :got_lo12:dat1]
45         ret
46
47 // CHECK-PRINT: detected cortex-a53-843419 erratum sequence starting at 23FF8 in unpatched output.
48 // CHECK: t3_ff8_ldrsimd:
49 // CHECK-NEXT:    23ff8:        e0 01 00 b0     adrp    x0, #249856
50 // CHECK-NEXT:    23ffc:        21 00 40 bd     ldr             s1, [x1]
51 // CHECK-FIX:     24000:        05 c0 00 14     b       #196628
52 // CHECK-NOFIX:   24000:        02 04 40 f9     ldr     x2, [x0, #8]
53 // CHECK-NEXT:    24004:        c0 03 5f d6     ret
54         .section .text.02, "ax", %progbits
55         .balign 4096
56         .globl t3_ff8_ldrsimd
57         .type t3_ff8_ldrsimd, %function
58         .space 4096 - 8
59 t3_ff8_ldrsimd:
60         adrp x0, dat2
61         ldr s1, [x1, #0]
62         ldr x2, [x0, :got_lo12:dat2]
63         ret
64
65 // CHECK-PRINT: detected cortex-a53-843419 erratum sequence starting at 25FFC in unpatched output.
66 // CHECK: t3_ffc_ldrpost:
67 // CHECK-NEXT:    25ffc:        c0 01 00 f0     adrp    x0, #241664
68 // CHECK-NEXT:    26000:        21 84 40 bc     ldr     s1, [x1], #8
69 // CHECK-FIX:     26004:        06 b8 00 14     b       #188440
70 // CHECK-NOFIX:   26004:        03 08 40 f9     ldr     x3, [x0, #16]
71 // CHECK-NEXT:    26008:        c0 03 5f d6     ret
72         .section .text.03, "ax", %progbits
73         .balign 4096
74         .globl t3_ffc_ldrpost
75         .type t3_ffc_ldrpost, %function
76         .space 4096 - 4
77 t3_ffc_ldrpost:
78         adrp x0, dat3
79         ldr s1, [x1], #8
80         ldr x3, [x0, :got_lo12:dat3]
81         ret
82
83 // CHECK-PRINT: detected cortex-a53-843419 erratum sequence starting at 27FF8 in unpatched output.
84 // CHECK: t3_ff8_strpre:
85 // CHECK-NEXT:    27ff8:        c0 01 00 b0     adrp    x0, #233472
86 // CHECK-NEXT:    27ffc:        21 8c 00 bc     str     s1, [x1, #8]!
87 // CHECK-FIX:     28000:        09 b0 00 14     b       #180260
88 // CHECK-NOFIX:   28000:        02 00 40 f9     ldr             x2, [x0]
89 // CHECK-NEXT:    28004:        c0 03 5f d6     ret
90         .section .text.04, "ax", %progbits
91         .balign 4096
92         .globl t3_ff8_strpre
93         .type t3_ff8_strpre, %function
94         .space 4096 - 8
95 t3_ff8_strpre:
96         adrp x0, dat1
97         str s1, [x1, #8]!
98         ldr x2, [x0, :lo12:dat1]
99         ret
100
101 // CHECK-PRINT: detected cortex-a53-843419 erratum sequence starting at 29FFC in unpatched output.
102 // CHECK: t3_ffc_str:
103 // CHECK-NEXT:    29ffc:        bc 01 00 f0     adrp    x28, #225280
104 // CHECK-NEXT:    2a000:        42 00 00 f9     str             x2, [x2]
105 // CHECK-FIX:     2a004:        0a a8 00 14     b       #172072
106 // CHECK-NOFIX:   2a004:        9c 07 00 f9     str     x28, [x28, #8]
107 // CHECK-NEXT:    2a008:        c0 03 5f d6     ret
108         .section .text.05, "ax", %progbits
109         .balign 4096
110         .globl t3_ffc_str
111         .type t3_ffc_str, %function
112         .space 4096 - 4
113 t3_ffc_str:
114         adrp x28, dat2
115         str x2, [x2, #0]
116         str x28, [x28, :lo12:dat2]
117         ret
118
119 // CHECK-PRINT: detected cortex-a53-843419 erratum sequence starting at 2BFFC in unpatched output.
120 // CHECK: t3_ffc_strsimd:
121 // CHECK-NEXT:    2bffc:        bc 01 00 b0     adrp    x28, #217088
122 // CHECK-NEXT:    2c000:        44 00 00 b9     str             w4, [x2]
123 // CHECK-FIX:     2c004:        0c a0 00 14     b       #163888
124 // CHECK-NOFIX:   2c004:        84 0b 00 f9     str     x4, [x28, #16]
125 // CHECK-NEXT:    2c008:        c0 03 5f d6     ret
126         .section .text.06, "ax", %progbits
127         .balign 4096
128         .globl t3_ffc_strsimd
129         .type t3_ffc_strsimd, %function
130         .space 4096 - 4
131 t3_ffc_strsimd:
132         adrp x28, dat3
133         str w4, [x2, #0]
134         str x4, [x28, :lo12:dat3]
135         ret
136
137 // CHECK-PRINT: detected cortex-a53-843419 erratum sequence starting at 2DFF8 in unpatched output.
138 // CHECK: t3_ff8_ldrunpriv:
139 // CHECK-NEXT:    2dff8:        9d 01 00 f0     adrp    x29, #208896
140 // CHECK-NEXT:    2dffc:        41 08 40 38     ldtrb           w1, [x2]
141 // CHECK-FIX:     2e000:        0f 98 00 14     b       #155708
142 // CHECK-NOFIX:   2e000:        bd 03 40 f9     ldr             x29, [x29]
143 // CHECK-NEXT:    2e004:        c0 03 5f d6     ret
144         .section .text.07, "ax", %progbits
145         .balign 4096
146         .globl t3_ff8_ldrunpriv
147         .type t3_ff8_ldrunpriv, %function
148         .space 4096 - 8
149 t3_ff8_ldrunpriv:
150         adrp x29, dat1
151         ldtrb w1, [x2, #0]
152         ldr x29, [x29, :got_lo12:dat1]
153         ret
154
155 // CHECK-PRINT: detected cortex-a53-843419 erratum sequence starting at 2FFFC in unpatched output.
156 // CHECK: t3_ffc_ldur:
157 // CHECK-NEXT:    2fffc:        9d 01 00 b0     adrp    x29, #200704
158 // CHECK-NEXT:    30000:        42 40 40 b8     ldur    w2, [x2, #4]
159 // CHECK-FIX:     30004:        10 90 00 14     b       #147520
160 // CHECK-NOFIX:   30004:        bd 07 40 f9     ldr     x29, [x29, #8]
161 // CHECK-NEXT:    30008:        c0 03 5f d6     ret
162         .balign 4096
163         .globl t3_ffc_ldur
164         .type t3_ffc_ldur, %function
165         .space 4096 - 4
166 t3_ffc_ldur:
167         adrp x29, dat2
168         ldur w2, [x2, #4]
169         ldr x29, [x29, :got_lo12:dat2]
170         ret
171
172 // CHECK-PRINT: detected cortex-a53-843419 erratum sequence starting at 31FFC in unpatched output.
173 // CHECK: t3_ffc_sturh:
174 // CHECK-NEXT:    31ffc:        72 01 00 f0     adrp    x18, #192512
175 // CHECK-NEXT:    32000:        43 40 00 78     sturh   w3, [x2, #4]
176 // CHECK-FIX:     32004:        12 88 00 14     b       #139336
177 // CHECK-NOFIX:   32004:        41 0a 40 f9     ldr     x1, [x18, #16]
178 // CHECK-NEXT:    32008:        c0 03 5f d6     ret
179         .section .text.09, "ax", %progbits
180         .balign 4096
181         .globl t3_ffc_sturh
182         .type t3_ffc_sturh, %function
183         .space 4096 - 4
184 t3_ffc_sturh:
185         adrp x18, dat3
186         sturh w3, [x2, #4]
187         ldr x1, [x18, :got_lo12:dat3]
188         ret
189
190 // CHECK-PRINT: detected cortex-a53-843419 erratum sequence starting at 33FF8 in unpatched output.
191 // CHECK: t3_ff8_literal:
192 // CHECK-NEXT:    33ff8:        72 01 00 b0     adrp    x18, #184320
193 // CHECK-NEXT:    33ffc:        e3 ff ff 58     ldr     x3, #-4
194 // CHECK-FIX:     34000:        15 80 00 14     b       #131156
195 // CHECK-NOFIX:   34000:        52 02 40 f9     ldr             x18, [x18]
196 // CHECK-NEXT:    34004:        c0 03 5f d6     ret
197         .section .text.10, "ax", %progbits
198         .balign 4096
199         .globl t3_ff8_literal
200         .type t3_ff8_literal, %function
201         .space 4096 - 8
202 t3_ff8_literal:
203         adrp x18, dat1
204         ldr x3, t3_ff8_literal
205         ldr x18, [x18, :lo12:dat1]
206         ret
207
208 // CHECK-PRINT: detected cortex-a53-843419 erratum sequence starting at 35FFC in unpatched output.
209 // CHECK: t3_ffc_register:
210 // CHECK-NEXT:    35ffc:        4f 01 00 f0     adrp    x15, #176128
211 // CHECK-NEXT:    36000:        43 68 61 f8     ldr             x3, [x2, x1]
212 // CHECK-FIX:     36004:        16 78 00 14     b       #122968
213 // CHECK-NOFIX:   36004:        ea 05 40 f9     ldr     x10, [x15, #8]
214 // CHECK-NEXT:    36008:        c0 03 5f d6     ret
215         .section .text.11, "ax", %progbits
216         .balign 4096
217         .globl t3_ffc_register
218         .type t3_ffc_register, %function
219         .space 4096 - 4
220 t3_ffc_register:
221         adrp x15, dat2
222         ldr x3, [x2, x1]
223         ldr x10, [x15, :lo12:dat2]
224         ret
225
226 // CHECK-PRINT: detected cortex-a53-843419 erratum sequence starting at 37FF8 in unpatched output.
227 // CHECK: t3_ff8_stp:
228 // CHECK-NEXT:    37ff8:        50 01 00 b0     adrp    x16, #167936
229 // CHECK-NEXT:    37ffc:        61 08 00 a9     stp             x1, x2, [x3]
230 // CHECK-FIX:     38000:        19 70 00 14     b       #114788
231 // CHECK-NOFIX:   38000:        0d 0a 40 f9     ldr     x13, [x16, #16]
232 // CHECK-NEXT:    38004:        c0 03 5f d6     ret
233         .section .text.12, "ax", %progbits
234         .balign 4096
235         .globl t3_ff8_stp
236         .type t3_ff8_stp, %function
237         .space 4096 - 8
238 t3_ff8_stp:
239         adrp x16, dat3
240         stp x1,x2, [x3, #0]
241         ldr x13, [x16, :lo12:dat3]
242         ret
243
244 // CHECK-PRINT: detected cortex-a53-843419 erratum sequence starting at 39FFC in unpatched output.
245 // CHECK: t3_ffc_stnp:
246 // CHECK-NEXT:    39ffc:        27 01 00 f0     adrp    x7, #159744
247 // CHECK-NEXT:    3a000:        61 08 00 a8     stnp            x1, x2, [x3]
248 // CHECK-FIX:     3a004:        1a 68 00 14     b       #106600
249 // CHECK-NOFIX:   3a004:        e9 00 40 f9     ldr             x9, [x7]
250 // CHECK-NEXT:    3a008:        c0 03 5f d6     ret
251         .section .text.13, "ax", %progbits
252         .balign 4096
253         .globl t3_ffc_stnp
254         .type t3_ffc_stnp, %function
255         .space 4096 - 4
256 t3_ffc_stnp:
257         adrp x7, dat1
258         stnp x1,x2, [x3, #0]
259         ldr x9, [x7, :lo12:dat1]
260         ret
261
262 // CHECK-PRINT: detected cortex-a53-843419 erratum sequence starting at 3BFFC in unpatched output.
263 // CHECK: t3_ffc_st1singlepost:
264 // CHECK-NEXT:    3bffc:        37 01 00 b0     adrp    x23, #151552
265 // CHECK-NEXT:    3c000:        20 04 82 0d     st1 { v0.b }[1], [x1], x2
266 // CHECK-FIX:     3c004:        1c 60 00 14     b       #98416
267 // CHECK-NOFIX:   3c004:        f6 06 40 f9     ldr     x22, [x23, #8]
268 // CHECK-NEXT:    3c008:        c0 03 5f d6     ret
269         .section .text.14, "ax", %progbits
270         .balign 4096
271         .globl t3_ffc_st1singlepost
272         .type t3_ffc_st1singlepost, %function
273         .space 4096 - 4
274 t3_ffc_st1singlepost:
275         adrp x23, dat2
276         st1 { v0.b }[1], [x1], x2
277         ldr x22, [x23, :lo12:dat2]
278         ret
279
280 // CHECK-PRINT: detected cortex-a53-843419 erratum sequence starting at 3DFF8 in unpatched output.
281 // CHECK: t3_ff8_st1multiple:
282 // CHECK-NEXT:    3dff8:        17 01 00 f0     adrp    x23, #143360
283 // CHECK-NEXT:    3dffc:        20 a0 00 4c     st1     { v0.16b, v1.16b }, [x1]
284 // CHECK-FIX:     3e000:        1f 58 00 14     b       #90236
285 // CHECK-NOFIX:   3e000:        f8 0a 40 f9     ldr     x24, [x23, #16]
286 // CHECK-NEXT:    3e004:        c0 03 5f d6     ret
287         .section .text.15, "ax", %progbits
288         .balign 4096
289         .globl t3_ff8_st1multiple
290         .type t3_ff8_st1muliple, %function
291         .space 4096 - 8
292 t3_ff8_st1multiple:
293         adrp x23, dat3
294         st1 { v0.16b, v1.16b }, [x1]
295         ldr x24, [x23, :lo12:dat3]
296         ret
297
298 // CHECK-PRINT: detected cortex-a53-843419 erratum sequence starting at 3FFF8 in unpatched output.
299 // CHECK: t4_ff8_ldr:
300 // CHECK-NEXT:    3fff8:        00 01 00 b0     adrp    x0, #135168
301 // CHECK-NEXT:    3fffc:        21 00 40 f9     ldr             x1, [x1]
302 // CHECK-NEXT:    40000:        42 00 00 8b     add             x2, x2, x0
303 // CHECK-FIX:     40004:        20 50 00 14     b       #82048
304 // CHECK-NOFIX:   40004:        02 00 40 f9     ldr             x2, [x0]
305 // CHECK-NEXT:    40008:        c0 03 5f d6     ret
306         .section .text.16, "ax", %progbits
307         .balign 4096
308         .globl t4_ff8_ldr
309         .type t4_ff8_ldr, %function
310         .space 4096 - 8
311 t4_ff8_ldr:
312         adrp x0, dat1
313         ldr x1, [x1, #0]
314         add x2, x2, x0
315         ldr x2, [x0, :got_lo12:dat1]
316         ret
317
318 // CHECK-PRINT: detected cortex-a53-843419 erratum sequence starting at 41FFC in unpatched output.
319 // CHECK: t4_ffc_str:
320 // CHECK-NEXT:    41ffc:        fc 00 00 f0     adrp    x28, #126976
321 // CHECK-NEXT:    42000:        42 00 00 f9     str             x2, [x2]
322 // CHECK-NEXT:    42004:        20 00 02 cb     sub             x0, x1, x2
323 // CHECK-FIX:     42008:        21 48 00 14     b       #73860
324 // CHECK-NOFIX:   42008:        9b 07 00 f9     str     x27, [x28, #8]
325 // CHECK-NEXT:    4200c:        c0 03 5f d6     ret
326         .section .text.17, "ax", %progbits
327         .balign 4096
328         .globl t4_ffc_str
329         .type t4_ffc_str, %function
330         .space 4096 - 4
331 t4_ffc_str:
332         adrp x28, dat2
333         str x2, [x2, #0]
334         sub x0, x1, x2
335         str x27, [x28, :got_lo12:dat2]
336         ret
337
338 // CHECK-PRINT: detected cortex-a53-843419 erratum sequence starting at 43FF8 in unpatched output.
339 // CHECK: t4_ff8_stp:
340 // CHECK-NEXT:    43ff8:        f0 00 00 b0     adrp    x16, #118784
341 // CHECK-NEXT:    43ffc:        61 08 00 a9     stp             x1, x2, [x3]
342 // CHECK-NEXT:    44000:        03 7e 10 9b     mul             x3, x16, x16
343 // CHECK-FIX:     44004:        24 40 00 14     b       #65680
344 // CHECK-NOFIX:   44004:        0e 0a 40 f9     ldr     x14, [x16, #16]
345 // CHECK-NEXT:    44008:        c0 03 5f d6     ret
346         .section .text.18, "ax", %progbits
347         .balign 4096
348         .globl t4_ff8_stp
349         .type t4_ff8_stp, %function
350         .space 4096 - 8
351 t4_ff8_stp:
352         adrp x16, dat3
353         stp x1,x2, [x3, #0]
354         mul x3, x16, x16
355         ldr x14, [x16, :got_lo12:dat3]
356         ret
357
358 // CHECK-PRINT: detected cortex-a53-843419 erratum sequence starting at 45FF8 in unpatched output.
359 // CHECK: t4_ff8_stppre:
360 // CHECK-NEXT:    45ff8:        d0 00 00 f0     adrp    x16, #110592
361 // CHECK-NEXT:    45ffc:        61 08 81 a9     stp     x1, x2, [x3, #16]!
362 // CHECK-NEXT:    46000:        03 7e 10 9b     mul             x3, x16, x16
363 // CHECK-FIX:     46004:        26 38 00 14     b       #57496
364 // CHECK-NOFIX:   46004:        0e 06 40 f9     ldr     x14, [x16, #8]
365 // CHECK-NEXT:    46008:        c0 03 5f d6     ret
366         .section .text.19, "ax", %progbits
367         .balign 4096
368         .globl t4_ff8_stppre
369         .type t4_ff8_stppre, %function
370         .space 4096 - 8
371 t4_ff8_stppre:
372         adrp x16, dat1
373         stp x1,x2, [x3, #16]!
374         mul x3, x16, x16
375         ldr x14, [x16, #8]
376         ret
377
378 // CHECK-PRINT: detected cortex-a53-843419 erratum sequence starting at 47FF8 in unpatched output.
379 // CHECK: t4_ff8_stppost:
380 // CHECK-NEXT:    47ff8:        d0 00 00 b0     adrp    x16, #102400
381 // CHECK-NEXT:    47ffc:        61 08 81 a8     stp     x1, x2, [x3], #16
382 // CHECK-NEXT:    48000:        03 7e 10 9b     mul             x3, x16, x16
383 // CHECK-FIX:     48004:        28 30 00 14     b       #49312
384 // CHECK-NOFIX:   48004:        0e 06 40 f9     ldr     x14, [x16, #8]
385 // CHECK-NEXT:    48008:        c0 03 5f d6     ret
386         .section .text.20, "ax", %progbits
387         .balign 4096
388         .globl t4_ff8_stppost
389         .type t4_ff8_stppost, %function
390         .space 4096 - 8
391 t4_ff8_stppost:
392         adrp x16, dat2
393         stp x1,x2, [x3], #16
394         mul x3, x16, x16
395         ldr x14, [x16, #8]
396         ret
397
398 // CHECK-PRINT: detected cortex-a53-843419 erratum sequence starting at 49FFC in unpatched output.
399 // CHECK: t4_ffc_stpsimd:
400 // CHECK-NEXT:    49ffc:        b0 00 00 f0     adrp    x16, #94208
401 // CHECK-NEXT:    4a000:        61 08 00 ad     stp             q1, q2, [x3]
402 // CHECK-NEXT:    4a004:        03 7e 10 9b     mul             x3, x16, x16
403 // CHECK-FIX:     4a008:        29 28 00 14     b       #41124
404 // CHECK-NOFIX:   4a008:        0e 06 40 f9     ldr     x14, [x16, #8]
405 // CHECK-NEXT:    4a00c:        c0 03 5f d6     ret
406         .section .text.21, "ax", %progbits
407         .balign 4096
408         .globl t4_ffc_stpsimd
409         .type t4_ffc_stpsimd, %function
410         .space 4096 - 4
411 t4_ffc_stpsimd:
412         adrp x16, dat3
413         stp q1,q2, [x3, #0]
414         mul x3, x16, x16
415         ldr x14, [x16, #8]
416         ret
417
418 // CHECK-PRINT: detected cortex-a53-843419 erratum sequence starting at 4BFFC in unpatched output.
419 // CHECK: t4_ffc_stnp:
420 // CHECK-NEXT:    4bffc:        a7 00 00 b0     adrp    x7, #86016
421 // CHECK-NEXT:    4c000:        61 08 00 a8     stnp            x1, x2, [x3]
422 // CHECK-NEXT:    4c004:        1f 20 03 d5     nop
423 // CHECK-FIX:     4c008:        2b 20 00 14     b       #32940
424 // CHECK-NOFIX:   4c008:        ea 00 40 f9     ldr             x10, [x7]
425 // CHECK-NEXT:    4c00c:        c0 03 5f d6     ret
426         .section .text.22, "ax", %progbits
427         .balign 4096
428         .globl t4_ffc_stnp
429         .type t4_ffc_stnp, %function
430         .space 4096 - 4
431 t4_ffc_stnp:
432         adrp x7, dat1
433         stnp x1,x2, [x3, #0]
434         nop
435         ldr x10, [x7, :got_lo12:dat1]
436         ret
437
438 // CHECK-PRINT: detected cortex-a53-843419 erratum sequence starting at 4DFFC in unpatched output.
439 // CHECK: t4_ffc_st1:
440 // CHECK-NEXT:    4dffc:        98 00 00 f0     adrp    x24, #77824
441 // CHECK-NEXT:    4e000:        20 80 00 4d     st1 { v0.s }[2], [x1]
442 // CHECK-NEXT:    4e004:        f6 06 40 f9     ldr     x22, [x23, #8]
443 // CHECK-FIX:     4e008:        2d 18 00 14     b       #24756
444 // CHECK-NOFIX:   4e008:        18 ff 3f f9     str     x24, [x24, #32760]
445 // CHECK-NEXT:    4e00c:        c0 03 5f d6     ret
446         .section .text.23, "ax", %progbits
447         .balign 4096
448         .globl t4_ffc_st1
449         .type t4_ffc_st1, %function
450         .space 4096 - 4
451 t4_ffc_st1:
452         adrp x24, dat2
453         st1 { v0.s }[2], [x1]
454         ldr x22, [x23, :got_lo12:dat2]
455         str x24, [x24, #32760]
456         ret
457
458 // CHECK-PRINT: detected cortex-a53-843419 erratum sequence starting at 4FFF8 in unpatched output.
459 // CHECK: t3_ff8_ldr_once:
460 // CHECK-NEXT:    4fff8:        80 00 00 b0     adrp    x0, #69632
461 // CHECK-NEXT:    4fffc:        20 70 82 4c     st1     { v0.16b }, [x1], x2
462 // CHECK-FIX:     50000:        31 10 00 14     b       #16580
463 // CHECK-NOFIX:   50000:        01 08 40 f9     ldr     x1, [x0, #16]
464 // CHECK-NEXT:    50004:        02 08 40 f9     ldr     x2, [x0, #16]
465 // CHECK-NEXT:    50008:        c0 03 5f d6     ret
466         .section .text.24, "ax", %progbits
467         .balign 4096
468         .globl t3_ff8_ldr_once
469         .type t3_ff8_ldr_once, %function
470         .space 4096 - 8
471 t3_ff8_ldr_once:
472         adrp x0, dat3
473         st1 { v0.16b }, [x1], x2
474         ldr x1, [x0, #16]
475         ldr x2, [x0, #16]
476         ret
477
478 // CHECK-PRINT: detected cortex-a53-843419 erratum sequence starting at 51FF8 in unpatched output.
479 // CHECK: t3_ff8_ldxr:
480 // CHECK-NEXT:    51ff8:        60 00 00 f0     adrp    x0, #61440
481 // CHECK-NEXT:    51ffc:        03 7c 5f c8     ldxr    x3, [x0]
482 // CHECK-FIX:     52000:        33 08 00 14     b       #8396
483 // CHECK-NOFIX:   52000:        01 08 40 f9     ldr     x1, [x0, #16]
484 // CHECK:         52004:        02 08 40 f9     ldr     x2, [x0, #16]
485 // CHECK-NEXT:    52008:        c0 03 5f d6     ret
486         .section .text.25, "ax", %progbits
487         .balign 4096
488         .globl t3_ff8_ldxr
489         .type t3_ff8_ldxr, %function
490         .space 4096 - 8
491 t3_ff8_ldxr:
492         adrp x0, dat3
493         ldxr x3, [x0]
494         ldr x1, [x0, #16]
495         ldr x2, [x0, #16]
496         ret
497
498 // CHECK-PRINT: detected cortex-a53-843419 erratum sequence starting at 53FF8 in unpatched output.
499 // CHECK: t3_ff8_stxr:
500 // CHECK-NEXT:    53ff8:        60 00 00 b0     adrp    x0, #53248
501 // CHECK-NEXT:    53ffc:        03 7c 04 c8     stxr    w4, x3, [x0]
502 // CHECK-FIX:     54000:        35 00 00 14     b       #212
503 // CHECK-NOFIX:   54000:        01 08 40 f9     ldr     x1, [x0, #16]
504 // CHECK:         54004:        02 08 40 f9     ldr     x2, [x0, #16]
505 // CHECK-NEXT:    54008:        c0 03 5f d6     ret
506         .section .text.26, "ax", %progbits
507         .balign 4096
508         .globl t3_ff8_stxr
509         .type t3_ff8_stxr, %function
510         .space 4096 - 8
511 t3_ff8_stxr:
512         adrp x0, dat3
513         stxr w4, x3, [x0]
514         ldr x1, [x0, #16]
515         ldr x2, [x0, #16]
516         ret
517
518         .text
519         .globl _start
520         .type _start, %function
521 _start:
522         ret
523
524 // CHECK-FIX: __CortexA53843419_22000:
525 // CHECK-FIX-NEXT:    5400c:    00 00 40 f9     ldr     x0, [x0]
526 // CHECK-FIX-NEXT:    54010:    fd 37 ff 17     b       #-204812
527 // CHECK-FIX: __CortexA53843419_24000:
528 // CHECK-FIX-NEXT:    54014:    02 04 40 f9     ldr     x2, [x0, #8]
529 // CHECK-FIX-NEXT:    54018:    fb 3f ff 17     b       #-196628
530 // CHECK-FIX: __CortexA53843419_26004:
531 // CHECK-FIX-NEXT:    5401c:    03 08 40 f9     ldr     x3, [x0, #16]
532 // CHECK-FIX-NEXT:    54020:    fa 47 ff 17     b       #-188440
533 // CHECK-FIX: __CortexA53843419_28000:
534 // CHECK-FIX-NEXT:    54024:    02 00 40 f9     ldr     x2, [x0]
535 // CHECK-FIX-NEXT:    54028:    f7 4f ff 17     b       #-180260
536 // CHECK-FIX: __CortexA53843419_2A004:
537 // CHECK-FIX-NEXT:    5402c:    9c 07 00 f9     str     x28, [x28, #8]
538 // CHECK-FIX-NEXT:    54030:    f6 57 ff 17     b       #-172072
539 // CHECK-FIX: __CortexA53843419_2C004:
540 // CHECK-FIX-NEXT:    54034:    84 0b 00 f9     str     x4, [x28, #16]
541 // CHECK-FIX-NEXT:    54038:    f4 5f ff 17     b       #-163888
542 // CHECK-FIX: __CortexA53843419_2E000:
543 // CHECK-FIX-NEXT:    5403c:    bd 03 40 f9     ldr     x29, [x29]
544 // CHECK-FIX-NEXT:    54040:    f1 67 ff 17     b       #-155708
545 // CHECK-FIX: __CortexA53843419_30004:
546 // CHECK-FIX-NEXT:    54044:    bd 07 40 f9     ldr     x29, [x29, #8]
547 // CHECK-FIX-NEXT:    54048:    f0 6f ff 17     b       #-147520
548 // CHECK-FIX: __CortexA53843419_32004:
549 // CHECK-FIX-NEXT:    5404c:    41 0a 40 f9     ldr     x1, [x18, #16]
550 // CHECK-FIX-NEXT:    54050:    ee 77 ff 17     b       #-139336
551 // CHECK-FIX: __CortexA53843419_34000:
552 // CHECK-FIX-NEXT:    54054:    52 02 40 f9     ldr     x18, [x18]
553 // CHECK-FIX-NEXT:    54058:    eb 7f ff 17     b       #-131156
554 // CHECK-FIX: __CortexA53843419_36004:
555 // CHECK-FIX-NEXT:    5405c:    ea 05 40 f9     ldr     x10, [x15, #8]
556 // CHECK-FIX-NEXT:    54060:    ea 87 ff 17     b       #-122968
557 // CHECK-FIX: __CortexA53843419_38000:
558 // CHECK-FIX-NEXT:    54064:    0d 0a 40 f9     ldr     x13, [x16, #16]
559 // CHECK-FIX-NEXT:    54068:    e7 8f ff 17     b       #-114788
560 // CHECK-FIX: __CortexA53843419_3A004:
561 // CHECK-FIX-NEXT:    5406c:    e9 00 40 f9     ldr     x9, [x7]
562 // CHECK-FIX-NEXT:    54070:    e6 97 ff 17     b       #-106600
563 // CHECK-FIX: __CortexA53843419_3C004:
564 // CHECK-FIX-NEXT:    54074:    f6 06 40 f9     ldr     x22, [x23, #8]
565 // CHECK-FIX-NEXT:    54078:    e4 9f ff 17     b       #-98416
566 // CHECK-FIX: __CortexA53843419_3E000:
567 // CHECK-FIX-NEXT:    5407c:    f8 0a 40 f9     ldr     x24, [x23, #16]
568 // CHECK-FIX-NEXT:    54080:    e1 a7 ff 17     b       #-90236
569 // CHECK-FIX: __CortexA53843419_40004:
570 // CHECK-FIX-NEXT:    54084:    02 00 40 f9     ldr     x2, [x0]
571 // CHECK-FIX-NEXT:    54088:    e0 af ff 17     b       #-82048
572 // CHECK-FIX: __CortexA53843419_42008:
573 // CHECK-FIX-NEXT:    5408c:    9b 07 00 f9     str     x27, [x28, #8]
574 // CHECK-FIX-NEXT:    54090:    df b7 ff 17     b       #-73860
575 // CHECK-FIX: __CortexA53843419_44004:
576 // CHECK-FIX-NEXT:    54094:    0e 0a 40 f9     ldr     x14, [x16, #16]
577 // CHECK-FIX-NEXT:    54098:    dc bf ff 17     b       #-65680
578 // CHECK-FIX: __CortexA53843419_46004:
579 // CHECK-FIX-NEXT:    5409c:    0e 06 40 f9     ldr     x14, [x16, #8]
580 // CHECK-FIX-NEXT:    540a0:    da c7 ff 17     b       #-57496
581 // CHECK-FIX: __CortexA53843419_48004:
582 // CHECK-FIX-NEXT:    540a4:    0e 06 40 f9     ldr     x14, [x16, #8]
583 // CHECK-FIX-NEXT:    540a8:    d8 cf ff 17     b       #-49312
584 // CHECK-FIX: __CortexA53843419_4A008:
585 // CHECK-FIX-NEXT:    540ac:    0e 06 40 f9     ldr     x14, [x16, #8]
586 // CHECK-FIX-NEXT:    540b0:    d7 d7 ff 17     b       #-41124
587 // CHECK-FIX: __CortexA53843419_4C008:
588 // CHECK-FIX-NEXT:    540b4:    ea 00 40 f9     ldr     x10, [x7]
589 // CHECK-FIX-NEXT:    540b8:    d5 df ff 17     b       #-32940
590 // CHECK-FIX: __CortexA53843419_4E008:
591 // CHECK-FIX-NEXT:    540bc:    18 ff 3f f9     str     x24, [x24, #32760]
592 // CHECK-FIX-NEXT:    540c0:    d3 e7 ff 17     b       #-24756
593 // CHECK-FIX: __CortexA53843419_50000:
594 // CHECK-FIX-NEXT:    540c4:    01 08 40 f9     ldr     x1, [x0, #16]
595 // CHECK-FIX-NEXT:    540c8:    cf ef ff 17     b       #-16580
596 // CHECK-FIX: __CortexA53843419_52000:
597 // CHECK-FIX-NEXT:    540cc:    01 08 40 f9     ldr     x1, [x0, #16]
598 // CHECK-FIX-NEXT:    540d0:    cd f7 ff 17     b       #-8396
599 // CHECK-FIX: __CortexA53843419_54000:
600 // CHECK-FIX-NEXT:    540d4:    01 08 40 f9     ldr     x1, [x0, #16]
601 // CHECK-FIX-NEXT:    540d8:    cb ff ff 17     b       #-212
602         .data
603         .globl dat
604         .globl dat2
605         .globl dat3
606 dat1:   .quad 1
607 dat2:   .quad 2
608 dat3:   .quad 3