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

Reduce assert to a warning for extrq and insertq #1115

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

OFFTKP
Copy link
Contributor

@OFFTKP OFFTKP commented Sep 27, 2024

Infamous second son hits the extrq assert during this instruction:
extrq xmm5 (980279e5d07bb9d3), xmm4 (2f0c00003d00), rip: 90088ca84

xmm4 has lowest 5 bits to 0 which means mask length is 0, and according to the spec a mask length of 0 means a mask of all 64 bits.

When index + length is bigger than 64 bits, the spec says it's undefined behavior. However instead of crashing it can give a warning and continue operation like normal.

It would be good to test on a real ps4 with homebrew in the future to get the correct behavior, it could be the case that it picks up bits from the high 64 bits of the xmm register, but I think it's more likely this isn't the case, since normally this instruction only operates on the low 64 bits.

It was tested on turtle's AMD cpu and the result is what I expected it to be. I think a warning should exist regardless since it's probably going to be quite rare, and for the very slight chance PS4's Jaguar does something different.

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.

1 participant