Reduce assert to a warning for extrq and insertq #1115
+16
−2
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.