You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by "dtcxzyw (via GitHub)" <gi...@apache.org> on 2024/07/31 12:53:03 UTC
[PR] libm/copysign: respect signed zero/NaN handling in copysign [nuttx]
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: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] libm/copysign: respect signed zero/NaN handling in copysign [nuttx]
Posted by "xiaoxiang781216 (via GitHub)" <gi...@apache.org>.
xiaoxiang781216 merged PR #12811:
URL: https://github.com/apache/nuttx/pull/12811
--
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: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org