]> git.proxmox.com Git - mirror_qemu.git/commit - fpu/softfloat.c
softfloat: Move sqrt_float to softfloat-parts.c.inc
authorRichard Henderson <richard.henderson@linaro.org>
Wed, 18 Nov 2020 20:14:37 +0000 (12:14 -0800)
committerRichard Henderson <richard.henderson@linaro.org>
Thu, 3 Jun 2021 20:59:34 +0000 (13:59 -0700)
commit9261b245f061cb80410fdae7be8460eaa21a5d7d
treeba15449329741217804db6a3dba2756f9319ad6a
parent39626b0ce830e6cd99459a8168b35c6a57be21bc
softfloat: Move sqrt_float to softfloat-parts.c.inc

Rename to parts$N_sqrt.
Reimplement float128_sqrt with FloatParts128.

Reimplement with the inverse sqrt newton-raphson algorithm from musl.
This is significantly faster than even the berkeley sqrt n-r algorithm,
because it does not use division instructions, only multiplication.

Ordinarily, changing algorithms at the same time as migrating code is
a bad idea, but this is the only way I found that didn't break one of
the routines at the same time.

Tested-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
fpu/softfloat-parts.c.inc
fpu/softfloat.c