dtcxzyw opened a new pull request, #12811: URL: https://github.com/apache/nuttx/pull/12811
## Summary Use `signbit(y)` instead of `y < 0` to fix the result of copysign/copysignl: https://alive2.llvm.org/ce/z/kjNLyh ``` copysign(+0.0, -0.0) returns +0.0. It should be -0.0. copysign(+0.0, NaN with signbit) returns +0.0. It should be -0.0. ``` I found this bug while working on my LLVM middle-end optimization patch https://github.com/llvm/llvm-project/pull/101324. Don't worry about the potential performance regression. I will file another PR in LLVM to handle this pattern :) ## Impact Fix the implementation of copysign/copysignl. ## Testing x86 with -O3 -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
