[libclc] [libclc] Move sign to the CLC builtins library (PR #115699)

2025-02-11 Thread Fraser Cormack via cfe-commits
https://github.com/frasercrmck closed https://github.com/llvm/llvm-project/pull/115699 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[libclc] [libclc] Move sign to the CLC builtins library (PR #115699)

2025-02-11 Thread Fraser Cormack via cfe-commits
@@ -0,0 +1,21 @@ +// TYPE sign(TYPE x) { +// if (isnan(x)) { +// return 0.0F; +// } +// if (x > 0.0F) { +// return 1.0F; +// } +// if (x < 0.0F) { +// return -1.0F; +// } +// return x; /* -0.0 or +0.0 */ +// } +_CLC_DEF _CLC_OVERLOAD __CLC_GENTYPE __clc_s

[libclc] [libclc] Move sign to the CLC builtins library (PR #115699)

2025-02-11 Thread Fraser Cormack via cfe-commits
https://github.com/frasercrmck updated https://github.com/llvm/llvm-project/pull/115699 >From 44adfb0225e0f96462bdf79371e9d16a37595c0c Mon Sep 17 00:00:00 2001 From: Fraser Cormack Date: Thu, 7 Nov 2024 12:40:56 + Subject: [PATCH] [libclc] Move sign to the CLC builtins library This patch n

[libclc] [libclc] Move sign to the CLC builtins library (PR #115699)

2025-02-06 Thread Matt Arsenault via cfe-commits
@@ -0,0 +1,21 @@ +// TYPE sign(TYPE x) { +// if (isnan(x)) { +// return 0.0F; +// } +// if (x > 0.0F) { +// return 1.0F; +// } +// if (x < 0.0F) { +// return -1.0F; +// } +// return x; /* -0.0 or +0.0 */ +// } +_CLC_DEF _CLC_OVERLOAD __CLC_GENTYPE __clc_s

[libclc] [libclc] Move sign to the CLC builtins library (PR #115699)

2025-01-29 Thread Matt Arsenault via cfe-commits
@@ -0,0 +1,21 @@ +// TYPE sign(TYPE x) { +// if (isnan(x)) { +// return 0.0F; +// } +// if (x > 0.0F) { +// return 1.0F; +// } +// if (x < 0.0F) { +// return -1.0F; +// } +// return x; /* -0.0 or +0.0 */ +// } +_CLC_DEF _CLC_OVERLOAD __CLC_GENTYPE __clc_s

[libclc] [libclc] Move sign to the CLC builtins library (PR #115699)

2025-01-29 Thread Fraser Cormack via cfe-commits
@@ -0,0 +1,21 @@ +// TYPE sign(TYPE x) { +// if (isnan(x)) { +// return 0.0F; +// } +// if (x > 0.0F) { +// return 1.0F; +// } +// if (x < 0.0F) { +// return -1.0F; +// } +// return x; /* -0.0 or +0.0 */ +// } +_CLC_DEF _CLC_OVERLOAD __CLC_GENTYPE __clc_s

[libclc] [libclc] Move sign to the CLC builtins library (PR #115699)

2025-01-29 Thread Matt Arsenault via cfe-commits
@@ -0,0 +1,21 @@ +// TYPE sign(TYPE x) { +// if (isnan(x)) { +// return 0.0F; +// } +// if (x > 0.0F) { +// return 1.0F; +// } +// if (x < 0.0F) { +// return -1.0F; +// } +// return x; /* -0.0 or +0.0 */ +// } +_CLC_DEF _CLC_OVERLOAD __CLC_GENTYPE __clc_s

[libclc] [libclc] Move sign to the CLC builtins library (PR #115699)

2025-01-28 Thread Fraser Cormack via cfe-commits
frasercrmck wrote: ping, thanks https://github.com/llvm/llvm-project/pull/115699 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[libclc] [libclc] Move sign to the CLC builtins library (PR #115699)

2025-01-22 Thread Fraser Cormack via cfe-commits
https://github.com/frasercrmck edited https://github.com/llvm/llvm-project/pull/115699 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[libclc] [libclc] Move sign to the CLC builtins library (PR #115699)

2025-01-22 Thread Fraser Cormack via cfe-commits
https://github.com/frasercrmck updated https://github.com/llvm/llvm-project/pull/115699 >From 8144673e0338acefe13fac0c20bbaba0412b8239 Mon Sep 17 00:00:00 2001 From: Fraser Cormack Date: Thu, 7 Nov 2024 12:40:56 + Subject: [PATCH 1/4] [libclc] Move sign to the CLC builtins library This pat

[libclc] [libclc] Move sign to the CLC builtins library (PR #115699)

2025-01-20 Thread Fraser Cormack via cfe-commits
frasercrmck wrote: I'll look into undoing the CMake changes and building the dependent CLC functions for SPIR-V targets later on. https://github.com/llvm/llvm-project/pull/115699 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.ll

[libclc] [libclc] Move sign to the CLC builtins library (PR #115699)

2025-01-20 Thread Fraser Cormack via cfe-commits
https://github.com/frasercrmck updated https://github.com/llvm/llvm-project/pull/115699 >From 9c5f79e720d0701d17f9d128b358320401baf666 Mon Sep 17 00:00:00 2001 From: Fraser Cormack Date: Thu, 7 Nov 2024 12:40:56 + Subject: [PATCH 1/3] [libclc] Move sign to the CLC builtins library This pat

[libclc] [libclc] Move sign to the CLC builtins library (PR #115699)

2025-01-20 Thread Fraser Cormack via cfe-commits
frasercrmck wrote: @arsenm I've just updated this PR. It still moves the `sign` implementation to the CLC library but now also optimizes it for vector types. There's no control flow nor scalarizing for vectors. I trust this will be a good enough default for the scalar form (on GPUs) though I s

[libclc] [libclc] Move sign to the CLC builtins library (PR #115699)

2025-01-20 Thread Fraser Cormack via cfe-commits
https://github.com/frasercrmck updated https://github.com/llvm/llvm-project/pull/115699 >From 9c5f79e720d0701d17f9d128b358320401baf666 Mon Sep 17 00:00:00 2001 From: Fraser Cormack Date: Thu, 7 Nov 2024 12:40:56 + Subject: [PATCH 1/2] [libclc] Move sign to the CLC builtins library This pat

[libclc] [libclc] Move sign to the CLC builtins library (PR #115699)

2024-11-25 Thread Fraser Cormack via cfe-commits
@@ -0,0 +1,38 @@ +#include +#include +#include + +#define CLC_SIGN(TYPE, F) \ + _CLC_DEF _CLC_OVERLOAD TYPE __clc_sign(TYPE x) { \ +if (__clc_isnan(x)) {

[libclc] [libclc] Move sign to the CLC builtins library (PR #115699)

2024-11-21 Thread Karol Herbst via cfe-commits
@@ -322,22 +322,26 @@ foreach( t ${LIBCLC_TARGETS_TO_BUILD} ) if ( ARCH STREQUAL spirv OR ARCH STREQUAL spirv64 ) set( build_flags -O0 -finline-hint-functions -DCLC_SPIRV ) - set( opt_flags ) + set( clc_opt_flags ) + # Inline CLC functions into OpenCL

[libclc] [libclc] Move sign to the CLC builtins library (PR #115699)

2024-11-20 Thread Matt Arsenault via cfe-commits
@@ -322,22 +322,26 @@ foreach( t ${LIBCLC_TARGETS_TO_BUILD} ) if ( ARCH STREQUAL spirv OR ARCH STREQUAL spirv64 ) set( build_flags -O0 -finline-hint-functions -DCLC_SPIRV ) - set( opt_flags ) + set( clc_opt_flags ) + # Inline CLC functions into OpenCL

[libclc] [libclc] Move sign to the CLC builtins library (PR #115699)

2024-11-20 Thread Karol Herbst via cfe-commits
@@ -322,22 +322,26 @@ foreach( t ${LIBCLC_TARGETS_TO_BUILD} ) if ( ARCH STREQUAL spirv OR ARCH STREQUAL spirv64 ) set( build_flags -O0 -finline-hint-functions -DCLC_SPIRV ) - set( opt_flags ) + set( clc_opt_flags ) + # Inline CLC functions into OpenCL

[libclc] [libclc] Move sign to the CLC builtins library (PR #115699)

2024-11-20 Thread Matt Arsenault via cfe-commits
https://github.com/arsenm edited https://github.com/llvm/llvm-project/pull/115699 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[libclc] [libclc] Move sign to the CLC builtins library (PR #115699)

2024-11-20 Thread Matt Arsenault via cfe-commits
@@ -0,0 +1,38 @@ +#include +#include +#include + +#define CLC_SIGN(TYPE, F) \ + _CLC_DEF _CLC_OVERLOAD TYPE __clc_sign(TYPE x) { \ +if (__clc_isnan(x)) {

[libclc] [libclc] Move sign to the CLC builtins library (PR #115699)

2024-11-20 Thread Matt Arsenault via cfe-commits
https://github.com/arsenm edited https://github.com/llvm/llvm-project/pull/115699 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[libclc] [libclc] Move sign to the CLC builtins library (PR #115699)

2024-11-20 Thread Matt Arsenault via cfe-commits
@@ -322,22 +322,26 @@ foreach( t ${LIBCLC_TARGETS_TO_BUILD} ) if ( ARCH STREQUAL spirv OR ARCH STREQUAL spirv64 ) set( build_flags -O0 -finline-hint-functions -DCLC_SPIRV ) - set( opt_flags ) + set( clc_opt_flags ) + # Inline CLC functions into OpenCL

[libclc] [libclc] Move sign to the CLC builtins library (PR #115699)

2024-11-20 Thread Daniel Stone via cfe-commits
fooishbar wrote: cc @karolherbst @airlied who are better contacts for CL in Mesa these days https://github.com/llvm/llvm-project/pull/115699 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-com

[libclc] [libclc] Move sign to the CLC builtins library (PR #115699)

2024-11-20 Thread Daniel Stone via cfe-commits
@@ -322,22 +322,26 @@ foreach( t ${LIBCLC_TARGETS_TO_BUILD} ) if ( ARCH STREQUAL spirv OR ARCH STREQUAL spirv64 ) set( build_flags -O0 -finline-hint-functions -DCLC_SPIRV ) - set( opt_flags ) + set( clc_opt_flags ) + # Inline CLC functions into OpenCL

[libclc] [libclc] Move sign to the CLC builtins library (PR #115699)

2024-11-20 Thread Fraser Cormack via cfe-commits
https://github.com/frasercrmck updated https://github.com/llvm/llvm-project/pull/115699 >From 0a9bcdc5fb9da8ada6d2580026f498f282ca7cf7 Mon Sep 17 00:00:00 2001 From: Fraser Cormack Date: Thu, 7 Nov 2024 12:40:56 + Subject: [PATCH] [libclc] Move sign to the CLC builtins library This patch n

[libclc] [libclc] Move sign to the CLC builtins library (PR #115699)

2024-11-20 Thread Fraser Cormack via cfe-commits
@@ -322,22 +322,26 @@ foreach( t ${LIBCLC_TARGETS_TO_BUILD} ) if ( ARCH STREQUAL spirv OR ARCH STREQUAL spirv64 ) set( build_flags -O0 -finline-hint-functions -DCLC_SPIRV ) - set( opt_flags ) + set( clc_opt_flags ) + # Inline CLC functions into OpenCL

[libclc] [libclc] Move sign to the CLC builtins library (PR #115699)

2024-11-20 Thread Fraser Cormack via cfe-commits
https://github.com/frasercrmck edited https://github.com/llvm/llvm-project/pull/115699 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[libclc] [libclc] Move sign to the CLC builtins library (PR #115699)

2024-11-20 Thread Karol Herbst via cfe-commits
@@ -322,22 +322,26 @@ foreach( t ${LIBCLC_TARGETS_TO_BUILD} ) if ( ARCH STREQUAL spirv OR ARCH STREQUAL spirv64 ) set( build_flags -O0 -finline-hint-functions -DCLC_SPIRV ) - set( opt_flags ) + set( clc_opt_flags ) + # Inline CLC functions into OpenCL

[libclc] [libclc] Move sign to the CLC builtins library (PR #115699)

2024-11-20 Thread Fraser Cormack via cfe-commits
@@ -322,22 +322,26 @@ foreach( t ${LIBCLC_TARGETS_TO_BUILD} ) if ( ARCH STREQUAL spirv OR ARCH STREQUAL spirv64 ) set( build_flags -O0 -finline-hint-functions -DCLC_SPIRV ) - set( opt_flags ) + set( clc_opt_flags ) + # Inline CLC functions into OpenCL

[libclc] [libclc] Move sign to the CLC builtins library (PR #115699)

2024-11-19 Thread Karol Herbst via cfe-commits
@@ -322,22 +322,26 @@ foreach( t ${LIBCLC_TARGETS_TO_BUILD} ) if ( ARCH STREQUAL spirv OR ARCH STREQUAL spirv64 ) set( build_flags -O0 -finline-hint-functions -DCLC_SPIRV ) - set( opt_flags ) + set( clc_opt_flags ) + # Inline CLC functions into OpenCL

[libclc] [libclc] Move sign to the CLC builtins library (PR #115699)

2024-11-19 Thread Karol Herbst via cfe-commits
https://github.com/karolherbst edited https://github.com/llvm/llvm-project/pull/115699 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[libclc] [libclc] Move sign to the CLC builtins library (PR #115699)

2024-11-19 Thread Karol Herbst via cfe-commits
https://github.com/karolherbst edited https://github.com/llvm/llvm-project/pull/115699 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[libclc] [libclc] Move sign to the CLC builtins library (PR #115699)

2024-11-19 Thread Karol Herbst via cfe-commits
https://github.com/karolherbst edited https://github.com/llvm/llvm-project/pull/115699 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[libclc] [libclc] Move sign to the CLC builtins library (PR #115699)

2024-11-19 Thread Daniel Stone via cfe-commits
@@ -322,22 +322,26 @@ foreach( t ${LIBCLC_TARGETS_TO_BUILD} ) if ( ARCH STREQUAL spirv OR ARCH STREQUAL spirv64 ) set( build_flags -O0 -finline-hint-functions -DCLC_SPIRV ) - set( opt_flags ) + set( clc_opt_flags ) + # Inline CLC functions into OpenCL

[libclc] [libclc] Move sign to the CLC builtins library (PR #115699)

2024-11-19 Thread Daniel Stone via cfe-commits
https://github.com/fooishbar edited https://github.com/llvm/llvm-project/pull/115699 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[libclc] [libclc] Move sign to the CLC builtins library (PR #115699)

2024-11-12 Thread Fraser Cormack via cfe-commits
@@ -0,0 +1,38 @@ +#include +#include +#include + +#define CLC_SIGN(TYPE, F) \ + _CLC_DEF _CLC_OVERLOAD TYPE __clc_sign(TYPE x) { \ +if (__clc_isnan(x)) {

[libclc] [libclc] Move sign to the CLC builtins library (PR #115699)

2024-11-12 Thread Matt Arsenault via cfe-commits
@@ -322,22 +322,26 @@ foreach( t ${LIBCLC_TARGETS_TO_BUILD} ) if ( ARCH STREQUAL spirv OR ARCH STREQUAL spirv64 ) set( build_flags -O0 -finline-hint-functions -DCLC_SPIRV ) - set( opt_flags ) + set( clc_opt_flags ) + # Inline CLC functions into OpenCL

[libclc] [libclc] Move sign to the CLC builtins library (PR #115699)

2024-11-12 Thread Fraser Cormack via cfe-commits
https://github.com/frasercrmck updated https://github.com/llvm/llvm-project/pull/115699 >From 47512ee4162318160964f1af132be90bed67c90c Mon Sep 17 00:00:00 2001 From: Fraser Cormack Date: Thu, 7 Nov 2024 12:40:56 + Subject: [PATCH 1/2] [libclc] Move sign to the CLC builtins library This pat

[libclc] [libclc] Move sign to the CLC builtins library (PR #115699)

2024-11-12 Thread Fraser Cormack via cfe-commits
@@ -0,0 +1,38 @@ +#include +#include +#include + +#define CLC_SIGN(TYPE, F) \ + _CLC_DEF _CLC_OVERLOAD TYPE __clc_sign(TYPE x) { \ +if (__clc_isnan(x)) {

[libclc] [libclc] Move sign to the CLC builtins library (PR #115699)

2024-11-12 Thread Fraser Cormack via cfe-commits
@@ -322,22 +322,26 @@ foreach( t ${LIBCLC_TARGETS_TO_BUILD} ) if ( ARCH STREQUAL spirv OR ARCH STREQUAL spirv64 ) set( build_flags -O0 -finline-hint-functions -DCLC_SPIRV ) - set( opt_flags ) + set( clc_opt_flags ) + # Inline CLC functions into OpenCL

[libclc] [libclc] Move sign to the CLC builtins library (PR #115699)

2024-11-11 Thread Matt Arsenault via cfe-commits
https://github.com/arsenm edited https://github.com/llvm/llvm-project/pull/115699 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[libclc] [libclc] Move sign to the CLC builtins library (PR #115699)

2024-11-11 Thread Matt Arsenault via cfe-commits
@@ -0,0 +1,38 @@ +#include +#include +#include + +#define CLC_SIGN(TYPE, F) \ + _CLC_DEF _CLC_OVERLOAD TYPE __clc_sign(TYPE x) { \ +if (__clc_isnan(x)) {

[libclc] [libclc] Move sign to the CLC builtins library (PR #115699)

2024-11-11 Thread Matt Arsenault via cfe-commits
@@ -322,22 +322,26 @@ foreach( t ${LIBCLC_TARGETS_TO_BUILD} ) if ( ARCH STREQUAL spirv OR ARCH STREQUAL spirv64 ) set( build_flags -O0 -finline-hint-functions -DCLC_SPIRV ) - set( opt_flags ) + set( clc_opt_flags ) + # Inline CLC functions into OpenCL

[libclc] [libclc] Move sign to the CLC builtins library (PR #115699)

2024-11-11 Thread Fraser Cormack via cfe-commits
frasercrmck wrote: > > So is the sign function currently implemented in the OpenCL headers? > > The sign function for SPIR-V/Mesa is currently implemented by libclc > [here](https://github.com/llvm/llvm-project/blob/main/libclc/generic/lib/common/sign.cl). > With this change, `sign` now calls

[libclc] [libclc] Move sign to the CLC builtins library (PR #115699)

2024-11-11 Thread Fraser Cormack via cfe-commits
https://github.com/frasercrmck edited https://github.com/llvm/llvm-project/pull/115699 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[libclc] [libclc] Move sign to the CLC builtins library (PR #115699)

2024-11-11 Thread Fraser Cormack via cfe-commits
frasercrmck wrote: > So is the sign function currently implemented in the OpenCL headers? The sign function for SPIR-V/Mesa is currently implemented by libclc [here](https://github.com/llvm/llvm-project/blob/main/libclc/generic/lib/common/sign.cl). With this change, `sign` now calls `__clc_sig

[libclc] [libclc] Move sign to the CLC builtins library (PR #115699)

2024-11-11 Thread Tom Stellard via cfe-commits
https://github.com/tstellar commented: So is the sign function currently implemented in the OpenCL headers? https://github.com/llvm/llvm-project/pull/115699 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/

[libclc] [libclc] Move sign to the CLC builtins library (PR #115699)

2024-11-11 Thread Fraser Cormack via cfe-commits
frasercrmck wrote: CC @tstellar @fooishbar who might be able to account for the Mesa/SPIR-V target? https://github.com/llvm/llvm-project/pull/115699 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo

[libclc] [libclc] Move sign to the CLC builtins library (PR #115699)

2024-11-11 Thread Fraser Cormack via cfe-commits
https://github.com/frasercrmck created https://github.com/llvm/llvm-project/pull/115699 This patch necessitates some changes to how CLSPV and SPIR-V targets are built. This is the first patch in this series in which an OpenCL function declaration has been called from the CLC library for these