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