https://github.com/spall edited 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
@@ -91,6 +91,137 @@ if.end: ; preds =
%if.else, %if.then
%3 = load i32, ptr %resp, align 4
ret i32 %3
}
+
+; CHECK: define i32 @flatten_switch(i32 %X)
+; CHECK-NOT: hlsl.controlflow.hint
+; CHECK: switch i32 %0, label %sw.epil
https://github.com/spall updated
https://github.com/llvm/llvm-project/pull/131666
>From 4d4541232fb8ada1a4a17701919809a2a727d52d Mon Sep 17 00:00:00 2001
From: Sarah Spall
Date: Mon, 17 Mar 2025 12:01:11 -0700
Subject: [PATCH 1/2] remove Macros implementing overloads for min and max.
Implement
spall wrote:
> this is not NFC, so we should verify that we can call these intrinsics with
> `half` values even if 16-bit types aren't enabled, and that they properly
> codegen to 32-bit varia
> > > > > For example, for `abs`, it still depends on the
> > > > > _HLSL_16BIT_AVAILABILITY availab
https://github.com/spall updated
https://github.com/llvm/llvm-project/pull/132979
>From 5facb02ef4df5e0da31b6adef66f0b72309b99df Mon Sep 17 00:00:00 2001
From: Sarah Spall
Date: Mon, 24 Mar 2025 17:15:54 -0700
Subject: [PATCH 1/5] new double overloads + tests
---
clang/lib/Frontend/InitPrepro
https://github.com/spall updated
https://github.com/llvm/llvm-project/pull/132979
>From 5facb02ef4df5e0da31b6adef66f0b72309b99df Mon Sep 17 00:00:00 2001
From: Sarah Spall
Date: Mon, 24 Mar 2025 17:15:54 -0700
Subject: [PATCH 1/4] new double overloads + tests
---
clang/lib/Frontend/InitPrepro
https://github.com/spall created
https://github.com/llvm/llvm-project/pull/132979
Add double overloads which cast the double to a float and call the float
builtin.
Makes these double overloads conditional on hlsl version 202x or earlier.
Add tests
Closes #128228
>From 5facb02ef4df5e0da31b6ade
https://github.com/spall updated
https://github.com/llvm/llvm-project/pull/132979
>From 5facb02ef4df5e0da31b6adef66f0b72309b99df Mon Sep 17 00:00:00 2001
From: Sarah Spall
Date: Mon, 24 Mar 2025 17:15:54 -0700
Subject: [PATCH 1/2] new double overloads + tests
---
clang/lib/Frontend/InitPrepro
https://github.com/spall closed https://github.com/llvm/llvm-project/pull/132979
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/spall created
https://github.com/llvm/llvm-project/pull/132804
Finish the work of #81782
Closes #132793
>From 140b17c6972ac7f867dc342f29121d71e079c9db Mon Sep 17 00:00:00 2001
From: Sarah Spall
Date: Mon, 24 Mar 2025 11:38:21 -0700
Subject: [PATCH] half overloads are defin
spall wrote:
> > this is not NFC, so we should verify that we can call these intrinsics with
> > `half` values even if 16-bit types aren't enabled, and that they properly
> > codegen to 32-bit varia
>
> > > > > > For example, for `abs`, it still depends on the
> > > > > > _HLSL_16BIT_AVAILABI
https://github.com/spall updated
https://github.com/llvm/llvm-project/pull/134174
>From 5d81a4b7b034dd5999feb6ab37537270d6bae2a8 Mon Sep 17 00:00:00 2001
From: Sarah Spall
Date: Wed, 2 Apr 2025 12:04:18 -0700
Subject: [PATCH] compare unqualified canonical types and add an hlsl array
rvalue cas
https://github.com/spall ready_for_review
https://github.com/llvm/llvm-project/pull/134174
___
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/135125
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -0,0 +1,110 @@
+// RUN: %clang_cc1 -finclude-default-header -triple
dxil-pc-shadermodel6.3-library %s \
+// RUN: -fnative-half-type -emit-llvm -disable-llvm-passes -o - | \
+// RUN: FileCheck %s
+// RUN: %clang_cc1 -finclude-default-header -triple
spirv-unknown-vulkan-compu
@@ -0,0 +1,53 @@
+// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.0-compute
-finclude-default-header -verify -Wdouble-promotion -Wconversion %s
+
spall wrote:
Maybe you should add a test case for an array of arrays, like 'int2[2][]'
https://github.com/llvm/llvm
@@ -3249,166 +3249,204 @@ void SemaHLSL::processExplicitBindingsOnDecl(VarDecl
*VD) {
}
}
}
-
-static bool CastInitializer(Sema &S, ASTContext &Ctx, Expr *E,
-llvm::SmallVectorImpl &List,
-llvm::SmallVectorImpl &Des
https://github.com/spall created
https://github.com/llvm/llvm-project/pull/133520
Add WaveReadLaneAt unsigned integer overloads
2nd argument of WaveReadLaneAt should be a uint32_t and not an int32_t
add tests
Closes #133473
>From 69d23f1ba200ceab78d1c108b629875b108689c0 Mon Sep 17 00:00:00 200
@@ -3249,166 +3249,204 @@ void SemaHLSL::processExplicitBindingsOnDecl(VarDecl
*VD) {
}
}
}
-
-static bool CastInitializer(Sema &S, ASTContext &Ctx, Expr *E,
-llvm::SmallVectorImpl &List,
-llvm::SmallVectorImpl &Des
@@ -3249,166 +3249,204 @@ void SemaHLSL::processExplicitBindingsOnDecl(VarDecl
*VD) {
}
}
}
-
-static bool CastInitializer(Sema &S, ASTContext &Ctx, Expr *E,
-llvm::SmallVectorImpl &List,
-llvm::SmallVectorImpl &Des
@@ -3249,166 +3249,204 @@ void SemaHLSL::processExplicitBindingsOnDecl(VarDecl
*VD) {
}
}
}
-
-static bool CastInitializer(Sema &S, ASTContext &Ctx, Expr *E,
-llvm::SmallVectorImpl &List,
-llvm::SmallVectorImpl &Des
@@ -3249,33 +3249,42 @@ void SemaHLSL::processExplicitBindingsOnDecl(VarDecl
*VD) {
}
}
}
+namespace {
+class InitListTransformer {
+ Sema &S;
+ ASTContext &Ctx;
+ QualType InitTy;
+ QualType *DstIt = nullptr;
+ Expr **ArgIt = nullptr;
+ bool Wrap;
@@ -0,0 +1,63 @@
+//===--- hlsl_compat_overloads.h - Additional HLSL overload 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-Licens
https://github.com/spall closed https://github.com/llvm/llvm-project/pull/129773
___
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/131035
___
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/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/16] extra scalar vector overloads for clamp
---
.../lib/Headers/h
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/14] extra scalar vector overloads for clamp
---
.../lib/Headers/h
https://github.com/spall closed 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
https://github.com/spall closed https://github.com/llvm/llvm-project/pull/131035
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
spall wrote:
> LGTM! Unfortunate about the macros not working out but this alternative is
> pretty convenient.
They would have worked if we didn't need even more overloads!
https://github.com/llvm/llvm-project/pull/131666
___
cfe-commits mailing list
https://github.com/spall created
https://github.com/llvm/llvm-project/pull/131666
Replace min and max overload implementation using macros with one using
templates.
Enable new overloads of the forms:
vector min/max(vector p0, U p1)
vector min/max(U p0, vector p1)
vector min/max(vector p0, ve
https://github.com/spall updated
https://github.com/llvm/llvm-project/pull/134683
>From 87308905daa9093caef9ffb920bf9968c0bfb597 Mon Sep 17 00:00:00 2001
From: Sarah Spall
Date: Mon, 7 Apr 2025 09:31:28 -0700
Subject: [PATCH 1/2] desguar constantarraytype
---
clang/lib/CodeGen/HLSLBufferLayou
@@ -605,13 +605,11 @@ void BackendConsumer::UnsupportedDiagHandler(
// Context will be nullptr for IR input files, we will construct the diag
// message from llvm::DiagnosticInfoUnsupported.
- if (Context != nullptr) {
+ if (Context != nullptr)
Loc = getBestLocation
@@ -2268,17 +2268,15 @@ static bool IsStandardConversion(Sema &S, Expr* From,
QualType ToType,
// handling here.
if (ToType->isArrayParameterType()) {
FromType = S.Context.getArrayParameterType(FromType);
- SCS.First = ICK_HLSL_Array_RValue;
} else if (
https://github.com/spall updated
https://github.com/llvm/llvm-project/pull/134174
>From 5d81a4b7b034dd5999feb6ab37537270d6bae2a8 Mon Sep 17 00:00:00 2001
From: Sarah Spall
Date: Wed, 2 Apr 2025 12:04:18 -0700
Subject: [PATCH 1/2] compare unqualified canonical types and add an hlsl array
rvalue
https://github.com/spall approved this pull request.
LGTM
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
https://github.com/spall edited https://github.com/llvm/llvm-project/pull/134293
___
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 based on previous pr approval and looking at the change in the latest
commit
https://github.com/llvm/llvm-project/pull/134293
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://li
https://github.com/spall created
https://github.com/llvm/llvm-project/pull/137004
Put tests for compatibility overloads for 'clamp', 'isinf', 'min', and 'max' in
own files which guarantee hlsl version 202x.
Closes #133277
>From d0051512fc864c250a3734ac4df0ba09072669ef Mon Sep 17 00:00:00 2001
https://github.com/spall updated
https://github.com/llvm/llvm-project/pull/134683
>From 87308905daa9093caef9ffb920bf9968c0bfb597 Mon Sep 17 00:00:00 2001
From: Sarah Spall
Date: Mon, 7 Apr 2025 09:31:28 -0700
Subject: [PATCH 1/3] desguar constantarraytype
---
clang/lib/CodeGen/HLSLBufferLayou
https://github.com/spall created
https://github.com/llvm/llvm-project/pull/138541
When an HLSL Init list is producing a Scalar, handle OpaqueValueExprs in the
Init List with 'emitInitListOpaqueValues'
Copied from 'AggExprEmitter::VisitCXXParenListOrInitListExpr'
Closes #136408
>From 24f4cf687
https://github.com/spall updated
https://github.com/llvm/llvm-project/pull/138541
Rate limit · GitHub
body {
background-color: #f6f8fa;
color: #24292e;
font-family: -apple-system,BlinkMacSystemFont,Segoe
UI,Helvetica,Arial,sans-ser
@@ -303,6 +303,48 @@ fmod(__detail::HLSL_FIXED_VECTOR X,
return __detail::fmod_vec_impl(X, Y);
}
+//===--===//
+// ldexp builtins
+//===--=
@@ -0,0 +1,39 @@
+// RUN: %clang_cc1 -finclude-default-header -triple
dxil-pc-shadermodel6.6-library %s -fnative-half-type -emit-llvm-only
-disable-llvm-passes -verify
+
+float test_double_inputs(double p0, double p1) {
+ return ldexp(p0, p1);
+ // expected-error@-1 {{no matc
@@ -0,0 +1,49 @@
+// 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
spall wrote:
A lot of the builtins that support half and float have tests with
@@ -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 %
https://github.com/spall updated
https://github.com/llvm/llvm-project/pull/138541
Rate limit · GitHub
body {
background-color: #f6f8fa;
color: #24292e;
font-family: -apple-system,BlinkMacSystemFont,Segoe
UI,Helvetica,Arial,sans-ser
@@ -2095,6 +2096,17 @@ Value *ScalarExprEmitter::VisitInitListExpr(InitListExpr
*E) {
assert (Ignore == false && "init list ignored");
unsigned NumInitElements = E->getNumInits();
+ // HLSL initialization lists in the AST are an expansion which can contain
+ // side-eff
https://github.com/spall closed https://github.com/llvm/llvm-project/pull/138541
___
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/135848
___
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/135848
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/spall created
https://github.com/llvm/llvm-project/pull/135848
Instead of converting the type in a RawBuffer to its HLSL type using
'ConvertType', use 'ConvertTypeForMem'.
ConvertTypeForMem handles booleans being i32 and boolean vectors being .
Add tests to show booleans and
https://github.com/spall edited https://github.com/llvm/llvm-project/pull/135848
___
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/135848
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/spall created
https://github.com/llvm/llvm-project/pull/134683
When calculating the layout for a cbuffer field, if that field is a
ConstantArrayType, desguar it before casting it to a ConstantArrayType.
Closes #134668
>From 87308905daa9093caef9ffb920bf9968c0bfb597 Mon Sep 1
https://github.com/spall closed 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
https://github.com/spall created
https://github.com/llvm/llvm-project/pull/138429
Update how Sema Checking is done for HLSL builtins to allow for better error
messages, mainly using 'err_builtin_invalid_arg_type'.
Try to follow the formula outlined in issue #134721
Closes #134721
>From 113910
https://github.com/spall created
https://github.com/llvm/llvm-project/pull/136580
Reland #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
https://github.com/spall closed https://github.com/llvm/llvm-project/pull/136580
___
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/134174
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
spall wrote:
> Hi, this turned a few bots red. Can this be fixed forward or should we revert
> in the meantime? Let me know if you need help with the bot setup / build
> config. Thanks!
It can be reverted
https://github.com/llvm/llvm-project/pull/134174
___
https://github.com/spall closed https://github.com/llvm/llvm-project/pull/136576
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/spall created
https://github.com/llvm/llvm-project/pull/136576
Reverts llvm/llvm-project#134174
Revert due to test error breaking a lot of bots.
>From e35cf35feff443c6dd9fbc0b5ab00efa8e282fa0 Mon Sep 17 00:00:00 2001
From: Sarah Spall
Date: Mon, 21 Apr 2025 09:27:45 -0700
Su
https://github.com/spall closed https://github.com/llvm/llvm-project/pull/135848
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/spall created
https://github.com/llvm/llvm-project/pull/127670
Fixes this crash: https://hlsl.godbolt.org/z/9aP74s4bP
Which happens because the de-sugared type is the same as the canonicalized
type.
Check if the de-sugared type is canonical before getting the ArrayParameterT
@@ -6585,6 +6585,18 @@ void InitializationSequence::InitializeFrom(Sema &S,
}
}
+if (S.getLangOpts().HLSL && Initializer && isa(DestAT))
{
spall wrote:
Would be nice to consolidate this if statement with the one below, unless HLSL
Arrays can a
https://github.com/spall edited https://github.com/llvm/llvm-project/pull/127557
___
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/127557
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
spall wrote:
> Looks fine to me, but this change doesn't only affect HLSL does it? The
> function `getArrayParameterType` in `ASTContext.cpp` doesn't look like it is
> HLSL-specific. I wonder if a similar bug occurs within C/C++.
I believe this function is only called in an HLSL context.
http
https://github.com/spall closed https://github.com/llvm/llvm-project/pull/127670
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -1817,5 +1817,9 @@ def ext_hlsl_access_specifiers : ExtWarn<
InGroup;
def err_hlsl_unsupported_component : Error<"invalid component '%0' used;
expected 'x', 'y', 'z', or 'w'">;
def err_hlsl_packoffset_invalid_reg : Error<"invalid resource class specifier
'%0' for packoff
@@ -131,3 +157,9 @@ double3 test_min_double3(double3 p0, double3 p1) { return
min(p0, p1); }
// CHECK-LABEL: define noundef nofpclass(nan inf) <4 x double>
@_Z16test_min_double4
// CHECK: call reassoc nnan ninf nsz arcp afn <4 x double> @llvm.minnum.v4f64
double4 test_min_dou
https://github.com/spall updated
https://github.com/llvm/llvm-project/pull/129334
>From ebaef38c40cba83d4b446a5320d57c86038f8286 Mon Sep 17 00:00:00 2001
From: Sarah Spall
Date: Fri, 28 Feb 2025 11:18:03 -0800
Subject: [PATCH 1/3] new max overloads + new min overloads
---
clang/lib/Headers/hl
spall wrote:
> Are there any error conditions that need testing as well?
I don't think there were error tests for min and max originally. I could add
some to make sure things like min(int4, int3) are still now allowed.
https://github.com/llvm/llvm-project/pull/129334
__
https://github.com/spall created
https://github.com/llvm/llvm-project/pull/129334
Add additional overloads for min and max to support
min(vector, T) and min(T, vector)
max(vector, T) and max(T, vector)
Add tests
Closes #128231
>From ebaef38c40cba83d4b446a5320d57c86038f8286 Mon Sep 17 00:00:00
@@ -1678,6 +1678,30 @@ half3 max(half3, half3);
_HLSL_16BIT_AVAILABILITY(shadermodel, 6.2)
_HLSL_BUILTIN_ALIAS(__builtin_elementwise_max)
half4 max(half4, half4);
+_HLSL_16BIT_AVAILABILITY(shadermodel, 6.2)
+constexpr half2 max(half2 p0, half p1) {
spall wrote:
@@ -1678,6 +1678,30 @@ half3 max(half3, half3);
_HLSL_16BIT_AVAILABILITY(shadermodel, 6.2)
_HLSL_BUILTIN_ALIAS(__builtin_elementwise_max)
half4 max(half4, half4);
+_HLSL_16BIT_AVAILABILITY(shadermodel, 6.2)
+constexpr half2 max(half2 p0, half p1) {
spall wrote:
https://github.com/spall edited https://github.com/llvm/llvm-project/pull/129334
___
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/129773
>From 6c2e22d2fa59f34401156ac6fd85c44730bf8c45 Mon Sep 17 00:00:00 2001
From: Sarah Spall
Date: Tue, 4 Mar 2025 12:58:13 -0800
Subject: [PATCH 1/3] make semantics case insensitive. update tests. add new
tests
--
spall wrote:
> nit: is there a way to check that the spelling is consistent in the error
> messages? Asking since I am no familiar with this part of the code.
I'm not sure I understand what you mean.
https://github.com/llvm/llvm-project/pull/129773
_
https://github.com/spall updated
https://github.com/llvm/llvm-project/pull/129773
>From 6c2e22d2fa59f34401156ac6fd85c44730bf8c45 Mon Sep 17 00:00:00 2001
From: Sarah Spall
Date: Tue, 4 Mar 2025 12:58:13 -0800
Subject: [PATCH 1/2] make semantics case insensitive. update tests. add new
tests
--
https://github.com/spall converted_to_draft
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
@@ -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)
\
@@ -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)
\
@@ -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)
\
@@ -141,6 +141,8 @@ void Parser::ParseHLSLAnnotations(ParsedAttributes &Attrs,
return;
}
+ II = PP.getIdentifierInfo(II->getName().lower());
spall wrote:
Okay that might requirement a significant change. I'll look into it
https://github.com/llvm/llvm
https://github.com/spall approved this pull request.
https://github.com/llvm/llvm-project/pull/130724
___
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/129939
>From 23debaf2084f953e60847b8f0814c5d1ee27c726 Mon Sep 17 00:00:00 2001
From: Sarah Spall
Date: Tue, 4 Mar 2025 09:53:56 -0800
Subject: [PATCH 1/4] extra scalar vector overloads for clamp
---
.../lib/Headers/hls
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 1/5] extra scalar vector overloads for clamp
---
.../lib/Headers/hls
https://github.com/spall closed 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 commented:
Looks mostly good to me, a couple of questions though which applied to most of
the templates in the code, but I only commented on the first instances I saw.
1. Do you need to check T is arithmetic if you're also checking its half? Wont'
the half check suffice
https://github.com/spall edited https://github.com/llvm/llvm-project/pull/130724
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -89,23 +89,31 @@ void asuint(double4, out uint4, out uint4);
/// \param X The X input value.
/// \param Y The Y input value.
+template
_HLSL_16BIT_AVAILABILITY(shadermodel, 6.2)
-const inline half distance(half X, half Y) {
+const inline __detail::enable_if_t<__detail::is
@@ -45,6 +45,10 @@ template struct is_arithmetic {
static const bool Value = __is_arithmetic(T);
};
+template
+using HLSL_FIXED_VECTOR =
+vector<__detail::enable_if_t<(N > 1 && N <= 4), T>, N>;
spall wrote:
should the enable_if_t not go around the ent
@@ -89,23 +89,31 @@ void asuint(double4, out uint4, out uint4);
/// \param X The X input value.
/// \param Y The Y input value.
+template
_HLSL_16BIT_AVAILABILITY(shadermodel, 6.2)
-const inline half distance(half X, half Y) {
+const inline __detail::enable_if_t<__detail::is
@@ -89,23 +89,31 @@ void asuint(double4, out uint4, out uint4);
/// \param X The X input value.
/// \param Y The Y input value.
+template
_HLSL_16BIT_AVAILABILITY(shadermodel, 6.2)
-const inline half distance(half X, half Y) {
+const inline __detail::enable_if_t<__detail::is
https://github.com/spall edited https://github.com/llvm/llvm-project/pull/130724
___
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/4] error on out of bounds vector accesses
---
.../clang/Basic/Dia
@@ -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
@@ -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
201 - 300 of 366 matches
Mail list logo