[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


================
@@ -2016,9 +2016,9 @@ def SLBSYNC : XForm_0<31, 338, (outs), (ins), "slbsync", IIC_SprSLBSYNC, []>;
 } // IsISA3_0
 
 def : Pat<(int_ppc_stdcx ForceXForm:$dst, g8rc:$A),
-          (STDCX g8rc:$A, ForceXForm:$dst)>;
+          (RLWINM (STDCX g8rc:$A, ForceXForm:$dst), 31, 1, 31)>;
 def : Pat<(PPCStoreCond ForceXForm:$dst, g8rc:$A, 8),
-          (STDCX g8rc:$A, ForceXForm:$dst)>;
+          (RLWINM (STDCX g8rc:$A, ForceXForm:$dst), 31, 1, 31)>;
----------------
chenzheng1030 wrote:

The mask seems not right. To get the `EQ` bit of CR0, we need `RLWINM (CR0INGPR), 31, 31, 31`

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


More information about the llvm-commits mailing list