1
2//===-- orc_rt_elfnix_tls_x86-64.s -------------------------------*- ASM -*-===//
3//
4// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
5// See https://llvm.org/LICENSE.txt for license information.
6// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7//
8//===----------------------------------------------------------------------===//
9//
10// This file is a part of the ORC runtime support library.
11//
12//===----------------------------------------------------------------------===//
13
14// The content of this file is x86_64-only
15#if defined(__x86_64__)
16.att_syntax
17
18#define REGISTER_SAVE_SPACE_SIZE 512
19
20 .text
21
22 // returns address of TLV in %rax, all other registers preserved
23 .globl ___orc_rt_elfnix_tls_get_addr
24___orc_rt_elfnix_tls_get_addr:
25 pushq %rbp
26 movq %rsp, %rbp
27 subq $REGISTER_SAVE_SPACE_SIZE, %rsp
28 movq %rcx, -16(%rbp)
29 movq %rdx, -24(%rbp)
30 movq %rsi, -32(%rbp)
31 movq %rdi, -40(%rbp)
32 movq %r8, -48(%rbp)
33 movq %r9, -56(%rbp)
34 movq %r10, -64(%rbp)
35 movq %r11, -72(%rbp)
36 movdqa %xmm0, -128(%rbp)
37 movdqa %xmm1, -144(%rbp)
38 movdqa %xmm2, -160(%rbp)
39 movdqa %xmm3, -176(%rbp)
40 movdqa %xmm4, -192(%rbp)
41 movdqa %xmm5, -208(%rbp)
42 movdqa %xmm6, -224(%rbp)
43 movdqa %xmm7, -240(%rbp)
44 call __orc_rt_elfnix_tls_get_addr_impl
45 movq -16(%rbp), %rcx
46 movq -24(%rbp), %rdx
47 movq -32(%rbp), %rsi
48 movq -40(%rbp), %rdi
49 movq -48(%rbp), %r8
50 movq -56(%rbp), %r9
51 movq -64(%rbp), %r10
52 movq -72(%rbp), %r11
53 movdqa -128(%rbp), %xmm0
54 movdqa -144(%rbp), %xmm1
55 movdqa -160(%rbp), %xmm2
56 movdqa -176(%rbp), %xmm3
57 movdqa -192(%rbp), %xmm4
58 movdqa -208(%rbp), %xmm5
59 movdqa -224(%rbp), %xmm6
60 movdqa -240(%rbp), %xmm7
61 addq $REGISTER_SAVE_SPACE_SIZE, %rsp
62 popq %rbp
63 ret
64
65#endif // defined(__x86_64__)
66