[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
Tue Oct 7 03:58:04 PDT 2025


================
@@ -8,8 +8,8 @@
 
 _CLC_DEF _CLC_OVERLOAD float __clc_remquo(float x, float y,
                                           __CLC_ADDRESS_SPACE int *quo) {
-  x = __clc_flush_denormal_if_not_supported(x);
-  y = __clc_flush_denormal_if_not_supported(y);
+  x = __clc_soft_flush_denormal(x);
+  y = __clc_soft_flush_denormal(y);
----------------
wenju-he wrote:

> https://github.com/ROCm/llvm-project/blob/0e9e3946cb257d1ed7b119333db451805865b36b/amd/device-libs/ocml/src/remainderF_base.h#L47
> 
> See this series of patches: [ROCm at b3beb93](https://github.com/ROCm/llvm-project/commit/b3beb9396041791c2ef22a5e8c3548a9f8686a5e) [ROCm at 9a7bc19](https://github.com/ROCm/llvm-project/commit/9a7bc191b9d6430985bce4dce55c3acef5c9fd3a) [ROCm at e9198f7](https://github.com/ROCm/llvm-project/commit/e9198f7d4619eb222f66c1f1d496eee3acdd8511)
> 
> Should just copy what these did

I have tried to port both libclc __clc_remquo and ocml remquo2 to replace intel gpu implementation at https://github.com/intel/intel-graphics-compiler/blob/fc97dc482697b320667a52914f1225556f0856e8/IGC/BiFModule/Implementation/Math/remquo.cl#L12-L104, however, the ported code can't pass OpenCL CTS test `./test_bruteforce remainder` on intel gpu.
Can I copy intel gpu implementation to overwrite libclc __clc_remquo?

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


More information about the cfe-commits mailing list