https://github.com/llvm-beanz closed
https://github.com/llvm/llvm-project/pull/67700
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/AaronBallman approved this pull request.
LGTM!
https://github.com/llvm/llvm-project/pull/67700
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/cor3ntin approved this pull request.
I am happy with the lexing/sema changes.
Please give @AaronBallman the opportunity to look at the code gen bits.
https://github.com/llvm/llvm-project/pull/67700
___
cfe-commits mailing list
cfe-co
llvm-beanz wrote:
Friendly ping @AaronBallman & @cor3ntin.
https://github.com/llvm/llvm-project/pull/67700
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
llvm-beanz wrote:
Friendly ping @AaronBallman & @cor3ntin.
https://github.com/llvm/llvm-project/pull/67700
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
llvm-beanz wrote:
@cor3ntin, I've in parallel been working on fleshing out the immediately
relevant bits of our language spec. This PR describes the _pp-number_ and
_vector-literal_ grammars roughly correctly to this change.
I think I've addressed all the other feedback on the PR, please let m
https://github.com/llvm-beanz updated
https://github.com/llvm/llvm-project/pull/67700
>From 2fa183da3991c0bc4da6163609331d198f4a37af Mon Sep 17 00:00:00 2001
From: Chris Bieneman
Date: Tue, 26 Sep 2023 19:48:18 -0500
Subject: [PATCH 1/4] [HLSL] Support vector swizzles on scalars
HLSL supports
@@ -930,7 +930,11 @@ NumericLiteralParser::NumericLiteralParser(StringRef
TokSpelling,
// and FP constants (specifically, the 'pp-number' regex), and assumes that
// the byte at "*end" is both valid and not part of the regex. Because of
// this, it doesn't have to check
@@ -0,0 +1,78 @@
+// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.6-library -x hlsl \
+// RUN: -finclude-default-header -ast-dump %s | FileCheck %s
+
+
+// CHECK: ExtVectorElementExpr {{.*}} 'int
__attribute__((ext_vector_type(2)))' xx
+// CHECK-NEXT: ImplicitCastExpr {{.*}} '
@@ -0,0 +1,14 @@
+// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.6-library -x hlsl
-finclude-default-header -verify %s
+
+
+int2 ToTwoInts(int V) {
+ return V.xy; // expected-error{{vector component access exceeds type 'int
__attribute__((ext_vector_type(1)))' (vector of 1 'i
@@ -0,0 +1,78 @@
+// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.6-library -x hlsl \
+// RUN: -finclude-default-header -ast-dump %s | FileCheck %s
+
+
+// CHECK: ExtVectorElementExpr {{.*}} 'int
__attribute__((ext_vector_type(2)))' xx
+// CHECK-NEXT: ImplicitCastExpr {{.*}} '
https://github.com/llvm-beanz updated
https://github.com/llvm/llvm-project/pull/67700
>From 2fa183da3991c0bc4da6163609331d198f4a37af Mon Sep 17 00:00:00 2001
From: Chris Bieneman
Date: Tue, 26 Sep 2023 19:48:18 -0500
Subject: [PATCH 1/3] [HLSL] Support vector swizzles on scalars
HLSL supports
https://github.com/llvm-beanz updated
https://github.com/llvm/llvm-project/pull/67700
>From 2fa183da3991c0bc4da6163609331d198f4a37af Mon Sep 17 00:00:00 2001
From: Chris Bieneman
Date: Tue, 26 Sep 2023 19:48:18 -0500
Subject: [PATCH 1/2] [HLSL] Support vector swizzles on scalars
HLSL supports
@@ -0,0 +1,78 @@
+// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.6-library -x hlsl \
+// RUN: -finclude-default-header -ast-dump %s | FileCheck %s
+
+
+// CHECK: ExtVectorElementExpr {{.*}} 'int
__attribute__((ext_vector_type(2)))' xx
+// CHECK-NEXT: ImplicitCastExpr {{.*}} '
@@ -0,0 +1,14 @@
+// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.6-library -x hlsl
-finclude-default-header -verify %s
+
+
+int2 ToTwoInts(int V) {
+ return V.xy; // expected-error{{vector component access exceeds type 'int
__attribute__((ext_vector_type(1)))' (vector of 1 'i
@@ -930,7 +930,11 @@ NumericLiteralParser::NumericLiteralParser(StringRef
TokSpelling,
// and FP constants (specifically, the 'pp-number' regex), and assumes that
// the byte at "*end" is both valid and not part of the regex. Because of
// this, it doesn't have to check
llvm-beanz wrote:
> This is the documentation i found. Can you confirm the intent is only to
> support `.x???` and `r???` ? It alludes to more options. Maybe we need a
> `isHLSLSwizzleStart` function to avoid comparing to `'x'` and `'r'` in
> multiple places.
The documentation for this is bad
cor3ntin wrote:
This is the documentation i found.
Can you confirm the intent is only to support `.x???` and `r???` ?
It alludes to more options.
Maybe we need a `isHLSLSwizzleStart` function to avoid comparing to `'x'` and
`'r'` in multiple places.
https://learn.microsoft.com/en-us/windows/win
@@ -930,7 +930,11 @@ NumericLiteralParser::NumericLiteralParser(StringRef
TokSpelling,
// and FP constants (specifically, the 'pp-number' regex), and assumes that
// the byte at "*end" is both valid and not part of the regex. Because of
// this, it doesn't have to check
@@ -1950,6 +1950,10 @@ bool Lexer::LexNumericConstant(Token &Result, const char
*CurPtr) {
while (isPreprocessingNumberBody(C)) {
CurPtr = ConsumeChar(CurPtr, Size, Result);
PrevCh = C;
+if (LangOpts.HLSL && C == '.' && (*CurPtr == 'x' || *CurPtr == 'r')) {
+
@@ -0,0 +1,78 @@
+// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.6-library -x hlsl \
+// RUN: -finclude-default-header -ast-dump %s | FileCheck %s
+
+
+// CHECK: ExtVectorElementExpr {{.*}} 'int
__attribute__((ext_vector_type(2)))' xx
+// CHECK-NEXT: ImplicitCastExpr {{.*}} '
https://github.com/AaronBallman edited
https://github.com/llvm/llvm-project/pull/67700
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -0,0 +1,14 @@
+// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.6-library -x hlsl
-finclude-default-header -verify %s
+
+
+int2 ToTwoInts(int V) {
+ return V.xy; // expected-error{{vector component access exceeds type 'int
__attribute__((ext_vector_type(1)))' (vector of 1 'i
@@ -1950,6 +1950,10 @@ bool Lexer::LexNumericConstant(Token &Result, const char
*CurPtr) {
while (isPreprocessingNumberBody(C)) {
CurPtr = ConsumeChar(CurPtr, Size, Result);
PrevCh = C;
+if (LangOpts.HLSL && C == '.' && (*CurPtr == 'x' || *CurPtr == 'r')) {
+
@@ -930,7 +930,11 @@ NumericLiteralParser::NumericLiteralParser(StringRef
TokSpelling,
// and FP constants (specifically, the 'pp-number' regex), and assumes that
// the byte at "*end" is both valid and not part of the regex. Because of
// this, it doesn't have to check
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 6bbccc0bcb36689507ba98ef338527d43334c7e7
2fa183da3991c0bc4da6163609331d198f4a37af --
llvmbot wrote:
@llvm/pr-subscribers-hlsl
Changes
HLSL supports vector swizzles on scalars by implicitly converting the scalar to
a single-element vector. This syntax is a convienent way to initialize vectors
based on filling a scalar value.
There are two parts of this change. The first p
https://github.com/llvm-beanz created
https://github.com/llvm/llvm-project/pull/67700
HLSL supports vector swizzles on scalars by implicitly converting the scalar to
a single-element vector. This syntax is a convienent way to initialize vectors
based on filling a scalar value.
There are two p
28 matches
Mail list logo