[clang] Hlsl dst function (PR #133828)

2025-04-05 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: None (metkarpoonam) Changes Implement dst algorithm in the hlsl_intrinsics.h and added test cases for HLSL codegen and sema fixes: https://github.com/llvm/llvm-project/issues/99108 --- Full diff: https://github.com/llvm/llvm-project/pull/

[clang] Hlsl dst function (PR #133828)

2025-04-05 Thread via cfe-commits
@@ -0,0 +1,45 @@ +// RUN: %clang_cc1 -finclude-default-header -x hlsl -triple dxil-pc-shadermodel6.2-library %s -fnative-half-type -emit-llvm -O1 -o - | FileCheck %s + + +// CHECK-LABEL: define noundef nofpclass(nan inf) <4 x float> @_Z12dstWithFloatDv4_fS_( +// CHECK-SAME: <4

[clang] Hlsl dst function (PR #133828)

2025-04-05 Thread Farzon Lotfi via cfe-commits
https://github.com/farzonl edited https://github.com/llvm/llvm-project/pull/133828 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Hlsl dst function (PR #133828)

2025-04-05 Thread Farzon Lotfi via cfe-commits
@@ -0,0 +1,85 @@ +// RUN: %clang_cc1 -finclude-default-header -x hlsl -triple dxil-pc-shadermodel6.2-library %s -fnative-half-type -emit-llvm -O1 -o - | FileCheck %s + + +// CHECK-LABEL: define noundef nofpclass(nan inf) <4 x float> @_Z12dstWithFloatDv4_fS_( +// CHECK-SAME: <4

[clang] Hlsl dst function (PR #133828)

2025-04-05 Thread Damyan Pepper via cfe-commits
@@ -35,6 +35,12 @@ length_vec_impl(vector X) { #endif } +template +constexpr vector dst_impl(vector src0, vector src1) { + vector dest = {1, src0[1] * src1[1], src0[2], src1[3]}; + return dest; +} damyanp wrote: It looks like this needs to be done across m

[clang] Hlsl dst function (PR #133828)

2025-04-05 Thread via cfe-commits
@@ -0,0 +1,37 @@ +// RUN: %clang_cc1 -finclude-default-header -triple dxil-pc-shadermodel6.6-library %s -fnative-half-type -emit-llvm-only -disable-llvm-passes -verify + +float4 test_too_many_arg(float4 p0) +{ +dst(p0, p0, p0); + // expected-error@-1 {{no matching function

[clang] Hlsl dst function (PR #133828)

2025-04-05 Thread Farzon Lotfi via cfe-commits
@@ -0,0 +1,85 @@ +// RUN: %clang_cc1 -finclude-default-header -x hlsl -triple dxil-pc-shadermodel6.2-library %s -fnative-half-type -emit-llvm -O1 -o - | FileCheck %s + + +// CHECK-LABEL: define noundef nofpclass(nan inf) <4 x float> @_Z12dstWithFloatDv4_fS_( +// CHECK-SAME: <4

[clang] Hlsl dst function (PR #133828)

2025-04-04 Thread via cfe-commits
https://github.com/metkarpoonam edited https://github.com/llvm/llvm-project/pull/133828 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Hlsl dst function (PR #133828)

2025-04-04 Thread via cfe-commits
https://github.com/metkarpoonam edited https://github.com/llvm/llvm-project/pull/133828 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Hlsl dst function (PR #133828)

2025-04-04 Thread via cfe-commits
https://github.com/metkarpoonam edited https://github.com/llvm/llvm-project/pull/133828 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Hlsl dst function (PR #133828)

2025-04-04 Thread via cfe-commits
https://github.com/metkarpoonam edited https://github.com/llvm/llvm-project/pull/133828 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Hlsl dst function (PR #133828)

2025-04-04 Thread via cfe-commits
https://github.com/metkarpoonam edited https://github.com/llvm/llvm-project/pull/133828 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Hlsl dst function (PR #133828)

2025-04-04 Thread via cfe-commits
@@ -35,6 +35,12 @@ length_vec_impl(vector X) { #endif } +template +constexpr vector dst_impl(vector src0, vector src1) { + vector dest = {1, src0[1] * src1[1], src0[2], src1[3]}; + return dest; +} metkarpoonam wrote: Thanks for the feedback! I've made the

[clang] Hlsl dst function (PR #133828)

2025-04-04 Thread via cfe-commits
@@ -0,0 +1,37 @@ +// RUN: %clang_cc1 -finclude-default-header -triple dxil-pc-shadermodel6.6-library %s -fnative-half-type -emit-llvm-only -disable-llvm-passes -verify + +float4 test_too_many_arg(float4 p0) +{ +dst(p0, p0, p0); + // expected-error@-1 {{no matching function

[clang] Hlsl dst function (PR #133828)

2025-04-04 Thread via cfe-commits
https://github.com/metkarpoonam updated https://github.com/llvm/llvm-project/pull/133828 >From 3a45246453d120da108e597d23da0fb8d9df0b1b Mon Sep 17 00:00:00 2001 From: Poonam Vilas Metkar Date: Mon, 31 Mar 2025 16:49:18 -0700 Subject: [PATCH 01/10] Implement a dst function with test cases for HL

[clang] Hlsl dst function (PR #133828)

2025-04-04 Thread Farzon Lotfi via cfe-commits
@@ -0,0 +1,37 @@ +// RUN: %clang_cc1 -finclude-default-header -triple dxil-pc-shadermodel6.6-library %s -fnative-half-type -emit-llvm-only -disable-llvm-passes -verify + +float4 test_too_many_arg(float4 p0) +{ +dst(p0, p0, p0); + // expected-error@-1 {{no matching function

[clang] Hlsl dst function (PR #133828)

2025-04-04 Thread Farzon Lotfi via cfe-commits
@@ -0,0 +1,85 @@ +// RUN: %clang_cc1 -finclude-default-header -x hlsl -triple dxil-pc-shadermodel6.2-library %s -fnative-half-type -emit-llvm -O1 -o - | FileCheck %s + + +// CHECK-LABEL: define noundef nofpclass(nan inf) <4 x float> @_Z12dstWithFloatDv4_fS_( +// CHECK-SAME: <4

[clang] Hlsl dst function (PR #133828)

2025-04-04 Thread via cfe-commits
@@ -0,0 +1,70 @@ +// RUN: %clang_cc1 -finclude-default-header -x hlsl -triple dxil-pc-shadermodel6.2-library %s -fnative-half-type -emit-llvm -O1 -o - | FileCheck %s metkarpoonam wrote: I removed the -O1 flag and added codegen with disable-llvm-pass. https://g

[clang] Hlsl dst function (PR #133828)

2025-04-04 Thread via cfe-commits
https://github.com/metkarpoonam updated https://github.com/llvm/llvm-project/pull/133828 >From 3a45246453d120da108e597d23da0fb8d9df0b1b Mon Sep 17 00:00:00 2001 From: Poonam Vilas Metkar Date: Mon, 31 Mar 2025 16:49:18 -0700 Subject: [PATCH 1/9] Implement a dst function with test cases for HLSL

[clang] Hlsl dst function (PR #133828)

2025-04-04 Thread via cfe-commits
https://github.com/metkarpoonam created https://github.com/llvm/llvm-project/pull/133828 Implement dst algorithm in the hlsl_intrinsics.h and added test cases for HLSL codegen and sema fixes: https://github.com/llvm/llvm-project/issues/99108 >From 3a45246453d120da108e597d23da0fb8d9df0b1b Mon S

[clang] Hlsl dst function (PR #133828)

2025-04-03 Thread via cfe-commits
https://github.com/metkarpoonam updated https://github.com/llvm/llvm-project/pull/133828 >From 3a45246453d120da108e597d23da0fb8d9df0b1b Mon Sep 17 00:00:00 2001 From: Poonam Vilas Metkar Date: Mon, 31 Mar 2025 16:49:18 -0700 Subject: [PATCH 1/8] Implement a dst function with test cases for HLSL

[clang] Hlsl dst function (PR #133828)

2025-04-03 Thread via cfe-commits
https://github.com/metkarpoonam updated https://github.com/llvm/llvm-project/pull/133828 >From 3a45246453d120da108e597d23da0fb8d9df0b1b Mon Sep 17 00:00:00 2001 From: Poonam Vilas Metkar Date: Mon, 31 Mar 2025 16:49:18 -0700 Subject: [PATCH 1/8] Implement a dst function with test cases for HLSL

[clang] Hlsl dst function (PR #133828)

2025-04-02 Thread Farzon Lotfi via cfe-commits
@@ -0,0 +1,70 @@ +// RUN: %clang_cc1 -finclude-default-header -x hlsl -triple dxil-pc-shadermodel6.2-library %s -fnative-half-type -emit-llvm -O1 -o - | FileCheck %s farzonl wrote: remove -O1 you should be able to check for correctness without optimizations. h

[clang] Hlsl dst function (PR #133828)

2025-04-02 Thread Farzon Lotfi via cfe-commits
@@ -0,0 +1,37 @@ +// RUN: %clang_cc1 -finclude-default-header -triple dxil-pc-shadermodel6.6-library %s -fnative-half-type -emit-llvm-only -disable-llvm-passes -verify + +float4 test_too_many_arg(float4 p0) +{ +dst(p0, p0, p0); + // expected-error@-1 {{no matching function

[clang] Hlsl dst function (PR #133828)

2025-04-02 Thread Farzon Lotfi via cfe-commits
@@ -0,0 +1,37 @@ +// RUN: %clang_cc1 -finclude-default-header -triple dxil-pc-shadermodel6.6-library %s -fnative-half-type -emit-llvm-only -disable-llvm-passes -verify + +float4 test_too_many_arg(float4 p0) +{ +dst(p0, p0, p0); + // expected-error@-1 {{no matching function

[clang] Hlsl dst function (PR #133828)

2025-04-02 Thread via cfe-commits
https://github.com/metkarpoonam updated https://github.com/llvm/llvm-project/pull/133828 >From 3a45246453d120da108e597d23da0fb8d9df0b1b Mon Sep 17 00:00:00 2001 From: Poonam Vilas Metkar Date: Mon, 31 Mar 2025 16:49:18 -0700 Subject: [PATCH 1/8] Implement a dst function with test cases for HLSL

[clang] Hlsl dst function (PR #133828)

2025-04-02 Thread via cfe-commits
https://github.com/metkarpoonam updated https://github.com/llvm/llvm-project/pull/133828 >From 3a45246453d120da108e597d23da0fb8d9df0b1b Mon Sep 17 00:00:00 2001 From: Poonam Vilas Metkar Date: Mon, 31 Mar 2025 16:49:18 -0700 Subject: [PATCH 1/7] Implement a dst function with test cases for HLSL

[clang] Hlsl dst function (PR #133828)

2025-04-02 Thread Farzon Lotfi via cfe-commits
@@ -0,0 +1,37 @@ +// RUN: %clang_cc1 -finclude-default-header -triple dxil-pc-shadermodel6.6-library %s -fnative-half-type -emit-llvm-only -disable-llvm-passes -verify + +float4 test_too_many_arg(float4 p0) +{ +dst(p0, p0, p0); + // expected-error@-1 {{no matching function

[clang] Hlsl dst function (PR #133828)

2025-04-02 Thread Farzon Lotfi via cfe-commits
@@ -0,0 +1,51 @@ +// RUN: %clang_cc1 -finclude-default-header -triple dxil-pc-shadermodel6.6-library %s -fnative-half-type -emit-llvm-only -disable-llvm-passes -verify + +float4 test_too_many_arg(float4 p0) +{ +dst(p0, p0, p0); + // expected-error@-1 {{no matching function

[clang] Hlsl dst function (PR #133828)

2025-04-02 Thread Farzon Lotfi via cfe-commits
@@ -0,0 +1,51 @@ +// RUN: %clang_cc1 -finclude-default-header -triple dxil-pc-shadermodel6.6-library %s -fnative-half-type -emit-llvm-only -disable-llvm-passes -verify + +float4 test_too_many_arg(float4 p0) +{ +dst(p0, p0, p0); + // expected-error@-1 {{no matching function

[clang] Hlsl dst function (PR #133828)

2025-04-02 Thread Farzon Lotfi via cfe-commits
https://github.com/farzonl edited https://github.com/llvm/llvm-project/pull/133828 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Hlsl dst function (PR #133828)

2025-04-02 Thread Farzon Lotfi via cfe-commits
https://github.com/farzonl deleted https://github.com/llvm/llvm-project/pull/133828 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Hlsl dst function (PR #133828)

2025-04-02 Thread Damyan Pepper via cfe-commits
@@ -35,6 +35,12 @@ length_vec_impl(vector X) { #endif } +template +constexpr vector dst_impl(vector src0, vector src1) { + vector dest = {1, src0[1] * src1[1], src0[2], src1[3]}; + return dest; +} damyanp wrote: Coding conventions: ```suggestion constexpr

[clang] Hlsl dst function (PR #133828)

2025-04-02 Thread Farzon Lotfi via cfe-commits
@@ -0,0 +1,37 @@ +// RUN: %clang_cc1 -finclude-default-header -triple dxil-pc-shadermodel6.6-library %s -fnative-half-type -emit-llvm-only -disable-llvm-passes -verify + +float4 test_too_many_arg(float4 p0) +{ +dst(p0, p0, p0); + // expected-error@-1 {{no matching function

[clang] Hlsl dst function (PR #133828)

2025-04-02 Thread Farzon Lotfi via cfe-commits
@@ -0,0 +1,37 @@ +// RUN: %clang_cc1 -finclude-default-header -triple dxil-pc-shadermodel6.6-library %s -fnative-half-type -emit-llvm-only -disable-llvm-passes -verify + +float4 test_too_many_arg(float4 p0) +{ +dst(p0, p0, p0); + // expected-error@-1 {{no matching function

[clang] Hlsl dst function (PR #133828)

2025-04-02 Thread Farzon Lotfi via cfe-commits
https://github.com/farzonl edited https://github.com/llvm/llvm-project/pull/133828 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Hlsl dst function (PR #133828)

2025-04-01 Thread via cfe-commits
https://github.com/metkarpoonam deleted https://github.com/llvm/llvm-project/pull/133828 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Hlsl dst function (PR #133828)

2025-04-01 Thread via cfe-commits
@@ -0,0 +1,37 @@ +// RUN: %clang_cc1 -finclude-default-header -triple dxil-pc-shadermodel6.6-library %s -fnative-half-type -emit-llvm-only -disable-llvm-passes -verify + +float4 test_too_many_arg(float4 p0) +{ +dst(p0, p0, p0); + // expected-error@-1 {{no matching function

[clang] Hlsl dst function (PR #133828)

2025-04-01 Thread via cfe-commits
https://github.com/metkarpoonam updated https://github.com/llvm/llvm-project/pull/133828 >From 3a45246453d120da108e597d23da0fb8d9df0b1b Mon Sep 17 00:00:00 2001 From: Poonam Vilas Metkar Date: Mon, 31 Mar 2025 16:49:18 -0700 Subject: [PATCH 1/4] Implement a dst function with test cases for HLSL

[clang] Hlsl dst function (PR #133828)

2025-03-31 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-backend-x86 Author: None (metkarpoonam) Changes Implement dst algorithm in the hlsl_intrinsics.h and added test cases for HLSL codegen and sema fixes: https://github.com/llvm/llvm-project/issues/99108 --- Full diff: https://github.com/llvm/llvm-project