GPUOpen-Drivers / llpc

LLVM-Based Pipeline Compiler
MIT License
166 stars 115 forks source link

Fix signed zero issue of atan2(y,x) #2796

Closed amdrexu closed 11 months ago

amdrexu commented 11 months ago

When y = 0 and x < 0, we must decide the final result according the sign of y. If y = -0.0, the result is -PI. If y = 0.0, the result is PI. This could be simplified as follow:

atan2(y, x) = copysign(PI, y) when y = 0 and x < 0

amdvlk-admin commented 11 months ago

Test summary for commit 446e7d604de23044818467f20b376eac1360460c

CTS tests (Failed: 0/137941)
  • Built with version 1.3.5.2
  • Ubuntu navi3x, Srdcvk
    • Passed: 35353/68939 (51.3%)
    • Failed: 0/68939 (0.0%)
    • Not Supported: 33586/68939 (48.7%)
    • Warnings: 0/68939 (0.0%)
    Ubuntu navi2x, Srdcvk
    • Passed: 35424/69002 (51.3%)
    • Failed: 0/69002 (0.0%)
    • Not Supported: 33578/69002 (48.7%)
    • Warnings: 0/69002 (0.0%)