[AArch64] Remember to cost operand 0 in FP compare-with-0.0 case
[official-gcc.git] / gcc / config / ia64 / ia64-c.c
blob7bf50327e61ffebab4ab6599f1d8f8cf38d97d5f
1 /* Definitions of C specific functions for GNU compiler.
2 Copyright (C) 2002-2015 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)
10 any later version.
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/>. */
21 #include "config.h"
22 #include "system.h"
23 #include "coretypes.h"
24 #include "tm.h"
25 #include "hash-set.h"
26 #include "machmode.h"
27 #include "vec.h"
28 #include "double-int.h"
29 #include "input.h"
30 #include "alias.h"
31 #include "symtab.h"
32 #include "wide-int.h"
33 #include "inchash.h"
34 #include "tree.h"
35 #include "stringpool.h"
36 #include "cpplib.h"
37 #include "c-family/c-common.h"
38 #include "c-family/c-pragma.h"
39 #include "diagnostic-core.h"
40 #include "tm_p.h"
42 static void ia64_hpux_add_pragma_builtin (tree func);
44 void
45 ia64_hpux_handle_builtin_pragma (cpp_reader *pfile ATTRIBUTE_UNUSED)
47 /* #pragma builtin name, name, name */
49 enum cpp_ttype type;
50 tree x;
52 type = pragma_lex (&x);
53 while (type == CPP_NAME)
55 ia64_hpux_add_pragma_builtin (x);
56 type = pragma_lex (&x);
57 if (type == CPP_COMMA)
58 type = pragma_lex (&x);
60 if (type != CPP_EOF)
61 warning (OPT_Wpragmas, "malformed #pragma builtin");
64 /* List of standard math functions which do not set matherr by default
65 and which have a different version which does set errno and which we
66 want to call *if* we have seen an extern for the routine and we have
67 asked for strict C89 compatibility. */
69 typedef struct c89_mathlib_names
71 const char *realname; /* User visible function name. */
72 const char *c89name; /* libm special name needed to set errno. */
73 } c89_mathlib_names;
75 static const c89_mathlib_names c89_mathlib_name_list [] =
77 {"acos", "_Acos_e#"},
78 {"acosd", "_Acosd_e#"},
79 {"acosdf", "_Acosdf_e#"},
80 {"acosdl", "_Acosdl_e#"},
81 {"acosdw", "_Acosdw_e#"},
82 {"acosf", "_Acosf_e#"},
83 {"acosh", "_Acosh_e#"},
84 {"acoshf", "_Acoshf_e#"},
85 {"acoshl", "_Acoshl_e#"},
86 {"acoshw", "_Acoshw_e#"},
87 {"acosl", "_Acosl_e#"},
88 {"acosw", "_Acosw_e#"},
89 {"asin", "_Asin_e#"},
90 {"asind", "_Asind_e#"},
91 {"asindf", "_Asindf_e#"},
92 {"asindl", "_Asindl_e#"},
93 {"asindw", "_Asindw_e#"},
94 {"asinf", "_Asinf_e#"},
95 {"asinl", "_Asinl_e#"},
96 {"asinw", "_Asinw_e#"},
97 {"atanh", "_Atanh_e#"},
98 {"atanhf", "_Atanhf_e#"},
99 {"atanhl", "_Atanhl_e#"},
100 {"atanhw", "_Atanhw_e#"},
101 {"cosh", "_Cosh_e#"},
102 {"coshf", "_Coshf_e#"},
103 {"coshl", "_Coshl_e#"},
104 {"coshw", "_Coshw_e#"},
105 {"exp2", "_Exp2_e#"},
106 {"exp2f", "_Exp2f_e#"},
107 {"exp2l", "_Exp2l_e#"},
108 {"exp2w", "_Exp2w_e#"},
109 {"exp", "_Exp_e#"},
110 {"expf", "_Expf_e#"},
111 {"expl", "_Expl_e#"},
112 {"expm1", "_Expm1_e#"},
113 {"expm1f", "_Expm1f_e#"},
114 {"expm1l", "_Expm1l_e#"},
115 {"expm1w", "_Expm1w_e#"},
116 {"expw", "_Expw_e#"},
117 {"fmod", "_Fmod_e#"},
118 {"fmodf", "_Fmodf_e#"},
119 {"fmodl", "_Fmodl_e#"},
120 {"fmodw", "_Fmodw_e#"},
121 {"gamma", "_Gamma_e#"},
122 {"gammaf", "_Gammaf_e#"},
123 {"gammal", "_Gammal_e#"},
124 {"gammaw", "_Gammaw_e#"},
125 {"ldexp", "_Ldexp_e#"},
126 {"ldexpf", "_Ldexpf_e#"},
127 {"ldexpl", "_Ldexpl_e#"},
128 {"ldexpw", "_Ldexpw_e#"},
129 {"lgamma", "_Lgamma_e#"},
130 {"lgammaf", "_Lgammaf_e#"},
131 {"lgammal", "_Lgammal_e#"},
132 {"lgammaw", "_Lgammaw_e#"},
133 {"log10", "_Log10_e#"},
134 {"log10f", "_Log10f_e#"},
135 {"log10l", "_Log10l_e#"},
136 {"log10w", "_Log10w_e#"},
137 {"log1p", "_Log1p_e#"},
138 {"log1pf", "_Log1pf_e#"},
139 {"log1pl", "_Log1pl_e#"},
140 {"log1pw", "_Log1pw_e#"},
141 {"log2", "_Log2_e#"},
142 {"log2f", "_Log2f_e#"},
143 {"log2l", "_Log2l_e#"},
144 {"log2w", "_Log2w_e#"},
145 {"log", "_Log_e#"},
146 {"logb", "_Logb_e#"},
147 {"logbf", "_Logbf_e#"},
148 {"logbl", "_Logbl_e#"},
149 {"logbw", "_Logbw_e#"},
150 {"logf", "_Logf_e#"},
151 {"logl", "_Logl_e#"},
152 {"logw", "_Logw_e#"},
153 {"nextafter", "_Nextafter_e#"},
154 {"nextafterf", "_Nextafterf_e#"},
155 {"nextafterl", "_Nextafterl_e#"},
156 {"nextafterw", "_Nextafterw_e#"},
157 {"pow", "_Pow_e#"},
158 {"powf", "_Powf_e#"},
159 {"powl", "_Powl_e#"},
160 {"poww", "_Poww_e#"},
161 {"remainder", "_Remainder_e#"},
162 {"remainderf", "_Remainderf_e#"},
163 {"remainderl", "_Remainderl_e#"},
164 {"remainderw", "_Remainderw_e#"},
165 {"scalb", "_Scalb_e#"},
166 {"scalbf", "_Scalbf_e#"},
167 {"scalbl", "_Scalbl_e#"},
168 {"scalbw", "_Scalbw_e#"},
169 {"sinh", "_Sinh_e#"},
170 {"sinhf", "_Sinhf_e#"},
171 {"sinhl", "_Sinhl_e#"},
172 {"sinhw", "_Sinhw_e#"},
173 {"sqrt", "_Sqrt_e#"},
174 {"sqrtf", "_Sqrtf_e#"},
175 {"sqrtl", "_Sqrtl_e#"},
176 {"sqrtw", "_Sqrtw_e#"},
177 {"tgamma", "_Tgamma_e#"},
178 {"tgammaf", "_Tgammaf_e#"},
179 {"tgammal", "_Tgammal_e#"},
180 {"tgammaw", "_Tgammaw_e#"}
183 static void
184 ia64_hpux_add_pragma_builtin (tree func)
186 size_t i;
188 if (!flag_isoc94 && flag_iso)
190 for (i = 0; i < ARRAY_SIZE (c89_mathlib_name_list); i++)
192 if (!strcmp(c89_mathlib_name_list[i].realname,
193 IDENTIFIER_POINTER (func)))
195 add_to_renaming_pragma_list(func,
196 get_identifier(c89_mathlib_name_list[i].c89name));