Re: [PATCH] Builtin function roundeven folding implementation

2019-08-25 Thread Tejas Joshi
Hi. This is the full patch for roundeven folding. The patch bootstraps and passes regression tests. 2019-08-25 Tejas Joshi Martin Jambor * builtins.c (mathfn_built_in_2): Added CASE_MATHFN_FLOATN for ROUNDEVEN. * builtins.def: Added function definitions fo

Re: [PATCH] Builtin function roundeven folding implementation

2019-08-23 Thread Joseph Myers
On Fri, 23 Aug 2019, Tejas Joshi wrote: > diff --git a/gcc/builtins.c b/gcc/builtins.c > index 9a766e4ad63..5149d901a96 100644 > --- a/gcc/builtins.c > +++ b/gcc/builtins.c > @@ -2056,6 +2056,7 @@ mathfn_built_in_2 (tree type, combined_fn fn) > CASE_MATHFN (REMQUO) > CASE_MATHFN_FLOATN (

Re: [PATCH] Builtin function roundeven folding implementation

2019-08-23 Thread Martin Jambor
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 > Martin Jambor > >

Re: [PATCH] Builtin function roundeven folding implementation

2019-08-22 Thread Tejas Joshi
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 Martin Jambor * builtins.c (mathfn_built_in_2): Added CASE_MATHFN for R

Re: [PATCH] Builtin function roundeven folding implementation

2019-08-22 Thread Joseph Myers
On Thu, 22 Aug 2019, Martin Jambor wrote: > +/* Round X to nearest integer, rounding halfway cases towards even. */ > + > +void > +real_roundeven (REAL_VALUE_TYPE *r, format_helper fmt, > + const REAL_VALUE_TYPE *x) > +{ > + if (is_halfway_below (x)) > + { > +do_add (r, x, &dcon

Re: [PATCH] Builtin function roundeven folding implementation

2019-08-22 Thread Martin Jambor
Hi, On Wed, Aug 21 2019, Joseph Myers wrote: > On Wed, 21 Aug 2019, Martin Jambor wrote: > >> - I have listed roundeven variants in extend.texi. If I did not find >> the right spot, I will gladly move to a more appropriate one. > > I don't think they should be documented with the __builtin_

Re: [PATCH] Builtin function roundeven folding implementation

2019-08-21 Thread Joseph Myers
On Wed, 21 Aug 2019, Martin Jambor wrote: > - I have listed roundeven variants in extend.texi. If I did not find > the right spot, I will gladly move to a more appropriate one. I don't think they should be documented with the __builtin_* that are always expanded inline. They should be do

Re: [PATCH] Builtin function roundeven folding implementation

2019-08-21 Thread Martin Jambor
Hi, On Wed, Aug 21 2019, Joseph Myers wrote: > On Wed, 21 Aug 2019, Martin Jambor wrote: > >> Hi Tejas, >> >> On Wed, Aug 14 2019, Tejas Joshi wrote: >> > Hi. >> > Here is a clean patch that does not fold roundeven resulting for >> > integer type and the conditions for folding functions >> > roun

Re: [PATCH] Builtin function roundeven folding implementation

2019-08-21 Thread Joseph Myers
On Wed, 21 Aug 2019, Martin Jambor wrote: > Hi Tejas, > > On Wed, Aug 14 2019, Tejas Joshi wrote: > > Hi. > > Here is a clean patch that does not fold roundeven resulting for > > integer type and the conditions for folding functions > > round/ceil/floor/roundeven and trunc only checks for signali

Re: [PATCH] Builtin function roundeven folding implementation

2019-08-21 Thread Martin Jambor
Hi Tejas, On Wed, Aug 14 2019, Tejas Joshi wrote: > Hi. > Here is a clean patch that does not fold roundeven resulting for > integer type and the conditions for folding functions > round/ceil/floor/roundeven and trunc only checks for signaling NaN. wouldn't checking for *signalling* NaNs mean usi

Re: [PATCH] Builtin function roundeven folding implementation

2019-08-13 Thread Tejas Joshi
Hi. Here is a clean patch that does not fold roundeven resulting for integer type and the conditions for folding functions round/ceil/floor/roundeven and trunc only checks for signaling NaN. This patch also conforms to GNU's coding style and standards. The fact that it should be CASE_MATHFN_FLOATN

Re: [PATCH] Builtin function roundeven folding implementation

2019-08-09 Thread Joseph Myers
On Fri, 28 Jun 2019, Tejas Joshi wrote: > +CASE_CFN_ROUNDEVEN: > +CASE_CFN_ROUNDEVEN_FN: > + if (!REAL_VALUE_ISNAN (*arg) || !flag_errno_math) Checking flag_errno_math here does not make sense. roundeven never sets errno (at least, TS 18661-1 makes it implementation-defined whether

Re: [PATCH] Builtin function roundeven folding implementation

2019-07-29 Thread Martin Jambor
Hi Joseph, can you please have look at this patch from Tejas, whether it is perhaps ready to be committed to trunk or what things still need to be addressed? Thanks a lot, Martin On Fri, Jun 28 2019, Tejas Joshi wrote: > Hi. > This patch includes implementation of new function roundeven along

[PATCH] Builtin function roundeven folding implementation

2019-06-27 Thread Tejas Joshi
Hi. This patch includes implementation of new function roundeven along with two utility functions. The patch bootstraps on x86_64-linux-gnu and passes regression tests. Thanks, Tejas gcc/ChangeLog: 2019-06-12 Tejas Joshi * builtins.c (mathfn_built_in_2): Added CASE_MATHFN for ROUNDEVEN.