[libclc] [libclc] Refine __clc_fp*_subnormals_supported and __clc_flush_denormal_if_not_supported (PR #157633)

Wenju He via cfe-commits cfe-commits at lists.llvm.org
Sun Jan 25 20:51:27 PST 2026


================
@@ -65,14 +55,12 @@ bool __attribute__((noinline)) __clc_runtime_has_hw_fma32(void);
 
 #define LOG_MAGIC_NUM_SP32 (1 + NUMEXPBITS_SP32 - EXPBIAS_SP32)
 
-_CLC_OVERLOAD _CLC_INLINE float __clc_flush_denormal_if_not_supported(float x) {
-  int ix = __clc_as_int(x);
-  if (!__clc_fp32_subnormals_supported() && ((ix & EXPBITS_SP32) == 0) &&
-      ((ix & MANTBITS_SP32) != 0)) {
-    ix &= SIGNBIT_SP32;
-    x = __clc_as_float(ix);
-  }
-  return x;
+_CLC_OVERLOAD _CLC_INLINE float __clc_soft_flush_denormal(float x) {
+  // Avoid calling __clc_fp32_subnormals_supported here: it uses
----------------
wenju-he wrote:

Restored function __clc_flush_denormal_if_not_supported and its original implementation in https://github.com/llvm/llvm-project/pull/157633/changes/23d0ff723f2f84f0d73b19bf785b4a8bd4d58f6a and https://github.com/llvm/llvm-project/pull/157633/changes/34cd062650a81393b0861ac48e285f7c393daeb3

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


More information about the cfe-commits mailing list