Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[NativeAOT] Rounding helpers use wrong rounding algorithm #97922

Closed
Tracked by #97729
filipnavara opened this issue Feb 3, 2024 · 1 comment · Fixed by #97964
Closed
Tracked by #97729

[NativeAOT] Rounding helpers use wrong rounding algorithm #97922

filipnavara opened this issue Feb 3, 2024 · 1 comment · Fixed by #97964

Comments

@filipnavara
Copy link
Member

filipnavara commented Feb 3, 2024

RhpFltRound/RhpDblRound are implemented using round/roundf. That's incorrect, since .NET default is round to even. Similar issue was recently fixed in NativeAOT-LLVM.

Unfortunately, roundeven/roundevenf methods are only available in C23 standard. They are implemented on glibc 2.25+ (current .NET requirement is 2.23) and missing on Bionic/MUSL libc. CoreCLR uses a custom implementation which can presumably be reused.

@ghost ghost added the untriaged New issue has not been triaged by the area owner label Feb 3, 2024
@ghost
Copy link

ghost commented Feb 3, 2024

Tagging subscribers to this area: @agocke, @MichalStrehovsky, @jkotas
See info in area-owners.md if you want to be subscribed.

Issue Details

RhpFltRound/RhpDblRound are implemented using round/roundf. That's incorrect, since .NET default is round to even. Similar issue was recently fixed in NativeAOT-LLVM.

Unfortunately, roundeven/roundevenf methods are only available in C23 standard. They are implemented on glibc 2.25+ (current .NET requirement is 2.23) and missing on Bionic libc. CoreCLR uses a custom implementation which can presumably be reused.

Author: filipnavara
Assignees: -
Labels:

area-NativeAOT-coreclr

Milestone: -

@ghost ghost added the in-pr There is an active PR which will close this issue when it is merged label Feb 5, 2024
@ghost ghost removed in-pr There is an active PR which will close this issue when it is merged untriaged New issue has not been triaged by the area owner labels Feb 6, 2024
@github-actions github-actions bot locked and limited conversation to collaborators Mar 7, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

1 participant