Partword atomic binaries are not zero extended as they should be.
This patch fixes them to ensure that they are zero extended.
Details
- Reviewers
nemanjai lei - Group Reviewers
Restricted Project - Commits
- rG45ad207e4585: [PowerPC] Add fix to partword atomic operations
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
LGTM. Of course, please ensure that this fixes the issue when the dependent patch is applied prior to committing this.
llvm/lib/Target/PowerPC/PPCISelLowering.cpp | ||
---|---|---|
11359 | // Since the shift amount is not a constant, we need to clear // the upper bits with a separate RLWINM. | |
llvm/test/CodeGen/PowerPC/ppc-partword-atomic.ll | ||
103 | Presumably this goes away when https://reviews.llvm.org/D101342 lands? Can you please apply that on top of this patch to make sure? Similarly with line 49. |
llvm/test/CodeGen/PowerPC/ppc-partword-atomic.ll | ||
---|---|---|
103 |
I have checked this and if I add the patch D101342 then those two lines disappear. --- a/llvm/test/CodeGen/PowerPC/ppc-partword-atomic.ll +++ b/llvm/test/CodeGen/PowerPC/ppc-partword-atomic.ll @@ -46,10 +46,9 @@ define dso_local zeroext i32 @testI8(i8 zeroext %val) local_unnamed_addr #0 { ; PWR9-NEXT: stbcx. 3, 0, 5 ; PWR9-NEXT: bne 0, .LBB0_1 ; PWR9-NEXT: # %bb.2: # %entry -; PWR9-NEXT: clrlwi 3, 4, 24 -; PWR9-NEXT: addis 4, 2, global_int@toc@ha +; PWR9-NEXT: addis 3, 2, global_int@toc@ha ; PWR9-NEXT: lwsync -; PWR9-NEXT: stw 3, global_int@toc@l(4) +; PWR9-NEXT: stw 4, global_int@toc@l(3) ; PWR9-NEXT: li 3, 55 ; PWR9-NEXT: blr entry: @@ -100,10 +99,9 @@ define dso_local zeroext i32 @testI16(i16 zeroext %val) local_unnamed_addr #0 { ; PWR9-NEXT: sthcx. 3, 0, 5 ; PWR9-NEXT: bne 0, .LBB1_1 ; PWR9-NEXT: # %bb.2: # %entry -; PWR9-NEXT: clrlwi 3, 4, 16 -; PWR9-NEXT: addis 4, 2, global_int@toc@ha +; PWR9-NEXT: addis 3, 2, global_int@toc@ha ; PWR9-NEXT: lwsync -; PWR9-NEXT: stw 3, global_int@toc@l(4) +; PWR9-NEXT: stw 4, global_int@toc@l(3) ; PWR9-NEXT: li 3, 55 ; PWR9-NEXT: blr entry: |