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

release/18.x: [Mips] Fix missing sign extension in expansion of sub-word atomic max (#77072) #84566

Closed
wants to merge 1 commit into from

Conversation

llvmbot
Copy link
Member

@llvmbot llvmbot commented Mar 8, 2024

Backport 755b439

Requested by: @brad0

…llvm#77072)

Add sign extension "SEB/SEH" before compare.

Fix llvm#61881

(cherry picked from commit 755b439)
@llvmbot llvmbot added this to the LLVM 18.X Release milestone Mar 8, 2024
@llvmbot
Copy link
Member Author

llvmbot commented Mar 8, 2024

@topperc What do you think about merging this PR to the release branch?

@brad0
Copy link
Contributor

brad0 commented Mar 11, 2024

@topperc

@@ -2001,8 +2225,6 @@ define i16 @test_umax_16(ptr nocapture %ptr, i16 signext %val) {
; MIPSELR6-NEXT: $BB6_1: # %entry
; MIPSELR6-NEXT: # =>This Inner Loop Header: Depth=1
; MIPSELR6-NEXT: ll $2, 0($6)
; MIPSELR6-NEXT: and $2, $2, $8
Copy link
Collaborator

@topperc topperc Mar 19, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@brad0 I think I missed this in the previous review. Why is it ok to remove the AND from the unsigned tests? My original comment about the AND being unnecessary was for the signed cases.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@brad0 I think I missed this in the previous review. Why is it ok to remove the AND from the unsigned tests? My original command about the AND being unnecssary was for the signed cases.

Looking at the PR I am not sure that was clear and @yingopq might have interpreted your comment as to remove all together.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@topperc Sorry, I misunderstand the previous review opinion. I tested the code with removing all and and did not find any issue, then I submit the patch. If you think it was wrong, I would submit again. Is it need?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@yingopq I'm not really a Mips expert so I'm not sure. But my understanding is that the and was clearing the upper and lower bits so that the unsigned min/max would only consider the byte or half word that it should and not any other values around it in memory.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I would submit again soon. Thanks.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@topperc I have submit pr: #85902, please help review, thanks again.

@brad0 brad0 closed this Mar 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

Successfully merging this pull request may close these issues.

4 participants