summaryrefslogtreecommitdiff
path: root/gcc/convert.c
diff options
context:
space:
mode:
authoruros <uros@138bc75d-0d04-0410-961f-82ee72b054a4>2005-04-11 06:16:39 +0000
committeruros <uros@138bc75d-0d04-0410-961f-82ee72b054a4>2005-04-11 06:16:39 +0000
commitac14875119315347b004b4b1a55fa4f7915396a2 (patch)
tree4f8876fc98292146b6f2b8bf4a5835e8ae42a92c /gcc/convert.c
parent13d02b5eeca399aa36c126a556321d605f9bac82 (diff)
downloadgcc-ac14875119315347b004b4b1a55fa4f7915396a2.tar.gz
* builtins.def (BUILT_IN_LCEIL, BUILT_IN_LCEILF, BUILT_IN_LCEILL)
(BUILT_IN_LLCEIL, BUILT_IN_LLCEILF, BUILT_IN_LLCEILL): New. * optabs.h (enum optab_index): Add new OTI_lceil. (lceil_optab): Define corresponding macro. * optabs.c (init_optabs): Initialize lceil_optab. * genopinit.c (optabs): Implement lceil_optab using lceilsi2 and lceildi2 patterns. * builtins.c (expand_builtin_int_roundingfn): Handle BUILT_IN_LCEIL{,F,L} and BUILT_IN_LLCEIL{,F,L}. (fold_builtin_int_roundingfn): Handle BUILT_IN_LCEIL{,F,L} and BUILT_IN_LLCEIL{,F,L}. (fold_builtin_1): Fold BUILT_IN_LCEIL{,F,L} and BUILT_IN_LLCEIL{,F,L} using fold_builtin_int_roundingfn. (mathfn_built_in): Handle BUILT_IN LCEIL and BUILT_IN_LLCEIL. (expand_builtin): Expand BUILT_IN_LCEIL{,F,L} and BUILT_IN_LLCEIL{,F,L} using expand_builtin_int_roundingfn. * convert.c (convert_to_integer): Convert (long int)ceil{,f,l}, into lceil built-in function and (long long int)ceil{,f,l} into llceil built-in function. * fold-const.c (tree_expr_nonnegative_p): Add BUILT_IN_LCEIL and BUILT_IN_LLCEIL. testsuite: * gcc.dg/builtins-53.c: Also check (int)ceil* and (long long int)ceil*. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@97964 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/convert.c')
-rw-r--r--gcc/convert.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/gcc/convert.c b/gcc/convert.c
index 79aef2140cf..9ae300d21f2 100644
--- a/gcc/convert.c
+++ b/gcc/convert.c
@@ -349,6 +349,13 @@ convert_to_integer (tree type, tree expr)
switch (fcode)
{
+ case BUILT_IN_CEIL: case BUILT_IN_CEILF: case BUILT_IN_CEILL:
+ if (TYPE_MAIN_VARIANT (type) == TYPE_MAIN_VARIANT (long_long_integer_type_node))
+ fn = mathfn_built_in (s_intype, BUILT_IN_LLCEIL);
+ else
+ fn = mathfn_built_in (s_intype, BUILT_IN_LCEIL);
+ break;
+
case BUILT_IN_FLOOR: case BUILT_IN_FLOORF: case BUILT_IN_FLOORL:
if (TYPE_MAIN_VARIANT (type) == TYPE_MAIN_VARIANT (long_long_integer_type_node))
fn = mathfn_built_in (s_intype, BUILT_IN_LLFLOOR);