https://github.com/frasercrmck updated
https://github.com/llvm/llvm-project/pull/109985
>From ba6a7682bfedb4249f26ed5e2af98499d884538d Mon Sep 17 00:00:00 2001
From: Fraser Cormack
Date: Mon, 23 Sep 2024 12:54:02 +0100
Subject: [PATCH 1/2] [libclc] Split off library build system into helpers
T
Author: Fraser Cormack
Date: 2024-10-29T13:09:56Z
New Revision: 183b38eb2261164fdfd6b7deac002edf27a39fe7
URL:
https://github.com/llvm/llvm-project/commit/183b38eb2261164fdfd6b7deac002edf27a39fe7
DIFF:
https://github.com/llvm/llvm-project/commit/183b38eb2261164fdfd6b7deac002edf27a39fe7.diff
LOG
Author: Fraser Cormack
Date: 2024-10-29T13:09:56Z
New Revision: b2bdd8bd39e90bfe3c66f6d5600468570a77ede6
URL:
https://github.com/llvm/llvm-project/commit/b2bdd8bd39e90bfe3c66f6d5600468570a77ede6
DIFF:
https://github.com/llvm/llvm-project/commit/b2bdd8bd39e90bfe3c66f6d5600468570a77ede6.diff
LOG
https://github.com/frasercrmck closed
https://github.com/llvm/llvm-project/pull/109985
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/frasercrmck updated
https://github.com/llvm/llvm-project/pull/109985
>From 183b38eb2261164fdfd6b7deac002edf27a39fe7 Mon Sep 17 00:00:00 2001
From: Fraser Cormack
Date: Mon, 23 Sep 2024 12:54:02 +0100
Subject: [PATCH 1/2] [libclc] Split off library build system into helpers
T
frasercrmck wrote:
ping
https://github.com/llvm/llvm-project/pull/109985
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
Author: Fraser Cormack
Date: 2024-11-04T10:37:11Z
New Revision: f1888e4029ec2bf657a072518dcc1c9b461559be
URL:
https://github.com/llvm/llvm-project/commit/f1888e4029ec2bf657a072518dcc1c9b461559be
DIFF:
https://github.com/llvm/llvm-project/commit/f1888e4029ec2bf657a072518dcc1c9b461559be.diff
LOG
https://github.com/frasercrmck created
https://github.com/llvm/llvm-project/pull/114774
These functions are all mapped to LLVM intrinsics.
The clspv and spirv targets don't declare or define any of these CLC functions,
and instead map these to their corresponding OpenCL symbols.
>From 8dd4fb4
Author: Fraser Cormack
Date: 2024-11-04T11:55:42Z
New Revision: b4ef43fc75dfeea76d4d968553858b2820420e58
URL:
https://github.com/llvm/llvm-project/commit/b4ef43fc75dfeea76d4d968553858b2820420e58
DIFF:
https://github.com/llvm/llvm-project/commit/b4ef43fc75dfeea76d4d968553858b2820420e58.diff
LOG
https://github.com/frasercrmck created
https://github.com/llvm/llvm-project/pull/114845
None
>From e2ac0ddbd762774282e878e043bac0edbbe75407 Mon Sep 17 00:00:00 2001
From: Fraser Cormack
Date: Mon, 4 Nov 2024 14:35:59 +
Subject: [PATCH] [libclc] Move clcmacro.h to CLC library. NFC
---
lib
frasercrmck wrote:
Sorry for the noise, but this felt too big to just push. It should hopefully
minimize diffs in upcoming patches.
https://github.com/llvm/llvm-project/pull/114845
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.
Author: Fraser Cormack
Date: 2024-11-04T10:52:46Z
New Revision: e28d7f713471cf33908a0fe5223f480dfd9b06f0
URL:
https://github.com/llvm/llvm-project/commit/e28d7f713471cf33908a0fe5223f480dfd9b06f0
DIFF:
https://github.com/llvm/llvm-project/commit/e28d7f713471cf33908a0fe5223f480dfd9b06f0.diff
LOG
https://github.com/frasercrmck updated
https://github.com/llvm/llvm-project/pull/114774
>From 625b491279f81dc9b55e80bf422d0e15f44f02bb Mon Sep 17 00:00:00 2001
From: Fraser Cormack
Date: Thu, 31 Oct 2024 13:11:00 +
Subject: [PATCH] [libclc] Move ceil/fabs/floor/rint/trunc to CLC library
Th
https://github.com/frasercrmck closed
https://github.com/llvm/llvm-project/pull/114774
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
frasercrmck wrote:
CC @rjodinchr, I hope this method of dealing with clspv works for you.
https://github.com/llvm/llvm-project/pull/114386
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commi
https://github.com/frasercrmck updated
https://github.com/llvm/llvm-project/pull/114386
>From 045a64caab8d99c29e6b0abbdcdc19f84a55b820 Mon Sep 17 00:00:00 2001
From: Fraser Cormack
Date: Thu, 26 Sep 2024 08:57:15 +0100
Subject: [PATCH] [libclc] Move min/max/clamp into the CLC builtins library
https://github.com/frasercrmck created
https://github.com/llvm/llvm-project/pull/114386
These functions are "shared" between integer and floating-point types, hence
the directory name. They are used in several CLC internal functions such as
__clc_ldexp.
Note that clspv and spirv targets don't
https://github.com/frasercrmck updated
https://github.com/llvm/llvm-project/pull/114386
>From c0e8cf9ec8a3ce75b62afdcbb6383af16c2f3539 Mon Sep 17 00:00:00 2001
From: Fraser Cormack
Date: Thu, 26 Sep 2024 08:57:15 +0100
Subject: [PATCH] [libclc] Move min/max/clamp into the CLC builtins library
Author: Fraser Cormack
Date: 2024-10-31T10:18:29Z
New Revision: fba9f05ff7b36f9cbb5835d79f659290dadecaad
URL:
https://github.com/llvm/llvm-project/commit/fba9f05ff7b36f9cbb5835d79f659290dadecaad
DIFF:
https://github.com/llvm/llvm-project/commit/fba9f05ff7b36f9cbb5835d79f659290dadecaad.diff
LOG
https://github.com/frasercrmck updated
https://github.com/llvm/llvm-project/pull/114386
>From 0465b89a7b624b8015e27efdbaf948c4aadd0e94 Mon Sep 17 00:00:00 2001
From: Fraser Cormack
Date: Thu, 26 Sep 2024 08:57:15 +0100
Subject: [PATCH] [libclc] Move min/max/clamp into the CLC builtins library
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
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
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
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
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
@@ -355,11 +355,13 @@ function(add_libclc_builtin_set)
install( FILES ${CMAKE_CURRENT_BINARY_DIR}/${obj_suffix} DESTINATION
"${CMAKE_INSTALL_DATADIR}/clc" )
foreach( a ${ARG_ALIASES} )
set( alias_suffix "${a}-${ARG_TRIPLE}.bc" )
-add_custom_target( ${alias_suffix}
https://github.com/frasercrmck closed
https://github.com/llvm/llvm-project/pull/116025
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
frasercrmck wrote:
Relanded in #116025.
https://github.com/llvm/llvm-project/pull/115885
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/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)) {
https://github.com/frasercrmck created
https://github.com/llvm/llvm-project/pull/116025
This relands commit 2c980310f67c13dd89c8702d40abeab47a4a2b4b after fixing an
issue.
>From beb58052420070d392f97bfba6af6af818df9a16 Mon Sep 17 00:00:00 2001
From: Fraser Cormack
Date: Wed, 13 Nov 2024 10:38
https://github.com/frasercrmck reopened
https://github.com/llvm/llvm-project/pull/114386
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
frasercrmck wrote:
> Moving them seems fine but these should probably just be deleted. __clc_min
> is equivalent to __builtin_elementwise_min etc.
>
> I see there's a __builtin_hlsl_elementwise_clamp, but given the language
> prefix it may be more abusive
https://github.com/llvm/llvm-projec
https://github.com/frasercrmck closed
https://github.com/llvm/llvm-project/pull/114386
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -0,0 +1,11 @@
+_CLC_OVERLOAD _CLC_DEF __CLC_GENTYPE __clc_max(__CLC_GENTYPE a,
+ __CLC_GENTYPE b) {
+ return (a > b ? a : b);
+}
+
+#ifndef __CLC_SCALAR
+_CLC_OVERLOAD _CLC_DEF __CLC_GENTYPE __clc_max(__CLC_GENTYPE a,
+
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
@@ -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)) {
https://github.com/frasercrmck created
https://github.com/llvm/llvm-project/pull/115865
This keeps values in vectors, rather than scalarizing them and then
reconstituting the vector. The builtin is identical to performing a C-style
cast on each element, which is what we were doing by recursive
@@ -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
https://github.com/frasercrmck created
https://github.com/llvm/llvm-project/pull/115857
Using '.hi' on a vector3 is technically allowed by the spec and is treated as a
4-element vector with an "undefined" w component. However, it's more
undef/poison code for the compiler to process and remove.
https://github.com/frasercrmck closed
https://github.com/llvm/llvm-project/pull/115865
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -221,8 +221,10 @@ if( ENABLE_RUNTIME_SUBNORMAL )
TARGET ${file}
INPUTS ${CMAKE_CURRENT_SOURCE_DIR}/generic/lib/${file}.ll
)
-install( FILES $ ARCHIVE
- DESTINATION "${CMAKE_INSTALL_DATADIR}/clc" )
+install(
+ FILES ${CMAKE_CURRENT_BINARY_D
@@ -221,8 +221,10 @@ if( ENABLE_RUNTIME_SUBNORMAL )
TARGET ${file}
INPUTS ${CMAKE_CURRENT_SOURCE_DIR}/generic/lib/${file}.ll
)
-install( FILES $ ARCHIVE
- DESTINATION "${CMAKE_INSTALL_DATADIR}/clc" )
+install(
+ FILES ${CMAKE_CURRENT_BINARY_D
https://github.com/frasercrmck edited
https://github.com/llvm/llvm-project/pull/109926
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/frasercrmck edited
https://github.com/llvm/llvm-project/pull/109926
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -221,8 +221,10 @@ if( ENABLE_RUNTIME_SUBNORMAL )
TARGET ${file}
INPUTS ${CMAKE_CURRENT_SOURCE_DIR}/generic/lib/${file}.ll
)
-install( FILES $ ARCHIVE
- DESTINATION "${CMAKE_INSTALL_DATADIR}/clc" )
+install(
+ FILES ${CMAKE_CURRENT_BINARY_D
https://github.com/frasercrmck updated
https://github.com/llvm/llvm-project/pull/109926
>From 567ea02fda22989a5af89746dbc5ed6eac0a43d9 Mon Sep 17 00:00:00 2001
From: Fraser Cormack
Date: Wed, 25 Sep 2024 09:18:10 +0100
Subject: [PATCH] [libclc] Fix installation w/ ENABLE_RUNTIME_SUBNORMAL
The
frasercrmck wrote:
> > Nixpkgs has no intention of moving away from standalone builds.
>
> I encourage you to acquire that intention. IMO libclc should not support the
> standalone build, and this should be version locked to the exact compiler
> commit. It's compiler data, not a real library
frasercrmck wrote:
CC @rjodinchr. I realise now that this idea may prove problematic for
`clspv`/`clspv64` targets. If this idea were to taken further, things like
OpenCL `minmag` would call `__clc_minmag` which would call `__clc_fabs` (e.g.),
but I notice `fabs` is not implemented in `clspv*`
@@ -167,12 +181,14 @@ install( FILES ${CMAKE_CURRENT_BINARY_DIR}/libclc.pc
DESTINATION "${CMAKE_INSTAL
install( DIRECTORY generic/include/clc DESTINATION
"${CMAKE_INSTALL_INCLUDEDIR}" )
if( ENABLE_RUNTIME_SUBNORMAL )
- add_library( subnormal_use_default STATIC
-generic/
https://github.com/frasercrmck created
https://github.com/llvm/llvm-project/pull/109926
The ARCHIVE artifact kind is not valid for install(FILES ...).
Additionally, install wasn't resolving the target's TARGET_FILE properly and
was trying to find it in the top-level build directory, rather tha
https://github.com/frasercrmck edited
https://github.com/llvm/llvm-project/pull/109926
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
frasercrmck wrote:
Thanks to @aaronpuchert for pointing this out in #87622.
https://github.com/llvm/llvm-project/pull/109926
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -167,12 +181,14 @@ install( FILES ${CMAKE_CURRENT_BINARY_DIR}/libclc.pc
DESTINATION "${CMAKE_INSTAL
install( DIRECTORY generic/include/clc DESTINATION
"${CMAKE_INSTALL_INCLUDEDIR}" )
if( ENABLE_RUNTIME_SUBNORMAL )
- add_library( subnormal_use_default STATIC
-generic/
https://github.com/frasercrmck created
https://github.com/llvm/llvm-project/pull/109985
Some libclc builtins currently use internal builtins prefixed with
'__clc_' for various reasons, e.g., to avoid naming clashes.
This commit formalizes this concept by starting to isolate the
definitions of t
https://github.com/frasercrmck updated
https://github.com/llvm/llvm-project/pull/109985
>From b01eadcda29e2df283c978901ea9616ebebd44aa Mon Sep 17 00:00:00 2001
From: Fraser Cormack
Date: Mon, 23 Sep 2024 12:54:02 +0100
Subject: [PATCH 1/2] [libclc] Split off library build system into helpers
T
https://github.com/frasercrmck closed
https://github.com/llvm/llvm-project/pull/115171
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
Author: Fraser Cormack
Date: 2024-11-07T17:47:52Z
New Revision: 6ca50a2593641f45b5310d907e6323f5eb367dfa
URL:
https://github.com/llvm/llvm-project/commit/6ca50a2593641f45b5310d907e6323f5eb367dfa
DIFF:
https://github.com/llvm/llvm-project/commit/6ca50a2593641f45b5310d907e6323f5eb367dfa.diff
LOG
@@ -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)) {
https://github.com/frasercrmck created
https://github.com/llvm/llvm-project/pull/116786
This commit moves over the OpenCL clz, hadd, mad24, mad_hi, mul24, mul_hi,
popcount, rhadd, and upsample builtins to the CLC library. There are no changes
to any target's CLC libraries.
The OpenCL mad_hi b
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
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
@@ -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
@@ -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
@@ -0,0 +1,44 @@
+#include
+#include
+#include
+
+_CLC_OVERLOAD _CLC_DEF char __clc_clz(char x) {
+ return __clc_clz((ushort)(uchar)x) - 8;
+}
+
+_CLC_OVERLOAD _CLC_DEF uchar __clc_clz(uchar x) {
+ return __clc_clz((ushort)x) - 8;
+}
+
+_CLC_OVERLOAD _CLC_DEF short __clc_clz(
https://github.com/frasercrmck edited
https://github.com/llvm/llvm-project/pull/116786
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -0,0 +1,21 @@
+#ifndef __CLC_INTEGER_CLC_CLZ_H__
+#define __CLC_INTEGER_CLC_CLZ_H__
+
+#if defined(CLC_CLSPV) || defined(CLC_SPIRV)
+// clspv and spir-v targets provide their own OpenCL-compatible clz
+#define __clc_clz clz
frasercrmck wrote:
Oh right, I thoug
frasercrmck wrote:
> For libclc maybe @tstellar -> @frasercrmck (or maybe both).
I'm not opposed to this if people think it suitable. But having someone from
Red Hat or AMD as co-maintainer(s) makes sense to me, as it's a project used
(downstream) by several different groups.
https://github.
@@ -0,0 +1,21 @@
+#ifndef __CLC_INTEGER_CLC_CLZ_H__
+#define __CLC_INTEGER_CLC_CLZ_H__
+
+#if defined(CLC_CLSPV) || defined(CLC_SPIRV)
+// clspv and spir-v targets provide their own OpenCL-compatible clz
+#define __clc_clz clz
frasercrmck wrote:
> > I'm not sure
@@ -0,0 +1,21 @@
+#ifndef __CLC_INTEGER_CLC_CLZ_H__
+#define __CLC_INTEGER_CLC_CLZ_H__
+
+#if defined(CLC_CLSPV) || defined(CLC_SPIRV)
+// clspv and spir-v targets provide their own OpenCL-compatible clz
+#define __clc_clz clz
frasercrmck wrote:
> On the `clspv`
@@ -0,0 +1,44 @@
+#include
+#include
+#include
+
+_CLC_OVERLOAD _CLC_DEF char __clc_clz(char x) {
+ return __clc_clz((ushort)(uchar)x) - 8;
+}
+
+_CLC_OVERLOAD _CLC_DEF uchar __clc_clz(uchar x) {
+ return __clc_clz((ushort)x) - 8;
+}
+
+_CLC_OVERLOAD _CLC_DEF short __clc_clz(
https://github.com/frasercrmck created
https://github.com/llvm/llvm-project/pull/118654
There's no automatic way of checking these headers are self-contained.
Instead of including these common files many times across the whole codebase,
we can include them in the generic `gentype.inc` and `flo
@@ -0,0 +1,21 @@
+#ifndef __CLC_INTEGER_CLC_CLZ_H__
+#define __CLC_INTEGER_CLC_CLZ_H__
+
+#if defined(CLC_CLSPV) || defined(CLC_SPIRV)
+// clspv and spir-v targets provide their own OpenCL-compatible clz
+#define __clc_clz clz
frasercrmck wrote:
> > The clspv/spi
https://github.com/frasercrmck edited
https://github.com/llvm/llvm-project/pull/116786
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -0,0 +1,21 @@
+#ifndef __CLC_INTEGER_CLC_CLZ_H__
+#define __CLC_INTEGER_CLC_CLZ_H__
+
+#if defined(CLC_CLSPV) || defined(CLC_SPIRV)
+// clspv and spir-v targets provide their own OpenCL-compatible clz
+#define __clc_clz clz
frasercrmck wrote:
> > In this conte
@@ -14585,11 +14585,18 @@ void Sema::CheckAddressOfPackedMember(Expr *rhs) {
_2, _3, _4));
}
+static ExprResult UsualUnaryConversionsNoPromoteInt(Sema &S, Expr *E) {
+ // Don't promote integer types
+ if (QualType Ty = E->getType();
S.getASTContext().is
https://github.com/frasercrmck updated
https://github.com/llvm/llvm-project/pull/119423
>From 3f007d702922db63e128e3c0f72dff2f600e0879 Mon Sep 17 00:00:00 2001
From: Fraser Cormack
Date: Tue, 10 Dec 2024 17:41:07 +
Subject: [PATCH 1/5] [clang] Fix sub-integer
__builtin_elementwise_(add|sub
frasercrmck wrote:
> Would be good to also update the documentation for the builtins the clarify
> the behavior.
I've added some words to that effect. Is that what you had in mind?
https://github.com/llvm/llvm-project/pull/119423
___
cfe-commits mail
https://github.com/frasercrmck updated
https://github.com/llvm/llvm-project/pull/119423
>From 3f007d702922db63e128e3c0f72dff2f600e0879 Mon Sep 17 00:00:00 2001
From: Fraser Cormack
Date: Tue, 10 Dec 2024 17:41:07 +
Subject: [PATCH 1/4] [clang] Fix sub-integer
__builtin_elementwise_(add|sub
@@ -14585,11 +14585,18 @@ void Sema::CheckAddressOfPackedMember(Expr *rhs) {
_2, _3, _4));
}
+static ExprResult UsualUnaryConversionsNoPromoteInt(Sema &S, Expr *E) {
+ // Don't promote integer types
+ if (QualType Ty = E->getType();
S.getASTContext().is
@@ -68,15 +66,18 @@ void test_builtin_elementwise_add_sat(float f1, float f2,
double d1, double d2,
long long int i2, si8 vi1, si8 vi2,
unsigned u1, unsigned u2, u4 vu1, u4 vu2,
https://github.com/frasercrmck edited
https://github.com/llvm/llvm-project/pull/119423
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/frasercrmck updated
https://github.com/llvm/llvm-project/pull/119423
>From 3f007d702922db63e128e3c0f72dff2f600e0879 Mon Sep 17 00:00:00 2001
From: Fraser Cormack
Date: Tue, 10 Dec 2024 17:41:07 +
Subject: [PATCH 1/6] [clang] Fix sub-integer
__builtin_elementwise_(add|sub
@@ -649,7 +649,9 @@ Unless specified otherwise operation(±0) = ±0 and
operation(±infinity) = ±in
The integer elementwise intrinsics, including
``__builtin_elementwise_popcount``,
``__builtin_elementwise_bitreverse``, ``__builtin_elementwise_add_sat``,
-``__builtin_elementwis
https://github.com/frasercrmck updated
https://github.com/llvm/llvm-project/pull/119423
>From 3f007d702922db63e128e3c0f72dff2f600e0879 Mon Sep 17 00:00:00 2001
From: Fraser Cormack
Date: Tue, 10 Dec 2024 17:41:07 +
Subject: [PATCH 1/7] [clang] Fix sub-integer
__builtin_elementwise_(add|sub
@@ -14585,11 +14585,18 @@ void Sema::CheckAddressOfPackedMember(Expr *rhs) {
_2, _3, _4));
}
+static ExprResult UsualUnaryConversionsNoPromoteInt(Sema &S, Expr *E) {
+ // Don't promote integer types
+ if (QualType Ty = E->getType();
S.getASTContext().is
@@ -14604,57 +14611,63 @@ bool
Sema::PrepareBuiltinElementwiseMathOneArgCall(CallExpr *TheCall) {
}
bool Sema::BuiltinElementwiseMath(CallExpr *TheCall, bool FPOnly) {
- QualType Res;
- if (BuiltinVectorMath(TheCall, Res, FPOnly))
-return true;
- TheCall->setType(Res);
@@ -0,0 +1,119 @@
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+
+#define __CLC_CONVERT_TY(X, TY) __builtin_convertvector(X, TY)
+
+// Macro for defining mad_sat variants for char/uchar/short/ushort
+// FIXME: Once using __clc_
https://github.com/frasercrmck created
https://github.com/llvm/llvm-project/pull/125517
This commit moves the mad_sat builtin to the CLC library.
It also optimizes it for vector types by avoiding scalarization. To help do
this it transforms the previous control-flow code into vector select cod
https://github.com/frasercrmck updated
https://github.com/llvm/llvm-project/pull/125517
>From 1404e1c7b4f133458751048b3f73800b90f98584 Mon Sep 17 00:00:00 2001
From: Fraser Cormack
Date: Wed, 29 Jan 2025 13:46:26 +
Subject: [PATCH] [libclc] Move mad_sat to CLC; optimize for vector
This com
https://github.com/frasercrmck updated
https://github.com/llvm/llvm-project/pull/125517
>From 1404e1c7b4f133458751048b3f73800b90f98584 Mon Sep 17 00:00:00 2001
From: Fraser Cormack
Date: Wed, 29 Jan 2025 13:46:26 +
Subject: [PATCH 1/2] [libclc] Move mad_sat to CLC; optimize for vector
This
https://github.com/frasercrmck closed
https://github.com/llvm/llvm-project/pull/125517
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/frasercrmck created
https://github.com/llvm/llvm-project/pull/125713
This commit moves the rotate builtin to the CLC library.
It also optimizes rotate(x, n) to generate the @llvm.fshl(x, x, n) intrinsic
directly, for both scalar and vector types. The previous implementation
https://github.com/frasercrmck edited
https://github.com/llvm/llvm-project/pull/125713
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
frasercrmck wrote:
CC @rjodinchr - you might not need to custom replace rotate yourselves in clspv
after this PR?
https://github.com/llvm/llvm-project/pull/125713
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/m
https://github.com/frasercrmck closed
https://github.com/llvm/llvm-project/pull/125713
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/frasercrmck created
https://github.com/llvm/llvm-project/pull/125673
This commit improves the diagnostics for vector (elementwise) builtins in a
couple of ways.
It primarily provides more precise type-checking diagnostics for builtins with
specific type requirements. Previo
https://github.com/frasercrmck created
https://github.com/llvm/llvm-project/pull/126052
This builtin is a little more involved than others as targets deal with
fma in various different ways.
Fundamentally, the CLC __clc_fma builtin compiles to
__builtin_elementwise_fma, which compiles to the @l
frasercrmck wrote:
FYI @rjodinchr this breaks downstream clspv testing.
```
# | declare !kernel_arg_name !7 float @llvm.fma.f32(float, float, float) #2
# | Unsupported llvm intrinsic
# | UNREACHABLE executed at /clspv/lib/SPIRVProducerPass.cpp:2390!
```
I was wondering if clspv should be transl
@@ -2393,8 +2395,10 @@ bool SemaHLSL::CheckBuiltinFunctionCall(unsigned
BuiltinID, CallExpr *TheCall) {
if (CheckVectorElementCallArgs(&SemaRef, TheCall))
return true;
if (SemaRef.BuiltinElementwiseTernaryMath(
-TheCall, /*CheckForFloatArgs*/
-
Author: Fraser Cormack
Date: 2025-02-06T09:04:27Z
New Revision: d4144ca27da174da3f8e7e3472e788b4246fd04e
URL:
https://github.com/llvm/llvm-project/commit/d4144ca27da174da3f8e7e3472e788b4246fd04e
DIFF:
https://github.com/llvm/llvm-project/commit/d4144ca27da174da3f8e7e3472e788b4246fd04e.diff
LOG
101 - 200 of 577 matches
Mail list logo