1 /* Definitions of C specific functions for GNU compiler.
2 Copyright (C) 2002-2017 Free Software Foundation, Inc.
3 Contributed by Steve Ellcey <sje@cup.hp.com>
5 This file is part of GCC.
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)
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.
17 You should have received a copy of the GNU General Public License
18 along with GCC; see the file COPYING3. If not see
19 <http://www.gnu.org/licenses/>. */
23 #include "coretypes.h"
25 #include "c-family/c-common.h"
26 #include "stringpool.h"
27 #include "c-family/c-pragma.h"
29 static void ia64_hpux_add_pragma_builtin (tree func
);
32 ia64_hpux_handle_builtin_pragma (cpp_reader
*pfile ATTRIBUTE_UNUSED
)
34 /* #pragma builtin name, name, name */
39 type
= pragma_lex (&x
);
40 while (type
== CPP_NAME
)
42 ia64_hpux_add_pragma_builtin (x
);
43 type
= pragma_lex (&x
);
44 if (type
== CPP_COMMA
)
45 type
= pragma_lex (&x
);
48 warning (OPT_Wpragmas
, "malformed #pragma builtin");
51 /* List of standard math functions which do not set matherr by default
52 and which have a different version which does set errno and which we
53 want to call *if* we have seen an extern for the routine and we have
54 asked for strict C89 compatibility. */
56 typedef struct c89_mathlib_names
58 const char *realname
; /* User visible function name. */
59 const char *c89name
; /* libm special name needed to set errno. */
62 static const c89_mathlib_names c89_mathlib_name_list
[] =
65 {"acosd", "_Acosd_e#"},
66 {"acosdf", "_Acosdf_e#"},
67 {"acosdl", "_Acosdl_e#"},
68 {"acosdw", "_Acosdw_e#"},
69 {"acosf", "_Acosf_e#"},
70 {"acosh", "_Acosh_e#"},
71 {"acoshf", "_Acoshf_e#"},
72 {"acoshl", "_Acoshl_e#"},
73 {"acoshw", "_Acoshw_e#"},
74 {"acosl", "_Acosl_e#"},
75 {"acosw", "_Acosw_e#"},
77 {"asind", "_Asind_e#"},
78 {"asindf", "_Asindf_e#"},
79 {"asindl", "_Asindl_e#"},
80 {"asindw", "_Asindw_e#"},
81 {"asinf", "_Asinf_e#"},
82 {"asinl", "_Asinl_e#"},
83 {"asinw", "_Asinw_e#"},
84 {"atanh", "_Atanh_e#"},
85 {"atanhf", "_Atanhf_e#"},
86 {"atanhl", "_Atanhl_e#"},
87 {"atanhw", "_Atanhw_e#"},
89 {"coshf", "_Coshf_e#"},
90 {"coshl", "_Coshl_e#"},
91 {"coshw", "_Coshw_e#"},
93 {"exp2f", "_Exp2f_e#"},
94 {"exp2l", "_Exp2l_e#"},
95 {"exp2w", "_Exp2w_e#"},
99 {"expm1", "_Expm1_e#"},
100 {"expm1f", "_Expm1f_e#"},
101 {"expm1l", "_Expm1l_e#"},
102 {"expm1w", "_Expm1w_e#"},
103 {"expw", "_Expw_e#"},
104 {"fmod", "_Fmod_e#"},
105 {"fmodf", "_Fmodf_e#"},
106 {"fmodl", "_Fmodl_e#"},
107 {"fmodw", "_Fmodw_e#"},
108 {"gamma", "_Gamma_e#"},
109 {"gammaf", "_Gammaf_e#"},
110 {"gammal", "_Gammal_e#"},
111 {"gammaw", "_Gammaw_e#"},
112 {"ldexp", "_Ldexp_e#"},
113 {"ldexpf", "_Ldexpf_e#"},
114 {"ldexpl", "_Ldexpl_e#"},
115 {"ldexpw", "_Ldexpw_e#"},
116 {"lgamma", "_Lgamma_e#"},
117 {"lgammaf", "_Lgammaf_e#"},
118 {"lgammal", "_Lgammal_e#"},
119 {"lgammaw", "_Lgammaw_e#"},
120 {"log10", "_Log10_e#"},
121 {"log10f", "_Log10f_e#"},
122 {"log10l", "_Log10l_e#"},
123 {"log10w", "_Log10w_e#"},
124 {"log1p", "_Log1p_e#"},
125 {"log1pf", "_Log1pf_e#"},
126 {"log1pl", "_Log1pl_e#"},
127 {"log1pw", "_Log1pw_e#"},
128 {"log2", "_Log2_e#"},
129 {"log2f", "_Log2f_e#"},
130 {"log2l", "_Log2l_e#"},
131 {"log2w", "_Log2w_e#"},
133 {"logb", "_Logb_e#"},
134 {"logbf", "_Logbf_e#"},
135 {"logbl", "_Logbl_e#"},
136 {"logbw", "_Logbw_e#"},
137 {"logf", "_Logf_e#"},
138 {"logl", "_Logl_e#"},
139 {"logw", "_Logw_e#"},
140 {"nextafter", "_Nextafter_e#"},
141 {"nextafterf", "_Nextafterf_e#"},
142 {"nextafterl", "_Nextafterl_e#"},
143 {"nextafterw", "_Nextafterw_e#"},
145 {"powf", "_Powf_e#"},
146 {"powl", "_Powl_e#"},
147 {"poww", "_Poww_e#"},
148 {"remainder", "_Remainder_e#"},
149 {"remainderf", "_Remainderf_e#"},
150 {"remainderl", "_Remainderl_e#"},
151 {"remainderw", "_Remainderw_e#"},
152 {"scalb", "_Scalb_e#"},
153 {"scalbf", "_Scalbf_e#"},
154 {"scalbl", "_Scalbl_e#"},
155 {"scalbw", "_Scalbw_e#"},
156 {"sinh", "_Sinh_e#"},
157 {"sinhf", "_Sinhf_e#"},
158 {"sinhl", "_Sinhl_e#"},
159 {"sinhw", "_Sinhw_e#"},
160 {"sqrt", "_Sqrt_e#"},
161 {"sqrtf", "_Sqrtf_e#"},
162 {"sqrtl", "_Sqrtl_e#"},
163 {"sqrtw", "_Sqrtw_e#"},
164 {"tgamma", "_Tgamma_e#"},
165 {"tgammaf", "_Tgammaf_e#"},
166 {"tgammal", "_Tgammal_e#"},
167 {"tgammaw", "_Tgammaw_e#"}
171 ia64_hpux_add_pragma_builtin (tree func
)
175 if (!flag_isoc94
&& flag_iso
)
177 for (i
= 0; i
< ARRAY_SIZE (c89_mathlib_name_list
); i
++)
179 if (!strcmp(c89_mathlib_name_list
[i
].realname
,
180 IDENTIFIER_POINTER (func
)))
182 add_to_renaming_pragma_list(func
,
183 get_identifier(c89_mathlib_name_list
[i
].c89name
));