[clang] [llvm] [HLSL] Implement dot2add intrinsic (PR #131237)

2025-03-20 Thread Ashley Coleman via cfe-commits
@@ -19681,6 +19681,21 @@ Value *CodeGenFunction::EmitHLSLBuiltinExpr(unsigned BuiltinID, getDotProductIntrinsic(CGM.getHLSLRuntime(), VecTy0->getElementType()), ArrayRef{Op0, Op1}, nullptr, "hlsl.dot"); } + case Builtin::BI__builtin_hlsl_dot2add: { +llvm

[clang] [llvm] [HLSL] Implement dot2add intrinsic (PR #131237)

2025-03-20 Thread Ashley Coleman via cfe-commits
@@ -19681,6 +19681,21 @@ Value *CodeGenFunction::EmitHLSLBuiltinExpr(unsigned BuiltinID, getDotProductIntrinsic(CGM.getHLSLRuntime(), VecTy0->getElementType()), ArrayRef{Op0, Op1}, nullptr, "hlsl.dot"); } + case Builtin::BI__builtin_hlsl_dot2add: { +llvm

[clang] [llvm] Hlsl asint16 intrinsic (PR #131900)

2025-03-20 Thread Ashley Coleman via cfe-commits
https://github.com/V-FEXrt approved this pull request. https://github.com/llvm/llvm-project/pull/131900 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [HLSL] Implement dot2add intrinsic (PR #131237)

2025-03-20 Thread Ashley Coleman via cfe-commits
@@ -2472,6 +2472,33 @@ bool SemaHLSL::CheckBuiltinFunctionCall(unsigned BuiltinID, CallExpr *TheCall) { return true; break; } + case Builtin::BI__builtin_hlsl_dot2add: { +// Check number of arguments should be 3 V-FEXrt wrote: Nit: imo this c

[clang] [llvm] [HLSL] Implement dot2add intrinsic (PR #131237)

2025-03-20 Thread Ashley Coleman via cfe-commits
@@ -19681,6 +19681,21 @@ Value *CodeGenFunction::EmitHLSLBuiltinExpr(unsigned BuiltinID, getDotProductIntrinsic(CGM.getHLSLRuntime(), VecTy0->getElementType()), ArrayRef{Op0, Op1}, nullptr, "hlsl.dot"); } + case Builtin::BI__builtin_hlsl_dot2add: { +llvm

[clang] [llvm] Hlsl asuint16 function (PR #132315)

2025-03-21 Thread Ashley Coleman via cfe-commits
https://github.com/V-FEXrt commented: LGTM but I'll let Farzon approve https://github.com/llvm/llvm-project/pull/132315 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] Hlsl asuint16 function (PR #132315)

2025-03-21 Thread Ashley Coleman via cfe-commits
@@ -0,0 +1,52 @@ +// RUN: %clang_cc1 -finclude-default-header -triple dxil-pc-shadermodel6.2-library %s -fnative-half-type -verify + +uint16_t test_asuint16_less_argument() +{ +return asuint16(); + // expected-error@-1 {{no matching function for call to 'asuint16'}} + // ex

[clang] [llvm] Hlsl asuint16 function (PR #132315)

2025-03-21 Thread Ashley Coleman via cfe-commits
https://github.com/V-FEXrt edited https://github.com/llvm/llvm-project/pull/132315 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [HLSL] Implement dot2add intrinsic (PR #131237)

2025-03-21 Thread Ashley Coleman via cfe-commits
@@ -0,0 +1,8 @@ +; RUN: opt -S -dxil-op-lower -mtriple=dxil-pc-shadermodel6.3-compute %s | FileCheck %s + +define noundef float @dot2add_simple(<2 x half> noundef %a, <2 x half> noundef %b, float %c) { +entry: +; CHECK: call float @dx.op.dot2AddHalf(i32 162, float %c, half %0, h

[clang] [llvm] [HLSL] Implement dot2add intrinsic (PR #131237)

2025-03-20 Thread Ashley Coleman via cfe-commits
@@ -0,0 +1,11 @@ +// RUN: %clang_cc1 -finclude-default-header -triple dxil-pc-shadermodel6.6-library %s -emit-llvm-only -disable-llvm-passes -verify + +bool test_too_few_arg() { + return __builtin_hlsl_dot2add(); + // expected-error@-1 {{too few arguments to function call, expe

[clang] [llvm] Hlsl asint16 intrinsic (PR #131900)

2025-04-05 Thread Ashley Coleman via cfe-commits
@@ -19,3 +20,12 @@ entry: %res = bitcast half %val2 to i16 ret i16 %res } + +define <4 x i16> @test_vector_half4(<4 x half> nofpclass(nan inf) %p1) { +entry: + ; CHECK: %[[#arg0:]] = OpFunctionParameter %[[#vec4_float_16]] + ; CHECK: %[[#Res1:]] = OpBitcast %[[#vec4_int_1

[clang] [HLSL][NFC] Refactor HLSLExternalSemaSource (PR #131032)

2025-03-25 Thread Ashley Coleman via cfe-commits
@@ -0,0 +1,96 @@ +//===--- HLSLBuiltinTypeDeclBuilder.h - HLSL Builtin Type Decl Builder ---===// +// +// 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: Apa

[clang] [llvm] [NFC][HLSL] Move emitter out of AMDGPU.cpp (PR #133251)

2025-03-27 Thread Ashley Coleman via cfe-commits
https://github.com/V-FEXrt approved this pull request. https://github.com/llvm/llvm-project/pull/133251 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [HLSL] Implement the dst HLSL Function (PR #133828)

2025-04-07 Thread Ashley Coleman via cfe-commits
@@ -0,0 +1,57 @@ +// RUN: %clang_cc1 -finclude-default-header -x hlsl -triple dxil-pc-shadermodel6.2-library %s -fnative-half-type -emit-llvm -disable-llvm-passes -o - | FileCheck %s + + +// CHECK-LABEL: linkonce_odr noundef nofpclass(nan inf) <4 x float> @_ZN4hlsl8__detail8dst

[clang] [HLSL] Implement the dst HLSL Function (PR #133828)

2025-04-09 Thread Ashley Coleman via cfe-commits
https://github.com/V-FEXrt approved this pull request. 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] Implement the dst HLSL Function (PR #133828)

2025-04-09 Thread Ashley Coleman via cfe-commits
@@ -174,6 +174,31 @@ const inline float distance(__detail::HLSL_FIXED_VECTOR X, __detail::HLSL_FIXED_VECTOR Y) { return __detail::distance_vec_impl(X, Y); } +//===--===// +// dst

[clang] [HLSL] Implement the dst HLSL Function (PR #133828)

2025-04-09 Thread Ashley Coleman via cfe-commits
https://github.com/V-FEXrt closed 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] Implement the dst HLSL Function (PR #133828)

2025-04-09 Thread Ashley Coleman via cfe-commits
@@ -0,0 +1,75 @@ +// 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) +{ V-FEXrt wrote: Is there a reason the function call

[clang] [HLSL] Implement the dst HLSL Function (PR #133828)

2025-04-09 Thread Ashley Coleman via cfe-commits
@@ -174,6 +174,31 @@ const inline float distance(__detail::HLSL_FIXED_VECTOR X, __detail::HLSL_FIXED_VECTOR Y) { return __detail::distance_vec_impl(X, Y); } +//===--===// +// dst

[clang] [llvm] [HLSL] Implement dot2add intrinsic (PR #131237)

2025-03-28 Thread Ashley Coleman via cfe-commits
@@ -390,6 +390,18 @@ Value *CodeGenFunction::EmitHLSLBuiltinExpr(unsigned BuiltinID, getDotProductIntrinsic(CGM.getHLSLRuntime(), VecTy0->getElementType()), ArrayRef{Op0, Op1}, nullptr, "hlsl.dot"); } + case Builtin::BI__builtin_hlsl_dot2add: { +llvm::Tr

[clang] [llvm] [HLSL] Implement dot2add intrinsic (PR #131237)

2025-03-28 Thread Ashley Coleman via cfe-commits
@@ -0,0 +1,78 @@ +// RUN: %clang_cc1 -finclude-default-header -fnative-half-type -triple \ +// RUN: dxil-pc-shadermodel6.3-compute %s -emit-llvm -disable-llvm-passes -o - | \ +// RUN: FileCheck %s --check-prefixes=CHECK,CHECK-DXIL +// RUN: %clang_cc1 -finclude-default-header

[clang] [llvm] [HLSL] Implement dot2add intrinsic (PR #131237)

2025-03-28 Thread Ashley Coleman via cfe-commits
https://github.com/V-FEXrt edited https://github.com/llvm/llvm-project/pull/131237 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [HLSL] Resource initialization by constructors (PR #135120)

2025-04-11 Thread Ashley Coleman via cfe-commits
@@ -287,6 +287,24 @@ Value *CodeGenFunction::EmitHLSLBuiltinExpr(unsigned BuiltinID, RetTy, CGM.getHLSLRuntime().getCreateResourceGetPointerIntrinsic(), ArrayRef{HandleOp, IndexOp}); } + case Builtin::BI__builtin_hlsl_resource_createpoisonhandle: { +llvm

[clang] [HLSL] Resource initialization by constructors (PR #135120)

2025-04-11 Thread Ashley Coleman via cfe-commits
@@ -3179,6 +3207,67 @@ void SemaHLSL::ActOnVariableDeclarator(VarDecl *VD) { } } +static bool initVarDeclWithCtor(Sema &S, VarDecl *VD, +MutableArrayRef Args) { + InitializedEntity Entity = InitializedEntity::InitializeVariable(VD); + Initia

[clang] [HLSL] Resource initialization by constructors (PR #135120)

2025-04-11 Thread Ashley Coleman via cfe-commits
@@ -3179,6 +3207,67 @@ void SemaHLSL::ActOnVariableDeclarator(VarDecl *VD) { } } +static bool initVarDeclWithCtor(Sema &S, VarDecl *VD, +MutableArrayRef Args) { + InitializedEntity Entity = InitializedEntity::InitializeVariable(VD); + Initia

[clang] [HLSL] Resource initialization by constructors (PR #135120)

2025-04-11 Thread Ashley Coleman via cfe-commits
@@ -287,6 +287,24 @@ Value *CodeGenFunction::EmitHLSLBuiltinExpr(unsigned BuiltinID, RetTy, CGM.getHLSLRuntime().getCreateResourceGetPointerIntrinsic(), ArrayRef{HandleOp, IndexOp}); } + case Builtin::BI__builtin_hlsl_resource_createpoisonhandle: { +llvm

[clang] [HLSL] Resource initialization by constructors (PR #135120)

2025-04-11 Thread Ashley Coleman via cfe-commits
@@ -1,34 +1,117 @@ // RUN: %clang_cc1 -triple dxil-pc-shadermodel6.3-library -x hlsl -emit-llvm -disable-llvm-passes -o - %s | FileCheck %s --check-prefixes=CHECK,CHECK-DXIL +// FIXME: SPIR-V codegen of llvm.spv.resource.handlefrombinding and resource types is not yet implement

[clang] [HLSL] Resource initialization by constructors (PR #135120)

2025-04-11 Thread Ashley Coleman via cfe-commits
https://github.com/V-FEXrt edited https://github.com/llvm/llvm-project/pull/135120 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [HLSL] Resource initialization by constructors (PR #135120)

2025-04-11 Thread Ashley Coleman via cfe-commits
@@ -3179,6 +3207,67 @@ void SemaHLSL::ActOnVariableDeclarator(VarDecl *VD) { } } +static bool initVarDeclWithCtor(Sema &S, VarDecl *VD, +MutableArrayRef Args) { + InitializedEntity Entity = InitializedEntity::InitializeVariable(VD); + Initia

[clang] [HLSL] Resource initialization by constructors (PR #135120)

2025-04-11 Thread Ashley Coleman via cfe-commits
https://github.com/V-FEXrt commented: LGTM but I don't have enough domain knowledge to approve https://github.com/llvm/llvm-project/pull/135120 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-

[clang] [HLSL] Implement the dst HLSL Function (PR #133828)

2025-04-07 Thread Ashley Coleman via cfe-commits
@@ -0,0 +1,57 @@ +// RUN: %clang_cc1 -finclude-default-header -x hlsl -triple dxil-pc-shadermodel6.2-library %s -fnative-half-type -emit-llvm -disable-llvm-passes -o - | FileCheck %s + + +// CHECK-LABEL: linkonce_odr noundef nofpclass(nan inf) <4 x float> @_ZN4hlsl8__detail8dst

[clang] [HLSL] Implement the dst HLSL Function (PR #133828)

2025-04-07 Thread Ashley Coleman via cfe-commits
@@ -174,6 +174,31 @@ const inline float distance(__detail::HLSL_FIXED_VECTOR X, __detail::HLSL_FIXED_VECTOR Y) { return __detail::distance_vec_impl(X, Y); } +//===--===// +// dst

[clang] [HLSL] Implement the dst HLSL Function (PR #133828)

2025-04-07 Thread Ashley Coleman via cfe-commits
@@ -174,6 +174,31 @@ const inline float distance(__detail::HLSL_FIXED_VECTOR X, __detail::HLSL_FIXED_VECTOR Y) { return __detail::distance_vec_impl(X, Y); } +//===--===//

[clang] [HLSL] Implement the dst HLSL Function (PR #133828)

2025-04-07 Thread Ashley Coleman via cfe-commits
@@ -174,6 +174,31 @@ const inline float distance(__detail::HLSL_FIXED_VECTOR X, __detail::HLSL_FIXED_VECTOR Y) { return __detail::distance_vec_impl(X, Y); } +//===--===// +// dst

[clang] [HLSL] Put tests for compatibility overloads for 'clamp', 'isinf', 'min', and 'max' in own files (PR #137004)

2025-04-28 Thread Ashley Coleman via cfe-commits
https://github.com/V-FEXrt approved this pull request. https://github.com/llvm/llvm-project/pull/137004 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] Reland "[HLSL][RootSignature] Implement initial parsing of the descriptor table clause params" (PR #136740)

2025-04-22 Thread Ashley Coleman via cfe-commits
https://github.com/V-FEXrt approved this pull request. https://github.com/llvm/llvm-project/pull/136740 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [HLSL] Resource initialization by constructors (PR #135120)

2025-04-29 Thread Ashley Coleman via cfe-commits
https://github.com/V-FEXrt approved this pull request. https://github.com/llvm/llvm-project/pull/135120 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [HLSL] Handle incomplete array types (PR #133508)

2025-04-23 Thread Ashley Coleman via cfe-commits
https://github.com/V-FEXrt approved this pull request. Looks great! https://github.com/llvm/llvm-project/pull/133508 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [NFC][RootSignatures] Conform to new std::optional calling conventions (PR #136747)

2025-04-23 Thread Ashley Coleman via cfe-commits
@@ -26,22 +26,14 @@ RootSignatureParser::RootSignatureParser(SmallVector &Elements, bool RootSignatureParser::parse() { // Iterate as many RootElements as possible - while (tryConsumeExpectedToken(TokenKind::kw_DescriptorTable)) { -// Dispatch onto parser method. -

[clang] [NFC][RootSignatures] Conform to new std::optional calling conventions (PR #136747)

2025-04-23 Thread Ashley Coleman via cfe-commits
@@ -26,22 +26,14 @@ RootSignatureParser::RootSignatureParser(SmallVector &Elements, bool RootSignatureParser::parse() { // Iterate as many RootElements as possible - while (tryConsumeExpectedToken(TokenKind::kw_DescriptorTable)) { -// Dispatch onto parser method. -

[clang] [NFC][RootSignatures] Conform to new std::optional calling conventions (PR #136747)

2025-04-23 Thread Ashley Coleman via cfe-commits
@@ -26,22 +26,14 @@ RootSignatureParser::RootSignatureParser(SmallVector &Elements, bool RootSignatureParser::parse() { // Iterate as many RootElements as possible - while (tryConsumeExpectedToken(TokenKind::kw_DescriptorTable)) { -// Dispatch onto parser method. -

[clang] [NFC][RootSignatures] Conform to new std::optional calling conventions (PR #136747)

2025-04-23 Thread Ashley Coleman via cfe-commits
@@ -26,22 +26,14 @@ RootSignatureParser::RootSignatureParser(SmallVector &Elements, bool RootSignatureParser::parse() { // Iterate as many RootElements as possible - while (tryConsumeExpectedToken(TokenKind::kw_DescriptorTable)) { -// Dispatch onto parser method. -

[clang] [NFC][RootSignatures] Conform to new std::optional calling conventions (PR #136747)

2025-04-23 Thread Ashley Coleman via cfe-commits
https://github.com/V-FEXrt approved this pull request. https://github.com/llvm/llvm-project/pull/136747 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [HLSL] Implement the dst HLSL Function (PR #133828)

2025-04-10 Thread Ashley Coleman via cfe-commits
@@ -174,6 +174,31 @@ const inline float distance(__detail::HLSL_FIXED_VECTOR X, __detail::HLSL_FIXED_VECTOR Y) { return __detail::distance_vec_impl(X, Y); } +//===--===// +// dst

[clang] [HLSL] Implement the dst HLSL Function (PR #133828)

2025-04-10 Thread Ashley Coleman via cfe-commits
@@ -0,0 +1,57 @@ +// RUN: %clang_cc1 -finclude-default-header -x hlsl -triple dxil-pc-shadermodel6.2-library %s -fnative-half-type -emit-llvm -disable-llvm-passes -o - | FileCheck %s + + +// CHECK-LABEL: linkonce_odr noundef nofpclass(nan inf) <4 x float> @_ZN4hlsl8__detail8dst

[clang] [HLSL] Disallow virtual inheritance and functions (PR #127346)

2025-02-18 Thread Ashley Coleman via cfe-commits
https://github.com/V-FEXrt approved this pull request. https://github.com/llvm/llvm-project/pull/127346 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [HLSL] Add "or" intrinsic (PR #128979)

2025-02-28 Thread Ashley Coleman via cfe-commits
https://github.com/V-FEXrt approved this pull request. https://github.com/llvm/llvm-project/pull/128979 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [HLSL] Add "or" intrinsic (PR #128979)

2025-02-28 Thread Ashley Coleman via cfe-commits
https://github.com/V-FEXrt closed https://github.com/llvm/llvm-project/pull/128979 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [HLSL] Add "or" intrinsic (PR #128979)

2025-02-27 Thread Ashley Coleman via cfe-commits
@@ -0,0 +1,27 @@ +// RUN: %clang_cc1 -finclude-default-header -triple dxil-pc-shadermodel6.6-library %s -verify -DTEST_FUNC=__builtin_hlsl_or +// RUN: %clang_cc1 -finclude-default-header -triple dxil-pc-shadermodel6.6-library %s -verify -DTEST_FUNC=__builtin_hlsl_and + + +bool t

[clang] [HLSL] Add "or" intrinsic (PR #128979)

2025-02-27 Thread Ashley Coleman via cfe-commits
@@ -0,0 +1,27 @@ +// RUN: %clang_cc1 -finclude-default-header -triple dxil-pc-shadermodel6.6-library %s -verify -DTEST_FUNC=__builtin_hlsl_or +// RUN: %clang_cc1 -finclude-default-header -triple dxil-pc-shadermodel6.6-library %s -verify -DTEST_FUNC=__builtin_hlsl_and + + ---

[clang] [HLSL] Add "or" intrinsic (PR #128979)

2025-02-27 Thread Ashley Coleman via cfe-commits
@@ -0,0 +1,27 @@ +// RUN: %clang_cc1 -finclude-default-header -triple dxil-pc-shadermodel6.6-library %s -verify -DTEST_FUNC=__builtin_hlsl_or +// RUN: %clang_cc1 -finclude-default-header -triple dxil-pc-shadermodel6.6-library %s -verify -DTEST_FUNC=__builtin_hlsl_and + + ---

[clang] [HLSL] Add "or" intrinsic (PR #128979)

2025-02-27 Thread Ashley Coleman via cfe-commits
@@ -0,0 +1,85 @@ +// RUN: %clang_cc1 -finclude-default-header -triple \ +// RUN: dxil-pc-shadermodel6.3-library %s \ +// RUN: -emit-llvm -O1 -o - | FileCheck %s + +//CHECK-LABEL: define noundef i1 @_Z15test_and_scalarbb( +//CHECK-SAME: i1 noundef [[X:%.*]], i1 noundef [[Y:%.*]

[clang] [HLSL] Add "or" intrinsic (PR #128979)

2025-02-27 Thread Ashley Coleman via cfe-commits
@@ -0,0 +1,85 @@ +// RUN: %clang_cc1 -finclude-default-header -triple \ +// RUN: dxil-pc-shadermodel6.3-library %s \ +// RUN: -emit-llvm -O1 -o - | FileCheck %s + +//CHECK-LABEL: define noundef i1 @_Z15test_and_scalarbb( +//CHECK-SAME: i1 noundef [[X:%.*]], i1 noundef [[Y:%.*]

[clang] [HLSL] Add "or" intrinsic (PR #128979)

2025-02-27 Thread Ashley Coleman via cfe-commits
@@ -290,6 +290,28 @@ _HLSL_BUILTIN_ALIAS(__builtin_hlsl_and) bool4 and(bool4 x, bool4 y); // clang-format on +//===--===// +// or builtins +//===

[clang] [llvm] [HLSL] Implement explicit layout for default constant buffer ($Globals) (PR #128991)

2025-03-12 Thread Ashley Coleman via cfe-commits
https://github.com/V-FEXrt approved this pull request. https://github.com/llvm/llvm-project/pull/128991 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [HLSL] Implement explicit layout for default constant buffer ($Globals) (PR #128991)

2025-03-12 Thread Ashley Coleman via cfe-commits
@@ -174,21 +176,51 @@ createBufferHandleType(const HLSLBufferDecl *BufDecl) { return cast(QT.getTypePtr()); } +// Iterates over all declarations in the HLSL buffer and based on the +// packoffset or register(c#) annotations it fills outs the Layout +// vector with the user-s

[clang] [HLSL] Implement HLSL splatting (PR #118992)

2025-02-13 Thread Ashley Coleman via cfe-commits
https://github.com/V-FEXrt approved this pull request. https://github.com/llvm/llvm-project/pull/118992 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [HLSL] Implement HLSL splatting (PR #118992)

2025-02-12 Thread Ashley Coleman via cfe-commits
@@ -491,6 +491,31 @@ static bool isTrivialFiller(Expr *E) { return false; } +static void EmitHLSLSplatCast(CodeGenFunction &CGF, Address DestVal, + QualType DestTy, llvm::Value *SrcVal, + QualType SrcTy, SourceLocatio

[clang] [HLSL] Implement HLSL splatting (PR #118992)

2025-02-12 Thread Ashley Coleman via cfe-commits
@@ -0,0 +1,87 @@ +// RUN: %clang_cc1 -finclude-default-header -triple dxil-pc-shadermodel6.3-library -x hlsl -emit-llvm -disable-llvm-passes -o - %s | FileCheck %s + +// array splat +// CHECK-LABEL: define void {{.*}}call4 +// CHECK: [[B:%.*]] = alloca [2 x i32], align 4 +// CHE

[clang] [HLSL] Implement HLSL splatting (PR #118992)

2025-02-12 Thread Ashley Coleman via cfe-commits
@@ -2804,6 +2804,42 @@ bool SemaHLSL::ContainsBitField(QualType BaseTy) { return false; } +// Can perform an HLSL splat cast if the Dest is an aggregate and the +// Src is a scalar or a vector of length 1 +// Or if Dest is a vector and Src is a vector of length 1 +bool SemaH

[clang] [HLSL] Implement HLSL splatting (PR #118992)

2025-02-12 Thread Ashley Coleman via cfe-commits
@@ -2804,6 +2804,42 @@ bool SemaHLSL::ContainsBitField(QualType BaseTy) { return false; } +// Can perform an HLSL splat cast if the Dest is an aggregate and the +// Src is a scalar or a vector of length 1 +// Or if Dest is a vector and Src is a vector of length 1 +bool SemaH

[clang] [HLSL][Sema] Fix Struct Size Calculation containing 16/32 bit scalars (PR #128086)

2025-02-21 Thread Ashley Coleman via cfe-commits
@@ -172,6 +172,27 @@ Decl *SemaHLSL::ActOnStartBuffer(Scope *BufferScope, bool CBuffer, return Result; } +static unsigned calculateLegacyCbufferFieldAlign(const ASTContext &Context, + QualType T) { + // Aggregate types are al

[clang] [HLSL][Sema] Fix Struct Size Calculation containing 16/32 bit scalars (PR #128086)

2025-02-21 Thread Ashley Coleman via cfe-commits
https://github.com/V-FEXrt edited https://github.com/llvm/llvm-project/pull/128086 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [HLSL][Sema] Fix Struct Size Calculation containing 16/32 bit scalars (PR #128086)

2025-02-21 Thread Ashley Coleman via cfe-commits
@@ -172,6 +172,27 @@ Decl *SemaHLSL::ActOnStartBuffer(Scope *BufferScope, bool CBuffer, return Result; } +static unsigned calculateLegacyCbufferFieldAlign(const ASTContext &Context, + QualType T) { + // Aggregate types are al

[clang] [HLSL][Sema] Fix Struct Size Calculation containing 16/32 bit scalars (PR #128086)

2025-02-20 Thread Ashley Coleman via cfe-commits
https://github.com/V-FEXrt created https://github.com/llvm/llvm-project/pull/128086 Fixes #119641 Update SemaHLSL to correctly calculate the alignment barrier for scalars that are not 4 bytes wide >From bebfc20fac6b27d02bca9af328d0568018672c71 Mon Sep 17 00:00:00 2001 From: Ashley Coleman Da

[clang] [HLSL][Sema] Fix Struct Size Calculation containing 16/32 bit scalars (PR #128086)

2025-02-21 Thread Ashley Coleman via cfe-commits
@@ -172,6 +172,27 @@ Decl *SemaHLSL::ActOnStartBuffer(Scope *BufferScope, bool CBuffer, return Result; } +static unsigned calculateLegacyCbufferFieldAlign(const ASTContext &Context, + QualType T) { + // Aggregate types are al

[clang] [HLSL][Sema] Fix Struct Size Calculation containing 16/32 bit scalars (PR #128086)

2025-02-21 Thread Ashley Coleman via cfe-commits
@@ -0,0 +1,60 @@ +// RUN: %clang_cc1 -std=hlsl2021 -finclude-default-header -x hlsl -triple \ +// RUN: dxil-pc-shadermodel6.3-library %s -fnative-half-type \ +// RUN: -emit-llvm -disable-llvm-passes -o - | FileCheck %s --check-prefix=CHECK-HALF + +// RUN: %clang_cc1 -std=hlsl

[clang] [HLSL][Sema] Fix Struct Size Calculation containing 16/32 bit scalars (PR #128086)

2025-02-21 Thread Ashley Coleman via cfe-commits
https://github.com/V-FEXrt updated https://github.com/llvm/llvm-project/pull/128086 >From bebfc20fac6b27d02bca9af328d0568018672c71 Mon Sep 17 00:00:00 2001 From: Ashley Coleman Date: Thu, 20 Feb 2025 16:16:16 -0700 Subject: [PATCH 1/3] [hlsl][Sema] Fix Struct Size Calculation containing 16 and

[clang] [HLSL][Sema] Fix Struct Size Calculation containing 16/32 bit scalars (PR #128086)

2025-02-24 Thread Ashley Coleman via cfe-commits
https://github.com/V-FEXrt updated https://github.com/llvm/llvm-project/pull/128086 >From bebfc20fac6b27d02bca9af328d0568018672c71 Mon Sep 17 00:00:00 2001 From: Ashley Coleman Date: Thu, 20 Feb 2025 16:16:16 -0700 Subject: [PATCH 1/4] [hlsl][Sema] Fix Struct Size Calculation containing 16 and

[clang] [HLSL][Sema] Fix Struct Size Calculation containing 16/32 bit scalars (PR #128086)

2025-02-24 Thread Ashley Coleman via cfe-commits
V-FEXrt wrote: @tex3d @hekota Okay PTAL when you have a moment! https://github.com/llvm/llvm-project/pull/128086 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [HLSL] Allow arrays to be returned by value in HLSL (PR #127896)

2025-02-20 Thread Ashley Coleman via cfe-commits
https://github.com/V-FEXrt approved this pull request. https://github.com/llvm/llvm-project/pull/127896 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [HLSL] Allow arrays to be returned by value in HLSL (PR #127896)

2025-02-20 Thread Ashley Coleman via cfe-commits
@@ -20681,7 +20681,8 @@ ExprResult RebuildUnknownAnyExpr::VisitCallExpr(CallExpr *E) { const FunctionType *FnType = CalleeType->castAs(); // Verify that this is a legal result type of a function. - if (DestType->isArrayType() || DestType->isFunctionType()) { + if ((Dest

[clang] [HLSL][Sema] Fix Struct Size Calculation containing 16/32 bit scalars (PR #128086)

2025-02-25 Thread Ashley Coleman via cfe-commits
https://github.com/V-FEXrt closed https://github.com/llvm/llvm-project/pull/128086 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [HLSL][Sema] Fix Struct Size Calculation containing 16/32 bit scalars (PR #128086)

2025-02-25 Thread Ashley Coleman via cfe-commits
https://github.com/V-FEXrt updated https://github.com/llvm/llvm-project/pull/128086 >From bebfc20fac6b27d02bca9af328d0568018672c71 Mon Sep 17 00:00:00 2001 From: Ashley Coleman Date: Thu, 20 Feb 2025 16:16:16 -0700 Subject: [PATCH 1/5] [hlsl][Sema] Fix Struct Size Calculation containing 16 and

[clang] [HLSL][Sema] Fix Struct Size Calculation containing 16/32 bit scalars (PR #128086)

2025-02-25 Thread Ashley Coleman via cfe-commits
@@ -172,6 +172,23 @@ Decl *SemaHLSL::ActOnStartBuffer(Scope *BufferScope, bool CBuffer, return Result; } +static unsigned calculateLegacyCbufferFieldAlign(const ASTContext &Context, + QualType T) { + // Arrays and Structs are

[clang] [HLSL][Sema] Fix Struct Size Calculation containing 16/32 bit scalars (PR #128086)

2025-02-25 Thread Ashley Coleman via cfe-commits
@@ -172,6 +172,23 @@ Decl *SemaHLSL::ActOnStartBuffer(Scope *BufferScope, bool CBuffer, return Result; } +static unsigned calculateLegacyCbufferFieldAlign(const ASTContext &Context, + QualType T) { + // Arrays and Structs are

[clang] [llvm] Hlsl asint16 intrinsic (PR #131900)

2025-03-19 Thread Ashley Coleman via cfe-commits
V-FEXrt wrote: I'm assuming this PR resolves an issue right? We typically add `Fixes #1234` (without the `) as part of the description so it will close the issue when the PR is merged https://github.com/llvm/llvm-project/pull/131900 ___ cfe-commits

[clang] [llvm] [HLSL] Implement dot2add intrinsic (PR #131237)

2025-04-03 Thread Ashley Coleman via cfe-commits
https://github.com/V-FEXrt approved this pull request. https://github.com/llvm/llvm-project/pull/131237 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [HLSL] Implement dot2add intrinsic (PR #131237)

2025-04-03 Thread Ashley Coleman via cfe-commits
https://github.com/V-FEXrt closed https://github.com/llvm/llvm-project/pull/131237 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [HLSL][NFC] Stricter Overload Tests (clamp, max, min, pow) (PR #138993)

2025-05-08 Thread Ashley Coleman via cfe-commits
https://github.com/V-FEXrt closed https://github.com/llvm/llvm-project/pull/138993 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [HLSL][NFC] Stricter Overload Tests (clamp, max, min, pow) (PR #138993)

2025-05-07 Thread Ashley Coleman via cfe-commits
https://github.com/V-FEXrt created https://github.com/llvm/llvm-project/pull/138993 Partial implementation of #138016 to unblock other ongoing work. NFC Rate limit · GitHub body { background-color: #f6f8fa; color: #24292e; font-fam

[clang] [HLSL][NFC] Stricter Overload Tests (clamp, max, min, pow) (PR #138993)

2025-05-07 Thread Ashley Coleman via cfe-commits
https://github.com/V-FEXrt updated https://github.com/llvm/llvm-project/pull/138993 >From 06b22eb40740588b55d2c71c096bace7dbc1c8c7 Mon Sep 17 00:00:00 2001 From: Ashley Coleman Date: Wed, 7 May 2025 17:51:58 -0600 Subject: [PATCH 1/2] [HLSL][NFC] Stricter Overload Tests (clamp,max,min,pow) ---

[clang] [HLSL] Add various overloads for MiniEngine (PR #139800)

2025-05-13 Thread Ashley Coleman via cfe-commits
https://github.com/V-FEXrt created https://github.com/llvm/llvm-project/pull/139800 Partial implementation of https://github.com/llvm/wg-hlsl/issues/264 Adds several overloads to various intrinsic functions used by MiniEngine Rate limit · GitHub body {

[clang] [HLSL] Add various overloads for MiniEngine (PR #139800)

2025-05-13 Thread Ashley Coleman via cfe-commits
@@ -158,6 +158,42 @@ namespace hlsl { return fn((float4)V1, (float4)V2, (float4)V3); \ } +#define _DXC_COMPAT_BINARY_VECTOR_SCALAR_OVERLOADS(fn) \ + template \ + cons

[clang] [HLSL] Add various overloads for MiniEngine (PR #139800)

2025-05-13 Thread Ashley Coleman via cfe-commits
@@ -236,6 +257,22 @@ _DXC_COMPAT_UNARY_INTEGER_OVERLOADS(cosh) _DXC_COMPAT_UNARY_DOUBLE_OVERLOADS(degrees) _DXC_COMPAT_UNARY_INTEGER_OVERLOADS(degrees) +//===--===// +// dot builtins overloads +//===--

[clang] [HLSL] Add various overloads for MiniEngine (PR #139800)

2025-05-13 Thread Ashley Coleman via cfe-commits
@@ -179,3 +179,41 @@ half3 test_lerp_half_scalar(half3 x, half3 y, half s) { return lerp(x, y, s); } float3 test_lerp_float_scalar(float3 x, float3 y, float s) { return lerp(x, y, s); } + +// CHECK: define [[FNATTRS]] <2 x float> @_Z23test_lerp_float_scalar1Dv2_ff( +// CHECK

[clang] [HLSL] Add Buffer def to frontend (PR #141086)

2025-05-22 Thread Ashley Coleman via cfe-commits
https://github.com/V-FEXrt updated https://github.com/llvm/llvm-project/pull/141086 >From 9868eef5e0752545c88e44ba2fb5d1929feb1e1a Mon Sep 17 00:00:00 2001 From: Ashley Coleman Date: Thu, 22 May 2025 09:19:38 -0600 Subject: [PATCH 1/2] [HLSL] Add Buffer def to frontend --- clang/lib/Sema/HLSL

[clang] [HLSL] Add Buffer def to frontend (PR #141086)

2025-05-27 Thread Ashley Coleman via cfe-commits
V-FEXrt wrote: @inbelic From Justin, looks like it doesn't :) (and this is a bug) https://hlsl.godbolt.org/z/sqMMffh6K I'm going to spin that off into its own task separate from this one so this doesn't get bogged down https://github.com/llvm/llvm-project/pull/141086 _

<    1   2