[libclc] [libclc] Move conversion builtins to the CLC library (PR #124727)

2025-01-28 Thread Fraser Cormack via cfe-commits
frasercrmck wrote: > In fact my setup was busted. In the end it seems to work without change. Thanks! Just for reference, is it just clspv's `check-spirv` you were running to test? Anything else I should be aware of? https://github.com/llvm/llvm-project/pull/124727

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

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

[libclc] [libclc] Move conversion builtins to the CLC library (PR #124727)

2025-01-28 Thread Fraser Cormack via cfe-commits
frasercrmck wrote: > I think for `clspv`, we would need to invert the condition to skip > user-facing functions. By that I mean that `clspv` will need all the > `convert_*` functions, and not the `__clc_convert_*_rte`. Then we will need > to update `clspv` to support natively the function with

[libclc] [libclc] Move several integer functions to CLC library (PR #116786)

2025-01-29 Thread Fraser Cormack via cfe-commits
https://github.com/frasercrmck updated https://github.com/llvm/llvm-project/pull/116786 >From 00f8980411e74a3071e6efbf553f78363ac92bb2 Mon Sep 17 00:00:00 2001 From: Fraser Cormack Date: Tue, 17 Dec 2024 16:52:51 + Subject: [PATCH] [libclc] Move several integer functions to CLC library Thi

[clang] [clang] Restrict the use of scalar types in vector builtins (PR #119423)

2025-01-29 Thread Fraser Cormack via cfe-commits
frasercrmck wrote: > LLVM Buildbot has detected a new failure on builder > `llvm-clang-aarch64-darwin` running on `doug-worker-4` while building `clang` > at step 6 "test-build-unified-tree-check-all". > > Full details are available at: > https://lab.llvm.org/buildbot/#/builders/190/builds/13

[libclc] [libclc] Move fp16 pragma guards out of header file (PR #122751)

2025-01-14 Thread Fraser Cormack via cfe-commits
@@ -207,10 +207,6 @@ return BUILTIN(x); \ } -#ifdef cl_khr_fp16 - -#pragma OPENCL EXTENSION cl_khr_fp16 : enable - #define _CLC_DEFINE_UNARY_BUILTIN_FP16(FUNCTION) \ _CLC_DEF _CLC

[libclc] [libclc] Move fp16 pragma guards out of header file (PR #122751)

2025-01-14 Thread Fraser Cormack via cfe-commits
https://github.com/frasercrmck updated https://github.com/llvm/llvm-project/pull/122751 >From 4dd89f2be8e80797a8e921145339ac2716505830 Mon Sep 17 00:00:00 2001 From: Fraser Cormack Date: Mon, 13 Jan 2025 17:29:06 + Subject: [PATCH 1/2] [libclc] Move fp16 pragma guards out of header file Ha

[libclc] [libclc] Move fp16 pragma guards out of header file (PR #122751)

2025-01-14 Thread Fraser Cormack via cfe-commits
@@ -207,10 +207,6 @@ return BUILTIN(x); \ } -#ifdef cl_khr_fp16 - -#pragma OPENCL EXTENSION cl_khr_fp16 : enable - #define _CLC_DEFINE_UNARY_BUILTIN_FP16(FUNCTION) \ _CLC_DEF _CLC

[libclc] [libclc] Move fp16 pragma guards out of header file (PR #122751)

2025-01-13 Thread Fraser Cormack via cfe-commits
https://github.com/frasercrmck created https://github.com/llvm/llvm-project/pull/122751 Having the fp16 pragmas enabled in the header file is risky, as we have some headers that also disable pragmas. We want to be as immune to changes in the order of included header files as possible. This pa

[libclc] [libclc] Move several integer functions to CLC library (PR #116786)

2025-01-15 Thread Fraser Cormack via cfe-commits
frasercrmck wrote: ping 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

[libclc] [libclc] Move smoothstep to CLC and optimize its codegen (PR #123183)

2025-01-16 Thread Fraser Cormack via cfe-commits
https://github.com/frasercrmck created https://github.com/llvm/llvm-project/pull/123183 This commit moves the implementation of the smoothstep function to the CLC library, whilst optimizing the codegen. This commit also adds support for 'half' versions of smoothstep, which were previously mis

[libclc] [libclc] Move smoothstep to CLC and optimize its codegen (PR #123183)

2025-01-16 Thread Fraser Cormack via cfe-commits
frasercrmck wrote: Here's an example of the difference in LLVM IR for `smoothstep(double16, double16, double16)`: https://godbolt.org/z/P9sM3Wjjn https://github.com/llvm/llvm-project/pull/123183 ___ cfe-commits mailing list cfe-commits@lists.llvm.or

[libclc] [libclc] Move smoothstep to CLC and optimize its codegen (PR #123183)

2025-01-16 Thread Fraser Cormack via cfe-commits
@@ -0,0 +1,52 @@ +/* frasercrmck wrote: I wasn't sure if the AMD copyright still applies to this copied file, so I kept it. https://github.com/llvm/llvm-project/pull/123183 ___ cfe-commits mailing list cfe-commits@lis

[libclc] [libclc] Move smoothstep to CLC and optimize its codegen (PR #123183)

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

[libclc] [libclc] Move degrees/radians to CLC library & optimize (PR #123222)

2025-01-16 Thread Fraser Cormack via cfe-commits
https://github.com/frasercrmck created https://github.com/llvm/llvm-project/pull/123222 Missing half variants were also added. The builtins are now consistently emitted in vector form (i.e., with a splat of the literal to the appropriate vector size). >From abe207cb6b90597a4f90a1db922c63ceb97

[libclc] [libclc] Move degrees/radians to CLC library & optimize (PR #123222)

2025-01-16 Thread Fraser Cormack via cfe-commits
frasercrmck wrote: I wasn't able to verify the `half` variants with the OpenCL CTS for some obscure CTS reason. Given that they're just casting the double literal to half I think they're almost certainly correct. https://github.com/llvm/llvm-project/pull/123222

[libclc] [libclc] Move degrees/radians to CLC library & optimize (PR #123222)

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

[clang] [llvm] [BasicAA] Do not decompose past casts with different index width (PR #119365)

2025-01-09 Thread Fraser Cormack via cfe-commits
frasercrmck wrote: > @frasercrmck BasicAA returns MayAlias for your example. Presumably AMDGPUAA > returns NoAlias because addrspace(3) and addrspace(0) can't alias, or > something like that. Yep, you're right, sorry for the false alarm. Because it's a `amdgpu_kernel` function and `A` (`%incd

[clang] [clang] Restrict use of scalar types in vector builtins (PR #119423)

2025-01-09 Thread Fraser Cormack via 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/8] [clang] Fix sub-integer __builtin_elementwise_(add|sub

[clang] [clang] Restrict use of scalar types in vector builtins (PR #119423)

2025-01-09 Thread Fraser Cormack via cfe-commits
@@ -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);

[clang] [clang] Restrict use of scalar types in vector builtins (PR #119423)

2025-01-09 Thread Fraser Cormack via cfe-commits
@@ -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

[clang] [clang] Restrict use of scalar types in vector builtins (PR #119423)

2025-01-09 Thread Fraser Cormack via cfe-commits
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

[libclc] [libclc] Add missing includes to CLC headers (PR #118654)

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

[libclc] [libclc] Move __clc_ldexp to CLC library (PR #126078)

2025-02-13 Thread Fraser Cormack via cfe-commits
frasercrmck wrote: > > I'll go add that builtin and come back to this - thanks. > > What do you think about libclc making use of weak linkage in principle? > > Weak should be handled properly by the targets, the one downside is that it > prevents optimization within a TU because the symbol's in

[libclc] [libclc] Move __clc_ldexp to CLC library (PR #126078)

2025-02-13 Thread Fraser Cormack via cfe-commits
frasercrmck wrote: Oh, also for context, there was https://github.com/llvm/llvm-project/pull/124709 a few weeks ago. So it appears that there are other people interested in moving libclc to the runtimes infrastructure. https://github.com/llvm/llvm-project/pull/126078 _

[libclc] [libclc] Fix int<->float conversion builtins (PR #126905)

2025-02-13 Thread Fraser Cormack via cfe-commits
frasercrmck wrote: > Do we really need to generate source for this? It's harder to reason about. > It looks like the sign bit of the input isn't preserved on underflow to 0 Perhaps we could simply check in the generated source? It shouldn't change all that often. We might want to split it up i

[libclc] [libclc] [cmake] Fix per-target *_convert.cl dependencies (PR #127315)

2025-02-15 Thread Fraser Cormack via cfe-commits
@@ -249,13 +249,19 @@ function(add_libclc_builtin_set) get_filename_component( file_dir ${file} DIRECTORY ) +if( ARG_ARCH STREQUAL spirv OR ARG_ARCH STREQUAL spirv64 ) + set(CONVERT_DEP clspv-generate_convert.cl) +else() + set(CONVERT_DEP generate_conver

[libclc] [libclc] Improve nextafter behaviour around zero (PR #127469)

2025-02-17 Thread Fraser Cormack via cfe-commits
https://github.com/frasercrmck created https://github.com/llvm/llvm-project/pull/127469 This commit improves the behaviour of (__clc_)nextafter around zero. Specifically, the nextafter value of very small negative numbers in the positive direction is now negative zero. Previously we'd return p

[libclc] [libclc] Improve nextafter behaviour around zero (PR #127469)

2025-02-17 Thread Fraser Cormack via cfe-commits
frasercrmck wrote: With this PR and with #126905 I achieved a fully passing OpenCL-CTS conversions run. https://github.com/llvm/llvm-project/pull/127469 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/lis

[libclc] [libclc] Fix int<->float conversion builtins (PR #126905)

2025-02-17 Thread Fraser Cormack via cfe-commits
frasercrmck wrote: See #127469 for the fix for the other conversion builtins. https://github.com/llvm/llvm-project/pull/126905 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[libclc] [libclc] Move frexp to CLC library; optimize half vecs (PR #127836)

2025-02-19 Thread Fraser Cormack via cfe-commits
https://github.com/frasercrmck created https://github.com/llvm/llvm-project/pull/127836 This commit moves the frexp builtin to the CLC library. It simultaneously optimizes the code generated for half vectors, which was previously scalarizing and casting up to float. With this commit it still c

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

2025-02-25 Thread Fraser Cormack via cfe-commits
@@ -0,0 +1,73 @@ +#if __CLC_FPSIZE == 32 + +_CLC_OVERLOAD _CLC_DEF __CLC_INTN __clc_ilogb(__CLC_GENTYPE x) { + __CLC_UINTN ux = __CLC_AS_UINTN(x); frasercrmck wrote: Yeah, I'm not sure using `frexp` is currently better given that there's no native path for it.

[libclc] libclc: Stop using asm declarations for r600 on amdgcn for get_global_size (PR #128692)

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

[libclc] [libclc] Stop installing CLC headers (PR #126908)

2025-02-25 Thread Fraser Cormack via cfe-commits
frasercrmck wrote: ping. Are the discussions above blocking the PR? If clang's internal headers are unsuitable must we fix those before landing this, or temporarily fix the installation of libclc's headers instead? https://github.com/llvm/llvm-project/pull/126908 __

[libclc] [libclc] Move log/log2/log10 to CLC library (PR #128540)

2025-02-25 Thread Fraser Cormack via cfe-commits
https://github.com/frasercrmck updated https://github.com/llvm/llvm-project/pull/128540 >From 0417fefc8b1d6b65941e48a1c2c4c700f601b38b Mon Sep 17 00:00:00 2001 From: Fraser Cormack Date: Mon, 24 Feb 2025 17:27:59 + Subject: [PATCH 1/2] [libclc] Move log/log2/log10 to CLC library No changes

[libclc] [libclc] Move log/log2/log10 to CLC library (PR #128540)

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

[libclc] [libclc] Move log/log2/log10 to CLC library (PR #128540)

2025-02-25 Thread Fraser Cormack via cfe-commits
@@ -0,0 +1,339 @@ +/* + * Copyright (c) 2014,2015 Advanced Micro Devices, Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restri

[libclc] [libclc] Move log/log2/log10 to CLC library (PR #128540)

2025-02-25 Thread Fraser Cormack via cfe-commits
@@ -0,0 +1,339 @@ +/* + * Copyright (c) 2014,2015 Advanced Micro Devices, Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restri

[libclc] [libclc] Fix int<->float conversion builtins (PR #126905)

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

[libclc] [libclc] Move fma to the CLC library (PR #126052)

2025-02-24 Thread Fraser Cormack via cfe-commits
https://github.com/frasercrmck updated https://github.com/llvm/llvm-project/pull/126052 >From 18d67915671a081540abde18b1b6c009ac094a27 Mon Sep 17 00:00:00 2001 From: Fraser Cormack Date: Tue, 28 Jan 2025 12:19:23 + Subject: [PATCH 1/2] [libclc] Move fma to the CLC library This builtin is a

[libclc] [libclc] Move fma to the CLC library (PR #126052)

2025-02-24 Thread Fraser Cormack via cfe-commits
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! > > ``` > > > > > >

[libclc] [libclc] Move fma to the CLC library (PR #126052)

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

[libclc] [libclc] Remove clspv-specific clc conversions (PR #128500)

2025-02-24 Thread Fraser Cormack via cfe-commits
https://github.com/frasercrmck created https://github.com/llvm/llvm-project/pull/128500 The clc and clc+clspv modes produced the same conversions code, so this patch simplifies the process. It further simplifies the internal checks the script makes by assuming the mutual exclusivity. >From ce

[libclc] [libclc] Remove clspv-specific clc conversions (PR #128500)

2025-02-24 Thread Fraser Cormack via cfe-commits
https://github.com/frasercrmck closed https://github.com/llvm/llvm-project/pull/128500 ___ 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 the CLC library (PR #128506)

2025-02-24 Thread Fraser Cormack via cfe-commits
https://github.com/frasercrmck created https://github.com/llvm/llvm-project/pull/128506 Note the CLC versions of these builtins don't offer the vector/scalar forms, for simplicity. The OpenCL layer converts the vector/scalar form to vector/vector. The CLC builtins use clang's __builtin_elemen

[libclc] [libclc] Move fmin/fmax to the CLC library (PR #128506)

2025-02-24 Thread Fraser Cormack via cfe-commits
frasercrmck wrote: Note @arsenm I didn't touch [amdgcn's fmin/fmax](https://github.com/llvm/llvm-project/blob/main/libclc/amdgcn/lib/math/fmin.cl) or [r600's](https://github.com/llvm/llvm-project/blob/main/libclc/r600/lib/math/fmin.cl) as I wasn't sure if any of that could be updated or at le

[libclc] [libclc] Move fmin/fmax to the CLC library (PR #128506)

2025-02-24 Thread Fraser Cormack via cfe-commits
frasercrmck wrote: > These should use the regular builtin fmin / fmax. Do you mean the AMD implementations, or the CLC ones too? Note there's no vector support for `__builtin_fmin` which is why I chose `__builtin_elementwise_min`. They appear to generate the same code so maybe I'm misundersta

[libclc] [libclc] Move nan to the CLC library (PR #128521)

2025-02-24 Thread Fraser Cormack via cfe-commits
https://github.com/frasercrmck created https://github.com/llvm/llvm-project/pull/128521 None >From 49a2cb5fc5a098dc16f9e348eba8a93b3433a379 Mon Sep 17 00:00:00 2001 From: Fraser Cormack Date: Mon, 24 Feb 2025 15:11:07 + Subject: [PATCH] [libclc] Move nan to the CLC library --- libclc/clc

[libclc] [libclc] Move nan to the CLC library (PR #128521)

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

[libclc] [libclc] Move log/log2/log10 to CLC library (PR #128540)

2025-02-24 Thread Fraser Cormack via cfe-commits
https://github.com/frasercrmck created https://github.com/llvm/llvm-project/pull/128540 No changes to codegen for AMDGPU/Nvidia targets. Note that for simplicity this commit doesn't try to refactor or optimize the implementations. Notably, each log is only implementated for scalar types; vect

[libclc] [libclc] Define macros for users of gentype.inc (PR #128012)

2025-02-20 Thread Fraser Cormack via cfe-commits
https://github.com/frasercrmck created https://github.com/llvm/llvm-project/pull/128012 Several users of (mostly math/) gentype.inc rely on types other than the 'gentype'. This is commonly intN as several maths builtins expose this as a return or paramter type. We were previously explicitly de

[libclc] [libclc] Define macros for users of gentype.inc (PR #128012)

2025-02-20 Thread Fraser Cormack via cfe-commits
https://github.com/frasercrmck closed https://github.com/llvm/llvm-project/pull/128012 ___ 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-02-20 Thread Fraser Cormack via cfe-commits
https://github.com/frasercrmck created https://github.com/llvm/llvm-project/pull/128028 This commit moves the logb and ilogb builtins to the CLC library. It simultaneously optimizes them both for vector types and for half types. Vector types were being scalarized in some cases. Half types were

[libclc] [libclc] Remove clspv-specific clc conversions (PR #128500)

2025-02-26 Thread Fraser Cormack via cfe-commits
frasercrmck wrote: > This commit is causing regressions on the OpenCL-CTS with `clvk/clspv`. I > need more time to understand what the issue is exactly. Interesting, I'm sorry about that. I diffed `clc-convert.cl` and `clc-clspv-convert.cl` before this change and they were identical, so the c

[libclc] [libclc] Move sqrt to CLC library (PR #128748)

2025-02-25 Thread Fraser Cormack via cfe-commits
@@ -21,19 +21,17 @@ */ #if __CLC_FPSIZE == 64 -#define __CLC_NAN __builtin_nan("") -#define ZERO 0.0 +#define __CLC_NAN DBL_NAN #elif __CLC_FPSIZE == 32 -#define __CLC_NAN NAN -#define ZERO 0.0f +#define __CLC_NAN FLT_NAN #elif __CLC_FPSIZE == 16 -#define __CLC_NAN (half)NA

[libclc] [libclc] Move __clc_ldexp to CLC library (PR #126078)

2025-02-26 Thread Fraser Cormack via cfe-commits
https://github.com/frasercrmck updated https://github.com/llvm/llvm-project/pull/126078 >From 27f4e94de5cb6f1220ddbd4b0197a44cb831d0fe Mon Sep 17 00:00:00 2001 From: Fraser Cormack Date: Wed, 5 Feb 2025 10:38:46 + Subject: [PATCH] [libclc] Move __clc_ldexp to CLC library This function was

[libclc] [libclc] Move __clc_ldexp to CLC library (PR #126078)

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

[libclc] [libclc] Make CLC library warning-free (PR #128864)

2025-02-26 Thread Fraser Cormack via cfe-commits
https://github.com/frasercrmck created https://github.com/llvm/llvm-project/pull/128864 There is a long-standing workaround in the libclc build system that silences a warning about the use of parentheses in bitwise conditional operations. In an effort to remove this workaround, this commit re-

[libclc] [libclc] Make CLC library warning-free (PR #128864)

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

[libclc] [libclc] Move round to CLC library (PR #128721)

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

[libclc] [libclc] Move sqrt to CLC library (PR #128748)

2025-02-25 Thread Fraser Cormack via cfe-commits
https://github.com/frasercrmck created https://github.com/llvm/llvm-project/pull/128748 This is fairly straightforward for most targets. AMDGPU provides its own implementation of sqrt for double types. This commit moves this into the implementation of CLC sqrt. It uses weak linkage on the 'de

[libclc] [libclc] Move __clc_ldexp to CLC library (PR #126078)

2025-02-25 Thread Fraser Cormack via cfe-commits
frasercrmck wrote: An update on this: in adding a clang elementwise builtin for ldexp (and for clz/ctz) I found it necessary to first refactor the clang diagnostics. I opened a PR for it (https://github.com/llvm/llvm-project/pull/125673) which isn't getting much traction so that's slowing thin

[libclc] [libclc][NFC] Remove unused intrinsics helpers (PR #128708)

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

[libclc] [libclc] Move round to CLC library (PR #128721)

2025-02-25 Thread Fraser Cormack via cfe-commits
https://github.com/frasercrmck created https://github.com/llvm/llvm-project/pull/128721 None >From f8a607fc8842d101e54648e3970cfa9aff81e6aa Mon Sep 17 00:00:00 2001 From: Fraser Cormack Date: Tue, 25 Feb 2025 13:13:09 + Subject: [PATCH] [libclc] Move round to CLC library --- libclc/clc/i

[libclc] [libclc][NFC] Remove unused intrinsics helpers (PR #128708)

2025-02-25 Thread Fraser Cormack via cfe-commits
https://github.com/frasercrmck created https://github.com/llvm/llvm-project/pull/128708 We want to move away from using asm declarations to define builtins. >From 76d6da267c5991374579031d402be33da88ed43f Mon Sep 17 00:00:00 2001 From: Fraser Cormack Date: Tue, 25 Feb 2025 12:48:27 + Subjec

[clang] [clang] Improve diagnostics for vector builtins (PR #125673)

2025-02-25 Thread Fraser Cormack via cfe-commits
@@ -2266,8 +2266,10 @@ bool SemaHLSL::CheckBuiltinFunctionCall(unsigned BuiltinID, CallExpr *TheCall) { if (CheckVectorElementCallArgs(&SemaRef, TheCall)) return true; if (SemaRef.BuiltinElementwiseTernaryMath( -TheCall, /*CheckForFloatArgs*/ -

[libclc] [libclc] Move log/log2/log10 to CLC library (PR #128540)

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

[libclc] [libclc] Move sqrt to CLC library (PR #128748)

2025-02-27 Thread Fraser Cormack via cfe-commits
https://github.com/frasercrmck updated https://github.com/llvm/llvm-project/pull/128748 >From f827260918c81053d833db6fe81039b7c0990a2f Mon Sep 17 00:00:00 2001 From: Fraser Cormack Date: Tue, 25 Feb 2025 12:27:06 + Subject: [PATCH 1/3] [libclc] Move sqrt to CLC library This is fairly strai

[libclc] [libclc] Move sqrt to CLC library (PR #128748)

2025-02-27 Thread Fraser Cormack via cfe-commits
@@ -21,19 +21,17 @@ */ #if __CLC_FPSIZE == 64 -#define __CLC_NAN __builtin_nan("") -#define ZERO 0.0 +#define __CLC_NAN DBL_NAN #elif __CLC_FPSIZE == 32 -#define __CLC_NAN NAN -#define ZERO 0.0f +#define __CLC_NAN FLT_NAN #elif __CLC_FPSIZE == 16 -#define __CLC_NAN (half)NA

[libclc] [libclc] Move sqrt to CLC library (PR #128748)

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

[libclc] [libclc] Move sqrt to CLC library (PR #128748)

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

[libclc] [libclc] Move sqrt to CLC library (PR #128748)

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

[libclc] [libclc] Move rsqrt to the CLC library (PR #129045)

2025-02-27 Thread Fraser Cormack via cfe-commits
https://github.com/frasercrmck created https://github.com/llvm/llvm-project/pull/129045 This also adds missing half variants to certain targets. It also optimizes some targets' implementations to perform the operation directly in vector types, as opposed to scalarizing. >From 4efd607ca71b9184

[libclc] [libclc] Suppress data-layout warnings during linking (PR #127532)

2025-02-17 Thread Fraser Cormack via cfe-commits
https://github.com/frasercrmck created https://github.com/llvm/llvm-project/pull/127532 libclc uses llvm-link to link together all of the individually built libclc builtins files into one module. Some of these builtins files are compiled from source by clang whilst others are converted from LL

[libclc] [libclc] Suppress data-layout warnings during linking (PR #127532)

2025-02-17 Thread Fraser Cormack via cfe-commits
@@ -1,8 +1,4 @@ -#if __clang_major__ >= 7 -target datalayout = "e-p:64:64-p1:64:64-p2:32:32-p3:32:32-p4:64:64-p5:32:32-p6:32:32-i64:64-v16:16-v24:32-v32:32-v48:64-v96:128-v192:256-v256:256-v512:512-v1024:1024-v2048:2048-n32:64-S32-A5" -#else -target datalayout = "e-p:32:32-p1:64

[libclc] [libclc] Fix dependencies on generated convert builtins (PR #127515)

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

[libclc] [libclc] Fix dependencies on generated convert builtins (PR #127515)

2025-02-17 Thread Fraser Cormack via cfe-commits
https://github.com/frasercrmck created https://github.com/llvm/llvm-project/pull/127515 In #127378 it was reported that builds without clspv targets enabled were failing after #124727, as all targets had a dependency on a file that only clspv targets generated. A quick fix was merged in #1273

[libclc] [libclc] Improve nextafter behaviour around zero (PR #127469)

2025-02-19 Thread Fraser Cormack via cfe-commits
@@ -13,19 +13,25 @@ const UINT_TYPE sign_bit = (UINT_TYPE)1 \ << (sizeof(INT_TYPE_SCALAR) * 8 - 1); \ const UINT_TYPE sign_bit_mask = sign_bit - (UINT_TYPE)1; \ -INT_TYP

[libclc] [libclc] Improve nextafter behaviour around zero (PR #127469)

2025-02-19 Thread Fraser Cormack via cfe-commits
https://github.com/frasercrmck updated https://github.com/llvm/llvm-project/pull/127469 >From dbe1d8d133a54d0353fdb466cd59f5931d670bbf Mon Sep 17 00:00:00 2001 From: Fraser Cormack Date: Mon, 17 Feb 2025 10:17:44 + Subject: [PATCH 1/2] [libclc] Improve nextafter behaviour around zero This

[libclc] [libclc] Improve nextafter behaviour around zero (PR #127469)

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

[libclc] [libclc] Clean up directory search procedure (PR #127783)

2025-02-19 Thread Fraser Cormack via cfe-commits
https://github.com/frasercrmck created https://github.com/llvm/llvm-project/pull/127783 During a recent change, the build system accidentally dropped the (theoretical) support for the CLC builtins library to build target-specific builtins from the 'amdgpu' directory, due to a change in variabl

[clang] [clang] Improve diagnostics for vector builtins (PR #125673)

2025-02-18 Thread Fraser Cormack via cfe-commits
@@ -12411,16 +12411,13 @@ def err_builtin_is_within_lifetime_invalid_arg : Error< "%select{non-|function }0pointer argument to '__builtin_is_within_lifetime' " "is not allowed">; -def err_builtin_invalid_arg_type: Error < - "%ordinal0 argument must be " - "%select{a vec

[libclc] [libclc] Use CLC conversion builtins in CLC functions (PR #127628)

2025-02-18 Thread Fraser Cormack via cfe-commits
https://github.com/frasercrmck created https://github.com/llvm/llvm-project/pull/127628 This commit is a broad update across libclc to use the CLC conversion builtins in CLC functions, even those with a '__clc' prefix in the generic folder. This better prepares them for an official move to the

[libclc] [libclc] Suppress data-layout warnings during linking (PR #127532)

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

[libclc] [libclc] Suppress data-layout warnings during linking (PR #127532)

2025-02-18 Thread Fraser Cormack via cfe-commits
@@ -1,8 +1,4 @@ -#if __clang_major__ >= 7 -target datalayout = "e-p:64:64-p1:64:64-p2:32:32-p3:32:32-p4:64:64-p5:32:32-p6:32:32-i64:64-v16:16-v24:32-v32:32-v48:64-v96:128-v192:256-v256:256-v512:512-v1024:1024-v2048:2048-n32:64-S32-A5" -#else -target datalayout = "e-p:32:32-p1:64

[libclc] [libclc] Disable external-calls testing for clspv targets (PR #127529)

2025-02-18 Thread Fraser Cormack via cfe-commits
frasercrmck wrote: Just one failure: ``` Timed Out Tests (1): MLIR :: Examples/standalone/test.toy Total Discovered Tests: 131804 Skipped : 48 (0.04%) Unsupported : 2855 (2.17%) Passed : 128580 (97.55%) Expectedly Failed:320 (0.24

[libclc] [libclc] Suppress data-layout warnings during linking (PR #127532)

2025-02-18 Thread Fraser Cormack via cfe-commits
https://github.com/frasercrmck updated https://github.com/llvm/llvm-project/pull/127532 >From 2004d2a93073273cd7e09fbf6da6de7972412e98 Mon Sep 17 00:00:00 2001 From: Fraser Cormack Date: Mon, 17 Feb 2025 18:04:08 + Subject: [PATCH] [libclc] Suppress data-layout warnings during linking libc

[libclc] [libclc] Suppress data-layout warnings during linking (PR #127532)

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

[libclc] [libclc] Suppress data-layout warnings during linking (PR #127532)

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

[libclc] [libclc] Use CLC conversion builtins in CLC functions (PR #127628)

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

[libclc] 378c6fb - [libclc][NFC] Rename macro; undef at end of file

2025-02-18 Thread Fraser Cormack via cfe-commits
Author: Fraser Cormack Date: 2025-02-18T14:56:25Z New Revision: 378c6fbe330e6de2feac8a8e3bc0c93ec6aca80d URL: https://github.com/llvm/llvm-project/commit/378c6fbe330e6de2feac8a8e3bc0c93ec6aca80d DIFF: https://github.com/llvm/llvm-project/commit/378c6fbe330e6de2feac8a8e3bc0c93ec6aca80d.diff LOG

[clang] [clang] Improve diagnostics for vector builtins (PR #125673)

2025-02-18 Thread Fraser Cormack via cfe-commits
@@ -12411,16 +12411,13 @@ def err_builtin_is_within_lifetime_invalid_arg : Error< "%select{non-|function }0pointer argument to '__builtin_is_within_lifetime' " "is not allowed">; -def err_builtin_invalid_arg_type: Error < - "%ordinal0 argument must be " - "%select{a vec

[clang] [clang] Improve diagnostics for vector builtins (PR #125673)

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

[libclc] [libclc] Suppress data-layout warnings during linking (PR #127532)

2025-02-18 Thread Fraser Cormack via cfe-commits
@@ -1,8 +1,4 @@ -#if __clang_major__ >= 7 -target datalayout = "e-p:64:64-p1:64:64-p2:32:32-p3:32:32-p4:64:64-p5:32:32-p6:32:32-i64:64-v16:16-v24:32-v32:32-v48:64-v96:128-v192:256-v256:256-v512:512-v1024:1024-v2048:2048-n32:64-S32-A5" -#else -target datalayout = "e-p:32:32-p1:64

[libclc] [libclc] Disable external-calls testing for clspv targets (PR #127529)

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

[libclc] [libclc] Disable external-calls testing for clspv targets (PR #127529)

2025-02-17 Thread Fraser Cormack via cfe-commits
https://github.com/frasercrmck created https://github.com/llvm/llvm-project/pull/127529 These targets don't include all OpenCL builtins, so there will always be external calls in the final bytecode module. Fixes #127316. >From 3b172c687e3c276eea4489a39de5ed285c8ddd0e Mon Sep 17 00:00:00 2001

[libclc] [libclc] Move fma to the CLC library (PR #126052)

2025-02-19 Thread Fraser Cormack via cfe-commits
https://github.com/frasercrmck updated https://github.com/llvm/llvm-project/pull/126052 >From b09ec4e569a2659eca66dc38e35a02a87134c209 Mon Sep 17 00:00:00 2001 From: Fraser Cormack Date: Tue, 28 Jan 2025 12:19:23 + Subject: [PATCH 1/2] [libclc] Move fma to the CLC library This builtin is a

[libclc] [libclc] Move modf to the CLC library (PR #127828)

2025-02-19 Thread Fraser Cormack via cfe-commits
https://github.com/frasercrmck updated https://github.com/llvm/llvm-project/pull/127828 >From 34c217f46e81cbceda12ffa47c1825a57706fdc8 Mon Sep 17 00:00:00 2001 From: Fraser Cormack Date: Wed, 19 Feb 2025 16:25:22 + Subject: [PATCH] [libclc] Move modf to the CLC library The "generic" unary_

[libclc] [libclc] Move modf to the CLC library (PR #127828)

2025-02-19 Thread Fraser Cormack via cfe-commits
https://github.com/frasercrmck created https://github.com/llvm/llvm-project/pull/127828 The "generic" unary_(def|decl)_with_ptr files are intended to be re-used by the sincos and fract builtins in the future as they share an identical type signature. >From 09835c009430464426dced5598a5e8a9cae1

[libclc] fb5a87e - [libclc][NFC] Reformat ep_log.cl

2025-02-19 Thread Fraser Cormack via cfe-commits
Author: Fraser Cormack Date: 2025-02-19T15:18:05Z New Revision: fb5a87e1a6febb2a81fd85f800e78c2e6dff5715 URL: https://github.com/llvm/llvm-project/commit/fb5a87e1a6febb2a81fd85f800e78c2e6dff5715 DIFF: https://github.com/llvm/llvm-project/commit/fb5a87e1a6febb2a81fd85f800e78c2e6dff5715.diff LOG

<    1   2   3   4   5   6   >