xref: /freebsd/contrib/llvm-project/compiler-rt/lib/orc/macho_tlv.x86-64.S (revision 13ec1e3155c7e9bf037b12af186351b7fa9b9450)
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#define REGISTER_SAVE_SPACE_SIZE        512
14
15        .text
16
17	// returns address of TLV in %rax, all other registers preserved
18	.globl ___orc_rt_macho_tlv_get_addr
19___orc_rt_macho_tlv_get_addr:
20        pushq           %rbp
21        movq            %rsp,        %rbp
22        subq            $REGISTER_SAVE_SPACE_SIZE, %rsp
23        movq            %rbx,     -8(%rbp)
24        movq            %rcx,    -16(%rbp)
25        movq            %rdx,    -24(%rbp)
26        movq            %rsi,    -32(%rbp)
27        movq            %rdi,    -40(%rbp)
28        movq            %r8,     -48(%rbp)
29        movq            %r9,     -56(%rbp)
30        movq            %r10,    -64(%rbp)
31        movq            %r11,    -72(%rbp)
32        movq            %r12,    -80(%rbp)
33        movq            %r13,    -88(%rbp)
34        movq            %r14,    -96(%rbp)
35        movq            %r15,   -104(%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_macho_tlv_get_addr_impl
45        movq            -8(%rbp),       %rbx
46        movq            -16(%rbp),      %rcx
47        movq            -24(%rbp),      %rdx
48        movq            -32(%rbp),      %rsi
49        movq            -40(%rbp),      %rdi
50        movq            -48(%rbp),      %r8
51        movq            -56(%rbp),      %r9
52        movq            -64(%rbp),      %r10
53        movq            -72(%rbp),      %r11
54        movq            -80(%rbp),      %r12
55        movq            -88(%rbp),      %r13
56        movq            -96(%rbp),      %r14
57        movq            -104(%rbp),     %r15
58        movdqa          -128(%rbp),     %xmm0
59	movdqa          -144(%rbp),     %xmm1
60	movdqa          -160(%rbp),     %xmm2
61	movdqa          -176(%rbp),     %xmm3
62	movdqa          -192(%rbp),     %xmm4
63	movdqa          -208(%rbp),     %xmm5
64	movdqa          -224(%rbp),     %xmm6
65	movdqa          -240(%rbp),     %xmm7
66        addq            $REGISTER_SAVE_SPACE_SIZE, %rsp
67        popq            %rbp
68        ret
69