]> git.ipfire.org Git - thirdparty/gcc.git/blob - libgcc/config/i386/i386-asm.h
i386.opt: Add option -mcall-ms2sysv-xlogues.
[thirdparty/gcc.git] / libgcc / config / i386 / i386-asm.h
1 /* Defines common perprocessor and assembly macros for use by various stubs.
2 Copyright (C) 2016-2017 Free Software Foundation, Inc.
3 Contributed by Daniel Santos <daniel.santos@pobox.com>
4
5 This file is part of GCC.
6
7 GCC is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 3, or (at your option)
10 any later version.
11
12 GCC is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
16
17 Under Section 7 of GPL version 3, you are granted additional
18 permissions described in the GCC Runtime Library Exception, version
19 3.1, as published by the Free Software Foundation.
20
21 You should have received a copy of the GNU General Public License and
22 a copy of the GCC Runtime Library Exception along with this program;
23 see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
24 <http://www.gnu.org/licenses/>. */
25
26 #ifndef I386_ASM_H
27 #define I386_ASM_H
28
29 #ifdef __ELF__
30 # define ELFFN(fn) .type fn,@function
31 #else
32 # define ELFFN(fn)
33 #endif
34
35 #define FUNC_START(fn) \
36 .global fn; \
37 ELFFN (fn); \
38 fn:
39
40 #define HIDDEN_FUNC(fn)\
41 FUNC_START (fn) \
42 .hidden fn; \
43
44 #define FUNC_END(fn) .size fn,.-fn
45
46 #ifdef __SSE2__
47 # ifdef __AVX__
48 # define MOVAPS vmovaps
49 # else
50 # define MOVAPS movaps
51 # endif
52
53 /* Save SSE registers 6-15. off is the offset of rax to get to xmm6. */
54 .macro SSE_SAVE off=0
55 MOVAPS %xmm15,(\off - 0x90)(%rax)
56 MOVAPS %xmm14,(\off - 0x80)(%rax)
57 MOVAPS %xmm13,(\off - 0x70)(%rax)
58 MOVAPS %xmm12,(\off - 0x60)(%rax)
59 MOVAPS %xmm11,(\off - 0x50)(%rax)
60 MOVAPS %xmm10,(\off - 0x40)(%rax)
61 MOVAPS %xmm9, (\off - 0x30)(%rax)
62 MOVAPS %xmm8, (\off - 0x20)(%rax)
63 MOVAPS %xmm7, (\off - 0x10)(%rax)
64 MOVAPS %xmm6, \off(%rax)
65 .endm
66
67 /* Restore SSE registers 6-15. off is the offset of rsi to get to xmm6. */
68 .macro SSE_RESTORE off=0
69 MOVAPS (\off - 0x90)(%rsi), %xmm15
70 MOVAPS (\off - 0x80)(%rsi), %xmm14
71 MOVAPS (\off - 0x70)(%rsi), %xmm13
72 MOVAPS (\off - 0x60)(%rsi), %xmm12
73 MOVAPS (\off - 0x50)(%rsi), %xmm11
74 MOVAPS (\off - 0x40)(%rsi), %xmm10
75 MOVAPS (\off - 0x30)(%rsi), %xmm9
76 MOVAPS (\off - 0x20)(%rsi), %xmm8
77 MOVAPS (\off - 0x10)(%rsi), %xmm7
78 MOVAPS \off(%rsi), %xmm6
79 .endm
80
81 #endif /* __SSE2__ */
82 #endif /* I386_ASM_H */