[libclc] libclc: clspv: fma: remove fp16 implementation (PR #135002)

2025-04-09 Thread Romaric Jodin via cfe-commits
rjodinchr wrote: @frasercrmck , could you please review, and merge when approved? Thank you 🙏 https://github.com/llvm/llvm-project/pull/135002 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-c

[libclc] libclc: clspv: fma: remove fp16 implementation (PR #135002)

2025-04-09 Thread Romaric Jodin via cfe-commits
https://github.com/rjodinchr created https://github.com/llvm/llvm-project/pull/135002 clspv is already handling generation of fp16. This implementation is preventing clspv from making the best choice to use an emulation on top of fp32-fma, or the native fp16-fma, depending on the command-line

[libclc] libclc: frexp: fix implementation regarding denormals (PR #134823)

2025-04-08 Thread Romaric Jodin via cfe-commits
@@ -26,7 +26,7 @@ __clc_frexp(__CLC_GENTYPE x, __CLC_ADDRESS_SPACE __CLC_INTN *ep) { (ai & (__CLC_INTN)MANTBITS_SP32); __CLC_INTN is_inf_nan_or_zero = - x == __CLC_FP_LIT(0.0) || __clc_isinf(x) || __clc_isnan(x); + ai == (__CLC_INTN)0 || __clc_isinf(x) || __

[libclc] libclc: frexp: fix implementation regarding denormals (PR #134823)

2025-04-08 Thread Romaric Jodin via cfe-commits
@@ -26,7 +26,7 @@ __clc_frexp(__CLC_GENTYPE x, __CLC_ADDRESS_SPACE __CLC_INTN *ep) { (ai & (__CLC_INTN)MANTBITS_SP32); __CLC_INTN is_inf_nan_or_zero = - x == __CLC_FP_LIT(0.0) || __clc_isinf(x) || __clc_isnan(x); + ai == (__CLC_INTN)0 || __clc_isinf(x) || __

[libclc] [libclc] Reduce bithacking in CLC frexp (PR #129871)

2025-04-08 Thread Romaric Jodin via cfe-commits
rjodinchr wrote: I'm clearly seeing those devices returning true when comparing subnormals to zero. So either they all have a bug, or the SPIR-V code produced by `clspv` is buggy. If it ends up being a bug from the device, we might want to have something more architecture friendly, or at least

[libclc] [libclc] Reduce bithacking in CLC frexp (PR #129871)

2025-04-07 Thread Romaric Jodin via cfe-commits
rjodinchr wrote: I've deployed that patch into ChromeOS, and now Intel, Qualcomm and Imagination are also failing. I need to have a closer look to see if anything can be changed in `clspv` to fix it, but I might end-up needing the fix mentioned a few weeks ago. https://github.com/llvm/llvm-pr

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

2025-04-05 Thread Romaric Jodin via cfe-commits
https://github.com/rjodinchr updated https://github.com/llvm/llvm-project/pull/132390 >From 95eeda421b4cdc468f828d36146d609e80d195d9 Mon Sep 17 00:00:00 2001 From: Romaric Jodin Date: Fri, 21 Mar 2025 13:51:41 +0100 Subject: [PATCH 1/3] libclc: erfc: fix fp32 implementation On some implementat

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

2025-04-05 Thread Romaric Jodin via cfe-commits
https://github.com/rjodinchr created https://github.com/llvm/llvm-project/pull/132390 On some implementation, the current implementation lead to slight accuracy issues. While the maths behing this implementation is correct, it does not take into account the accumulation of errors coming from o

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

2025-04-05 Thread Romaric Jodin via cfe-commits
https://github.com/rjodinchr edited https://github.com/llvm/llvm-project/pull/132390 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

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

2025-04-05 Thread Romaric Jodin via cfe-commits
rjodinchr wrote: @karolherbst could you try this patch to see if it fixes rusticl as well? https://github.com/llvm/llvm-project/pull/132390 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-comm

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

2025-04-05 Thread Romaric Jodin via cfe-commits
https://github.com/rjodinchr edited https://github.com/llvm/llvm-project/pull/132390 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

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

2025-04-04 Thread Romaric Jodin via cfe-commits
https://github.com/rjodinchr created https://github.com/llvm/llvm-project/pull/134094 clspv uses a better implementation that is not using a bigger side when not available. Add a dummy implementation for mul_hi to avoid to override the implementation of clspv with the one in libclc. >From 46d

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

2025-04-03 Thread Romaric Jodin via cfe-commits
https://github.com/rjodinchr updated https://github.com/llvm/llvm-project/pull/134094 >From 46d4e40a3142b36811b85ac3d2ececf46d5b8e7c Mon Sep 17 00:00:00 2001 From: Romaric Jodin Date: Wed, 2 Apr 2025 17:12:17 +0200 Subject: [PATCH 1/2] [libclc]: clspv: add a dummy implememtation for mul_hi cls

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

2025-04-02 Thread Romaric Jodin via cfe-commits
rjodinchr wrote: For the record, clspv implementation is based on OpMulExtended which is SPIR-V specific and not accessible from C. https://github.com/llvm/llvm-project/pull/134094 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.

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

2025-04-02 Thread Romaric Jodin via cfe-commits
rjodinchr wrote: @frasercrmck could you please review? https://github.com/llvm/llvm-project/pull/134094 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

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

2025-03-24 Thread Romaric Jodin via cfe-commits
rjodinchr wrote: > It might be worth re-titling the PR to mention FTZ mode? Sure, I'm not sure what you have in mind, but feel free to do it when submitting it upstream (I cannot do it myself) https://github.com/llvm/llvm-project/pull/132390 ___ cfe-

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

2025-03-24 Thread Romaric Jodin via cfe-commits
rjodinchr wrote: > Though this does seem to be an improvement so it might be worth merging > anyway. As you say, it fixes things for you and for mesa. Are you both > testing on FTZ implementations, by any chance? Yes, default run of the CTS using clvk ends up running with FTZ. https://github.

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

2025-03-24 Thread Romaric Jodin via cfe-commits
https://github.com/rjodinchr updated https://github.com/llvm/llvm-project/pull/132390 >From 95eeda421b4cdc468f828d36146d609e80d195d9 Mon Sep 17 00:00:00 2001 From: Romaric Jodin Date: Fri, 21 Mar 2025 13:51:41 +0100 Subject: [PATCH 1/2] libclc: erfc: fix fp32 implementation On some implementat

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

2025-03-21 Thread Romaric Jodin via cfe-commits
https://github.com/rjodinchr updated https://github.com/llvm/llvm-project/pull/132390 >From 95eeda421b4cdc468f828d36146d609e80d195d9 Mon Sep 17 00:00:00 2001 From: Romaric Jodin Date: Fri, 21 Mar 2025 13:51:41 +0100 Subject: [PATCH] libclc: erfc: fix fp32 implementation On some implementation,

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

2025-03-21 Thread Romaric Jodin via cfe-commits
rjodinchr wrote: @frasercrmck could you review please? https://github.com/llvm/llvm-project/pull/132390 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[libclc] [libclc] Reduce bithacking in CLC frexp (PR #129871)

2025-03-20 Thread Romaric Jodin via cfe-commits
rjodinchr wrote: I tend to agree. let's keep it that way. https://github.com/llvm/llvm-project/pull/129871 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[libclc] [libclc] Reduce bithacking in CLC frexp (PR #129871)

2025-03-18 Thread Romaric Jodin via cfe-commits
rjodinchr wrote: The following patch is fixing the issue on my side: ``` - __CLC_INTN is_inf_nan_or_zero = - x == __CLC_FP_LIT(0.0) || __clc_isinf(x) || __clc_isnan(x); + __CLC_INTN is_inf_nan_or_zero = + ai == (__CLC_INTN)0 || e == (__CLC_INTN)129 || __clc_isinf(x) || __clc_isnan(

[libclc] [libclc] Reduce bithacking in CLC frexp (PR #129871)

2025-03-18 Thread Romaric Jodin via cfe-commits
rjodinchr wrote: But maybe it is just masking a swiftshader bug? https://github.com/llvm/llvm-project/pull/129871 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[libclc] [libclc] Reduce bithacking in CLC frexp (PR #129871)

2025-03-18 Thread Romaric Jodin via cfe-commits
rjodinchr wrote: This is failing with `fp32`. The failing value is very close to zero (it's a denormal), I think something is going wrong with `x == __CLC_FP_LIT(0.0)` when computing `is_inf_nan_or_zero`. Maybe a bug inside Swiftshader with denormal comparison to zero? https://github.com/llvm/

[libclc] [libclc] Reduce bithacking in CLC frexp (PR #129871)

2025-03-17 Thread Romaric Jodin via cfe-commits
rjodinchr wrote: yes wrong results: ``` ERROR: frexp: {-8404992.00, 139} ulp error at 0x1.008p-140: *{0x1.008p-1, -139} vs. {0x1.008p-140, 0} ``` https://github.com/llvm/llvm-project/pull/129871 ___ cfe-commits mailing list cfe-commits@lists.llvm.

[libclc] [libclc] Reduce bithacking in CLC frexp (PR #129871)

2025-03-17 Thread Romaric Jodin via cfe-commits
rjodinchr wrote: This commit breaks running with clvk & Swiftshader. Not a big deal on my side. Just wanted to let you know. https://github.com/llvm/llvm-project/pull/129871 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.or

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

2025-02-26 Thread Romaric Jodin via cfe-commits
rjodinchr wrote: In fact, I missed that I had to modify some build files in Google infra for that change. So it's all good. Also, would you have a 15min slot in the coming days to talk about all your libclc work? https://github.com/llvm/llvm-project/pull/128500 __

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

2025-02-26 Thread Romaric Jodin via cfe-commits
rjodinchr wrote: This commit is causing regressions on the OpenCL-CTS with `clvk/clspv`. I need more time to understand what the issue is exactly. https://github.com/llvm/llvm-project/pull/128500 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

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

2025-02-24 Thread Romaric Jodin via cfe-commits
rjodinchr 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] Fix int<->float conversion builtins (PR #126905)

2025-02-23 Thread Romaric Jodin via cfe-commits
https://github.com/rjodinchr approved this pull request. 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-23 Thread Romaric Jodin via cfe-commits
rjodinchr 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

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

2025-01-28 Thread Romaric Jodin via cfe-commits
rjodinchr wrote: clspv's `check-spirv` is what you want to test yes. But I was running within Google infra to try directly using the OpenCL-CTS. https://github.com/llvm/llvm-project/pull/124727 ___ cfe-commits mailing list cfe-commits@lists.llvm.org h

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

2025-01-28 Thread Romaric Jodin via cfe-commits
rjodinchr wrote: In fact my setup was busted. In the end it seems to work without change. https://github.com/llvm/llvm-project/pull/124727 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commi

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

2025-01-28 Thread Romaric Jodin via cfe-commits
rjodinchr 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 the `__cl

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

2025-01-28 Thread Romaric Jodin via cfe-commits
rjodinchr wrote: This is not correct for `clspv`. It breaks everything and it feels like it needs quite some work to fix. FYI, I'll be OOO from Feb 3 to Feb 21. Can it wait that long? I'm not sure I'll have enough time to figure it out before the end of the week. https://github.com/llvm/llvm-

[libclc] libclc: clspv: add missing clc_isnan.cl dependency (PR #124614)

2025-01-28 Thread Romaric Jodin via cfe-commits
rjodinchr wrote: Thank you https://github.com/llvm/llvm-project/pull/124614 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[libclc] libclc: clspv: add missing clc_isnan.cl dependency (PR #124614)

2025-01-28 Thread Romaric Jodin via cfe-commits
rjodinchr wrote: @frasercrmck , I cannot merge it myself, could you do it please? > Should spirv/SOURCES and spirv64/SOURCES receive the same thing? I'm not sure, I would guess yes, but without testing it, it's hard to be 100% sure. https://github.com/llvm/llvm-project/pull/124614 ___

[libclc] libclc: clspv: add missing clc_isnan.cl dependency (PR #124614)

2025-01-27 Thread Romaric Jodin via cfe-commits
https://github.com/rjodinchr created https://github.com/llvm/llvm-project/pull/124614 clc_isnan.cl is needed since https://github.com/llvm/llvm-project/pull/124097 >From 1c11070d2f2997b76412e7be07fa05501147c5ff Mon Sep 17 00:00:00 2001 From: Romaric Jodin Date: Mon, 27 Jan 2025 20:21:31 +0100

[libclc] libclc: clspv: add missing clc_isnan.cl dependency (PR #124614)

2025-01-27 Thread Romaric Jodin via cfe-commits
rjodinchr wrote: @frasercrmck, could you review please? https://github.com/llvm/llvm-project/pull/124614 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

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

2024-12-05 Thread Romaric Jodin via 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 rjodinchr wrote: I don't think the s

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

2024-12-05 Thread Romaric Jodin via 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 rjodinchr wrote: On the `clspv` side

[libclc] [libclc] Create an internal 'clc' builtins library (PR #109985)

2024-09-26 Thread Romaric Jodin via cfe-commits
rjodinchr 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 `c

[libclc] libclc: add half version of 'sign' (PR #99841)

2024-07-22 Thread Romaric Jodin via cfe-commits
rjodinchr wrote: @frasercrmck could you review please? https://github.com/llvm/llvm-project/pull/99841 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[libclc] libclc: increase fp16 support (PR #98149)

2024-07-22 Thread Romaric Jodin via cfe-commits
rjodinchr wrote: @mgorny thank you for the report. It should be fixed with: https://github.com/llvm/llvm-project/pull/99841 https://github.com/llvm/llvm-project/pull/98149 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/

[libclc] libclc: add half version of 'sign' (PR #99841)

2024-07-22 Thread Romaric Jodin via cfe-commits
https://github.com/rjodinchr created https://github.com/llvm/llvm-project/pull/99841 None >From 009987936213d404a7dd28b5f1551ce85e6c8560 Mon Sep 17 00:00:00 2001 From: Romaric Jodin Date: Mon, 22 Jul 2024 09:44:01 +0200 Subject: [PATCH] libclc: add half version of 'sign' --- libclc/generic/l

[libclc] libclc: increase fp16 support (PR #98149)

2024-07-18 Thread Romaric Jodin via cfe-commits
rjodinchr wrote: This PR should fix the build issue: https://github.com/llvm/llvm-project/pull/99481 https://github.com/llvm/llvm-project/pull/98149 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinf

[libclc] libclc: fix convert with half (PR #99481)

2024-07-18 Thread Romaric Jodin via cfe-commits
rjodinchr wrote: @frasercrmck could you please review? thanks https://github.com/llvm/llvm-project/pull/99481 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[libclc] libclc: fix convert with half (PR #99481)

2024-07-18 Thread Romaric Jodin via cfe-commits
https://github.com/rjodinchr created https://github.com/llvm/llvm-project/pull/99481 Fix following update of libclc introducing more fp16 support: https://github.com/llvm/llvm-project/commit/7e6a73959ae97b1f9476a90290a492ba90cb950d >From 63f5f5a57c55dce7c2cdcbddff8f80817104f48e Mon Sep 17 00:0

[libclc] libclc: increase fp16 support (PR #98149)

2024-07-18 Thread Romaric Jodin via cfe-commits
rjodinchr wrote: I am able to reproduce it, working on it right now https://github.com/llvm/llvm-project/pull/98149 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[libclc] libclc: increase fp16 support (PR #98149)

2024-07-18 Thread Romaric Jodin via cfe-commits
rjodinchr wrote: > @rjodinchr I was about to merge and noticed your email is hidden. I just > wanted to check with you whether you want to make it public, as per the > discussion > https://discourse.llvm.org/t/hidden-emails-on-github-should-we-do-something-about-it/74223/67. > AFAICT there's

[libclc] libclc: increase fp16 support (PR #98149)

2024-07-17 Thread Romaric Jodin via cfe-commits
rjodinchr wrote: Also, just leave that thought here: A next step might be to use `native` functions instead (when available). They should provide enough precision for half, but be more performance. Also as the accuracy is undefined for those functions, maybe it should be an opt-in option in th

[libclc] libclc: increase fp16 support (PR #98149)

2024-07-17 Thread Romaric Jodin via cfe-commits
https://github.com/rjodinchr updated https://github.com/llvm/llvm-project/pull/98149 >From 449321d1d22c39201e132cbd8b5846cbe12dbe39 Mon Sep 17 00:00:00 2001 From: Romaric Jodin Date: Tue, 9 Jul 2024 14:22:26 +0200 Subject: [PATCH] libclc: increase fp16 support Increase fp16 support to allow cl

[libclc] libclc: increase fp16 support (PR #98149)

2024-07-17 Thread Romaric Jodin via cfe-commits
@@ -181,3 +181,15 @@ _CLC_OVERLOAD _CLC_DEF double atan(double x) _CLC_UNARY_VECTORIZE(_CLC_OVERLOAD _CLC_DEF, double, atan, double); #endif // cl_khr_fp64 + +#ifdef cl_khr_fp16 rjodinchr wrote: Alright, just found that it is due to includes order in `atan.cl

[libclc] libclc: increase fp16 support (PR #98149)

2024-07-17 Thread Romaric Jodin via cfe-commits
@@ -181,3 +181,15 @@ _CLC_OVERLOAD _CLC_DEF double atan(double x) _CLC_UNARY_VECTORIZE(_CLC_OVERLOAD _CLC_DEF, double, atan, double); #endif // cl_khr_fp64 + +#ifdef cl_khr_fp16 rjodinchr wrote: I agree, but I had some weird compilation errors. Does it work o

[libclc] libclc: increase fp16 support (PR #98149)

2024-07-09 Thread Romaric Jodin via cfe-commits
rjodinchr wrote: @frasercrmck Could you review it please? https://github.com/llvm/llvm-project/pull/98149 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[libclc] libclc: increase fp16 support (PR #98149)

2024-07-09 Thread Romaric Jodin via cfe-commits
https://github.com/rjodinchr updated https://github.com/llvm/llvm-project/pull/98149 >From a387a97cc6ed89c65a9a80bc030e705ec864bf36 Mon Sep 17 00:00:00 2001 From: Romaric Jodin Date: Tue, 9 Jul 2024 14:22:26 +0200 Subject: [PATCH] libclc: increase fp16 support Increase fp16 support to allow cl

[libclc] libclc: increase fp16 support (PR #98149)

2024-07-09 Thread Romaric Jodin via cfe-commits
https://github.com/rjodinchr updated https://github.com/llvm/llvm-project/pull/98149 >From c03c6e3a746fe6bfaf164151278db3cd32111f19 Mon Sep 17 00:00:00 2001 From: Romaric Jodin Date: Tue, 9 Jul 2024 14:22:26 +0200 Subject: [PATCH] libclc: increase fp16 support Increase fp16 support to allow cl

[libclc] libclc: increase fp16 support (PR #98149)

2024-07-09 Thread Romaric Jodin via cfe-commits
rjodinchr wrote: @alan-baker @kpet , could you please review? https://github.com/llvm/llvm-project/pull/98149 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[libclc] libclc: increase fp16 support (PR #98149)

2024-07-09 Thread Romaric Jodin via cfe-commits
rjodinchr wrote: Those implementations have been tested using 1 Intel and 1 AMD devices (with clvk/clspv) https://github.com/llvm/llvm-project/pull/98149 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/li

[libclc] libclc: increase fp16 support (PR #98149)

2024-07-09 Thread Romaric Jodin via cfe-commits
https://github.com/rjodinchr created https://github.com/llvm/llvm-project/pull/98149 Increase fp16 support to allow clspv to continue to be OpenCL compliant following the update of the OpenCL-CTS adding more testing on math functions and conversions with half. Math functions are implemented b

[clang] [libclc] libclc: remove __attribute__((assume)) for clspv targets (PR #92126)

2024-05-17 Thread Romaric Jodin via cfe-commits
rjodinchr wrote: Is there something else needed on my side to get that PR merged? https://github.com/llvm/llvm-project/pull/92126 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [libclc] libclc: remove __attribute__((assume)) for clspv targets (PR #92126)

2024-05-14 Thread Romaric Jodin via cfe-commits
https://github.com/rjodinchr updated https://github.com/llvm/llvm-project/pull/92126 >From c8798839ee93caa9e5a3db6d770801a4c22010c8 Mon Sep 17 00:00:00 2001 From: Romaric Jodin Date: Tue, 14 May 2024 16:08:26 +0200 Subject: [PATCH] libclc: remove __attribute__((assume)) for clspv targets Inste

[clang] [libclc] libclc: remove __attribute__((assume)) for clspv targets (PR #92126)

2024-05-14 Thread Romaric Jodin via cfe-commits
https://github.com/rjodinchr updated https://github.com/llvm/llvm-project/pull/92126 >From 4ce295d3dbd7a5b723cdf410d2023eb59120d27a Mon Sep 17 00:00:00 2001 From: Romaric Jodin Date: Tue, 14 May 2024 16:08:26 +0200 Subject: [PATCH] libclc: remove __attribute__((assume)) for clspv targets Inste

[clang] [libclc] libclc: remove __attribute__((assume)) for clspv targets (PR #92126)

2024-05-14 Thread Romaric Jodin via cfe-commits
https://github.com/rjodinchr updated https://github.com/llvm/llvm-project/pull/92126 >From df793384bdb689b3b74ca83102a539a1db623e9f Mon Sep 17 00:00:00 2001 From: Romaric Jodin Date: Tue, 14 May 2024 16:08:26 +0200 Subject: [PATCH] libclc: remove __attribute__((assume)) for clspv targets Inste

[clang] [libclc] libclc: remove __attribute__((assume)) for clspv targets (PR #92126)

2024-05-14 Thread Romaric Jodin via cfe-commits
https://github.com/rjodinchr updated https://github.com/llvm/llvm-project/pull/92126 >From 05fd8c24146a5237c7c4cc425beb205524429ba7 Mon Sep 17 00:00:00 2001 From: Romaric Jodin Date: Tue, 14 May 2024 16:08:26 +0200 Subject: [PATCH] libclc: remove __attribute__((assume)) for clspv targets Inste

[clang] [libclc] libclc: remove __attribute__((assume)) for clspv targets (PR #92126)

2024-05-14 Thread Romaric Jodin via cfe-commits
rjodinchr wrote: @erichkeane, I don't know what you expect for the release note, where should I write something? https://github.com/llvm/llvm-project/pull/92126 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mai

[clang] [libclc] libclc: remove __attribute__((assume)) for clspv targets (PR #92126)

2024-05-14 Thread Romaric Jodin via cfe-commits
@@ -4561,3 +4561,9 @@ def CodeAlign: StmtAttr { static constexpr int MaximumAlignment = 4096; }]; } + +def ClspvLibclcBuiltin: DeclOrStmtAttr { + let Spellings = [Clang<"clspv_libclc_builtin">]; + let Documentation = [Undocumented]; rjodinchr wrote: Wh

[clang] [libclc] libclc: remove __attribute__((assume)) for clspv targets (PR #92126)

2024-05-14 Thread Romaric Jodin via cfe-commits
@@ -4561,3 +4561,9 @@ def CodeAlign: StmtAttr { static constexpr int MaximumAlignment = 4096; }]; } + +def ClspvLibclcBuiltin: DeclOrStmtAttr { + let Spellings = [Clang<"clspv_libclc_builtin">]; + let Documentation = [Undocumented]; + let SimpleHandler = 1; ---

[clang] [libclc] [llvm] [openmp] [Clang] `__attribute__((assume))` refactor (PR #84934)

2024-05-14 Thread Romaric Jodin via cfe-commits
rjodinchr wrote: Here is the PR ready for review: https://github.com/llvm/llvm-project/pull/92126 https://github.com/llvm/llvm-project/pull/84934 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cf

[clang] [libclc] libclc: remove __attribute__((assume)) for clspv targets (PR #92126)

2024-05-14 Thread Romaric Jodin via cfe-commits
https://github.com/rjodinchr updated https://github.com/llvm/llvm-project/pull/92126 >From 41e2a5c3fd693fad20e2f76d1a39a1ac9468a33b Mon Sep 17 00:00:00 2001 From: Romaric Jodin Date: Tue, 14 May 2024 16:08:26 +0200 Subject: [PATCH] libclc: remove __attribute__((assume)) for clspv targets Inste

[clang] [libclc] libclc: remove __attribute__((assume)) for clspv targets (PR #92126)

2024-05-14 Thread Romaric Jodin via cfe-commits
https://github.com/rjodinchr created https://github.com/llvm/llvm-project/pull/92126 Instead add a proper attribute in clang, and add convert it to function metadata to keep the information in the IR. The goal is to remove the dependency on __attribute__((assume)) that should have not be there

[clang] [libclc] [llvm] [openmp] [Clang] `__attribute__((assume))` refactor (PR #84934)

2024-05-14 Thread Romaric Jodin via cfe-commits
rjodinchr wrote: I'll make a PR for clspv then https://github.com/llvm/llvm-project/pull/84934 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [libclc] [llvm] [openmp] [Clang] `__attribute__((assume))` refactor (PR #84934)

2024-05-14 Thread Romaric Jodin via cfe-commits
rjodinchr wrote: Alright with those changes, everything should be fine for `clspv`: ``` diff --git a/clang/include/clang/Basic/Attr.td b/clang/include/clang/Basic/Attr.td index dc87a8c6f022..056f22b56001 100644 --- a/clang/include/clang/Basic/Attr.td +++ b/clang/include/clang/Basic/Attr.td @@ -4

[clang] [libclc] [llvm] [openmp] [Clang] `__attribute__((assume))` refactor (PR #84934)

2024-05-14 Thread Romaric Jodin via cfe-commits
rjodinchr wrote: This is the first time I'm trying to add an attribute, and I think I am missing something. I am adding this part in `Attr.td`: ``` def ClspvLibclcBuiltin: DeclOrStmtAttr { let Spellings = [Clang<"clspv_libclc_builtin">]; let Documentation = [Undocumented]; let SimpleHandle

[clang] [libclc] [llvm] [openmp] [Clang] `__attribute__((assume))` refactor (PR #84934)

2024-05-13 Thread Romaric Jodin via cfe-commits
rjodinchr wrote: It is only to tag functions. I guess the name would be `clspv_libclc_builtin` (https://github.com/llvm/llvm-project/blob/main/libclc/generic/include/clc/clcfunc.h#L11). I've started to test with such a solution to make sure everything works on clspv side, but I need more time.

[clang] [libclc] [llvm] [openmp] [Clang] `__attribute__((assume))` refactor (PR #84934)

2024-05-12 Thread Romaric Jodin via cfe-commits
rjodinchr wrote: > > It has nothing to do with OpenMP. The goal was just to get something in the > > llvm IR that we could check for. The `assume` attribute allows us to pass a > > string that we can then check in a llvm pass. > > Could you investigate whether 'annotate' would do what you want

[clang] [libclc] [llvm] [openmp] [Clang] `__attribute__((assume))` refactor (PR #84934)

2024-05-08 Thread Romaric Jodin via cfe-commits
rjodinchr wrote: It has nothing to do with OpenMP. The goal was just to get something in the llvm IR that we could check for. The `assume` attribute allows us to pass a string that we can then check in a llvm pass. https://github.com/llvm/llvm-project/pull/84934 __

[clang] [libclc] [llvm] [openmp] [Clang] `__attribute__((assume))` refactor (PR #84934)

2024-05-08 Thread Romaric Jodin via cfe-commits
rjodinchr wrote: > The libclc usage seems to have been added by @rjodinchr in > https://reviews.llvm.org/D147773 (and approved by @alan-baker). Perhaps they > have an opinion? https://github.com/google/clspv uses the assume attribute. The goal is to be able to put a mark on libclc functions t

[libclc] [llvm] [libclc] Refactor build system to allow in-tree builds (PR #87622)

2024-04-10 Thread Romaric Jodin via cfe-commits
https://github.com/rjodinchr approved this pull request. https://github.com/llvm/llvm-project/pull/87622 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[libclc] [libclc] Fix a couple of issues preventing in-tree builds (PR #87505)

2024-04-08 Thread Romaric Jodin via cfe-commits
rjodinchr wrote: > > ``` > > set( spv_suffix ${arch_suffix}.spv ) > > add_custom_command( OUTPUT "${spv_suffix}" > > COMMAND ${LLVM_SPIRV} ${spvflags} -o "${spv_suffix}" > > ${builtins_opt_lib_tgt} > > DEPENDS ${builtins_link_lib_tgt} ) > > ``` > > > > > > > >

[libclc] [llvm] [libclc] Refactor build system to allow in-tree builds (PR #87622)

2024-04-05 Thread Romaric Jodin via cfe-commits
@@ -358,3 +399,7 @@ foreach( t ${LIBCLC_TARGETS_TO_BUILD} ) endif() endforeach( d ) endforeach( t ) + +if( NOT LIBCLC_STANDALONE_BUILD ) + add_subdirectory( test ) rjodinchr wrote: There is no `CMakeLists.txt` in `/llvm/libclc/test`. https://github.com

[libclc] libclc: clspv: update gen_convert.cl for clspv (PR #66902)

2024-03-14 Thread Romaric Jodin via cfe-commits
https://github.com/rjodinchr edited https://github.com/llvm/llvm-project/pull/66902 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[libclc] libclc: clspv: update gen_convert.cl for clspv (PR #66902)

2024-03-14 Thread Romaric Jodin via cfe-commits
https://github.com/rjodinchr updated https://github.com/llvm/llvm-project/pull/66902 >From c5f3c0a72bf5b52f7f92df3bcc00a7c5b9001a5c Mon Sep 17 00:00:00 2001 From: Romaric Jodin Date: Tue, 18 Jul 2023 09:30:09 +0200 Subject: [PATCH] libclc: clspv: update gen_convert.cl for clspv Add a clspv swi

[libclc] libclc: clspv: update gen_convert.cl for clspv (PR #66902)

2024-03-14 Thread Romaric Jodin via cfe-commits
@@ -307,8 +320,8 @@ def generate_saturated_conversion(src, dst, size): # Conversion from float to int print( """ {DST}{N} y = convert_{DST}{N}(x); - y = select(y, ({DST}{N}){DST_MIN}, {BP}(x < ({SRC}{N}){DST_MIN}){BS}); - y = select(y, ({DST}{N}){

[libclc] libclc: clspv: update gen_convert.cl for clspv (PR #66902)

2024-03-14 Thread Romaric Jodin via cfe-commits
@@ -26,6 +27,12 @@ # # convert_<_sat><_roundingMode>() +import sys + +clspv = False +if len(sys.argv) == 2 and sys.argv[1] == "--clspv": +clspv = True + rjodinchr wrote: I wanted to avoid the dependency on argparse to be added. But Python version not hav

[libclc] libclc: clspv: update gen_convert.cl for clspv (PR #66902)

2024-03-14 Thread Romaric Jodin via cfe-commits
https://github.com/rjodinchr updated https://github.com/llvm/llvm-project/pull/66902 >From 79427445538b3abeda08224e48484ddac1342243 Mon Sep 17 00:00:00 2001 From: Romaric Jodin Date: Tue, 18 Jul 2023 09:30:09 +0200 Subject: [PATCH] libclc: clspv: update gen_convert.cl for clspv Add a clspv swi

[libclc] libclc: clspv: update gen_convert.cl for clspv (PR #66902)

2024-03-14 Thread Romaric Jodin via cfe-commits
https://github.com/rjodinchr updated https://github.com/llvm/llvm-project/pull/66902 >From 8d2b49e198feb8ec3d836b871178b14c161c4d5d Mon Sep 17 00:00:00 2001 From: Romaric Jodin Date: Tue, 18 Jul 2023 09:30:09 +0200 Subject: [PATCH] libclc: clspv: update gen_convert.cl for clspv Add a clspv swi

[libclc] libclc: clspv: update gen_convert.cl for clspv (PR #66902)

2024-03-14 Thread Romaric Jodin via cfe-commits
https://github.com/rjodinchr updated https://github.com/llvm/llvm-project/pull/66902 >From a6146bbc90d198d62d516bf09a41034f36f7866c Mon Sep 17 00:00:00 2001 From: Romaric Jodin Date: Tue, 18 Jul 2023 09:30:09 +0200 Subject: [PATCH] libclc: clspv: update gen_convert.cl for clspv Add a clspv swi

[libclc] libclc: clspv: update gen_convert.cl for clspv (PR #66902)

2024-03-14 Thread Romaric Jodin via cfe-commits
https://github.com/rjodinchr edited https://github.com/llvm/llvm-project/pull/66902 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[libclc] libclc: clspv: create gen_convert.cl for clspv (PR #66902)

2024-03-14 Thread Romaric Jodin via cfe-commits
https://github.com/rjodinchr edited https://github.com/llvm/llvm-project/pull/66902 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[libclc] libclc: clspv: create gen_convert.cl for clspv (PR #66902)

2024-03-14 Thread Romaric Jodin via cfe-commits
https://github.com/rjodinchr updated https://github.com/llvm/llvm-project/pull/66902 >From 5614f89c90cf865c88fbcf95d707e34dfeb18a19 Mon Sep 17 00:00:00 2001 From: Romaric Jodin Date: Tue, 18 Jul 2023 09:30:09 +0200 Subject: [PATCH] libclc: clspv: update gen_convert.cl for clspv Add a clspv swi

[clang] clang/OpenCL: set sqrt fp accuracy on call to Z4sqrt (PR #66651)

2023-11-15 Thread Romaric Jodin via cfe-commits
rjodinchr wrote: @AnastasiaStulova Could you please take a look? thanks https://github.com/llvm/llvm-project/pull/66651 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] clang/OpenCL: set sqrt fp accuracy on call to Z4sqrt (PR #66651)

2023-11-03 Thread Romaric Jodin via cfe-commits
rjodinchr wrote: What is the next step to get this PR merged? https://github.com/llvm/llvm-project/pull/66651 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] clang/OpenCL: set sqrt fp accuracy on call to Z4sqrt (PR #66651)

2023-10-24 Thread Romaric Jodin via cfe-commits
rjodinchr wrote: @arsenm? https://github.com/llvm/llvm-project/pull/66651 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] clang/OpenCL: set sqrt fp accuracy on call to Z4sqrt (PR #66651)

2023-10-18 Thread Romaric Jodin via cfe-commits
rjodinchr wrote: @arsenm could you have another look at this PR? Thank you https://github.com/llvm/llvm-project/pull/66651 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] clang/OpenCL: set sqrt fp accuracy on call to Z4sqrt (PR #66651)

2023-10-02 Thread Romaric Jodin via cfe-commits
@@ -5612,6 +5612,10 @@ RValue CodeGenFunction::EmitCall(const CGFunctionInfo &CallInfo, BundleList); EmitBlock(Cont); } + if (CI->getCalledFunction() && CI->getCalledFunction()->hasName() && + CI->getCalledFunction()->getName().startsw

[clang] clang/OpenCL: set sqrt fp accuracy on call to Z4sqrt (PR #66651)

2023-09-25 Thread Romaric Jodin via cfe-commits
@@ -5612,6 +5612,10 @@ RValue CodeGenFunction::EmitCall(const CGFunctionInfo &CallInfo, BundleList); EmitBlock(Cont); } + if (CI->getCalledFunction() && CI->getCalledFunction()->hasName() && + CI->getCalledFunction()->getName().startsw

[clang] clang/OpenCL: set sqrt fp accuracy on call to Z4sqrt (PR #66651)

2023-09-25 Thread Romaric Jodin via cfe-commits
rjodinchr wrote: @arsenm Could you review this PR again please? https://github.com/llvm/llvm-project/pull/66651 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[libclc] libclc: clspv: create gen_convert.cl for clspv (PR #66902)

2023-09-21 Thread Romaric Jodin via cfe-commits
https://github.com/rjodinchr updated https://github.com/llvm/llvm-project/pull/66902 >From 67e347f9987b48652daaaceb4a51041f7b9a1430 Mon Sep 17 00:00:00 2001 From: Romaric Jodin Date: Tue, 18 Jul 2023 09:30:09 +0200 Subject: [PATCH] libclc: clspv: create gen_convert.cl for clspv Create clspv ow

[libclc] libclc: clspv: create gen_convert.cl for clspv (PR #66902)

2023-09-20 Thread Romaric Jodin via cfe-commits
rjodinchr wrote: @kpet @alan-baker could you review this PR please? https://github.com/llvm/llvm-project/pull/66902 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

  1   2   >