Re: RFC: Creating a more efficient sincos interface

2018-09-13 Thread Richard Biener
On September 13, 2018 4:32:42 PM GMT+02:00, Alexander Monakov wrote: >On Thu, 13 Sep 2018, Wilco Dijkstra wrote: >> What do people think? Ideally I'd like to support this in a generic >way so all targets can >> benefit, but it's also feasible to enable it on a per-target basis. >Also since not

Re: RFC: Creating a more efficient sincos interface

2018-09-13 Thread Joseph Myers
On Thu, 13 Sep 2018, Florian Weimer wrote: > I think this is totally fine if you call it expif or something like that (and > put the sine in the imaginary part, of course). And declare it in bits/cmathcalls.h as included from complex.h, rather than in math.h. With an appropriate custom

Re: RFC: Creating a more efficient sincos interface

2018-09-13 Thread Alexander Monakov
On Thu, 13 Sep 2018, Wilco Dijkstra wrote: > What do people think? Ideally I'd like to support this in a generic way so > all targets can > benefit, but it's also feasible to enable it on a per-target basis. Also > since not all libraries > will support the new interface, there would have to be

Re: RFC: Creating a more efficient sincos interface

2018-09-13 Thread Szabolcs Nagy
On 13/09/18 14:52, Florian Weimer wrote: > On 09/13/2018 03:27 PM, Wilco Dijkstra wrote: >> Hi, >> >> The existing sincos functions use 2 pointers to return the sine and cosine >> result. In >> most cases 4 memory accesses are necessary per call. This is inefficient and >> often >> significantly

Re: RFC: Creating a more efficient sincos interface

2018-09-13 Thread Florian Weimer
On 09/13/2018 03:27 PM, Wilco Dijkstra wrote: Hi, The existing sincos functions use 2 pointers to return the sine and cosine result. In most cases 4 memory accesses are necessary per call. This is inefficient and often significantly slower than returning values in registers. I ran a few

Re: RFC: Creating a more efficient sincos interface

2018-09-13 Thread H.J. Lu
On Thu, Sep 13, 2018 at 6:27 AM, Wilco Dijkstra wrote: > Hi, > > The existing sincos functions use 2 pointers to return the sine and cosine > result. In > most cases 4 memory accesses are necessary per call. This is inefficient and > often > significantly slower than returning values in

RFC: Creating a more efficient sincos interface

2018-09-13 Thread Wilco Dijkstra
Hi, The existing sincos functions use 2 pointers to return the sine and cosine result. In most cases 4 memory accesses are necessary per call. This is inefficient and often significantly slower than returning values in registers. I ran a few experiments on the new optimized sincosf