[FRIAM] Q_rsqrt() vs 1/sqrt()

Marcus Daniels marcus at snoutfarm.com
Thu Jan 7 18:46:25 EST 2021


There's a reciprocal sqrt instruction in SSE (x86) that your compiler may be pattern matching to, depending on your compiler options.   You could disassemble to see what you get from the latter.

-----Original Message-----
From: Friam <friam-bounces at redfish.com> On Behalf Of u?l? ???
Sent: Thursday, January 7, 2021 3:24 PM
To: FriAM <friam at redfish.com>
Subject: [FRIAM] Q_rsqrt() vs 1/sqrt()

https://en.wikipedia.org/wiki/Fast_inverse_square_root

So, why is Q_rsqrt() *slower* than 1/sqrt()?

1/sqrt() took 0.294771 s
Q_rsqrt() took 0.51579 s

-- 
↙↙↙ uǝlƃ


More information about the Friam mailing list