https://github.com/frasercrmck closed
https://github.com/llvm/llvm-project/pull/128028
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/arsenm approved this pull request.
I still think this should be fixed to be in terms of frexp utilities but this
is just moving it anyway and that's separate
https://github.com/llvm/llvm-project/pull/128028
___
cfe-commits mailing
https://github.com/frasercrmck updated
https://github.com/llvm/llvm-project/pull/128028
>From 78922ca56104988a8b07f496a66e2943ca38262a Mon Sep 17 00:00:00 2001
From: Fraser Cormack
Date: Thu, 20 Feb 2025 08:42:36 +
Subject: [PATCH 1/2] [libclc] Move logb/ilogb to CLC library; optimize
This
@@ -0,0 +1,73 @@
+#if __CLC_FPSIZE == 32
+
+_CLC_OVERLOAD _CLC_DEF __CLC_INTN __clc_ilogb(__CLC_GENTYPE x) {
+ __CLC_UINTN ux = __CLC_AS_UINTN(x);
frasercrmck wrote:
Yeah, I'm not sure using `frexp` is currently better given that there's no
native path for it.
@@ -0,0 +1,73 @@
+#if __CLC_FPSIZE == 32
+
+_CLC_OVERLOAD _CLC_DEF __CLC_INTN __clc_ilogb(__CLC_GENTYPE x) {
+ __CLC_UINTN ux = __CLC_AS_UINTN(x);
arsenm wrote:
although I guess this better if you have a dedicated frexp_exp instruction.
Could factor out the fre
@@ -0,0 +1,73 @@
+#if __CLC_FPSIZE == 32
+
+_CLC_OVERLOAD _CLC_DEF __CLC_INTN __clc_ilogb(__CLC_GENTYPE x) {
+ __CLC_UINTN ux = __CLC_AS_UINTN(x);
arsenm wrote:
This should be implemented in terms of frexp and avoid relying on the exponent
bits.
Something like
https://github.com/frasercrmck created
https://github.com/llvm/llvm-project/pull/128028
This commit moves the logb and ilogb builtins to the CLC library.
It simultaneously optimizes them both for vector types and for half types.
Vector types were being scalarized in some cases. Half types were