[libclc] [llvm] [libclc] Support LLVM_ENABLE_RUNTIMES when building (PR #141574)

2025-05-29 Thread Fraser Cormack via cfe-commits
@@ -72,7 +72,7 @@ else() # Note that we check this later (for both build types) but we can provide a # more useful error message when built in-tree. We assume that LLVM tools are # always available so don't warn here. - if( NOT clang IN_LIST LLVM_ENABLE_PROJECTS ) + if(

[libclc] libclc: clspv: do not set generic_addrspace_val (PR #141912)

2025-05-29 Thread Fraser Cormack via cfe-commits
https://github.com/frasercrmck approved this pull request. Sorry about that. Just to confirm this will work like nvptx, so it will report that the generic address space is available but won't generate certain generic functions (because it's identical to the private address space). If we get r

[libclc] [llvm] [libclc] Support LLVM_ENABLE_RUNTIMES when building (PR #141574)

2025-05-28 Thread Fraser Cormack via cfe-commits
frasercrmck wrote: I'm assuming the libc++ tests aren't failing due to this PR. They seem unstable, looking at jobs run for other PRs. https://github.com/llvm/llvm-project/pull/141574 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lis

[libclc] [libclc] Move vload & vstore to CLC library (PR #141755)

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

[libclc] [libclc] Move vload & vstore to CLC library (PR #141755)

2025-05-28 Thread Fraser Cormack via cfe-commits
https://github.com/frasercrmck created https://github.com/llvm/llvm-project/pull/141755 This commit moves the various vload and vstore builtins (including vload_half, vloada_half, etc.) to the CLC library. This is almost entirely a code move and does not make any attempt to clean up or optimi

[libclc] [llvm] [libclc] Support LLVM_ENABLE_RUNTIMES when building (PR #141574)

2025-05-28 Thread Fraser Cormack via cfe-commits
https://github.com/frasercrmck updated https://github.com/llvm/llvm-project/pull/141574 >From f5278d261d203cea8889174c8b0a16c03d1cbad9 Mon Sep 17 00:00:00 2001 From: Fraser Cormack Date: Tue, 27 May 2025 11:11:14 +0100 Subject: [PATCH 1/2] [libclc] Support LLVM_ENABLE_RUNTIMES when building Th

[libclc] [llvm] [libclc] Support LLVM_ENABLE_RUNTIMES when building (PR #141574)

2025-05-28 Thread Fraser Cormack via cfe-commits
frasercrmck wrote: > > That said, I don't believe it "works" in the way it's supposed to. It still > > grabs the host tools using `get_host_tool_path` in CMake, and custom > > commands to build with that. I take it we're supposed to use > > `CMAKE_C_COMPILER` as if we were a regular CMake proj

[libclc] [libclc] Move prefetch to clc library (PR #141721)

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

[libclc] [llvm] [libclc] Support LLVM_ENABLE_RUNTIMES when building (PR #141574)

2025-05-27 Thread Fraser Cormack via cfe-commits
frasercrmck wrote: > The changes make sense for just adding it, but does it actually work? Truth be told I haven't grasped exactly how the runtimes system works. This "works" in that `-DLLVM_ENABLE_RUNTIMES=libclc` will build all libclc targets in, e.g., `build/runtimes/runtimes-bins/libclc/am

[libclc] [llvm] [libclc] Support LLVM_ENABLE_RUNTIMES when building (PR #141574)

2025-05-27 Thread Fraser Cormack via cfe-commits
@@ -35,7 +35,7 @@ list(INSERT CMAKE_MODULE_PATH 0 # We order libraries to mirror roughly how they are layered, except that compiler-rt can depend # on libc++, so we put it after. -set(LLVM_DEFAULT_RUNTIMES "libc;libunwind;libcxxabi;pstl;libcxx;compiler-rt;openmp;offload") +s

[libclc] [llvm] [libclc] Support LLVM_ENABLE_RUNTIMES when building (PR #141574)

2025-05-27 Thread Fraser Cormack via cfe-commits
https://github.com/frasercrmck edited https://github.com/llvm/llvm-project/pull/141574 ___ 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-27 Thread Fraser Cormack via cfe-commits
frasercrmck wrote: ping, thanks. https://github.com/llvm/llvm-project/pull/131995 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[libclc] [llvm] [libclc] Support LLVM_ENABLE_RUNTIMES when building (PR #141574)

2025-05-27 Thread Fraser Cormack via cfe-commits
https://github.com/frasercrmck created https://github.com/llvm/llvm-project/pull/141574 This commit deprecates the use of LLVM_ENABLE_PROJECTS in favour of LLVM_ENABLE_RUNTIMES. Alternatively, using -DLLVM_RUNTIME_TARGETS= combined with -DRUNTIMES__LLVM_ENABLE_RUNTIMES=libclc also gets pretty

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

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

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

2025-05-22 Thread Fraser Cormack via cfe-commits
frasercrmck wrote: > > I wasn't sure if this was necessary so this commit replaces the vector2 > > versions of the constants with the vector3/vector4 ones. The OpenCL-CTS > > seems okay with it. If this is incorrect then it's not very difficult to > > split them back out again. > > Does it pa

[libclc] [libclc] Move step to the CLC library; add missing half variants (PR #140936)

2025-05-22 Thread Fraser Cormack via cfe-commits
https://github.com/frasercrmck closed https://github.com/llvm/llvm-project/pull/140936 ___ 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
https://github.com/frasercrmck closed https://github.com/llvm/llvm-project/pull/137183 ___ 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
https://github.com/frasercrmck edited https://github.com/llvm/llvm-project/pull/137183 ___ 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
@@ -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
@@ -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
@@ -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
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] 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] 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] 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 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] 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

[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

[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_

[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

[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-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] [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] 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] 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] [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] Mov erf & erfc to CLC library (PR #140524)

2025-05-19 Thread Fraser Cormack via cfe-commits
https://github.com/frasercrmck updated https://github.com/llvm/llvm-project/pull/140524 >From 38c1e5e62efa56c8dbca4e087555695ad34fe469 Mon Sep 17 00:00:00 2001 From: Fraser Cormack Date: Mon, 19 May 2025 11:10:08 +0100 Subject: [PATCH 1/2] [libclc] Mov erf & erfc to CLC library This completes

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

2025-05-19 Thread Fraser Cormack via cfe-commits
https://github.com/frasercrmck edited 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

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

2025-05-19 Thread Fraser Cormack via cfe-commits
frasercrmck wrote: ping, thanks 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] Mov erf & erfc to CLC library (PR #140524)

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

[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

[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] 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] 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] 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] 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] 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 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] [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 (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 (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
@@ -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 >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
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

[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 '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 '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 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 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 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

[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 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 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 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] c5b750f - [libclc] Move log2/log10 tables to CLC tables impl

2025-05-01 Thread Fraser Cormack via cfe-commits
Author: Fraser Cormack Date: 2025-05-01T10:23:28+01:00 New Revision: c5b750f5af72fadd4c00c120c9c585240da466b4 URL: https://github.com/llvm/llvm-project/commit/c5b750f5af72fadd4c00c120c9c585240da466b4 DIFF: https://github.com/llvm/llvm-project/commit/c5b750f5af72fadd4c00c120c9c585240da466b4.diff

[libclc] [libclc] Move minmag & maxmag to the CLC library (PR #137982)

2025-05-01 Thread Fraser Cormack via cfe-commits
@@ -0,0 +1,18 @@ +//===--===// +// +// 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 minmag & maxmag to the CLC library (PR #137982)

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

[libclc] [libclc] Move minmag & maxmag to the CLC library (PR #137982)

2025-04-30 Thread Fraser Cormack via cfe-commits
https://github.com/frasercrmck created https://github.com/llvm/llvm-project/pull/137982 None >From d2eea7bc2f2332d4c8b7d28f3512ab67a03f6360 Mon Sep 17 00:00:00 2001 From: Fraser Cormack Date: Wed, 30 Apr 2025 16:59:06 +0100 Subject: [PATCH] [libclc] Move minmag & maxmag to the CLC library ---

[libclc] [libclc] Clean up unnecessary #undef __CLC_BODYs (PR #137959)

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

[libclc] [libclc] Clean up unnecessary #undef __CLC_BODYs (PR #137959)

2025-04-30 Thread Fraser Cormack via cfe-commits
https://github.com/frasercrmck updated https://github.com/llvm/llvm-project/pull/137959 >From ef6433ffa32a8f4ced865382bfd45de61f5aef53 Mon Sep 17 00:00:00 2001 From: Fraser Cormack Date: Wed, 30 Apr 2025 13:48:16 +0100 Subject: [PATCH 1/2] [libclc] Clean up unnecessary #undef __CLC_BODYs This

[libclc] [libclc] Clean up unnecessary #undef __CLC_BODYs (PR #137959)

2025-04-30 Thread Fraser Cormack via cfe-commits
frasercrmck wrote: CC @wenju-he https://github.com/llvm/llvm-project/pull/137959 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[libclc] [libclc] Clean up unnecessary #undef __CLC_BODYs (PR #137959)

2025-04-30 Thread Fraser Cormack via cfe-commits
https://github.com/frasercrmck created https://github.com/llvm/llvm-project/pull/137959 This macro is automatically undefined by the various gentype-like helpers. >From ef6433ffa32a8f4ced865382bfd45de61f5aef53 Mon Sep 17 00:00:00 2001 From: Fraser Cormack Date: Wed, 30 Apr 2025 13:48:16 +0100

[libclc] 1180740 - [libclc][NFC] Remove unused integer-gentype.inc

2025-04-30 Thread Fraser Cormack via cfe-commits
Author: Fraser Cormack Date: 2025-04-30T13:39:23+01:00 New Revision: 1180740ced0218865577a09c9245f035e443a6f0 URL: https://github.com/llvm/llvm-project/commit/1180740ced0218865577a09c9245f035e443a6f0 DIFF: https://github.com/llvm/llvm-project/commit/1180740ced0218865577a09c9245f035e443a6f0.diff

[libclc] [libclc] Add v3 variants of async_work_group_copy/async_work_group_strided_copy/prefetch (PR #137932)

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

[libclc] [libclc] Add v3 variants of async_work_group_copy/async_work_group_strided_copy/prefetch (PR #137932)

2025-04-30 Thread Fraser Cormack via cfe-commits
https://github.com/frasercrmck approved this pull request. Thanks. We could probably come up with some kind of combined `gentype.inc` that does them both at once (though both currently `undef` `__CLC_BODY` after they finish so we'd need to be able to stop that, or preserve `__CLC_BODY` across

[libclc] [libclc] Add v3 variants of async_work_group_copy/async_work_group_strided_copy/prefetch (PR #137932)

2025-04-30 Thread Fraser Cormack via cfe-commits
@@ -9,15 +9,31 @@ #define __CLC_DST_ADDR_SPACE local #define __CLC_SRC_ADDR_SPACE global #define __CLC_BODY -#include +#include +#undef __CLC_DST_ADDR_SPACE frasercrmck wrote: We probably don't need to `undef` and re-`define` here, when `local/global` isn'

[libclc] [libclc] Add v3 variants of async_work_group_copy/async_work_group_strided_copy/prefetch (PR #137932)

2025-04-30 Thread Fraser Cormack via cfe-commits
https://github.com/frasercrmck edited https://github.com/llvm/llvm-project/pull/137932 ___ 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-04-30 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

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

2025-04-30 Thread Fraser Cormack via cfe-commits
https://github.com/frasercrmck created https://github.com/llvm/llvm-project/pull/137940 As best as I can see, all NVPTX architectures support the generic address space. I note there's a FIXME in the target's address space map about 'generic' still having to be added to the target but we haven'

[libclc] [libclc] Add v3 variants of async_work_group_copy/async_work_group_strided_copy/prefetch (PR #137932)

2025-04-30 Thread Fraser Cormack via cfe-commits
https://github.com/frasercrmck approved this pull request. LGTM. I see there's a note in the spec: `async_work_group_copy and async_work_group_strided_copy for 3-component vector types behave as async_work_group_copy and async_work_group_strided_copy respectively for 4-component vector types.

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

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

[libclc] [libclc] Avoid casting NANs & literals to 'gentype' (PR #137824)

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

[libclc] [libclc] Avoid casting NANs & literals to 'gentype' (PR #137824)

2025-04-29 Thread Fraser Cormack via cfe-commits
https://github.com/frasercrmck updated https://github.com/llvm/llvm-project/pull/137824 >From abb52892c044ca1883cc41d97c3edf08aafc9746 Mon Sep 17 00:00:00 2001 From: Fraser Cormack Date: Tue, 29 Apr 2025 16:05:19 +0100 Subject: [PATCH] [libclc] Avoid casting NANs & literals to 'gentype' By hav

[libclc] [libclc] Move fdim to CLC library; simplify (PR #137811)

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

[libclc] [libclc] Avoid casting NANs & literals to 'gentype' (PR #137824)

2025-04-29 Thread Fraser Cormack via cfe-commits
https://github.com/frasercrmck created https://github.com/llvm/llvm-project/pull/137824 By having these already defined as type 'gentype' we can avoid unnecessary casting. >From 662f8881d3da88714231b9a232a6006ae834b3b7 Mon Sep 17 00:00:00 2001 From: Fraser Cormack Date: Tue, 29 Apr 2025 16:05

[libclc] 6ffccea - [libclc][NFC] Remove binary_decl_tt.inc

2025-04-29 Thread Fraser Cormack via cfe-commits
Author: Fraser Cormack Date: 2025-04-29T15:48:46+01:00 New Revision: 6ffccea1c2b804d530c0f7bf3cc92db42b4432c5 URL: https://github.com/llvm/llvm-project/commit/6ffccea1c2b804d530c0f7bf3cc92db42b4432c5 DIFF: https://github.com/llvm/llvm-project/commit/6ffccea1c2b804d530c0f7bf3cc92db42b4432c5.diff

[libclc] [libclc] Move fdim to CLC library; simplify (PR #137811)

2025-04-29 Thread Fraser Cormack via cfe-commits
https://github.com/frasercrmck created https://github.com/llvm/llvm-project/pull/137811 This commit moves the fdim builtin to the CLC library. It simultaneously simplifies the codegen, unifying it between scalar and vector and avoiding bithacking for vector types. >From a20d00150430c7e5c24b69

[libclc] [libclc][NFC] Remove unary_builtin.inc (PR #137656)

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

[clang] [AMDGPU] Support the OpenCL generic addrspace feature by default (PR #137636)

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

[libclc] [libclc] Move fract to the CLC library (PR #137785)

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

[libclc] [libclc] Move fract to the CLC library (PR #137785)

2025-04-29 Thread Fraser Cormack via cfe-commits
https://github.com/frasercrmck updated https://github.com/llvm/llvm-project/pull/137785 >From f9a265e0d9bcecb80d25b97c394d7b9aa68d27ea Mon Sep 17 00:00:00 2001 From: Fraser Cormack Date: Tue, 29 Apr 2025 11:43:00 +0100 Subject: [PATCH 1/2] [libclc] Move fract to the CLC library The builtin was

[libclc] [libclc] Move fract to the CLC library (PR #137785)

2025-04-29 Thread Fraser Cormack via cfe-commits
https://github.com/frasercrmck created https://github.com/llvm/llvm-project/pull/137785 The builtin was already vectorized so there's no difference to codegen for non-SPIR-V targets. >From f9a265e0d9bcecb80d25b97c394d7b9aa68d27ea Mon Sep 17 00:00:00 2001 From: Fraser Cormack Date: Tue, 29 Apr

[libclc] [libclc] Optimize generic CLC fmin/fmax (PR #128506)

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

  1   2   3   4   5   6   7   8   >