[libclc] [libclc] Fix remainder calculation in clc_remquo for subnormals (PR #217925)

Wenju He via cfe-commits cfe-commits at lists.llvm.org
Fri Aug 21 21:54:30 PDT 2026


================
@@ -127,7 +127,7 @@ __clc_remquo_stret(__CLC_GENTYPE x, __CLC_GENTYPE y) {
                            ? (__CLC_CHARN)1
                            : (__CLC_CHARN)-1;
 
-    __CLC_GENTYPE t = __clc_mad(y, -__CLC_CONVERT_GENTYPE(qsgn), x);
+    __CLC_GENTYPE t = qsgn > 0 ? (x - y) : (x + y);
----------------
wenju-he wrote:

Fold the condition into previous ternary operator?
For vector code, the new ternary operator causes more redfirst instruction on intel gpu.

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


More information about the cfe-commits mailing list