[clang] Adding `asuint` implementation to hlsl (PR #107292)

2024-10-10 Thread LLVM Continuous Integration via cfe-commits
llvm-ci wrote: LLVM Buildbot has detected a new failure on builder `clang-m68k-linux-cross` running on `suse-gary-m68k-cross` while building `clang` at step 5 "ninja check 1". Full details are available at: https://lab.llvm.org/buildbot/#/builders/27/builds/438 Here is the relevant piece of

[clang] Adding `asuint` implementation to hlsl (PR #107292)

2024-09-13 Thread via cfe-commits
github-actions[bot] wrote: @joaosaffran Congratulations on having your first Pull Request (PR) merged into the LLVM Project! Your changes will be combined with recent changes from other authors, then tested by our [build bots](https://lab.llvm.org/buildbot/). If there is a problem with a bu

[clang] Adding `asuint` implementation to hlsl (PR #107292)

2024-09-13 Thread Farzon Lotfi via cfe-commits
https://github.com/farzonl closed https://github.com/llvm/llvm-project/pull/107292 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Adding `asuint` implementation to hlsl (PR #107292)

2024-09-13 Thread via cfe-commits
https://github.com/joaosaffran updated https://github.com/llvm/llvm-project/pull/107292 >From c6434c06d17a2442863f8843e75dc870966fb97c Mon Sep 17 00:00:00 2001 From: Joao Saffran Date: Tue, 3 Sep 2024 19:06:22 + Subject: [PATCH 1/6] Adding `asuint` implementation to hlsl --- clang/includ

[clang] Adding `asuint` implementation to hlsl (PR #107292)

2024-09-13 Thread Farzon Lotfi via cfe-commits
https://github.com/farzonl approved this pull request. https://github.com/llvm/llvm-project/pull/107292 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Adding `asuint` implementation to hlsl (PR #107292)

2024-09-13 Thread Justin Bogner via cfe-commits
https://github.com/bogner approved this pull request. looks good, thanks! https://github.com/llvm/llvm-project/pull/107292 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Adding `asuint` implementation to hlsl (PR #107292)

2024-09-13 Thread Justin Bogner via cfe-commits
@@ -0,0 +1,25 @@ +// RUN: %clang_cc1 -finclude-default-header -triple dxil-pc-shadermodel6.6-library %s -fnative-half-type -emit-llvm-only -disable-llvm-passes -verify bogner wrote: The `-emit-llvm-only` and `-disable-llvm-passes` flags don't really do anything

[clang] Adding `asuint` implementation to hlsl (PR #107292)

2024-09-13 Thread Justin Bogner via cfe-commits
https://github.com/bogner edited https://github.com/llvm/llvm-project/pull/107292 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Adding `asuint` implementation to hlsl (PR #107292)

2024-09-13 Thread via cfe-commits
joaosaffran wrote: > ⚠️ C/C++ code formatter, clang-format found issues in your code. ⚠️ > > You can test this locally with the following command: > View the diff from clang-format here. This is formatting issue is caused because, clang's LLVM style assumes C++14, where the space isn't require

[clang] Adding `asuint` implementation to hlsl (PR #107292)

2024-09-12 Thread via cfe-commits
@@ -0,0 +1,18 @@ +// RUN: %clang_cc1 -finclude-default-header -triple dxil-pc-shadermodel6.6-library %s -fnative-half-type -emit-llvm-only -disable-llvm-passes -verify -verify-ignore-unexpected joaosaffran wrote: I've updated the tests, but here is the full err

[clang] Adding `asuint` implementation to hlsl (PR #107292)

2024-09-12 Thread via cfe-commits
https://github.com/joaosaffran updated https://github.com/llvm/llvm-project/pull/107292 >From c6434c06d17a2442863f8843e75dc870966fb97c Mon Sep 17 00:00:00 2001 From: Joao Saffran Date: Tue, 3 Sep 2024 19:06:22 + Subject: [PATCH 1/5] Adding `asuint` implementation to hlsl --- clang/includ

[clang] Adding `asuint` implementation to hlsl (PR #107292)

2024-09-12 Thread via cfe-commits
https://github.com/joaosaffran updated https://github.com/llvm/llvm-project/pull/107292 >From c6434c06d17a2442863f8843e75dc870966fb97c Mon Sep 17 00:00:00 2001 From: Joao Saffran Date: Tue, 3 Sep 2024 19:06:22 + Subject: [PATCH 1/5] Adding `asuint` implementation to hlsl --- clang/includ

[clang] Adding `asuint` implementation to hlsl (PR #107292)

2024-09-12 Thread via cfe-commits
github-actions[bot] wrote: :warning: C/C++ code formatter, clang-format found issues in your code. :warning: You can test this locally with the following command: ``bash git-clang-format --diff 447b32fb192b90be00164a027f990e16c0325de3 d2f55b360d65b8fea16aaab6bba9d7da284d6e49 --e

[clang] Adding `asuint` implementation to hlsl (PR #107292)

2024-09-12 Thread Chris B via cfe-commits
@@ -0,0 +1,18 @@ +// RUN: %clang_cc1 -finclude-default-header -triple dxil-pc-shadermodel6.6-library %s -fnative-half-type -emit-llvm-only -disable-llvm-passes -verify -verify-ignore-unexpected llvm-beanz wrote: what messages are seen but not expected? https:/

[clang] Adding `asuint` implementation to hlsl (PR #107292)

2024-09-12 Thread via cfe-commits
@@ -0,0 +1,18 @@ +// RUN: %clang_cc1 -finclude-default-header -triple dxil-pc-shadermodel6.6-library %s -fnative-half-type -emit-llvm-only -disable-llvm-passes -verify -verify-ignore-unexpected joaosaffran wrote: I am seeing some issues when testing without it,

[clang] Adding `asuint` implementation to hlsl (PR #107292)

2024-09-12 Thread Justin Bogner via cfe-commits
@@ -0,0 +1,18 @@ +// RUN: %clang_cc1 -finclude-default-header -triple dxil-pc-shadermodel6.6-library %s -fnative-half-type -emit-llvm-only -disable-llvm-passes -verify -verify-ignore-unexpected bogner wrote: This still has `-verify-ignore-unexpected`... https:

[clang] Adding `asuint` implementation to hlsl (PR #107292)

2024-09-12 Thread Justin Bogner via cfe-commits
@@ -0,0 +1,35 @@ +//===- hlsl_intrinsics.h - HLSL definitions for intrinsics --===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache

[clang] Adding `asuint` implementation to hlsl (PR #107292)

2024-09-12 Thread Justin Bogner via cfe-commits
@@ -0,0 +1,35 @@ +//===- hlsl_intrinsics.h - HLSL definitions for intrinsics --===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache

[clang] Adding `asuint` implementation to hlsl (PR #107292)

2024-09-12 Thread Justin Bogner via cfe-commits
@@ -0,0 +1,35 @@ +//===- hlsl_intrinsics.h - HLSL definitions for intrinsics --===// bogner wrote: This comment needs updating. https://github.com/llvm/llvm-project/pull/107292 ___ cfe-commits mailing list

[clang] Adding `asuint` implementation to hlsl (PR #107292)

2024-09-12 Thread Justin Bogner via cfe-commits
@@ -10,6 +10,7 @@ #define _HLSL_HLSL_INTRINSICS_H_ namespace hlsl { +#include "hlsl_details.h" bogner wrote: We shouldn't `#include` a file inside a namespace. Instead, "hlsl_details.h" should also have a `namespace hlsl {}` block around the `__detail` names

[clang] Adding `asuint` implementation to hlsl (PR #107292)

2024-09-12 Thread via cfe-commits
https://github.com/joaosaffran updated https://github.com/llvm/llvm-project/pull/107292 >From c6434c06d17a2442863f8843e75dc870966fb97c Mon Sep 17 00:00:00 2001 From: Joao Saffran Date: Tue, 3 Sep 2024 19:06:22 + Subject: [PATCH 1/5] Adding `asuint` implementation to hlsl --- clang/includ

[clang] Adding `asuint` implementation to hlsl (PR #107292)

2024-09-12 Thread via cfe-commits
https://github.com/joaosaffran deleted https://github.com/llvm/llvm-project/pull/107292 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Adding `asuint` implementation to hlsl (PR #107292)

2024-09-12 Thread via cfe-commits
@@ -0,0 +1,42 @@ +//===- hlsl_intrinsics.h - HLSL definitions for intrinsics --===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache

[clang] Adding `asuint` implementation to hlsl (PR #107292)

2024-09-12 Thread via cfe-commits
https://github.com/joaosaffran updated https://github.com/llvm/llvm-project/pull/107292 >From c6434c06d17a2442863f8843e75dc870966fb97c Mon Sep 17 00:00:00 2001 From: Joao Saffran Date: Tue, 3 Sep 2024 19:06:22 + Subject: [PATCH 1/5] Adding `asuint` implementation to hlsl --- clang/includ

[clang] Adding `asuint` implementation to hlsl (PR #107292)

2024-09-12 Thread Chris B via cfe-commits
@@ -0,0 +1,42 @@ +//===- hlsl_intrinsics.h - HLSL definitions for intrinsics --===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache

[clang] Adding `asuint` implementation to hlsl (PR #107292)

2024-09-11 Thread via cfe-commits
https://github.com/joaosaffran updated https://github.com/llvm/llvm-project/pull/107292 >From a48e8ef405604b0c74364351ef32d0b05aee1098 Mon Sep 17 00:00:00 2001 From: Joao Saffran Date: Tue, 3 Sep 2024 19:06:22 + Subject: [PATCH 1/4] Adding `asuint` implementation to hlsl --- clang/includ

[clang] Adding `asuint` implementation to hlsl (PR #107292)

2024-09-11 Thread via cfe-commits
https://github.com/joaosaffran updated https://github.com/llvm/llvm-project/pull/107292 >From a88a4eda4ce2ad32ee2ec02549b25c9f08aa14e9 Mon Sep 17 00:00:00 2001 From: Joao Saffran Date: Tue, 3 Sep 2024 19:06:22 + Subject: [PATCH 1/4] Adding `asuint` implementation to hlsl --- clang/includ

[clang] Adding `asuint` implementation to hlsl (PR #107292)

2024-09-11 Thread via cfe-commits
https://github.com/joaosaffran updated https://github.com/llvm/llvm-project/pull/107292 >From a88a4eda4ce2ad32ee2ec02549b25c9f08aa14e9 Mon Sep 17 00:00:00 2001 From: Joao Saffran Date: Tue, 3 Sep 2024 19:06:22 + Subject: [PATCH 1/4] Adding `asuint` implementation to hlsl --- clang/includ

[clang] Adding `asuint` implementation to hlsl (PR #107292)

2024-09-11 Thread via cfe-commits
https://github.com/joaosaffran updated https://github.com/llvm/llvm-project/pull/107292 >From a88a4eda4ce2ad32ee2ec02549b25c9f08aa14e9 Mon Sep 17 00:00:00 2001 From: Joao Saffran Date: Tue, 3 Sep 2024 19:06:22 + Subject: [PATCH 1/4] Adding `asuint` implementation to hlsl --- clang/includ

[clang] Adding `asuint` implementation to hlsl (PR #107292)

2024-09-11 Thread via cfe-commits
joaosaffran wrote: After discussing with @bogner and @farzonl, we decided the following: - Using `static_assert` for the errors makes the user experience inconsistent, since we expect the type checking to happen in `SemaHLSL.cpp`, as other builtins. - The 16 bit casts don't have this problem

[clang] Adding `asuint` implementation to hlsl (PR #107292)

2024-09-10 Thread via cfe-commits
@@ -387,6 +387,65 @@ float3 asin(float3); _HLSL_BUILTIN_ALIAS(__builtin_elementwise_asin) float4 asin(float4); +//===--===// +// asuint builtins +//===--

[clang] Adding `asuint` implementation to hlsl (PR #107292)

2024-09-10 Thread Farzon Lotfi via cfe-commits
https://github.com/farzonl edited https://github.com/llvm/llvm-project/pull/107292 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Adding `asuint` implementation to hlsl (PR #107292)

2024-09-10 Thread Farzon Lotfi via cfe-commits
@@ -387,6 +387,65 @@ float3 asin(float3); _HLSL_BUILTIN_ALIAS(__builtin_elementwise_asin) float4 asin(float4); +//===--===// +// asuint builtins +//===--

[clang] Adding `asuint` implementation to hlsl (PR #107292)

2024-09-10 Thread Justin Bogner via cfe-commits
https://github.com/bogner edited https://github.com/llvm/llvm-project/pull/107292 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Adding `asuint` implementation to hlsl (PR #107292)

2024-09-10 Thread Justin Bogner via cfe-commits
@@ -387,6 +387,65 @@ float3 asin(float3); _HLSL_BUILTIN_ALIAS(__builtin_elementwise_asin) float4 asin(float4); +//===--===// +// asuint builtins +//===--

[clang] Adding `asuint` implementation to hlsl (PR #107292)

2024-09-10 Thread via cfe-commits
https://github.com/joaosaffran updated https://github.com/llvm/llvm-project/pull/107292 >From a88a4eda4ce2ad32ee2ec02549b25c9f08aa14e9 Mon Sep 17 00:00:00 2001 From: Joao Saffran Date: Tue, 3 Sep 2024 19:06:22 + Subject: [PATCH 1/4] Adding `asuint` implementation to hlsl --- clang/includ

[clang] Adding `asuint` implementation to hlsl (PR #107292)

2024-09-10 Thread via cfe-commits
https://github.com/joaosaffran updated https://github.com/llvm/llvm-project/pull/107292 >From a88a4eda4ce2ad32ee2ec02549b25c9f08aa14e9 Mon Sep 17 00:00:00 2001 From: Joao Saffran Date: Tue, 3 Sep 2024 19:06:22 + Subject: [PATCH 1/4] Adding `asuint` implementation to hlsl --- clang/includ

[clang] Adding `asuint` implementation to hlsl (PR #107292)

2024-09-09 Thread via cfe-commits
@@ -387,6 +387,65 @@ float3 asin(float3); _HLSL_BUILTIN_ALIAS(__builtin_elementwise_asin) float4 asin(float4); +//===--===// +// asuint builtins +//===--

[clang] Adding `asuint` implementation to hlsl (PR #107292)

2024-09-09 Thread via cfe-commits
joaosaffran wrote: @farzonl I discussed the `half` type support with @llvm-beanz, he suggested using static asserts, which I've added and now checks whether the type being passed has 32bits. This prevents the `half` support. Any concerns regarding this approach? https://github.com/llvm/llvm-p

[clang] Adding `asuint` implementation to hlsl (PR #107292)

2024-09-09 Thread via cfe-commits
https://github.com/joaosaffran updated https://github.com/llvm/llvm-project/pull/107292 >From a88a4eda4ce2ad32ee2ec02549b25c9f08aa14e9 Mon Sep 17 00:00:00 2001 From: Joao Saffran Date: Tue, 3 Sep 2024 19:06:22 + Subject: [PATCH 1/4] Adding `asuint` implementation to hlsl --- clang/includ

[clang] Adding `asuint` implementation to hlsl (PR #107292)

2024-09-09 Thread via cfe-commits
https://github.com/joaosaffran updated https://github.com/llvm/llvm-project/pull/107292 >From a88a4eda4ce2ad32ee2ec02549b25c9f08aa14e9 Mon Sep 17 00:00:00 2001 From: Joao Saffran Date: Tue, 3 Sep 2024 19:06:22 + Subject: [PATCH 1/4] Adding `asuint` implementation to hlsl --- clang/includ

[clang] Adding `asuint` implementation to hlsl (PR #107292)

2024-09-09 Thread Farzon Lotfi via cfe-commits
@@ -387,6 +387,65 @@ float3 asin(float3); _HLSL_BUILTIN_ALIAS(__builtin_elementwise_asin) float4 asin(float4); +//===--===// +// asuint builtins +//===--

[clang] Adding `asuint` implementation to hlsl (PR #107292)

2024-09-09 Thread Farzon Lotfi via cfe-commits
@@ -0,0 +1,41 @@ +// RUN: %clang_cc1 -finclude-default-header -x hlsl -triple dxil-pc-shadermodel6.3-library %s -fnative-half-type -emit-llvm -O1 -o - | FileCheck %s + +// CHECK: define {{.*}}test_uint{{.*}}(i32 {{.*}} [[VAL:%.*]]){{.*}} +// CHECK-NOT: bitcast +// CHECK: ret i3

[clang] Adding `asuint` implementation to hlsl (PR #107292)

2024-09-09 Thread Farzon Lotfi via cfe-commits
farzonl wrote: > @llvm-beanz I've implemented your suggestions. One issue I found is that the > code generation will work with half types, which are not supported in the > current implementation. Any suggestions into how to approach this? is there a way to know if the use of `__builtin_bit_cas

[clang] Adding `asuint` implementation to hlsl (PR #107292)

2024-09-09 Thread via cfe-commits
joaosaffran wrote: @llvm-beanz I've implemented your suggestions. One issue I found is that the code generation will work with half types, which are not supported in the current implementation. Any suggestions into how to approach this? https://github.com/llvm/llvm-project/pull/107292

[clang] Adding `asuint` implementation to hlsl (PR #107292)

2024-09-09 Thread via cfe-commits
https://github.com/joaosaffran updated https://github.com/llvm/llvm-project/pull/107292 >From a88a4eda4ce2ad32ee2ec02549b25c9f08aa14e9 Mon Sep 17 00:00:00 2001 From: Joao Saffran Date: Tue, 3 Sep 2024 19:06:22 + Subject: [PATCH 1/4] Adding `asuint` implementation to hlsl --- clang/includ

[clang] Adding `asuint` implementation to hlsl (PR #107292)

2024-09-09 Thread via cfe-commits
https://github.com/joaosaffran updated https://github.com/llvm/llvm-project/pull/107292 >From a88a4eda4ce2ad32ee2ec02549b25c9f08aa14e9 Mon Sep 17 00:00:00 2001 From: Joao Saffran Date: Tue, 3 Sep 2024 19:06:22 + Subject: [PATCH 1/4] Adding `asuint` implementation to hlsl --- clang/includ

[clang] Adding `asuint` implementation to hlsl (PR #107292)

2024-09-09 Thread Justin Bogner via cfe-commits
@@ -0,0 +1,18 @@ +// RUN: %clang_cc1 -finclude-default-header -triple dxil-pc-shadermodel6.6-library %s -fnative-half-type -emit-llvm-only -disable-llvm-passes -verify -verify-ignore-unexpected + + +export uint4 test_asuint_too_many_arg(float p0, float p1) { + return __builtin_

[clang] Adding `asuint` implementation to hlsl (PR #107292)

2024-09-09 Thread Justin Bogner via cfe-commits
@@ -0,0 +1,18 @@ +// RUN: %clang_cc1 -finclude-default-header -triple dxil-pc-shadermodel6.6-library %s -fnative-half-type -emit-llvm-only -disable-llvm-passes -verify -verify-ignore-unexpected bogner wrote: I don't think we should be using `-verify-ignore-unex

[clang] Adding `asuint` implementation to hlsl (PR #107292)

2024-09-08 Thread via cfe-commits
https://github.com/joaosaffran updated https://github.com/llvm/llvm-project/pull/107292 >From a88a4eda4ce2ad32ee2ec02549b25c9f08aa14e9 Mon Sep 17 00:00:00 2001 From: Joao Saffran Date: Tue, 3 Sep 2024 19:06:22 + Subject: [PATCH 1/3] Adding `asuint` implementation to hlsl --- clang/includ

[clang] Adding `asuint` implementation to hlsl (PR #107292)

2024-09-08 Thread via cfe-commits
@@ -387,6 +387,23 @@ float3 asin(float3); _HLSL_BUILTIN_ALIAS(__builtin_elementwise_asin) float4 asin(float4); +//===--===// +// asuint builtins +//===--

[clang] Adding `asuint` implementation to hlsl (PR #107292)

2024-09-08 Thread via cfe-commits
https://github.com/joaosaffran updated https://github.com/llvm/llvm-project/pull/107292 >From a88a4eda4ce2ad32ee2ec02549b25c9f08aa14e9 Mon Sep 17 00:00:00 2001 From: Joao Saffran Date: Tue, 3 Sep 2024 19:06:22 + Subject: [PATCH 1/3] Adding `asuint` implementation to hlsl --- clang/includ

[clang] Adding `asuint` implementation to hlsl (PR #107292)

2024-09-06 Thread Farzon Lotfi via cfe-commits
@@ -387,6 +387,23 @@ float3 asin(float3); _HLSL_BUILTIN_ALIAS(__builtin_elementwise_asin) float4 asin(float4); +//===--===// +// asuint builtins +//===--

[clang] Adding `asuint` implementation to hlsl (PR #107292)

2024-09-06 Thread Justin Bogner via cfe-commits
@@ -387,6 +387,23 @@ float3 asin(float3); _HLSL_BUILTIN_ALIAS(__builtin_elementwise_asin) float4 asin(float4); +//===--===// +// asuint builtins +//===--

[clang] Adding `asuint` implementation to hlsl (PR #107292)

2024-09-06 Thread via cfe-commits
https://github.com/joaosaffran updated https://github.com/llvm/llvm-project/pull/107292 >From a88a4eda4ce2ad32ee2ec02549b25c9f08aa14e9 Mon Sep 17 00:00:00 2001 From: Joao Saffran Date: Tue, 3 Sep 2024 19:06:22 + Subject: [PATCH 1/3] Adding `asuint` implementation to hlsl --- clang/includ

[clang] Adding `asuint` implementation to hlsl (PR #107292)

2024-09-06 Thread via cfe-commits
@@ -387,6 +387,23 @@ float3 asin(float3); _HLSL_BUILTIN_ALIAS(__builtin_elementwise_asin) float4 asin(float4); +//===--===// +// asuint builtins +//===--

[clang] Adding `asuint` implementation to hlsl (PR #107292)

2024-09-06 Thread Chris B via cfe-commits
https://github.com/llvm-beanz commented: One question I have about this is do we actually need new builtins? These are just doing bit casts correct? Could we implement them entirely in the header? Something like: ```hlsl template T bit_cast(U Val) { return __builtin_bit_cast(T, Val); } uint

[clang] Adding `asuint` implementation to hlsl (PR #107292)

2024-09-06 Thread via cfe-commits
https://github.com/joaosaffran updated https://github.com/llvm/llvm-project/pull/107292 >From a88a4eda4ce2ad32ee2ec02549b25c9f08aa14e9 Mon Sep 17 00:00:00 2001 From: Joao Saffran Date: Tue, 3 Sep 2024 19:06:22 + Subject: [PATCH 1/3] Adding `asuint` implementation to hlsl --- clang/includ

[clang] Adding `asuint` implementation to hlsl (PR #107292)

2024-09-06 Thread Justin Bogner via cfe-commits
@@ -0,0 +1,26 @@ +// RUN: %clang_cc1 -finclude-default-header -x hlsl -triple dxil-pc-shadermodel6.3-library %s -fnative-half-type -emit-llvm -disable-llvm-passes -o - | FileCheck %s + + +// CHECK-LABEL: test_asuint4_uint +// CHECK: ret i32 %0 +export uint test_asuint4_uint(uint

[clang] Adding `asuint` implementation to hlsl (PR #107292)

2024-09-06 Thread Justin Bogner via cfe-commits
@@ -0,0 +1,26 @@ +// RUN: %clang_cc1 -finclude-default-header -x hlsl -triple dxil-pc-shadermodel6.3-library %s -fnative-half-type -emit-llvm -disable-llvm-passes -o - | FileCheck %s + + +// CHECK-LABEL: test_asuint4_uint +// CHECK: ret i32 %0 +export uint test_asuint4_uint(uint

[clang] Adding `asuint` implementation to hlsl (PR #107292)

2024-09-06 Thread Justin Bogner via cfe-commits
@@ -0,0 +1,26 @@ +// RUN: %clang_cc1 -finclude-default-header -x hlsl -triple dxil-pc-shadermodel6.3-library %s -fnative-half-type -emit-llvm -disable-llvm-passes -o - | FileCheck %s + + +// CHECK-LABEL: test_asuint4_uint +// CHECK: ret i32 %0 +export uint test_asuint4_uint(uint

[clang] Adding `asuint` implementation to hlsl (PR #107292)

2024-09-06 Thread Justin Bogner via cfe-commits
@@ -387,6 +387,23 @@ float3 asin(float3); _HLSL_BUILTIN_ALIAS(__builtin_elementwise_asin) float4 asin(float4); +//===--===// +// asuint builtins +//===--

[clang] Adding `asuint` implementation to hlsl (PR #107292)

2024-09-06 Thread Justin Bogner via cfe-commits
@@ -0,0 +1,26 @@ +// RUN: %clang_cc1 -finclude-default-header -x hlsl -triple dxil-pc-shadermodel6.3-library %s -fnative-half-type -emit-llvm -disable-llvm-passes -o - | FileCheck %s bogner wrote: It's probably better if we remove the `-disable-llvm-passes` and

[clang] Adding `asuint` implementation to hlsl (PR #107292)

2024-09-06 Thread Justin Bogner via cfe-commits
https://github.com/bogner commented: This is going in the right direction but the tests need some work. I made a couple of comments to point you in the right direction. We also need to make sure we're testing all of the cases we care about, so we need tests with inputs of `int`, `uint`, vector

[clang] Adding `asuint` implementation to hlsl (PR #107292)

2024-09-06 Thread Justin Bogner via cfe-commits
https://github.com/bogner edited https://github.com/llvm/llvm-project/pull/107292 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Adding `asuint` implementation to hlsl (PR #107292)

2024-09-06 Thread Farzon Lotfi via cfe-commits
https://github.com/farzonl approved this pull request. LGTM https://github.com/llvm/llvm-project/pull/107292 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Adding `asuint` implementation to hlsl (PR #107292)

2024-09-06 Thread Farzon Lotfi via cfe-commits
https://github.com/farzonl deleted https://github.com/llvm/llvm-project/pull/107292 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Adding `asuint` implementation to hlsl (PR #107292)

2024-09-06 Thread Farzon Lotfi via cfe-commits
@@ -0,0 +1,26 @@ +// RUN: %clang_cc1 -finclude-default-header -x hlsl -triple dxil-pc-shadermodel6.3-library %s -fnative-half-type -emit-llvm -disable-llvm-passes -o - | FileCheck %s + + +// CHECK-LABEL: test_asuint4_uint +// CHECK: ret i32 %0 +export uint test_asuint4_uint(uint

[clang] Adding `asuint` implementation to hlsl (PR #107292)

2024-09-06 Thread Farzon Lotfi via cfe-commits
@@ -1427,6 +1447,14 @@ bool CheckAllArgsHaveFloatRepresentation(Sema *S, CallExpr *TheCall) { checkAllFloatTypes); } +bool CheckArgIsFloatOrIntWithoutImplicits(Sema *S, Expr *Arg) { + auto checkFloat = [](clang::QualType PassedType) -> bool

[clang] Adding `asuint` implementation to hlsl (PR #107292)

2024-09-06 Thread Farzon Lotfi via cfe-commits
https://github.com/farzonl edited https://github.com/llvm/llvm-project/pull/107292 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Adding `asuint` implementation to hlsl (PR #107292)

2024-09-06 Thread Farzon Lotfi via cfe-commits
@@ -1427,6 +1447,14 @@ bool CheckAllArgsHaveFloatRepresentation(Sema *S, CallExpr *TheCall) { checkAllFloatTypes); } +bool CheckArgIsFloatOrIntWithoutImplicits(Sema *S, Expr *Arg) { + auto checkFloat = [](clang::QualType PassedType) -> bool

[clang] Adding `asuint` implementation to hlsl (PR #107292)

2024-09-06 Thread Farzon Lotfi via cfe-commits
@@ -387,6 +387,23 @@ float3 asin(float3); _HLSL_BUILTIN_ALIAS(__builtin_elementwise_asin) float4 asin(float4); +//===--===// +// asuint builtins +//===--

[clang] Adding `asuint` implementation to hlsl (PR #107292)

2024-09-06 Thread Justin Bogner via cfe-commits
@@ -387,6 +387,23 @@ float3 asin(float3); _HLSL_BUILTIN_ALIAS(__builtin_elementwise_asin) float4 asin(float4); +//===--===// +// asuint builtins +//===--

[clang] Adding `asuint` implementation to hlsl (PR #107292)

2024-09-05 Thread via cfe-commits
https://github.com/joaosaffran updated https://github.com/llvm/llvm-project/pull/107292 >From f1ca0a6070aa34bcce92d76df3a2e897d44e5f9c Mon Sep 17 00:00:00 2001 From: Joao Saffran Date: Tue, 3 Sep 2024 19:06:22 + Subject: [PATCH 1/2] Adding `asuint` implementation to hlsl --- clang/includ

[clang] Adding `asuint` implementation to hlsl (PR #107292)

2024-09-05 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-backend-x86 Author: None (joaosaffran) Changes Implements support for the `asuint` HLSL function casting behaviour. Addressing the `splitdouble` scenario will be addressed in a future PR. Fixes: #70097 --- Full diff: https://github.com/llvm/llvm-proje

[clang] Adding `asuint` implementation to hlsl (PR #107292)

2024-09-05 Thread via cfe-commits
https://github.com/joaosaffran ready_for_review https://github.com/llvm/llvm-project/pull/107292 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Adding `asuint` implementation to hlsl (PR #107292)

2024-09-05 Thread via cfe-commits
https://github.com/joaosaffran updated https://github.com/llvm/llvm-project/pull/107292 >From f1ca0a6070aa34bcce92d76df3a2e897d44e5f9c Mon Sep 17 00:00:00 2001 From: Joao Saffran Date: Tue, 3 Sep 2024 19:06:22 + Subject: [PATCH 1/2] Adding `asuint` implementation to hlsl --- clang/includ

[clang] Adding `asuint` implementation to hlsl (PR #107292)

2024-09-05 Thread via cfe-commits
https://github.com/joaosaffran updated https://github.com/llvm/llvm-project/pull/107292 >From f1ca0a6070aa34bcce92d76df3a2e897d44e5f9c Mon Sep 17 00:00:00 2001 From: Joao Saffran Date: Tue, 3 Sep 2024 19:06:22 + Subject: [PATCH 1/2] Adding `asuint` implementation to hlsl --- clang/includ

[clang] Adding `asuint` implementation to hlsl (PR #107292)

2024-09-05 Thread via cfe-commits
https://github.com/joaosaffran updated https://github.com/llvm/llvm-project/pull/107292 >From f1ca0a6070aa34bcce92d76df3a2e897d44e5f9c Mon Sep 17 00:00:00 2001 From: Joao Saffran Date: Tue, 3 Sep 2024 19:06:22 + Subject: [PATCH 1/2] Adding `asuint` implementation to hlsl --- clang/includ

[clang] Adding `asuint` implementation to hlsl (PR #107292)

2024-09-05 Thread Farzon Lotfi via cfe-commits
@@ -387,6 +387,23 @@ float3 asin(float3); _HLSL_BUILTIN_ALIAS(__builtin_elementwise_asin) float4 asin(float4); +//===--===// +// asuint builtins +//===--

[clang] Adding `asuint` implementation to hlsl (PR #107292)

2024-09-05 Thread via cfe-commits
https://github.com/joaosaffran edited https://github.com/llvm/llvm-project/pull/107292 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Adding `asuint` implementation to hlsl (PR #107292)

2024-09-04 Thread via cfe-commits
https://github.com/joaosaffran updated https://github.com/llvm/llvm-project/pull/107292 >From f1ca0a6070aa34bcce92d76df3a2e897d44e5f9c Mon Sep 17 00:00:00 2001 From: Joao Saffran Date: Tue, 3 Sep 2024 19:06:22 + Subject: [PATCH 1/2] Adding `asuint` implementation to hlsl --- clang/includ

[clang] Adding `asuint` implementation to hlsl (PR #107292)

2024-09-04 Thread via cfe-commits
https://github.com/joaosaffran updated https://github.com/llvm/llvm-project/pull/107292 >From f1ca0a6070aa34bcce92d76df3a2e897d44e5f9c Mon Sep 17 00:00:00 2001 From: Joao Saffran Date: Tue, 3 Sep 2024 19:06:22 + Subject: [PATCH 1/2] Adding `asuint` implementation to hlsl --- clang/includ

[clang] Adding `asuint` implementation to hlsl (PR #107292)

2024-09-04 Thread via cfe-commits
https://github.com/joaosaffran updated https://github.com/llvm/llvm-project/pull/107292 >From f1ca0a6070aa34bcce92d76df3a2e897d44e5f9c Mon Sep 17 00:00:00 2001 From: Joao Saffran Date: Tue, 3 Sep 2024 19:06:22 + Subject: [PATCH 1/2] Adding `asuint` implementation to hlsl --- clang/includ

[clang] Adding `asuint` implementation to hlsl (PR #107292)

2024-09-04 Thread via cfe-commits
https://github.com/joaosaffran edited https://github.com/llvm/llvm-project/pull/107292 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Adding `asuint` implementation to hlsl (PR #107292)

2024-09-04 Thread via cfe-commits
https://github.com/joaosaffran updated https://github.com/llvm/llvm-project/pull/107292 >From f1ca0a6070aa34bcce92d76df3a2e897d44e5f9c Mon Sep 17 00:00:00 2001 From: Joao Saffran Date: Tue, 3 Sep 2024 19:06:22 + Subject: [PATCH 1/2] Adding `asuint` implementation to hlsl --- clang/includ

[clang] Adding `asuint` implementation to hlsl (PR #107292)

2024-09-04 Thread via cfe-commits
https://github.com/joaosaffran updated https://github.com/llvm/llvm-project/pull/107292 >From f1ca0a6070aa34bcce92d76df3a2e897d44e5f9c Mon Sep 17 00:00:00 2001 From: Joao Saffran Date: Tue, 3 Sep 2024 19:06:22 + Subject: [PATCH 1/2] Adding `asuint` implementation to hlsl --- clang/includ

[clang] Adding `asuint` implementation to hlsl (PR #107292)

2024-09-04 Thread via cfe-commits
https://github.com/joaosaffran updated https://github.com/llvm/llvm-project/pull/107292 >From f1ca0a6070aa34bcce92d76df3a2e897d44e5f9c Mon Sep 17 00:00:00 2001 From: Joao Saffran Date: Tue, 3 Sep 2024 19:06:22 + Subject: [PATCH 1/2] Adding `asuint` implementation to hlsl --- clang/includ

[clang] Adding `asuint` implementation to hlsl (PR #107292)

2024-09-04 Thread via cfe-commits
github-actions[bot] wrote: Thank you for submitting a Pull Request (PR) to the LLVM Project! This PR will be automatically labeled and the relevant teams will be notified. If you wish to, you can add reviewers by using the "Reviewers" section on this page. If this is not working for you, it

[clang] Adding `asuint` implementation to hlsl (PR #107292)

2024-09-04 Thread via cfe-commits
https://github.com/joaosaffran created https://github.com/llvm/llvm-project/pull/107292 None >From f1ca0a6070aa34bcce92d76df3a2e897d44e5f9c Mon Sep 17 00:00:00 2001 From: Joao Saffran Date: Tue, 3 Sep 2024 19:06:22 + Subject: [PATCH] Adding `asuint` implementation to hlsl --- clang/incl