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] Builtin function roundeven folding implementation


Hi,

On Fri, Aug 23 2019, Tejas Joshi wrote:
> Hi,
> This is a full patch for the roundeven variants along with
> documentation and additional testcases. The following code also
> conforms to GNU's coding standards.
>
> Thanks,
> Tejas
>
> 2019-08-22  Tejas Joshi  <tejasjoshi9673@gmail.com>
>             Martin Jambor  <mjambor@suse.cz>
>
>         * builtins.c (mathfn_built_in_2): Added CASE_MATHFN for ROUNDEVEN.
>         * builtins.def: Added function definitions for roundeven function
>         variants.
>         * fold-const-call.c (fold_const_call_ss): Added case for roundeven
>         function call.
>         * fold-const.c (negate_mathfn_p): Added case for roundeven function.
>         (tree_call_nonnegative_warnv_p): Added case for roundeven function.
>         (integer_valued_real_call_p): Added case for roundeven function.
>         * real.c (is_even): New function. Returns true if real number is even,
>         otherwise returns false.
>         (is_halfway_below): New function. Returns true if real number is
>         halfway between two integers, else return false.
>         (real_roundeven): New function. Round real number to nearest integer,
>         rounding halfway cases towards even.
>         * real.h (real_value): Added descriptive comments.  Added function
>         declaration for roundeven function.
>         * doc/extend.texi (Other Builtins): List roundeven variants among
>         functions which can be handled as builtins.
>
> gcc/testsuite/ChangeLog:
>
> 2019-08-21  Tejas Joshi  <tejasjoshi9673@gmail.com>
>
>         * gcc.dg/torture/builtin-round-roundeven.c: New test.
>         * gcc.dg/torture/builtin-round-roundevenf128.c: New test.

For the record, I bootstrapped and tested the patch on an x86_64-linux
and it passes both fine.

Joseph, please have a look and hopefully this is the version that I can
commit?

Thanks,

Martin


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