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

Fix rounding of some x87 instructions #951

Merged
merged 13 commits into from
Apr 14, 2024
Merged

Fix rounding of some x87 instructions #951

merged 13 commits into from
Apr 14, 2024

Conversation

Hagb
Copy link
Contributor

@Hagb Hagb commented Apr 14, 2024

The rounding is not very precise, because of the implement of math functions of gibc. It should be better than nothing though.
Trigonometric instructions (FSIN, FCOS, FSINCOS and FPTAN) still use the default rounding mode, for sin, cos and tan of glibc don't follow the current rounding mode.

@ptitSeb
Copy link
Owner

ptitSeb commented Apr 14, 2024

Why are setting the round mode for each float operation? what software requires that? For example, I don't expact any software to relly on the rounding mode for an Addition between 2 float numbers.

@Hagb
Copy link
Contributor Author

Hagb commented Apr 14, 2024

Why are setting the round mode for each float operation? what software requires that? For example, I don't expact any software to relly on the rounding mode for an Addition between 2 float numbers.

Touhou 12.3 Hisoutensoku requires it. Its netplay dependents of the accuracy of computing (mainly the four basic math operations) and converting of float. Even the tiny difference caused by a different rounding mode can lead to desynchronization in netplay.

@ptitSeb
Copy link
Owner

ptitSeb commented Apr 14, 2024

I see. Well, all those set/unset of the rounding will slow down stuff for many games that don't need it. Can you put this new code behind BOX64_DYNAREC_FASTROUND?

@Hagb
Copy link
Contributor Author

Hagb commented Apr 14, 2024

Can you put this new code behind BOX64_DYNAREC_FASTROUND?

yes of course

@Hagb
Copy link
Contributor Author

Hagb commented Apr 14, 2024

Can you put this new code behind BOX64_DYNAREC_FASTROUND?

done

src/include/setround.h Outdated Show resolved Hide resolved
@ptitSeb ptitSeb merged commit 35ea6fd into ptitSeb:master Apr 14, 2024
36 checks passed
@Hagb
Copy link
Contributor Author

Hagb commented Apr 14, 2024

Oops messages of all these commits were included in the 35ea6fd. Is this ok?

@ptitSeb
Copy link
Owner

ptitSeb commented Apr 14, 2024

Oops messages of all these commits were included in the 35ea6fd. Is this ok?

Yeah, I that's fine

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.

2 participants