This is the mail archive of the
newlib@sourceware.org
mailing list for the newlib project.
Re: [PATCH] Improve performance of sinf/cosf/sincosf
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