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

uǝlƃ ↙↙↙ gepropella at gmail.com
Thu Jan 7 19:09:19 EST 2021


Great idea! Thanks. I'd tried gcc -S. Whew is my ASM rusty. But objdump -d doesn't show any rsqrt instructions. 

On 1/7/21 3:46 PM, Marcus Daniels wrote:
> 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