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 float->int conversion overflow behaviour #4237

Merged
merged 5 commits into from
Jan 1, 2025

Conversation

bylaws
Copy link
Collaborator

@bylaws bylaws commented Dec 28, 2024

ARM behaviour here is to saturate on overflow or NaN inputs, whereas X86 returns a sentinel value of 2^(bitsize-1), explicitly emulate this.

Closes #2995

@bylaws bylaws force-pushed the fpfix branch 4 times, most recently from 359d76d to 4539243 Compare December 28, 2024 23:25
@bylaws bylaws changed the title WIP: CI test WIP: Fix float->int conversion overflow behaviour Dec 28, 2024
@Sonicadvance1
Copy link
Member

Does this handle underflow cases as well?

@Sonicadvance1
Copy link
Member

This also fixes "The Talos Principle" timing bug with audio cutting out after a few seconds, and the intro scenes playing on superspeed.

@Sonicadvance1
Copy link
Member

This also fixes #4217

@Sonicadvance1
Copy link
Member

This also fixes Animal Well's music have chirps and pops in it.

@bylaws bylaws force-pushed the fpfix branch 5 times, most recently from 6df5706 to 7a32a1e Compare December 29, 2024 20:10
This is always used, removing it avoids needing to handle unused codepaths.
ARM behaviour here is to saturate on overflow or NaN inputs, whereas
X86 returns a sentinel value of 2^(bitsize-1), explicitly emulate this.
@bylaws bylaws marked this pull request as ready for review December 30, 2024 00:48
@bylaws bylaws changed the title WIP: Fix float->int conversion overflow behaviour Fix float->int conversion overflow behaviour Dec 30, 2024
@bylaws
Copy link
Collaborator Author

bylaws commented Dec 30, 2024

Does this handle underflow cases as well?

This works with the standard arm behaviour, this is tested now

@Sonicadvance1
Copy link
Member

Apparently this also fixes Satisfactory's dedicated server crashing.

@Sonicadvance1 Sonicadvance1 merged commit d2f86e4 into FEX-Emu:main Jan 1, 2025
11 of 12 checks passed
@neobrain
Copy link
Member

neobrain commented Jan 2, 2025

Good fix, and happy new year!

For the record though, please avoid opening placeholder PRs without a description and changing them into proper ones after the fact. If people unsubscribe for what looks like a playground PR, these updates will be missed. (Depending on the mail client, all updates will be collapsed under the original PR title as well.)

Opening a new PR instead avoids these problems.

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.

cvttpd2dq is probably broken
3 participants