This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH, midlevel]: Convert (int)ceil -> lceil


On Sat, 9 Apr 2005, Uros Bizjak wrote:
> 2005-04-09  Uros Bizjak  <uros@kss-loka.si>
>
>     * 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*.
>

This is OK for mainline.

Thanks,

Roger
--


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]