[llvm-branch-commits] [libclc] libclc: Really implement denormal config checks (PR #187356)
Wenju He via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Wed Mar 18 16:04:55 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),
+ __FPCLASS_POSZERO);
+}
+
+#endif
+
+_CLC_DEF bool __clc_denormals_are_zero_fp32() {
+ return __builtin_isfpclass(__builtin_canonicalizef(FLT_TRUE_MIN),
+ __FPCLASS_POSZERO);
+}
+
+#ifdef cl_khr_fp64
+
----------------
wenju-he wrote:
#pragma OPENCL EXTENSION cl_khr_fp64 : enable
https://github.com/llvm/llvm-project/pull/187356
More information about the llvm-branch-commits
mailing list