[Mesa-dev] [PATCH 3/4] r600: use ieee version of rcp

Ilia Mirkin imirkin at alum.mit.edu
Thu Nov 9 17:37:08 UTC 2017


On Thu, Nov 9, 2017 at 12:27 PM, Jan Vesely <jan.vesely at rutgers.edu> wrote:
> On Thu, 2017-11-09 at 03:58 +0100, sroland at vmware.com wrote:
>> From: Roland Scheidegger <sroland at vmware.com>
>>
>> r600 used the clamped version for rcp, whereas both evergreen and cayman
>> used the ieee version. I don't know why that discrepancy exists (it does so
>> since day 1) but there does not seem to be a valid reason for this, so make
>> it consistent. This seems now safer than before the previous commit (using
>> the mystery dx10 clamp).
>> Note that rsq still uses clamped version (as before even though the table
>> may have suggested otherwise for evergreen) for r600/eg, but not for cayman.
>
> just layman's opinion here. Does TGSI not mandate specific behaviour
> wrt nans and infinities for this OP?
>
>> I just don't feel lucky enough to change this (it should also be noted r600
>> supports sqrt natively, which is always ieee, therefore might not really see
>> rsqrt with glsl often presumably).
>
> why would that be? isn't RECIPSQRT_IEEE(x) still optimization over
> RECIP_IEEE(SQRT(x))?

More like the other way... SQRT is an opt of 1/RSQ. Traditionally GPUs
haven't had SQRT ops. NVIDIA still doesn't have one. Shader code tends
to be written with that knowledge in mind.

  -ilia


More information about the mesa-dev mailing list