File: aarch64-cortex-a53-843419-tlsrelax.s

package info (click to toggle)
llvm-toolchain-11 1%3A11.0.1-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 995,808 kB
  • sloc: cpp: 4,767,656; ansic: 760,916; asm: 477,436; python: 170,940; objc: 69,804; lisp: 29,914; sh: 23,855; f90: 18,173; pascal: 7,551; perl: 7,471; ml: 5,603; awk: 3,489; makefile: 2,573; xml: 915; cs: 573; fortran: 503; javascript: 452
file content (38 lines) | stat: -rw-r--r-- 1,378 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
// REQUIRES: aarch64
// RUN: llvm-mc -filetype=obj -triple=aarch64-none-linux %s -o %t.o
// RUN: ld.lld -fix-cortex-a53-843419 %t.o -o %t2
// RUN: llvm-objdump --triple=aarch64-linux-gnu -d %t2 | FileCheck %s

// The following code sequence is covered by the TLS IE to LE relaxation. It
// transforms the ADRP, LDR to MOVZ, MOVK. The former can trigger a
// cortex-a53-843419 patch, whereas the latter can not. As both
// relaxation and patching transform instructions very late in the
// link there is a possibility of them both being simultaneously
// applied. In this case the relaxed sequence is immune from the erratum so we
// prefer to keep it.
 .text
 .balign 4096
 .space  4096 - 8
 .globl _start
 .type  _start,@function
_start:
 mrs    x1, tpidr_el0
 adrp   x0, :gottprel:v
 ldr    x1, [x0, #:gottprel_lo12:v]
 adrp   x0, :gottprel:v
 ldr    x1, [x0, #:gottprel_lo12:v]
 ret

// CHECK: <_start>:
// CHECK-NEXT:   211ff8:        41 d0 3b d5     mrs     x1, TPIDR_EL0
// CHECK-NEXT:   211ffc:        00 00 a0 d2     movz    x0, #0, lsl #16
// CHECK-NEXT:   212000:        01 02 80 f2     movk    x1, #16
// CHECK-NEXT:   212004:        00 00 a0 d2     movz    x0, #0, lsl #16
// CHECK-NEXT:   212008:        01 02 80 f2     movk    x1, #16
// CHECK-NEXT:   21200c:        c0 03 5f d6     ret

 .type  v,@object
 .section       .tbss,"awT",@nobits
 .globl v
v:
 .word 0