1 /* _Float128 aliasing macro support for ifunc generation on PPC.
2    Copyright (C) 2020-2022 Free Software Foundation, Inc.
3    This file is part of the GNU C Library.
4 
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.
9 
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.
14 
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/>.  */
18 
19 #ifndef _FLOAT128_IFUNC_REDIRECT_MACROS_PPC64LE
20 #define _FLOAT128_IFUNC_REDIRECT_MACROS_PPC64LE 1
21 
22 /* Define the redirection macros used throughout most of the IFUNC headers.
23    The variant is inferred via compiler options.
24 
25    F128_REDIR_PFX_R(function, destination_prefix, reentrant_suffix)
26      Redirect function, optionally suffixed by reentrant_suffix, to a function
27      named destination_prefix ## function ## variant ## reentrant_suffix.
28 
29    F128_SFX_APPEND(sym)
30      Append the the multiarch variant specific suffix to the sym. sym is not
31      expanded.  This is sym ## variant.
32 
33    F128_REDIR_R(func, reentrant_suffix)
34      Redirect func to a function named function ## variant ## reentrant_suffix
35 
36    F128_REDIR(function)
37      Convience wrapper for F128_REDIR_R where function does not require
38      a suffix argument.
39 
40 */
41 #ifndef _ARCH_PWR9
42 #define F128_REDIR_PFX_R(func, pfx, r) \
43   extern __typeof(func ## r) func ## r __asm( #pfx #func "_power8" #r );
44 #define F128_SFX_APPEND(x) x ## _power8
45 #else
46 #define F128_REDIR_PFX_R(func, pfx, r) \
47   extern __typeof(func ## r) func ## r __asm( #pfx #func "_power9" #r );
48 #define F128_SFX_APPEND(x) x ## _power9
49 #endif
50 #define F128_REDIR_R(func, r) F128_REDIR_PFX_R (func, , r)
51 #define F128_REDIR(func) F128_REDIR_R (func, )
52 
53 #endif /*_FLOAT128_IFUNC_REDIRECT_MACROS_PPC64LE */
54