[PATCH]: PR29335 use MPFR for builtin sincos

Richard Guenther richard.guenther@gmail.com
Wed Nov 1 16:10:00 GMT 2006


On 11/1/06, Kaveh R. GHAZI <ghazi@caip.rutgers.edu> wrote:
> On Wed, 1 Nov 2006, Richard Guenther wrote:
>
> > On 11/1/06, Kaveh R. GHAZI <ghazi@caip.rutgers.edu> wrote:
> > > This patch uses MPFR for builtin sincos.
> > >
> > > For a call like sincos(0.0,s,c), where "s" and "c" are pointers, I
> > > transform this into e.g. "(void)(*s=0.0,*c=1.0)".
> > >
> > > Bootstrapped on sparc-sun-solaris2.10, no regressions.  The new testcases
> > > all pass.  In the transcendental accuracy testsuite, there is no sincos
> > > test, however I was able to shoehorn the values used in the sin and cos
> > > tests through builtin sincos and they all get "perfect" results.
> > >
> > > Okay for mainline?
> >
> > This might transform a valid gimple statement into a non-gimple one - did
> > you verify that the various places that might fold the statement correctly
> > handle this case?
> > Richard.
>
> Sorry, how would I go about checking that?  I mean ensuring *all* "the
> various places that might fold the statement".  I want to make sure I do
> an exhaustive check.

The most obvious place is fold_stmt and the DOM pass.  Then of course
the propagator engine and FRE/PRE folding.  I would start with simple
testcases like

 double zero = 0.0;
 sincos(zero, &s, &c);

to get the propagator engine folding after CCP.  Then maybe generate
some testcases with control flow that move the folding possibility to later
passes.  Otherwise an exhaustive check is difficult ;)

Richard.



More information about the Gcc-patches mailing list