-
Notifications
You must be signed in to change notification settings - Fork 12.5k
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
[MIPS] Incorrect expansion of sub-word signed atomic max #61881
Comments
@llvm/issue-subscribers-backend-mips |
Hi @Amanieu, |
If you look at the assembly code, it is extracting the byte from the word by masking it (lines marked |
The current implementation will happen to work if the byte is the top byte in the word, since no sign-extension is required them. But in other cases the result will be incorrect. |
Add sign extension "SEB/SEH" before compare. Fix llvm#61881
Add sign extension "SEB/SEH" before compare. Fix llvm#61881
Add sign extension "SEB/SEH" before compare. Fix llvm#61881
…llvm#77072) Add sign extension "SEB/SEH" before compare. Fix llvm#61881 (cherry picked from commit 755b439)
Add sign extension "SEB/SEH" before compare. Fix llvm#61881
…llvm#77072) Add sign extension "SEB/SEH" before compare. Fix llvm#61881 (cherry picked from commit 755b439)
…x processing. (llvm#85902) Fix llvm#61881 (cherry picked from commit 5d7fd6a)
…llvm#77072) Add sign extension "SEB/SEH" before compare. Fix llvm#61881 (cherry picked from commit 755b439)
…x processing. (llvm#85902) Fix llvm#61881 (cherry picked from commit 5d7fd6a)
In order for the following `SLT` instruction to work properly, we need to sign-extend appropriate subwords. In addition, subwords must remain in the same position from before sign-extension. Resolves llvm#61881. Also, downstream bugs rust-lang/rust#100650 and rust-lang/rust#123772 are fixed.
In order for the following `SLT` instruction to work properly, we need to sign-extend appropriate subwords. In addition, subwords must remain in the same position from before sign-extension. Resolves llvm#61881. Also, downstream bugs rust-lang/rust#100650 and rust-lang/rust#123772 are fixed.
IR
Asm (
-march=mipsel
)The problem
The expansion of
i8
signed atomic max masks out all bits that are not involved, but fails to sign-extend the values before passing them toslt
for a proper signed comparison.Downstream bug: rust-lang/rust#100650
The text was updated successfully, but these errors were encountered: