[libre-riscv-dev] FP unit testing (was Re: [isa-dev] FP reciprocal sqrt extension proposal)

lkcl luke.leighton at gmail.com
Thu Jul 25 09:54:00 BST 2019

On Thursday, July 25, 2019 at 9:45:08 AM UTC+1, Jacob Lifshay wrote:

> The special case values should be (for reciprocal sqrt): 
> NaN -> NaN (ignoring signaling/quiet) 
> -Inf -> NaN 
> -finite -> NaN 
> -0 -> -Inf (div-by-zero; weird, but this is how ieee 754 defines it) 
> +0 -> +Inf (div-by-zero) 
> +finite -> rsqrt 
> +Inf -> +0 

do you happen to know if that's the exact order in which those tests have 
to be actioned?  the reason i ask is because i got caught out when doing 
fpsqrt special cases: i'd placed zero-testing later in the list, tested -ve 
numbers (all -ve numbers) first to return canonical-NaN, and of course 
sqrt(-ve zero) is -ve zero.

this one "-0 -> -Inf" kiiinda makes sense if the 1/ is considered to take 
precedence over sqrt() part.


More information about the libre-riscv-dev mailing list