round: Abolished the CPU rounding mode change and modified it to a different logic. #13435
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This doesn't happen with llvm 15.0.7, but I expect there are many users using 15.0.0, so I fixed it.The llvm that comes with MacOS from the beginning may be 15.0.0, and to use 15.0.7 we need to install it from homebrew.
When I compared the assembly code, the one using llvm 15.0.0 was calculatingplaces > 0 ? value * exponent : value / exponent
before the CPU round mode change, so I made fix like this.failed test:
https://github.com/php/php-src/actions/runs/7945635002/job/21692533874
testing in my repo:https://github.com/SakiTakamachi/php-src/actions/runs/7968042924/job/21751687740#pragma STDC FENV_ACCESS ON
is included in C99, but many compilers do not support it.Based on that, I decided that the CPU rounding mode change feature should not be used even if it existed, and I modified it to a different logic that does not use it.