[clang] [HLSL] Support vector swizzles on scalars (PR #67700)

2023-11-29 Thread Chris B via cfe-commits
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

[clang] [HLSL] Support vector swizzles on scalars (PR #67700)

2023-11-29 Thread Aaron Ballman via 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

[clang] [HLSL] Support vector swizzles on scalars (PR #67700)

2023-11-28 Thread via 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

[clang] [HLSL] Support vector swizzles on scalars (PR #67700)

2023-11-28 Thread Chris B via 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

[clang] [HLSL] Support vector swizzles on scalars (PR #67700)

2023-11-13 Thread Chris B via 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

[clang] [HLSL] Support vector swizzles on scalars (PR #67700)

2023-11-08 Thread Chris B via 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

[clang] [HLSL] Support vector swizzles on scalars (PR #67700)

2023-10-27 Thread Chris B via cfe-commits
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

[clang] [HLSL] Support vector swizzles on scalars (PR #67700)

2023-10-25 Thread via cfe-commits
@@ -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

[clang] [HLSL] Support vector swizzles on scalars (PR #67700)

2023-10-25 Thread Aaron Ballman via cfe-commits
@@ -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 {{.*}} '

[clang] [HLSL] Support vector swizzles on scalars (PR #67700)

2023-10-25 Thread Aaron Ballman via 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

[clang] [HLSL] Support vector swizzles on scalars (PR #67700)

2023-10-25 Thread Aaron Ballman via cfe-commits
@@ -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 {{.*}} '

[clang] [HLSL] Support vector swizzles on scalars (PR #67700)

2023-10-24 Thread Chris B via cfe-commits
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

[clang] [HLSL] Support vector swizzles on scalars (PR #67700)

2023-10-23 Thread Chris B via cfe-commits
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

[clang] [HLSL] Support vector swizzles on scalars (PR #67700)

2023-10-23 Thread Chris B via cfe-commits
@@ -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 {{.*}} '

[clang] [HLSL] Support vector swizzles on scalars (PR #67700)

2023-10-23 Thread Chris B via 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

[clang] [HLSL] Support vector swizzles on scalars (PR #67700)

2023-10-23 Thread Chris B via cfe-commits
@@ -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

[clang] [HLSL] Support vector swizzles on scalars (PR #67700)

2023-10-16 Thread Chris B via cfe-commits
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

[clang] [HLSL] Support vector swizzles on scalars (PR #67700)

2023-10-12 Thread via cfe-commits
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

[clang] [HLSL] Support vector swizzles on scalars (PR #67700)

2023-10-12 Thread via cfe-commits
@@ -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

[clang] [HLSL] Support vector swizzles on scalars (PR #67700)

2023-10-12 Thread via cfe-commits
@@ -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')) { +

[clang] [HLSL] Support vector swizzles on scalars (PR #67700)

2023-10-12 Thread Aaron Ballman via cfe-commits
@@ -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 {{.*}} '

[clang] [HLSL] Support vector swizzles on scalars (PR #67700)

2023-10-12 Thread Aaron Ballman via cfe-commits
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

[clang] [HLSL] Support vector swizzles on scalars (PR #67700)

2023-10-12 Thread Aaron Ballman via 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

[clang] [HLSL] Support vector swizzles on scalars (PR #67700)

2023-10-09 Thread Justin Bogner via cfe-commits
@@ -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')) { +

[clang] [HLSL] Support vector swizzles on scalars (PR #67700)

2023-10-09 Thread Justin Bogner via cfe-commits
@@ -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

[clang] [HLSL] Support vector swizzles on scalars (PR #67700)

2023-09-28 Thread via cfe-commits
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 --

[clang] [HLSL] Support vector swizzles on scalars (PR #67700)

2023-09-28 Thread via cfe-commits
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

[clang] [HLSL] Support vector swizzles on scalars (PR #67700)

2023-09-28 Thread Chris B via cfe-commits
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