Skip to content

Conversation

@Keno
Copy link
Contributor

@Keno Keno commented Jan 19, 2022

As discussed in JuliaLang/julia#43786, openlibm's sqrt function is incorrectly rounded for i387. IEEE requires correct rounding for these functions and LLVM relies on it. Fix that by setting the precision in the FPU control word (see e.g. e_ceil.S for similar FPU modifications).

Similar changes are not required for single precision because it does not suffer from the double rounding issue.

As discussed in JuliaLang/julia#43786, openlibm's sqrt function is incorrectly rounded for i387. IEEE requires correct rounding for these functions and LLVM relies on it. Fix that by setting the precision in the FPU control word (see e.g. e_ceil.S for similar FPU modifications).
@ViralBShah ViralBShah merged commit ae2d916 into master Jan 19, 2022
@ViralBShah ViralBShah deleted the kf/sqrtrounding branch January 19, 2022 23:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants