[libclc] [libclc][amdgpu] Implement native_exp via AMD builtin (PR #133696)

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

[libclc] [libclc] Move several 'native' builtins to CLC library (PR #129679)

2025-03-31 Thread Fraser Cormack via cfe-commits
@@ -0,0 +1,3 @@ +_CLC_OVERLOAD _CLC_DEF __CLC_GENTYPE __clc_native_log(__CLC_GENTYPE val) { + return __clc_native_log2(val) * (1.0f / M_LOG2E_F); frasercrmck wrote: We now apply `-fapprox-func`, as of #133119. If I change this PR to remove the AMDGPU definition

[libclc] [libclc] Move several 'native' builtins to CLC library (PR #129679)

2025-03-31 Thread Fraser Cormack via cfe-commits
https://github.com/frasercrmck updated https://github.com/llvm/llvm-project/pull/129679 >From aabdf579b3d88e59f8604943573c9beeafb4cf66 Mon Sep 17 00:00:00 2001 From: Fraser Cormack Date: Tue, 4 Mar 2025 10:03:00 + Subject: [PATCH 1/2] [libclc] Move several 'native' builtins to CLC library

[libclc] [libclc] Move several 'native' builtins to CLC library (PR #129679)

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

[libclc] [libclc][amdgpu] Implement native_exp via builtin (PR #133696)

2025-03-31 Thread Fraser Cormack via cfe-commits
https://github.com/frasercrmck updated https://github.com/llvm/llvm-project/pull/133696 >From b927766ee9d6e8a19af3cfcd5a05f7dcd2197ced Mon Sep 17 00:00:00 2001 From: Fraser Cormack Date: Mon, 31 Mar 2025 11:37:43 +0100 Subject: [PATCH] [libclc][amdgpu] Implement native_exp via AMD builtin This

[libclc] [libclc][amdgpu] Implement native_exp via AMD builtin (PR #133696)

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

[libclc] [libclc] Move several 'native' builtins to CLC library (PR #129679)

2025-03-31 Thread Fraser Cormack via cfe-commits
https://github.com/frasercrmck updated https://github.com/llvm/llvm-project/pull/129679 >From aabdf579b3d88e59f8604943573c9beeafb4cf66 Mon Sep 17 00:00:00 2001 From: Fraser Cormack Date: Tue, 4 Mar 2025 10:03:00 + Subject: [PATCH] [libclc] Move several 'native' builtins to CLC library This

[libclc] [libclc] Move several 'native' builtins to CLC library (PR #129679)

2025-03-31 Thread Fraser Cormack via cfe-commits
@@ -0,0 +1,3 @@ +_CLC_OVERLOAD _CLC_DEF __CLC_GENTYPE __clc_native_exp(__CLC_GENTYPE val) { + return __clc_native_exp2(val * M_LOG2E_F); frasercrmck wrote: With #133696 merged, I think this is resolved. AMDGPU still has a custom definition of `__clc_native_exp`

[libclc] [libclc] Move fmin & fmax to CLC library (PR #134218)

2025-04-03 Thread Fraser Cormack via cfe-commits
https://github.com/frasercrmck created https://github.com/llvm/llvm-project/pull/134218 This is an alternative to #128506 which doesn't attempt to change the codegen for fmin and fmax on their way to the CLC library. The amdgcn and r600 custom definitions of fmin/fmax are now converted to cust

[libclc] [libclc]: clspv: add a dummy implememtation for mul_hi (PR #134094)

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

[libclc] [libclc] Move fmin & fmax to CLC library (PR #134218)

2025-04-03 Thread Fraser Cormack via cfe-commits
frasercrmck wrote: fmin/fmax are needed for minmag/maxmag/fract, and fract is needed for sin/cos/tan so these builtins are a bottleneck right now. https://github.com/llvm/llvm-project/pull/134218 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[libclc] [libclc] Add missing license headers to source IR files (PR #132758)

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

[libclc] libclc: erfc: fix fp32 implementation (PR #132390)

2025-04-04 Thread Fraser Cormack via cfe-commits
https://github.com/frasercrmck approved this pull request. LGTM. It might be worth re-titling the PR to mention FTZ mode? https://github.com/llvm/llvm-project/pull/132390 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/c

[clang] [clang] Introduce elementwise clz/ctz builtins (PR #131995)

2025-03-19 Thread Fraser Cormack via cfe-commits
@@ -1484,6 +1484,18 @@ def ElementwiseSubSat : Builtin { let Prototype = "void(...)"; } +def ElementwiseClz : Builtin { + let Spellings = ["__builtin_elementwise_clz"]; + let Attributes = [NoThrow, Const, CustomTypeChecking, Constexpr]; + let Prototype = "void(...)"; +} +

[clang] [clang] Introduce elementwise clz/ctz builtins (PR #131995)

2025-03-19 Thread Fraser Cormack via cfe-commits
https://github.com/frasercrmck updated https://github.com/llvm/llvm-project/pull/131995 >From c0eef87f4301a9725b7d81e78875a816d3cdf7cb Mon Sep 17 00:00:00 2001 From: Fraser Cormack Date: Mon, 3 Feb 2025 16:54:17 + Subject: [PATCH 1/3] [clang] Introduce elementwise clz/ctz builtins These bu

[libclc] [libclc] Relicense gen_convert.py (PR #132213)

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

[libclc] [libclc] Add license headers to files missing them (PR #132239)

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

[libclc] [libclc] link_bc target should depends on target builtins.link.clc-arch_suffix (PR #132338)

2025-03-24 Thread Fraser Cormack via cfe-commits
https://github.com/frasercrmck approved this pull request. LGTM, thanks https://github.com/llvm/llvm-project/pull/132338 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[libclc] [libclc] Skip opt command if opt_flags is empty (PR #130882)

2025-03-24 Thread Fraser Cormack via cfe-commits
@@ -342,22 +342,32 @@ function(add_libclc_builtin_set) set( builtins_opt_lib_tgt builtins.opt.${ARG_ARCH_SUFFIX} ) - # Add opt target - add_custom_command( OUTPUT ${builtins_opt_lib_tgt}.bc -COMMAND ${opt_exe} ${ARG_OPT_FLAGS} -o ${builtins_opt_lib_tgt}.bc - ${bu

[libclc] [libclc] link_bc target should depends on target builtins.link.clc-arch_suffix (PR #132338)

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

[libclc] [libclc] Move log1p/asinh/acosh to the CLC library (PR #132956)

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

[libclc] [libclc] Move log1p/asinh/acosh/atanh to the CLC library (PR #132956)

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

[libclc] [libclc] Move log1p/asinh/acosh to the CLC library (PR #132956)

2025-03-25 Thread Fraser Cormack via cfe-commits
https://github.com/frasercrmck created https://github.com/llvm/llvm-project/pull/132956 These three functions all relatedin that they share tables and helper functions. Furthermore, the acosh builtins calls log1p. As with other work in this area, these builtins are now vectorized. To enable t

[libclc] [libclc] Move cbrt to the CLC library; vectorize (PR #133940)

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

[libclc] [libclc] Move sinh, cosh & tanh to the CLC library (PR #134063)

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

[libclc] [libclc] Move log1p/asinh/acosh/atanh to the CLC library (PR #132956)

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

[libclc] [libclc] Pass -fapprox-func when compiling 'native' builtins (PR #133119)

2025-03-27 Thread Fraser Cormack via cfe-commits
https://github.com/frasercrmck updated https://github.com/llvm/llvm-project/pull/133119 >From afb5cf51ce0b2de2a3d58dbd493c80173e970fac Mon Sep 17 00:00:00 2001 From: Fraser Cormack Date: Wed, 26 Mar 2025 16:18:34 + Subject: [PATCH 1/2] [libclc] Pass -fapprox-func when compiling 'native' bu

[libclc] [libclc] Pass -fapprox-func when compiling 'native' builtins (PR #133119)

2025-03-27 Thread Fraser Cormack via cfe-commits
https://github.com/frasercrmck updated https://github.com/llvm/llvm-project/pull/133119 >From afb5cf51ce0b2de2a3d58dbd493c80173e970fac Mon Sep 17 00:00:00 2001 From: Fraser Cormack Date: Wed, 26 Mar 2025 16:18:34 + Subject: [PATCH 1/4] [libclc] Pass -fapprox-func when compiling 'native' bu

[libclc] [libclc] Pass -fapprox-func when compiling 'native' builtins (PR #133119)

2025-03-27 Thread Fraser Cormack via cfe-commits
https://github.com/frasercrmck updated https://github.com/llvm/llvm-project/pull/133119 >From afb5cf51ce0b2de2a3d58dbd493c80173e970fac Mon Sep 17 00:00:00 2001 From: Fraser Cormack Date: Wed, 26 Mar 2025 16:18:34 + Subject: [PATCH 1/3] [libclc] Pass -fapprox-func when compiling 'native' bu

[libclc] [libclc] Move atan2/atan2pi to the CLC library (PR #133226)

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

[libclc] [libclc] Move atan2/atan2pi to the CLC library (PR #133226)

2025-03-27 Thread Fraser Cormack via cfe-commits
https://github.com/frasercrmck created https://github.com/llvm/llvm-project/pull/133226 As with other work in this area, these builtins are now vectorized. A further table has been split into two. There was discrepancy between comments above the table describing the values as "lead" and "tail"

[libclc] [libclc] Move atan2/atan2pi to the CLC library (PR #133226)

2025-03-27 Thread Fraser Cormack via cfe-commits
https://github.com/frasercrmck updated https://github.com/llvm/llvm-project/pull/133226 >From 497781f9fe1d1750d37a36948be285cdb6c14b04 Mon Sep 17 00:00:00 2001 From: Fraser Cormack Date: Tue, 25 Mar 2025 18:19:38 + Subject: [PATCH 1/2] [libclc] Move atan2/atan2pi to the CLC library --- li

[libclc] [libclc] Pass -fapprox-func when compiling 'native' builtins (PR #133119)

2025-03-27 Thread Fraser Cormack via cfe-commits
frasercrmck wrote: I've pushed an update with uses the `COMPILE_OPTIONS` property. It's definitely better, thanks for the suggestion. It would be best if there were `CMakeLists.txt` in each sub-directory which added the properties. However, because we currently have this system where targets

[libclc] [libclc] Move __clc_(remainder|fmod|remquo) to the CLC library (PR #132054)

2025-03-27 Thread Fraser Cormack via cfe-commits
https://github.com/frasercrmck updated https://github.com/llvm/llvm-project/pull/132054 >From e480113652a1a371e296192d4e1460af26a8a436 Mon Sep 17 00:00:00 2001 From: Fraser Cormack Date: Wed, 19 Mar 2025 14:52:09 + Subject: [PATCH 1/3] [libclc] Move __clc_remainder to CLC library It was al

[libclc] [libclc] Move asin/acos/atan to the CLC library (PR #132788)

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

[libclc] [libclc] Pass -fapprox-func when compiling 'native' builtins (PR #133119)

2025-03-27 Thread Fraser Cormack via cfe-commits
frasercrmck wrote: > set_source_files_properties That's true but since we're compiling with custom commands (I think) the properties won't automatically get picked up. That said, we could perhaps set the properties as you suggest and retrieve them with `get_source_file_property`. We'd still n

[libclc] [libclc] Move fmod, remainder & remquo to the CLC library (PR #132054)

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

[clang] [SYCL] Basic code generation for SYCL kernel caller offload entry point functions. (PR #133030)

2025-03-27 Thread Fraser Cormack via cfe-commits
@@ -229,6 +229,12 @@ class CodeGenTypes { const CGFunctionInfo &arrangeBuiltinFunctionCall(QualType resultType, const CallArgList &args); + /// A SYCL device kernel function is a free standing function with + /// spir_kern

[libclc] [libclc] Move fmin & fmax to CLC library (PR #134218)

2025-04-03 Thread Fraser Cormack via cfe-commits
https://github.com/frasercrmck updated https://github.com/llvm/llvm-project/pull/134218 >From 583261a0d1fc57ddb8ae964cbaf4f044c39d9bf2 Mon Sep 17 00:00:00 2001 From: Fraser Cormack Date: Thu, 3 Apr 2025 09:29:28 +0100 Subject: [PATCH 1/3] [libclc] Move fmin & fmax to CLC library This is an alt

[libclc] [libclc] Move fmin & fmax to CLC library (PR #134218)

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

[libclc] [libclc] Move sinh, cosh & tanh to the CLC library (PR #134063)

2025-04-02 Thread Fraser Cormack via cfe-commits
https://github.com/frasercrmck updated https://github.com/llvm/llvm-project/pull/134063 >From 498e82e2ec64cf6ba04466ac58fca5769fecdefd Mon Sep 17 00:00:00 2001 From: Fraser Cormack Date: Wed, 2 Apr 2025 11:06:30 +0100 Subject: [PATCH 1/2] [libclc] Move sinh, cosh & tanh to the CLC library This

[libclc] [libclc] Move cbrt to the CLC library; vectorize (PR #133940)

2025-04-02 Thread Fraser Cormack via cfe-commits
@@ -0,0 +1,135 @@ +//===--===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apa

[libclc] [libclc] Move sinh, cosh & tanh to the CLC library (PR #134063)

2025-04-02 Thread Fraser Cormack via cfe-commits
https://github.com/frasercrmck created https://github.com/llvm/llvm-project/pull/134063 This commit also vectorizes the builtins. >From 498e82e2ec64cf6ba04466ac58fca5769fecdefd Mon Sep 17 00:00:00 2001 From: Fraser Cormack Date: Wed, 2 Apr 2025 11:06:30 +0100 Subject: [PATCH] [libclc] Move sin

[libclc] [libclc] Move lgamma, lgamma_r & tgamma to CLC library (PR #134053)

2025-04-02 Thread Fraser Cormack via cfe-commits
@@ -0,0 +1,73 @@ +//===--===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apac

[libclc] [libclc] Move lgamma, lgamma_r & tgamma to CLC library (PR #134053)

2025-04-02 Thread Fraser Cormack via cfe-commits
@@ -0,0 +1,73 @@ +//===--===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apac

[libclc] [libclc] Move native_(exp10|powr|tan) to CLC library (PR #134080)

2025-04-02 Thread Fraser Cormack via cfe-commits
https://github.com/frasercrmck created https://github.com/llvm/llvm-project/pull/134080 These are the three remaining native builtins not yet ported. There are elementwise versions of exp10 and tan which correspond to the intrinsics, which may be preferable to the current versions which route

[libclc] [libclc] Move lgamma, lgamma_r & tgamma to CLC library (PR #134053)

2025-04-02 Thread Fraser Cormack via cfe-commits
https://github.com/frasercrmck created https://github.com/llvm/llvm-project/pull/134053 Also enable half-precision variants of tgamma, which were previously missing. Note that unlike recent work, these builtins are not vectorized as part of this commit. Ultimately all three call into lgamma_r,

[libclc] [libclc] Move sinh, cosh & tanh to the CLC library (PR #134063)

2025-04-02 Thread Fraser Cormack via cfe-commits
@@ -0,0 +1,201 @@ +//===--===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apa

[libclc] [libclc] Move rootn to the CLC library; optimize (PR #133735)

2025-04-04 Thread Fraser Cormack via cfe-commits
https://github.com/frasercrmck created https://github.com/llvm/llvm-project/pull/133735 The function was already nominally in the CLC namespace; this commit just moves it over. This commit also vectorizes the builtin to avoid scalarization. >From 67b778704e01e1e783cdf635a5fd4ca359f71d22 Mon S

[libclc] [libclc] Move lgamma, lgamma_r & tgamma to CLC library (PR #134053)

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

[libclc] [libclc] add --only-needed to llvm-link when INTERNALIZE flag is set (PR #130871)

2025-04-04 Thread Fraser Cormack via cfe-commits
frasercrmck wrote: Interesting - I'm not seeing any change in bytecode modules before and after this change. https://github.com/llvm/llvm-project/pull/130871 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailma

[libclc] [libclc] Relicense gen_convert.py (PR #132213)

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

[libclc] [libclc] Move sin, cos & sincos to CLC library (PR #139527)

2025-05-12 Thread Fraser Cormack via cfe-commits
https://github.com/frasercrmck updated https://github.com/llvm/llvm-project/pull/139527 >From 875c5fa90fff79456da734ae4be1e4590df6d127 Mon Sep 17 00:00:00 2001 From: Fraser Cormack Date: Thu, 1 May 2025 17:24:58 +0100 Subject: [PATCH 1/3] [libclc] Move sin, cos & sincos to CLC library This com

[libclc] [libclc] Move sin, cos & sincos to CLC library (PR #139527)

2025-05-12 Thread Fraser Cormack via cfe-commits
https://github.com/frasercrmck created https://github.com/llvm/llvm-project/pull/139527 This commit moves the remaining FP64 sin and cos helper functions to the CLC library. As a consequence, it formally moves all sin, cos and sincos builtins to the CLC library. Previously, the FP16 and FP32 w

[libclc] [libclc] Move sin, cos & sincos to CLC library (PR #139527)

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

[libclc] [libclc] Move tan to the CLC library (PR #139547)

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

[clang] [clang] Introduce elementwise clz/ctz builtins (PR #131995)

2025-05-13 Thread Fraser Cormack via cfe-commits
@@ -831,6 +832,14 @@ of different sizes and signs is forbidden in binary and ternary builtins. semantics, see `LangRef

[libclc] [libclc] Move (fast) length & distance to CLC library (PR #139701)

2025-05-13 Thread Fraser Cormack via cfe-commits
https://github.com/frasercrmck created https://github.com/llvm/llvm-project/pull/139701 This commit also refactors how geometric builtins are defined and declared, by sharing more helpers. It also removes an unnecessary gentype-like helper in favour of the more complete math/gentype.inc. Ther

[libclc] [libclc] Move (fast) length & distance to CLC library (PR #139701)

2025-05-13 Thread Fraser Cormack via cfe-commits
https://github.com/frasercrmck updated https://github.com/llvm/llvm-project/pull/139701 >From 0b08b0e3fe0befc2c10b66bd4c8efdab0f805e1a Mon Sep 17 00:00:00 2001 From: Fraser Cormack Date: Mon, 14 Apr 2025 10:06:08 +0100 Subject: [PATCH 1/2] [libclc] Move (fast) length & distance to CLC library

[libclc] [libclc] Move (fast) length & distance to CLC library (PR #139701)

2025-05-13 Thread Fraser Cormack via cfe-commits
@@ -0,0 +1,60 @@ +//===--===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apac

[libclc] [libclc] Move (fast) length & distance to CLC library (PR #139701)

2025-05-13 Thread Fraser Cormack via cfe-commits
https://github.com/frasercrmck updated https://github.com/llvm/llvm-project/pull/139701 Rate limit · GitHub body { background-color: #f6f8fa; color: #24292e; font-family: -apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sa

[libclc] [libclc] Move (fast) length & distance to CLC library (PR #139701)

2025-05-13 Thread Fraser Cormack via cfe-commits
@@ -43,7 +43,9 @@ _CLC_OVERLOAD _CLC_DEF __CLC_SCALAR_GENTYPE __clc_length(__CLC_GENTYPE p) { if (l2 < __CLC_GENTYPE_MIN) { p *= __CLC_GENTYPE_MIN_SCALE_UP; return __clc_sqrt(__clc_dot(p, p)) * __CLC_GENTYPE_MIN_SCALE_DOWN; - } else if (l2 == INFINITY) { + } + + i

[libclc] [libclc] Move tan to the CLC library (PR #139547)

2025-05-12 Thread Fraser Cormack via cfe-commits
https://github.com/frasercrmck created https://github.com/llvm/llvm-project/pull/139547 There was already a __clc_tan in the OpenCL layer. This commit moves the function over whilst vectorizing it. The function __clc_tan is no longer a public symbol, which should have never been the case. >F

[libclc] [libclc] Move tan to the CLC library (PR #139547)

2025-05-12 Thread Fraser Cormack via cfe-commits
https://github.com/frasercrmck updated https://github.com/llvm/llvm-project/pull/139547 >From 0ae904aae986275cae06c96791fb5bd4a933ca85 Mon Sep 17 00:00:00 2001 From: Fraser Cormack Date: Mon, 12 May 2025 14:35:54 +0100 Subject: [PATCH 1/2] [libclc] Move tan to the CLC library There was already

[libclc] [libclc] Move logb/ilogb to CLC library; optimize (PR #128028)

2025-05-12 Thread Fraser Cormack via cfe-commits
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

[libclc] [libclc] Move 'half' builtins to CLC library (PR #139563)

2025-05-12 Thread Fraser Cormack via cfe-commits
https://github.com/frasercrmck created https://github.com/llvm/llvm-project/pull/139563 There are no changes to the generated bytecode. Rate limit · GitHub body { background-color: #f6f8fa; color: #24292e; font-family: -apple-syste

[libclc] [libclc] Move 'half' builtins to CLC library (PR #139563)

2025-05-12 Thread Fraser Cormack via cfe-commits
https://github.com/frasercrmck updated https://github.com/llvm/llvm-project/pull/139563 Rate limit · GitHub body { background-color: #f6f8fa; color: #24292e; font-family: -apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sa

[libclc] [libclc] Move 'half' builtins to CLC library (PR #139563)

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

[libclc] [libclc] Move (fast) length & distance to CLC library (PR #139701)

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

[libclc] [libclc] Move logb/ilogb to CLC library; optimize (PR #128028)

2025-05-13 Thread Fraser Cormack via cfe-commits
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

[libclc] 0e8f0b5 - [libclc][NFC] Fix return after else

2025-05-13 Thread Fraser Cormack via cfe-commits
Author: Fraser Cormack Date: 2025-05-13T11:46:26+01:00 New Revision: 0e8f0b51ff598689b5eccc8b28c402b0dbcc97be URL: https://github.com/llvm/llvm-project/commit/0e8f0b51ff598689b5eccc8b28c402b0dbcc97be DIFF: https://github.com/llvm/llvm-project/commit/0e8f0b51ff598689b5eccc8b28c402b0dbcc97be.diff

[libclc] [libclc] Move cross to CLC library; add missing half overloads (PR #139713)

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

[libclc] [libclc] Add (fast) normalize to CLC; add half overloads (PR #139759)

2025-05-13 Thread Fraser Cormack via cfe-commits
https://github.com/frasercrmck updated https://github.com/llvm/llvm-project/pull/139759 >From c55c1f218d31d415872a7fee9b5b62fa66e23011 Mon Sep 17 00:00:00 2001 From: Fraser Cormack Date: Thu, 27 Feb 2025 15:02:32 + Subject: [PATCH 1/2] [libclc] Add (fast) normalize to CLC; add half overload

[libclc] [libclc] Add (fast) normalize to CLC; add half overloads (PR #139759)

2025-05-13 Thread Fraser Cormack via cfe-commits
https://github.com/frasercrmck created https://github.com/llvm/llvm-project/pull/139759 For simplicity the half overloads just call into the float versions of the builtin. Note that in the move some floating-point constants were combined. The vector2 versions of normalize used slightly differ

[libclc] [libclc] Improving vector code generated from scalar code (PR #140008)

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

[libclc] [libclc] Append file_specific_compile_options after ARG_COMPILE_FLAGS (PR #139871)

2025-05-14 Thread Fraser Cormack via cfe-commits
https://github.com/frasercrmck approved this pull request. Makes sense to me, good spot. https://github.com/llvm/llvm-project/pull/139871 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commit

[libclc] [libclc] Append file_specific_compile_options after ARG_COMPILE_FLAGS (PR #139871)

2025-05-16 Thread Fraser Cormack via cfe-commits
frasercrmck wrote: Sure, no problem. You can probably request [commit access](https://llvm.org/docs/DeveloperPolicy.html#obtaining-commit-access) by now, though. https://github.com/llvm/llvm-project/pull/139871 ___ cfe-commits mailing list cfe-commit

[libclc] [libclc] Append file_specific_compile_options after ARG_COMPILE_FLAGS (PR #139871)

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

[libclc] [libclc] Re-use shuffle_decl.inc in OpenCL shuffle2 declaration (PR #140679)

2025-05-20 Thread Fraser Cormack via cfe-commits
https://github.com/frasercrmck approved this pull request. LGTM, thanks https://github.com/llvm/llvm-project/pull/140679 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[libclc] [libclc] Reorganize OpenCL builtins (PR #140557)

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

[libclc] 2fb6ff4 - [libclc] Fix header inclusion issues

2025-05-20 Thread Fraser Cormack via cfe-commits
Author: Fraser Cormack Date: 2025-05-20T10:19:09+01:00 New Revision: 2fb6ff46f62e53e821b37d3ca0a71985969eaf44 URL: https://github.com/llvm/llvm-project/commit/2fb6ff46f62e53e821b37d3ca0a71985969eaf44 DIFF: https://github.com/llvm/llvm-project/commit/2fb6ff46f62e53e821b37d3ca0a71985969eaf44.diff

[libclc] [libclc] Re-use shuffle_decl.inc in OpenCL shuffle2 declaration (PR #140679)

2025-05-20 Thread Fraser Cormack via cfe-commits
frasercrmck wrote: Sorry, just merged #140557 so you'll have to fix the conflicts before merging. https://github.com/llvm/llvm-project/pull/140679 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/c

[libclc] [libclc] Add (fast) normalize to CLC; add half overloads (PR #139759)

2025-05-20 Thread Fraser Cormack via cfe-commits
https://github.com/frasercrmck updated https://github.com/llvm/llvm-project/pull/139759 >From 1db30b6513de258f12055e6d3597d1680fbd3287 Mon Sep 17 00:00:00 2001 From: Fraser Cormack Date: Thu, 27 Feb 2025 15:02:32 + Subject: [PATCH 1/2] [libclc] Add (fast) normalize to CLC; add half overload

[clang] [NVPTX] Support the OpenCL generic addrspace feature by default (PR #137940)

2025-05-20 Thread Fraser Cormack via cfe-commits
@@ -170,6 +170,8 @@ class LLVM_LIBRARY_VISIBILITY NVPTXTargetInfo : public TargetInfo { Opts["cl_khr_global_int32_extended_atomics"] = true; Opts["cl_khr_local_int32_base_atomics"] = true; Opts["cl_khr_local_int32_extended_atomics"] = true; + +Opts["__opencl_c_

[libclc] [libclc] Re-use shuffle_decl.inc in OpenCL shuffle2 declaration (PR #140679)

2025-05-20 Thread Fraser Cormack via cfe-commits
@@ -6,41 +6,14 @@ // //===--===// -#define _CLC_SHUFFLE2_DECL(TYPE, MASKTYPE, RETTYPE) \ - _CLC_OVERLOAD _CLC_DECL RETTYPE shuffle2(TYPE x, TYPE y, MASKTYPE mask); +#define __CLC_

[libclc] 80913b4 - [libclc][NFC] Reuse inc file for OpenCL frexp decl

2025-05-21 Thread Fraser Cormack via cfe-commits
Author: Fraser Cormack Date: 2025-05-21T10:19:31+01:00 New Revision: 80913b44a41ae0bbfbfee0c7b15cfa5a20e445d8 URL: https://github.com/llvm/llvm-project/commit/80913b44a41ae0bbfbfee0c7b15cfa5a20e445d8 DIFF: https://github.com/llvm/llvm-project/commit/80913b44a41ae0bbfbfee0c7b15cfa5a20e445d8.diff

[libclc] [libclc] Move all remquo address spaces to CLC library (PR #140871)

2025-05-21 Thread Fraser Cormack via cfe-commits
https://github.com/frasercrmck created https://github.com/llvm/llvm-project/pull/140871 Previously the OpenCL address space overloads of remquo would call into the one and only 'private' CLC remquo. This was an outlier compared with the other pointer-argumented maths builtins. This commit mov

[libclc] [libclc] Move all remquo address spaces to CLC library (PR #140871)

2025-05-21 Thread Fraser Cormack via cfe-commits
https://github.com/frasercrmck updated https://github.com/llvm/llvm-project/pull/140871 >From 3e070b23eea6ac3a9514d0cd5c9785e220d5f5e1 Mon Sep 17 00:00:00 2001 From: Fraser Cormack Date: Wed, 21 May 2025 10:39:12 +0100 Subject: [PATCH 1/2] [libclc] Move all remquo address spaces to CLC library

[libclc] [libclc] Move all remquo address spaces to CLC library (PR #140871)

2025-05-21 Thread Fraser Cormack via cfe-commits
https://github.com/frasercrmck updated https://github.com/llvm/llvm-project/pull/140871 >From 3e070b23eea6ac3a9514d0cd5c9785e220d5f5e1 Mon Sep 17 00:00:00 2001 From: Fraser Cormack Date: Wed, 21 May 2025 10:39:12 +0100 Subject: [PATCH 1/3] [libclc] Move all remquo address spaces to CLC library

[libclc] [libclc] Re-use shuffle_decl.inc in OpenCL shuffle2 declaration (PR #140679)

2025-05-21 Thread Fraser Cormack via cfe-commits
@@ -6,41 +6,14 @@ // //===--===// -#define _CLC_SHUFFLE2_DECL(TYPE, MASKTYPE, RETTYPE) \ - _CLC_OVERLOAD _CLC_DECL RETTYPE shuffle2(TYPE x, TYPE y, MASKTYPE mask); +#define __CLC_

[libclc] [libclc] Re-use shuffle_decl.inc in OpenCL shuffle2 declaration (PR #140679)

2025-05-21 Thread Fraser Cormack via cfe-commits
https://github.com/frasercrmck approved this pull request. https://github.com/llvm/llvm-project/pull/140679 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[libclc] [libclc] Re-use shuffle_decl.inc in OpenCL shuffle2 declaration (PR #140679)

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

[clang] [NVPTX] Support the OpenCL generic addrspace feature by default (PR #137940)

2025-05-21 Thread Fraser Cormack via cfe-commits
@@ -170,6 +170,8 @@ class LLVM_LIBRARY_VISIBILITY NVPTXTargetInfo : public TargetInfo { Opts["cl_khr_global_int32_extended_atomics"] = true; Opts["cl_khr_local_int32_base_atomics"] = true; Opts["cl_khr_local_int32_extended_atomics"] = true; + +Opts["__opencl_c_

[clang] [NVPTX] Support the OpenCL generic addrspace feature by default (PR #137940)

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

[libclc] [libclc] Move all remquo address spaces to CLC library (PR #140871)

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

[libclc] [libclc] Support the generic address space (PR #137183)

2025-05-21 Thread Fraser Cormack via cfe-commits
@@ -23,4 +23,20 @@ #define _CLC_DEF __attribute__((always_inline)) #endif +#if __OPENCL_C_VERSION__ == CL_VERSION_2_0 || \ +(__OPENCL_C_VERSION__ >= CL_VERSION_3_0 && \ + defined(__opencl_c_generic_addr

[libclc] [libclc] Support the generic address space (PR #137183)

2025-05-21 Thread Fraser Cormack via cfe-commits
@@ -420,12 +420,37 @@ foreach( t ${LIBCLC_TARGETS_TO_BUILD} ) -D${CLC_TARGET_DEFINE} # All libclc builtin libraries see CLC headers -I${CMAKE_CURRENT_SOURCE_DIR}/clc/include + # Error on undefined macros + -Werror=undef ) if( NOT "${cpu}"

[libclc] [libclc] Support the generic address space (PR #137183)

2025-05-21 Thread Fraser Cormack via cfe-commits
https://github.com/frasercrmck updated https://github.com/llvm/llvm-project/pull/137183 >From fcae18dd0b4af6f7517ba8eda368374fa693a5f9 Mon Sep 17 00:00:00 2001 From: Fraser Cormack Date: Thu, 24 Apr 2025 11:24:30 +0100 Subject: [PATCH 1/6] [libclc] Support the generic address space This commit

[libclc] [libclc] Support the generic address space (PR #137183)

2025-05-21 Thread Fraser Cormack via cfe-commits
https://github.com/frasercrmck updated https://github.com/llvm/llvm-project/pull/137183 >From fcae18dd0b4af6f7517ba8eda368374fa693a5f9 Mon Sep 17 00:00:00 2001 From: Fraser Cormack Date: Thu, 24 Apr 2025 11:24:30 +0100 Subject: [PATCH 1/5] [libclc] Support the generic address space This commit

[libclc] [libclc] Mov erf & erfc to CLC library (PR #140524)

2025-05-19 Thread Fraser Cormack via cfe-commits
https://github.com/frasercrmck created https://github.com/llvm/llvm-project/pull/140524 This completes the set of maths builtins. No attempt to vectorize or optimize this code. The implementation is licensed to SunPro so will probably need to be replaced at some point in the future anyway. Ca

<    2   3   4   5   6   7   8   >