https://github.com/spall edited 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
@@ -290,6 +290,24 @@ _HLSL_BUILTIN_ALIAS(__builtin_hlsl_and)
bool4 and(bool4 x, bool4 y);
// clang-format on
+//===--===//
+// or builtins
+//===
@@ -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
@@ -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 @_Z12test_or_boolbb(
+//CHECK-SAME: i1 noundef [[X:%.*]], i1 noundef [[Y:%.*]])
https://github.com/spall updated
https://github.com/llvm/llvm-project/pull/128952
>From 656d6e87466bfc85246f7abaedfe6549e566717b Mon Sep 17 00:00:00 2001
From: Sarah Spall
Date: Wed, 26 Feb 2025 14:37:06 -0800
Subject: [PATCH 1/3] error on out of bounds vector accesses
---
.../clang/Basic/Dia
https://github.com/spall commented:
Code LGTM, but I don't know enough to say if the tests look right.
https://github.com/llvm/llvm-project/pull/128981
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listi
@@ -1,41 +1,56 @@
-// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.3-library -x hlsl -ast-dump -o
- %s | FileCheck %s
+// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.3-library
-finclude-default-header -ast-dump -o - %s | FileCheck %s
-// CHECK:HLSLBufferDecl 0x[[CB:[0-9a-f]+]
https://github.com/spall edited https://github.com/llvm/llvm-project/pull/128981
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/spall closed https://github.com/llvm/llvm-project/pull/123977
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
spall wrote:
The latest commits make it an error for all, add a release note, and modify a
test which had an out of bounds vector access.
https://github.com/llvm/llvm-project/pull/128952
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://
@@ -58,9 +58,7 @@ constexpr vector reflect_vec_impl(vector I,
vector N) {
#endif
}
-template
-constexpr enable_if_t::value || is_same::value, T>
-fmod_impl(T X, T Y) {
+template constexpr T fmod_impl(T X, T Y) {
spall wrote:
The code on line 61 is still ne
https://github.com/spall updated
https://github.com/llvm/llvm-project/pull/129939
>From 23debaf2084f953e60847b8f0814c5d1ee27c726 Mon Sep 17 00:00:00 2001
From: Sarah Spall
Date: Tue, 4 Mar 2025 09:53:56 -0800
Subject: [PATCH 01/11] extra scalar vector overloads for clamp
---
.../lib/Headers/h
@@ -94,6 +109,9 @@ uint64_t3 test_clamp_ulong3(uint64_t3 p0, uint64_t3 p1) {
return clamp(p0, p1,p1
// CHECK: define [[FNATTRS]] <4 x i64> @_Z17test_clamp_ulong4
// CHECK: call <4 x i64> @llvm.[[TARGET]].uclamp.v4i64
uint64_t4 test_clamp_ulong4(uint64_t4 p0, uint64_t4 p1) { re
@@ -58,9 +58,7 @@ constexpr vector reflect_vec_impl(vector I,
vector N) {
#endif
}
-template
-constexpr enable_if_t::value || is_same::value, T>
-fmod_impl(T X, T Y) {
+template constexpr T fmod_impl(T X, T Y) {
spall wrote:
Why is this needed along with t
@@ -58,9 +58,7 @@ constexpr vector reflect_vec_impl(vector I,
vector N) {
#endif
}
-template
-constexpr enable_if_t::value || is_same::value, T>
-fmod_impl(T X, T Y) {
+template constexpr T fmod_impl(T X, T Y) {
spall wrote:
> Not sure I understand the que
@@ -14017,6 +14017,24 @@ void Sema::CheckCastAlign(Expr *Op, QualType T,
SourceRange TRange) {
<< TRange << Op->getSourceRange();
}
+void Sema::CheckVectorAccess(const Expr *BaseExpr, const Expr *IndexExpr) {
+ const VectorType *VTy = BaseExpr->getType()->getAs();
+ if
https://github.com/spall updated
https://github.com/llvm/llvm-project/pull/129939
>From b464aec7a7686a696006d23f16541ff2ca0bc1b2 Mon Sep 17 00:00:00 2001
From: Sarah Spall
Date: Tue, 4 Mar 2025 09:53:56 -0800
Subject: [PATCH 1/2] extra scalar vector overloads for clamp
---
.../lib/Headers/hls
https://github.com/spall created
https://github.com/llvm/llvm-project/pull/129939
Add additional vector scalar overloads for clamp
Revamp Macros which generate overloads
Add Tests
Fix one test which now errors instead of warns.
Closes #128230
>From b464aec7a7686a696006d23f16541ff2ca0bc1b2 Mon
@@ -35,25 +35,48 @@ namespace hlsl {
#define _HLSL_16BIT_AVAILABILITY_STAGE(environment, version, stage)
#endif
-#define GEN_VEC_SCALAR_OVERLOADS(FUNC_NAME, BASE_TYPE, AVAIL)
\
- GEN_BOTH_OVERLOADS(FUNC_NAME, BASE_TYPE, BASE_TYPE##2, AVAIL)
\
https://github.com/spall updated
https://github.com/llvm/llvm-project/pull/129939
>From 23debaf2084f953e60847b8f0814c5d1ee27c726 Mon Sep 17 00:00:00 2001
From: Sarah Spall
Date: Tue, 4 Mar 2025 09:53:56 -0800
Subject: [PATCH 01/10] extra scalar vector overloads for clamp
---
.../lib/Headers/h
spall wrote:
I need to add more tests for certain odd cases.
https://github.com/llvm/llvm-project/pull/129939
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/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
@@ -2527,7 +2527,7 @@ QualType Sema::BuildMatrixType(QualType ElementTy, Expr
*NumRows, Expr *NumCols,
}
bool Sema::CheckFunctionReturnType(QualType T, SourceLocation Loc) {
- if (T->isArrayType() || T->isFunctionType()) {
+ if ((!getLangOpts().HLSL && T->isArrayType()) ||
https://github.com/spall updated
https://github.com/llvm/llvm-project/pull/118992
>From e994824f3630ee8b224afceb6c14d980c9013112 Mon Sep 17 00:00:00 2001
From: Sarah Spall
Date: Fri, 6 Dec 2024 05:14:17 +
Subject: [PATCH 01/18] splat cast wip
---
clang/include/clang/AST/OperationKinds.def
@@ -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
https://github.com/spall updated
https://github.com/llvm/llvm-project/pull/123977
>From 50f8b16bf83d70cc37f2ac7e70c9195a4c4cda02 Mon Sep 17 00:00:00 2001
From: Sarah Spall
Date: Thu, 16 Jan 2025 01:32:25 +
Subject: [PATCH 01/13] wip
---
clang/lib/CodeGen/CGExpr.cpp | 19
@@ -370,6 +370,9 @@ CAST_OPERATION(HLSLArrayRValue)
// Aggregate by Value cast (HLSL only).
CAST_OPERATION(HLSLElementwiseCast)
+// Splat cast for Aggregates (HLSL only).
+CAST_OPERATION(HLSLSplatCast)
spall wrote:
This cast technically also splats vectors in
@@ -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
https://github.com/spall created
https://github.com/llvm/llvm-project/pull/127896
Enable Arrays to be returned in HLSL, and a test for this.
Closes #126568
>From 362b64d31e5f70e4a26ea04c99a58fd5f5ca50ca Mon Sep 17 00:00:00 2001
From: Sarah Spall
Date: Fri, 14 Feb 2025 12:59:56 -0800
Subject:
https://github.com/spall updated
https://github.com/llvm/llvm-project/pull/127896
>From 362b64d31e5f70e4a26ea04c99a58fd5f5ca50ca Mon Sep 17 00:00:00 2001
From: Sarah Spall
Date: Fri, 14 Feb 2025 12:59:56 -0800
Subject: [PATCH 1/4] Allow arrays to be returned by value in HLSL + test
---
clang/
https://github.com/spall closed 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
https://github.com/spall updated
https://github.com/llvm/llvm-project/pull/127896
>From 362b64d31e5f70e4a26ea04c99a58fd5f5ca50ca Mon Sep 17 00:00:00 2001
From: Sarah Spall
Date: Fri, 14 Feb 2025 12:59:56 -0800
Subject: [PATCH 1/2] Allow arrays to be returned by value in HLSL + test
---
clang/
https://github.com/spall updated
https://github.com/llvm/llvm-project/pull/123977
>From 50f8b16bf83d70cc37f2ac7e70c9195a4c4cda02 Mon Sep 17 00:00:00 2001
From: Sarah Spall
Date: Thu, 16 Jan 2025 01:32:25 +
Subject: [PATCH 01/14] wip
---
clang/lib/CodeGen/CGExpr.cpp | 19
https://github.com/spall updated
https://github.com/llvm/llvm-project/pull/127896
>From 362b64d31e5f70e4a26ea04c99a58fd5f5ca50ca Mon Sep 17 00:00:00 2001
From: Sarah Spall
Date: Fri, 14 Feb 2025 12:59:56 -0800
Subject: [PATCH 1/3] Allow arrays to be returned by value in HLSL + test
---
clang/
@@ -410,6 +410,12 @@ VectorType::VectorType(TypeClass tc, QualType vecType,
unsigned nElements,
VectorTypeBits.NumElements = nElements;
}
+bool Type::isPackedVectorBoolType(const ASTContext &ctx) const {
+ if (ctx.getLangOpts().HLSL)
spall wrote:
The code
https://github.com/spall updated
https://github.com/llvm/llvm-project/pull/123977
>From 50f8b16bf83d70cc37f2ac7e70c9195a4c4cda02 Mon Sep 17 00:00:00 2001
From: Sarah Spall
Date: Thu, 16 Jan 2025 01:32:25 +
Subject: [PATCH 01/15] wip
---
clang/lib/CodeGen/CGExpr.cpp | 19
https://github.com/spall approved this pull request.
https://github.com/llvm/llvm-project/pull/127921
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/spall approved this pull request.
LGTM
https://github.com/llvm/llvm-project/pull/125807
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/spall approved this pull request.
https://github.com/llvm/llvm-project/pull/128047
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/spall updated
https://github.com/llvm/llvm-project/pull/128952
>From 656d6e87466bfc85246f7abaedfe6549e566717b Mon Sep 17 00:00:00 2001
From: Sarah Spall
Date: Wed, 26 Feb 2025 14:37:06 -0800
Subject: [PATCH 1/2] error on out of bounds vector accesses
---
.../clang/Basic/Dia
https://github.com/spall ready_for_review
https://github.com/llvm/llvm-project/pull/128952
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/spall edited https://github.com/llvm/llvm-project/pull/128952
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -14017,6 +14017,24 @@ void Sema::CheckCastAlign(Expr *Op, QualType T,
SourceRange TRange) {
<< TRange << Op->getSourceRange();
}
+void Sema::CheckVectorAccess(const Expr *BaseExpr, const Expr *IndexExpr) {
+ const VectorType *VTy = BaseExpr->getType()->getAs();
+ if
https://github.com/spall edited https://github.com/llvm/llvm-project/pull/128952
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/spall updated
https://github.com/llvm/llvm-project/pull/123977
>From 50f8b16bf83d70cc37f2ac7e70c9195a4c4cda02 Mon Sep 17 00:00:00 2001
From: Sarah Spall
Date: Thu, 16 Jan 2025 01:32:25 +
Subject: [PATCH 01/16] wip
---
clang/lib/CodeGen/CGExpr.cpp | 19
https://github.com/spall updated
https://github.com/llvm/llvm-project/pull/123977
>From 50f8b16bf83d70cc37f2ac7e70c9195a4c4cda02 Mon Sep 17 00:00:00 2001
From: Sarah Spall
Date: Thu, 16 Jan 2025 01:32:25 +
Subject: [PATCH 01/15] wip
---
clang/lib/CodeGen/CGExpr.cpp | 19
https://github.com/spall created
https://github.com/llvm/llvm-project/pull/134174
Update Sema Checking to always do an HLSL Array RValue cast in the case we are
dealing with hlsl constant array types
Instead of comparing canonical types, compare canonical unqualified types
Add a test to show it
https://github.com/spall closed https://github.com/llvm/llvm-project/pull/131928
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/spall closed https://github.com/llvm/llvm-project/pull/133520
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -0,0 +1,36 @@
+// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py
UTC_ARGS: --version 5
+// 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
@@ -253,6 +253,37 @@ const inline float
length(__detail::HLSL_FIXED_VECTOR X) {
return __detail::length_vec_impl(X);
}
+//===--===//
+// lit builtins
+//===--
@@ -280,6 +280,22 @@ constexpr bool4 isinf(double4 V) { return
isinf((float4)V); }
_DXC_COMPAT_TERNARY_DOUBLE_OVERLOADS(lerp)
_DXC_COMPAT_TERNARY_INTEGER_OVERLOADS(lerp)
+//===--===//
+// lit builtins overloa
@@ -253,6 +253,37 @@ const inline float
length(__detail::HLSL_FIXED_VECTOR X) {
return __detail::length_vec_impl(X);
}
+//===--===//
+// lit builtins
+//===--
https://github.com/spall edited https://github.com/llvm/llvm-project/pull/131666
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -42,47 +42,47 @@ float2 test_mad_element_type_mismatch(half2 p0, float2 p1) {
float2 test_builtin_mad_float2_splat(float p0, float2 p1) {
return __builtin_hlsl_mad(p0, p1, p1);
- // expected-error@-1 {{all arguments to '__builtin_hlsl_mad' must be
vectors}}
+ // expect
@@ -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
@@ -158,6 +158,42 @@ namespace hlsl {
return fn((float4)V1, (float4)V2, (float4)V3);
\
}
+#define _DXC_COMPAT_BINARY_VECTOR_SCALAR_OVERLOADS(fn)
\
+ template
\
+ cons
@@ -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
+//===--
@@ -1,4 +1,4 @@
-// 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
+// RUN: %clang_cc1 -finclude-default-header -triple
dxil-pc-shadermodel6.6-library %
@@ -158,6 +158,42 @@ namespace hlsl {
return fn((float4)V1, (float4)V2, (float4)V3);
\
}
+#define _DXC_COMPAT_BINARY_VECTOR_SCALAR_OVERLOADS(fn)
\
+ template
\
+ cons
https://github.com/spall updated
https://github.com/llvm/llvm-project/pull/138429
>From 1139101e277f8f4d327fd7b422959dc4a3a43dbe Mon Sep 17 00:00:00 2001
From: Sarah Spall
Date: Tue, 18 Mar 2025 11:04:11 -0700
Subject: [PATCH 1/2] update error messaging
---
.../clang/Basic/DiagnosticSemaKinds
@@ -2507,13 +2441,9 @@ bool SemaHLSL::CheckBuiltinFunctionCall(unsigned
BuiltinID, CallExpr *TheCall) {
break;
}
case Builtin::BI__builtin_hlsl_dot: {
-if (SemaRef.checkArgCount(TheCall, 2))
spall wrote:
BuiltinVectorToScalarMath checks that the a
@@ -2446,37 +2376,41 @@ bool SemaHLSL::CheckBuiltinFunctionCall(unsigned
BuiltinID, CallExpr *TheCall) {
case Builtin::BI__builtin_hlsl_any: {
if (SemaRef.checkArgCount(TheCall, 1))
return true;
+if (CheckAnyScalarOrVector(&SemaRef, TheCall, 0))
+ return t
https://github.com/spall closed https://github.com/llvm/llvm-project/pull/138429
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/spall updated
https://github.com/llvm/llvm-project/pull/138429
>From 1139101e277f8f4d327fd7b422959dc4a3a43dbe Mon Sep 17 00:00:00 2001
From: Sarah Spall
Date: Tue, 18 Mar 2025 11:04:11 -0700
Subject: [PATCH 1/3] update error messaging
---
.../clang/Basic/DiagnosticSemaKinds
https://github.com/spall created
https://github.com/llvm/llvm-project/pull/140627
In 'EmitStoreThroughExtVectorComponentLValue', move the code which ZExts in the
case the Destination Scalar Type is larger than the Source Scalar Type, to the
top of the function, to ensure each condition is hand
301 - 366 of 366 matches
Mail list logo