Re: [AArch64] Use scvtf fbits option where appropriate

2019-06-18 Thread Richard Sandiford
Wilco Dijkstra writes: > > +/* If X is a positive CONST_DOUBLE with a value that is the reciprocal of > a > > +   power of 2 (i.e 1/2^n) return the number of float bits. e.g. for > x==(1/2^n) > > +   return n. Otherwise return -1.  */ > > +int > > +aarch64_fpconst_pow2_recip (rtx x) > > +{

Re: [AArch64] Use scvtf fbits option where appropriate

2019-06-18 Thread Wilco Dijkstra
Hi, And a few more comments: > +/* If X is a positive CONST_DOUBLE with a value that is the reciprocal of a > +   power of 2 (i.e 1/2^n) return the number of float bits. e.g. for > x==(1/2^n) > +   return n. Otherwise return -1.  */ > +int > +aarch64_fpconst_pow2_recip (rtx x) > +{ > + 

Re: [AArch64] Use scvtf fbits option where appropriate

2019-06-18 Thread Richard Earnshaw (lists)
On 18/06/2019 10:11, Joel Hutton wrote: > Hi, > > On 13/06/2019 18:26, Wilco Dijkstra wrote: >> Wouldn't it be easier to just do exact_log2 (real_to_integer (&r0)) >> and then check the range is in 1..31? > I've revised this section. >> --- a/gcc/config/aarch64/aarch64.md >> +++ b/gcc/config/aarch

Re: [AArch64] Use scvtf fbits option where appropriate

2019-06-13 Thread Wilco Dijkstra
Hi Joel, A few comments below: +/* If X is a positive CONST_DOUBLE with a value that is the reciprocal of a + power of 2 (i.e 1/2^n) return the number of float bits. e.g. for x==(1/2^n) + return log2 (n). Otherwise return 0. */ +int +aarch64_fpconst_pow2_recip (rtx x) +{ + REAL_VALUE_TYPE r