[llvm-branch-commits] [libclc] libclc: Really implement denormal config checks (PR #187356)

Matt Arsenault via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Thu Mar 19 00:51:19 PDT 2026


================
@@ -6,8 +6,29 @@
 //
 //===----------------------------------------------------------------------===//
 
+#include "clc/float/definitions.h"
 #include "clc/math/clc_subnormal_config.h"
 
-_CLC_DEF bool __clc_denormals_are_zero_fp16() { return false; }
-_CLC_DEF bool __clc_denormals_are_zero_fp32() { return true; }
-_CLC_DEF bool __clc_denormals_are_zero_fp64() { return false; }
+#ifdef cl_khr_fp16
+#pragma OPENCL EXTENSION cl_khr_fp16 : enable
+
+_CLC_DEF bool __clc_denormals_are_zero_fp16() {
+  return __builtin_isfpclass(__builtin_canonicalizef16(HALF_TRUE_MIN),
----------------
arsenm wrote:

That's not really a plus here, it's just longer 

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


More information about the llvm-branch-commits mailing list