1 /* PLT trampolines. x86-64 version.
2 Copyright (C) 2004-2024 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.
5 The GNU C Library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Lesser General Public
7 License as published by the Free Software Foundation; either
8 version 2.1 of the License, or (at your option) any later version.
10 The GNU C Library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Lesser General Public License for more details.
15 You should have received a copy of the GNU Lesser General Public
16 License along with the GNU C Library; if not, see
17 <https://www.gnu.org/licenses/>. */
21 #include <cpu-features-offsets.h>
22 #include <features-offsets.h>
23 #include <link-defines.h>
24 #include <isa-level.h>
25 #include "dl-trampoline-save.h"
27 /* Area on stack to save and restore registers used for parameter
28 passing when calling _dl_fixup. */
29 #define REGISTER_SAVE_RAX 0
30 #define REGISTER_SAVE_RCX (REGISTER_SAVE_RAX + 8)
31 #define REGISTER_SAVE_RDX (REGISTER_SAVE_RCX + 8)
32 #define REGISTER_SAVE_RSI (REGISTER_SAVE_RDX + 8)
33 #define REGISTER_SAVE_RDI (REGISTER_SAVE_RSI + 8)
34 #define REGISTER_SAVE_R8 (REGISTER_SAVE_RDI + 8)
35 #define REGISTER_SAVE_R9 (REGISTER_SAVE_R8 + 8)
41 # define VMOVA vmovdqa64
42 # define VEC(i) zmm##i
43 # define _dl_runtime_profile _dl_runtime_profile_avx512
44 # define SECTION(p) p##.evex512
45 # include "dl-trampoline.h"
46 # undef _dl_runtime_profile
52 # if MINIMUM_X86_ISA_LEVEL <= AVX_X86_ISA_LEVEL
54 # define VMOVA vmovdqa
55 # define VEC(i) ymm##i
56 # define SECTION(p) p##.avx
57 # define _dl_runtime_profile _dl_runtime_profile_avx
58 # include "dl-trampoline.h"
59 # undef _dl_runtime_profile
66 # if MINIMUM_X86_ISA_LEVEL < AVX_X86_ISA_LEVEL
67 /* movaps/movups is 1-byte shorter. */
70 # define VEC(i) xmm##i
71 # define _dl_runtime_profile _dl_runtime_profile_sse
73 # include "dl-trampoline.h"
74 # undef _dl_runtime_profile
81 #if MINIMUM_X86_ISA_LEVEL < AVX_X86_ISA_LEVEL
83 # define STATE_SAVE_ALIGNMENT 16
84 # define _dl_runtime_resolve _dl_runtime_resolve_fxsave
85 # include "dl-trampoline.h"
86 # undef _dl_runtime_resolve
88 # undef STATE_SAVE_ALIGNMENT
92 #define STATE_SAVE_ALIGNMENT 64
93 #define _dl_runtime_resolve _dl_runtime_resolve_xsave
94 #include "dl-trampoline.h"
95 #undef _dl_runtime_resolve
97 #undef STATE_SAVE_ALIGNMENT
100 #define STATE_SAVE_ALIGNMENT 64
101 #define _dl_runtime_resolve _dl_runtime_resolve_xsavec
102 #include "dl-trampoline.h"
103 #undef _dl_runtime_resolve
105 #undef STATE_SAVE_ALIGNMENT