[llvm] [PowerPC] Fix mask for __st[d/w/h/b]cx builtins (PR #104453)

Chen Zheng via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 19 00:35:40 PDT 2024


================
@@ -26,7 +26,7 @@ define dso_local i64 @test_stdcx(ptr %a, i64 %b) {
 ; CHECK-NEXT:    stdcx. 4, 0, 3
 ; CHECK-NEXT:    mfocrf 3, 128
 ; CHECK-NEXT:    srwi 3, 3, 28
-; CHECK-NEXT:    extsw 3, 3
+; CHECK-NEXT:    srwi 3, 3, 1
----------------
chenzheng1030 wrote:

If the `srwi` can not be merged with previous `srwi` with the changed mask, we need a follow up issue to merge these two RLWINM.

```
RLWINM 3, 3, 4, 28, 31
RLWINM 3, 3, 31, 31, 31
```

===>

```
RLWINM 3, 3, 3, 31, 31
```


https://github.com/llvm/llvm-project/pull/104453


More information about the llvm-commits mailing list