[PATCH] Improve performance of sinf/cosf/sincosf

Wilco Dijkstra Wilco.Dijkstra@arm.com
Tue Jun 19 11:38:00 GMT 2018


Jon Beniston wrote:

>16-bit - ~200% worse and wrong results

> This can be fixed in reduce_fast, by changing: 
>
> -  int n = ((int)r + 0x800000) >> 24;
> +  int n = ((int32_t)r + 0x800000) >> 24;
>
> It's then ~400% slower, but gets the right answer.

Thanks for testing, I'll fix it. Note the new math code isn't enabled on any
targets currently except for Arm CPUs with 64-bit hardware FP and AArch64.
It shouldn't be used on 16-bit targets or on targets without floating point
hardware - for those the only reasonable implementation is fixed point
arithmetic.

Wilco


    


More information about the Newlib mailing list