aboutsummaryrefslogtreecommitdiff
path: root/gcc/fold-const.c
diff options
context:
space:
mode:
authorMichael Meissner <meissner@linux.vnet.ibm.com>2017-12-28 21:19:12 +0000
committerMichael Meissner <meissner@gcc.gnu.org>2017-12-28 21:19:12 +0000
commitc6cfa2bfa09ac95dd01fa7927fa80274f9583823 (patch)
tree150679d60c4befc77e534f93d662b51e48277224 /gcc/fold-const.c
parentec8a1b8d931ccdfa87d712028226a03ff17f6cef (diff)
downloadgcc-c6cfa2bfa09ac95dd01fa7927fa80274f9583823.zip
gcc-c6cfa2bfa09ac95dd01fa7927fa80274f9583823.tar.gz
gcc-c6cfa2bfa09ac95dd01fa7927fa80274f9583823.tar.bz2
builtins.def: (_Float<N> and _Float<N>X BUILT_IN_CEIL): Add _Float<N> and _Float<N>X variants...
[gcc] 2017-12-28 Michael Meissner <meissner@linux.vnet.ibm.com> * builtins.def: (_Float<N> and _Float<N>X BUILT_IN_CEIL): Add _Float<N> and _Float<N>X variants for rounding built-in functions. (_Float<N> and _Float<N>X BUILT_IN_FLOOR): Likewise. (_Float<N> and _Float<N>X BUILT_IN_NEARBYINT): Likewise. (_Float<N> and _Float<N>X BUILT_IN_RINT): Likewise. (_Float<N> and _Float<N>X BUILT_IN_ROUND): Likewise. (_Float<N> and _Float<N>X BUILT_IN_TRUNC): Likewise. * builtins.c (mathfn_built_in_2): Likewise. * internal-fn.def (CEIL): Likewise. (FLOOR): Likewise. (NEARBYINT): Likewise. (RINT): Likewise. (ROUND): Likewise. (TRUNC): Likewise. * convert.c (convert_to_integer_1): Likewise. * fold-const.c (tree_call_nonnegative_warnv_p): Likewise. (integer_valued_real_call_p): Likewise. * fold-const-call.c (fold_const_call_ss): Likewise. * gencfn-macros.c (print_case_cfn): Change CFN and operator printers to take a const char * suffix instead of a bool. (print_define_operator_list): Likewise. (fltall_suffixes): New list of suffixes, that include the traditional suffixes as well as all of the _Float<N> and _Float<N>X suffixes. (main): For _Float<N> and _Float<N>X functions, emit both <name>_FN and <name>_ALL variants. The <macro>_FN variant only has the _Float<N> and _Float<N>X case names or operators. The <name>_ALL variant has both the traditional and the _Float<N>/_Float<N>X case names or operators. * match.pd (COPYSIGN optimizations): Provide optimizations for _Float<N> and _Float<N>X types where possible. (MIN/MAX optimizations): Likewise. (sqrt optimizations): Likewise. (rounding optimizations): Likewise. [gcc/c] 2017-12-28 Michael Meissner <meissner@linux.vnet.ibm.com> * c-decl.c (header_for_builtin_fn): Add integer rounding _Float<N> and _Float<N>X built-in functions. From-SVN: r256026
Diffstat (limited to 'gcc/fold-const.c')
-rw-r--r--gcc/fold-const.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/gcc/fold-const.c b/gcc/fold-const.c
index 10a67b2..e776108 100644
--- a/gcc/fold-const.c
+++ b/gcc/fold-const.c
@@ -13004,9 +13004,11 @@ tree_call_nonnegative_warnv_p (tree type, combined_fn fn, tree arg0, tree arg1,
CASE_CFN_ATANH:
CASE_CFN_CBRT:
CASE_CFN_CEIL:
+ CASE_CFN_CEIL_FN:
CASE_CFN_ERF:
CASE_CFN_EXPM1:
CASE_CFN_FLOOR:
+ CASE_CFN_FLOOR_FN:
CASE_CFN_FMOD:
CASE_CFN_FREXP:
CASE_CFN_ICEIL:
@@ -13024,8 +13026,11 @@ tree_call_nonnegative_warnv_p (tree type, combined_fn fn, tree arg0, tree arg1,
CASE_CFN_LROUND:
CASE_CFN_MODF:
CASE_CFN_NEARBYINT:
+ CASE_CFN_NEARBYINT_FN:
CASE_CFN_RINT:
+ CASE_CFN_RINT_FN:
CASE_CFN_ROUND:
+ CASE_CFN_ROUND_FN:
CASE_CFN_SCALB:
CASE_CFN_SCALBLN:
CASE_CFN_SCALBN:
@@ -13034,6 +13039,7 @@ tree_call_nonnegative_warnv_p (tree type, combined_fn fn, tree arg0, tree arg1,
CASE_CFN_SINH:
CASE_CFN_TANH:
CASE_CFN_TRUNC:
+ CASE_CFN_TRUNC_FN:
/* True if the 1st argument is nonnegative. */
return RECURSE (arg0);
@@ -13539,11 +13545,17 @@ integer_valued_real_call_p (combined_fn fn, tree arg0, tree arg1, int depth)
switch (fn)
{
CASE_CFN_CEIL:
+ CASE_CFN_CEIL_FN:
CASE_CFN_FLOOR:
+ CASE_CFN_FLOOR_FN:
CASE_CFN_NEARBYINT:
+ CASE_CFN_NEARBYINT_FN:
CASE_CFN_RINT:
+ CASE_CFN_RINT_FN:
CASE_CFN_ROUND:
+ CASE_CFN_ROUND_FN:
CASE_CFN_TRUNC:
+ CASE_CFN_TRUNC_FN:
return true;
CASE_CFN_FMIN: