File: ppc64-tls-le-relax.s

package info (click to toggle)
swiftlang 6.0.3-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 2,519,992 kB
  • sloc: cpp: 9,107,863; ansic: 2,040,022; asm: 1,135,751; python: 296,500; objc: 82,456; f90: 60,502; lisp: 34,951; pascal: 19,946; sh: 18,133; perl: 7,482; ml: 4,937; javascript: 4,117; makefile: 3,840; awk: 3,535; xml: 914; fortran: 619; cs: 573; ruby: 573
file content (81 lines) | stat: -rw-r--r-- 1,681 bytes parent folder | download | duplicates (15)
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
# REQUIRES: ppc
# RUN: split-file %s %t
# RUN: llvm-mc -filetype=obj -triple=powerpc64le %t/initexec -o %t/initexec.o
# RUN: llvm-mc -filetype=obj -triple=powerpc64le %t/defs -o %t/defs.o
# RUN: ld.lld %t/initexec.o %t/defs.o -o %t/out
# RUN: llvm-objdump -d --no-show-raw-insn %t/out | FileCheck %s

# CHECK-LABEL: <GetAddrT>:
# CHECK:         mflr 0
# CHECK-NEXT:    std 30, -16(1)
# CHECK-NEXT:    std 0, 16(1)
# CHECK-NEXT:    stdu 1, -48(1)
# CHECK-NEXT:    paddi 3, 13, -28672, 0
# CHECK-NEXT:    mr 30, 3
# CHECK-NEXT:    mr 3, 30
# CHECK-NEXT:    bl
# CHECK-NEXT:    mr 4, 30
# CHECK-NEXT:    addi 1, 1, 48
# CHECK-NEXT:    ld 0, 16(1)
# CHECK-NEXT:    ld 30, -16(1)
# CHECK-NEXT:    mtlr 0
# CHECK-NEXT:    b

## Generated From:
## extern __thread unsigned TGlobal;
## unsigned getConst(unsigned*);
## unsigned addVal(unsigned, unsigned*);
##
## unsigned GetAddrT() {
##   return addVal(getConst(&TGlobal), &TGlobal);
## }

//--- initexec
GetAddrT:
  mflr 0
  std 30, -16(1)
  std 0, 16(1)
  stdu 1, -48(1)
  pld 3, TGlobal@got@tprel@pcrel(0), 1
  add 30, 3, TGlobal@tls@pcrel
  mr      3, 30
  bl getConst@notoc
  mr      4, 30
  addi 1, 1, 48
  ld 0, 16(1)
  ld 30, -16(1)
  mtlr 0
  b addVal@notoc

## Generated From:
## __thread unsigned TGlobal;
##
## unsigned getConst(unsigned* A) {
##   return *A + 3;
## }
##
## unsigned addVal(unsigned A, unsigned* B) {
##   return A + *B;
## }

//--- defs
.globl  getConst
getConst:
  lwz 3, 0(3)
  addi 3, 3, 3
  clrldi  3, 3, 32
  blr

.globl  addVal
addVal:
  lwz 4, 0(4)
  add 3, 4, 3
  clrldi  3, 3, 32
  blr

.section        .tbss,"awT",@nobits
.globl  TGlobal
.p2align        2
TGlobal:
  .long   0
  .size   TGlobal, 4