[llvm] [AMDGPU] Improve codegen for copysign(x, fneg(y)) (PR #207178)

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 21 10:47:32 PDT 2026


================
@@ -7291,4 +7291,175 @@ define <2 x half> @v_copysign_v2f16_0_v2bf64(<2 x double> %sign) {
   ret <2 x half> %op
 }
 
+define amdgpu_ps half @s_copysign_f16_0_fneg(half inreg %sign) {
+; SIVI-LABEL: s_copysign_f16_0_fneg:
+; SIVI:       ; %bb.0:
+; SIVI-NEXT:    s_xor_b32 s0, s0, 0x80000000
----------------
arsenm wrote:

Probably could handle the s cases better, but best for follow up 

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


More information about the llvm-commits mailing list