https://github.com/farzonl edited
https://github.com/llvm/llvm-project/pull/132288
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -322,5 +322,53 @@ reflect(__detail::HLSL_FIXED_VECTOR I,
__detail::HLSL_FIXED_VECTOR N) {
return __detail::reflect_vec_impl(I, N);
}
+
+//===--===//
+// smoothstep builtin
+//===---
llvmbot wrote:
@llvm/pr-subscribers-clang-codegen
Author: Kaitlin Peng (kmpeng)
Changes
Closes #99156.
Tasks completed:
- Implement `smoothstep` using HLSL source in `hlsl_intrinsics.h`
- Implement the `smoothstep` SPIR-V target built-in in
`clang/include/clang/Basic/BuiltinsSPIRV.td`
-
llvmbot wrote:
@llvm/pr-subscribers-backend-spir-v
@llvm/pr-subscribers-clang
Author: Kaitlin Peng (kmpeng)
Changes
Closes #99156.
Tasks completed:
- Implement `smoothstep` using HLSL source in `hlsl_intrinsics.h`
- Implement the `smoothstep` SPIR-V target built-in in
`clang/include/cla
https://github.com/farzonl closed
https://github.com/llvm/llvm-project/pull/132288
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/kmpeng updated
https://github.com/llvm/llvm-project/pull/132288
>From 1d28510653b39fcabe45ad37197674bdd0217add Mon Sep 17 00:00:00 2001
From: kmpeng
Date: Tue, 18 Mar 2025 13:25:10 -0700
Subject: [PATCH 01/11] create int_spv_smoothstep intrinsic, create smoothstep
lowering &
https://github.com/farzonl approved this pull request.
This looks, good. really minor nit needs to be addressed then merge.
https://github.com/llvm/llvm-project/pull/132288
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/
@@ -0,0 +1,54 @@
+// RUN: %clang_cc1 %s -triple spirv-pc-vulkan-compute -verify
+
+typedef float float2 __attribute__((ext_vector_type(2)));
+typedef float float3 __attribute__((ext_vector_type(3)));
+
+float2 test_no_second_arg(float2 p0) {
+ return __builtin_spirv_smoothstep(p0
@@ -0,0 +1,60 @@
+; RUN: llc -O0 -verify-machineinstrs -mtriple=spirv-unknown-unknown %s -o - |
FileCheck %s
+; RUN: %if spirv-tools %{ llc -O0 -mtriple=spirv-unknown-unknown %s -o -
-filetype=obj | spirv-val %}
farzonl wrote:
This should be fine. I think Steve
https://github.com/kmpeng edited
https://github.com/llvm/llvm-project/pull/132288
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -0,0 +1,60 @@
+; RUN: llc -O0 -verify-machineinstrs -mtriple=spirv-unknown-unknown %s -o - |
FileCheck %s
+; RUN: %if spirv-tools %{ llc -O0 -mtriple=spirv-unknown-unknown %s -o -
-filetype=obj | spirv-val %}
kmpeng wrote:
@s-perron Changing the target envir
https://github.com/kmpeng edited
https://github.com/llvm/llvm-project/pull/132288
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
llvmbot wrote:
@llvm/pr-subscribers-llvm-ir
Author: Kaitlin Peng (kmpeng)
Changes
Closes #99156.
Tasks completed:
- Implement `smoothstep` using HLSL source in `hlsl_intrinsics.h`
- Implement the `smoothstep` SPIR-V target built-in in
`clang/include/clang/Basic/BuiltinsSPIRV.td`
- Add s
https://github.com/kmpeng edited
https://github.com/llvm/llvm-project/pull/132288
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/kmpeng edited
https://github.com/llvm/llvm-project/pull/132288
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -0,0 +1,60 @@
+; RUN: llc -O0 -verify-machineinstrs -mtriple=spirv-unknown-unknown %s -o - |
FileCheck %s
+; RUN: %if spirv-tools %{ llc -O0 -mtriple=spirv-unknown-unknown %s -o -
-filetype=obj | spirv-val %}
kmpeng wrote:
Seems like this change produces thi
https://github.com/kmpeng deleted
https://github.com/llvm/llvm-project/pull/132288
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -101,6 +101,52 @@ bool SemaSPIRV::CheckSPIRVBuiltinFunctionCall(unsigned
BuiltinID,
TheCall->setType(RetTy);
break;
}
+ case SPIRV::BI__builtin_spirv_smoothstep: {
+if (SemaRef.checkArgCount(TheCall, 3))
+ return true;
+
+// check if the all argument
https://github.com/kmpeng updated
https://github.com/llvm/llvm-project/pull/132288
>From 1d28510653b39fcabe45ad37197674bdd0217add Mon Sep 17 00:00:00 2001
From: kmpeng
Date: Tue, 18 Mar 2025 13:25:10 -0700
Subject: [PATCH 01/10] create int_spv_smoothstep intrinsic, create smoothstep
lowering &
@@ -0,0 +1,60 @@
+; RUN: llc -O0 -verify-machineinstrs -mtriple=spirv-unknown-unknown %s -o - |
FileCheck %s
+; RUN: %if spirv-tools %{ llc -O0 -mtriple=spirv-unknown-unknown %s -o -
-filetype=obj | spirv-val %}
kmpeng wrote:
Code updated with `--target-env vul
https://github.com/kmpeng edited
https://github.com/llvm/llvm-project/pull/132288
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -101,6 +101,52 @@ bool SemaSPIRV::CheckSPIRVBuiltinFunctionCall(unsigned
BuiltinID,
TheCall->setType(RetTy);
break;
}
+ case SPIRV::BI__builtin_spirv_smoothstep: {
+if (SemaRef.checkArgCount(TheCall, 3))
+ return true;
+
+// check if the all argument
https://github.com/kmpeng updated
https://github.com/llvm/llvm-project/pull/132288
>From 7853b27b8fffa6d2c0393a4004abaac9a7954608 Mon Sep 17 00:00:00 2001
From: kmpeng
Date: Tue, 18 Mar 2025 13:25:10 -0700
Subject: [PATCH 01/10] create int_spv_smoothstep intrinsic, create smoothstep
lowering &
@@ -0,0 +1,60 @@
+; RUN: llc -O0 -verify-machineinstrs -mtriple=spirv-unknown-unknown %s -o - |
FileCheck %s
+; RUN: %if spirv-tools %{ llc -O0 -mtriple=spirv-unknown-unknown %s -o -
-filetype=obj | spirv-val %}
kmpeng wrote:
Would you also like this added to t
@@ -101,6 +101,52 @@ bool SemaSPIRV::CheckSPIRVBuiltinFunctionCall(unsigned
BuiltinID,
TheCall->setType(RetTy);
break;
}
+ case SPIRV::BI__builtin_spirv_smoothstep: {
+if (SemaRef.checkArgCount(TheCall, 3))
+ return true;
+
+// check if the all argument
https://github.com/kmpeng edited
https://github.com/llvm/llvm-project/pull/132288
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/kmpeng edited
https://github.com/llvm/llvm-project/pull/132288
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/s-perron edited
https://github.com/llvm/llvm-project/pull/132288
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/s-perron approved this pull request.
The SPV code looks good to me. I just want one small suggestion.
https://github.com/llvm/llvm-project/pull/132288
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi
@@ -0,0 +1,60 @@
+; RUN: llc -O0 -verify-machineinstrs -mtriple=spirv-unknown-unknown %s -o - |
FileCheck %s
+; RUN: %if spirv-tools %{ llc -O0 -mtriple=spirv-unknown-unknown %s -o -
-filetype=obj | spirv-val %}
s-perron wrote:
I would like to start having the
https://github.com/kmpeng updated
https://github.com/llvm/llvm-project/pull/132288
>From 7853b27b8fffa6d2c0393a4004abaac9a7954608 Mon Sep 17 00:00:00 2001
From: kmpeng
Date: Tue, 18 Mar 2025 13:25:10 -0700
Subject: [PATCH 1/8] create int_spv_smoothstep intrinsic, create smoothstep
lowering & m
@@ -101,6 +101,52 @@ bool SemaSPIRV::CheckSPIRVBuiltinFunctionCall(unsigned
BuiltinID,
TheCall->setType(RetTy);
break;
}
+ case SPIRV::BI__builtin_spirv_smoothstep: {
+if (SemaRef.checkArgCount(TheCall, 3))
+ return true;
+
+// check if the all argument
https://github.com/kmpeng edited
https://github.com/llvm/llvm-project/pull/132288
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -101,6 +101,52 @@ bool SemaSPIRV::CheckSPIRVBuiltinFunctionCall(unsigned
BuiltinID,
TheCall->setType(RetTy);
break;
}
+ case SPIRV::BI__builtin_spirv_smoothstep: {
+if (SemaRef.checkArgCount(TheCall, 3))
+ return true;
+
+// check if the all argument
@@ -101,6 +101,52 @@ bool SemaSPIRV::CheckSPIRVBuiltinFunctionCall(unsigned
BuiltinID,
TheCall->setType(RetTy);
break;
}
+ case SPIRV::BI__builtin_spirv_smoothstep: {
+if (SemaRef.checkArgCount(TheCall, 3))
+ return true;
+
+// check if the all argument
@@ -0,0 +1,183 @@
+// 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 \
+// RUN: dxil-pc-shadermodel6.3-library %s -fnative-half-type \
+// RUN: -emit-llvm -O1 -o - |
@@ -322,5 +322,53 @@ reflect(__detail::HLSL_FIXED_VECTOR I,
__detail::HLSL_FIXED_VECTOR N) {
return __detail::reflect_vec_impl(I, N);
}
+
+//===--===//
+// smoothstep builtin
+//===---
@@ -0,0 +1,183 @@
+// 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 \
+// RUN: dxil-pc-shadermodel6.3-library %s -fnative-half-type \
+// RUN: -emit-llvm -O1 -o - |
@@ -0,0 +1,43 @@
+// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py
UTC_ARGS: --version 5
+
+// RUN: %clang_cc1 -O1 -triple spirv-pc-vulkan-compute %s -emit-llvm -o - |
FileCheck %s
+
+typedef float float2 __attribute__((ext_vector_type(2)));
+typedef
@@ -0,0 +1,183 @@
+// 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 \
+// RUN: dxil-pc-shadermodel6.3-library %s -fnative-half-type \
+// RUN: -emit-llvm -O1 -o - |
@@ -101,6 +101,52 @@ bool SemaSPIRV::CheckSPIRVBuiltinFunctionCall(unsigned
BuiltinID,
TheCall->setType(RetTy);
break;
}
+ case SPIRV::BI__builtin_spirv_smoothstep: {
+if (SemaRef.checkArgCount(TheCall, 3))
+ return true;
+
+// check if the all argument
https://github.com/farzonl edited
https://github.com/llvm/llvm-project/pull/132288
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -25,3 +25,9 @@ def SPIRVReflect : Builtin {
let Attributes = [NoThrow, Const];
let Prototype = "void(...)";
}
+
+def SPIRVSmoothStep : Builtin {
+ let Spellings = ["__builtin_spirv_smoothstep"];
+ let Attributes = [NoThrow, Const];
farzonl wrote:
do w
https://github.com/kmpeng updated
https://github.com/llvm/llvm-project/pull/132288
>From 0a5da660c5aae053d87d556e59f98c121d916b79 Mon Sep 17 00:00:00 2001
From: kmpeng
Date: Tue, 18 Mar 2025 13:25:10 -0700
Subject: [PATCH 1/7] create int_spv_smoothstep intrinsic, create smoothstep
lowering & m
https://github.com/kmpeng updated
https://github.com/llvm/llvm-project/pull/132288
>From 0a5da660c5aae053d87d556e59f98c121d916b79 Mon Sep 17 00:00:00 2001
From: kmpeng
Date: Tue, 18 Mar 2025 13:25:10 -0700
Subject: [PATCH 1/8] create int_spv_smoothstep intrinsic, create smoothstep
lowering & m
github-actions[bot] wrote:
:warning: undef deprecator found issues in your code. :warning:
You can test this locally with the following command:
``bash
git diff -U0 --pickaxe-regex -S
'([^a-zA-Z0-9#_-]undef[^a-zA-Z0-9_-]|UndefValue::get)'
2c8e26081fc5a023471622ddc98638431c66ac6f
https://github.com/kmpeng updated
https://github.com/llvm/llvm-project/pull/132288
>From 0a5da660c5aae053d87d556e59f98c121d916b79 Mon Sep 17 00:00:00 2001
From: kmpeng
Date: Tue, 18 Mar 2025 13:25:10 -0700
Subject: [PATCH 1/7] create int_spv_smoothstep intrinsic, create smoothstep
lowering & m
@@ -0,0 +1,18 @@
+// RUN: %clang_cc1 %s -triple spirv-pc-vulkan-compute -verify
+
+typedef float float2 __attribute__((ext_vector_type(2)));
+
+float2 test_no_second_arg(float2 p0) {
+ return __builtin_spirv_smoothstep(p0);
+ // expected-error@-1 {{too few arguments to function
llvmbot wrote:
@llvm/pr-subscribers-hlsl
Author: Kaitlin Peng (kmpeng)
Changes
Closes #99156.
Tasks completed:
- Implement `smoothstep` using HLSL source in `hlsl_intrinsics.h`
- Implement the `smoothstep` SPIR-V target built-in in
`clang/include/clang/Basic/BuiltinsSPIRV.td`
- Add sema
https://github.com/farzonl deleted
https://github.com/llvm/llvm-project/pull/132288
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/farzonl deleted
https://github.com/llvm/llvm-project/pull/132288
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -0,0 +1,44 @@
+// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py
UTC_ARGS: --version 5
+
+// RUN: %clang_cc1 -O1 -triple spirv-pc-vulkan-compute %s -emit-llvm -o - |
FileCheck %s
+
+typedef float float2 __attribute__((ext_vector_type(2)));
+typedef
https://github.com/kmpeng deleted
https://github.com/llvm/llvm-project/pull/132288
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -0,0 +1,44 @@
+// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py
UTC_ARGS: --version 5
+
+// RUN: %clang_cc1 -O1 -triple spirv-pc-vulkan-compute %s -emit-llvm -o - |
FileCheck %s
+
+typedef float float2 __attribute__((ext_vector_type(2)));
+typedef
@@ -0,0 +1,44 @@
+// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py
UTC_ARGS: --version 5
+
+// RUN: %clang_cc1 -O1 -triple spirv-pc-vulkan-compute %s -emit-llvm -o - |
FileCheck %s
+
+typedef float float2 __attribute__((ext_vector_type(2)));
+typedef
@@ -0,0 +1,44 @@
+// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py
UTC_ARGS: --version 5
+
+// RUN: %clang_cc1 -O1 -triple spirv-pc-vulkan-compute %s -emit-llvm -o - |
FileCheck %s
+
+typedef float float2 __attribute__((ext_vector_type(2)));
+typedef
@@ -0,0 +1,18 @@
+// RUN: %clang_cc1 %s -triple spirv-pc-vulkan-compute -verify
+
+typedef float float2 __attribute__((ext_vector_type(2)));
+
+float2 test_no_second_arg(float2 p0) {
+ return __builtin_spirv_smoothstep(p0);
+ // expected-error@-1 {{too few arguments to function
https://github.com/farzonl deleted
https://github.com/llvm/llvm-project/pull/132288
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -101,6 +101,44 @@ bool SemaSPIRV::CheckSPIRVBuiltinFunctionCall(unsigned
BuiltinID,
TheCall->setType(RetTy);
break;
}
+ case SPIRV::BI__builtin_spirv_smoothstep: {
+if (SemaRef.checkArgCount(TheCall, 3))
+ return true;
+
+ExprResult A = TheCall->getA
@@ -20955,6 +20955,25 @@ Value *CodeGenFunction::EmitSPIRVBuiltinExpr(unsigned
BuiltinID,
/*ReturnType=*/I->getType(), Intrinsic::spv_reflect,
ArrayRef{I, N}, nullptr, "spv.reflect");
}
+ case SPIRV::BI__builtin_spirv_smoothstep: {
+Value *Min = EmitScal
@@ -20955,6 +20955,25 @@ Value *CodeGenFunction::EmitSPIRVBuiltinExpr(unsigned
BuiltinID,
/*ReturnType=*/I->getType(), Intrinsic::spv_reflect,
ArrayRef{I, N}, nullptr, "spv.reflect");
}
+ case SPIRV::BI__builtin_spirv_smoothstep: {
+Value *Min = EmitScal
https://github.com/kmpeng updated
https://github.com/llvm/llvm-project/pull/132288
>From 0a5da660c5aae053d87d556e59f98c121d916b79 Mon Sep 17 00:00:00 2001
From: kmpeng
Date: Tue, 18 Mar 2025 13:25:10 -0700
Subject: [PATCH 1/6] create int_spv_smoothstep intrinsic, create smoothstep
lowering & m
https://github.com/kmpeng deleted
https://github.com/llvm/llvm-project/pull/132288
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -101,6 +101,44 @@ bool SemaSPIRV::CheckSPIRVBuiltinFunctionCall(unsigned
BuiltinID,
TheCall->setType(RetTy);
break;
}
+ case SPIRV::BI__builtin_spirv_smoothstep: {
+if (SemaRef.checkArgCount(TheCall, 3))
+ return true;
+
+ExprResult A = TheCall->getA
@@ -101,6 +101,44 @@ bool SemaSPIRV::CheckSPIRVBuiltinFunctionCall(unsigned
BuiltinID,
TheCall->setType(RetTy);
break;
}
+ case SPIRV::BI__builtin_spirv_smoothstep: {
+if (SemaRef.checkArgCount(TheCall, 3))
+ return true;
+
+ExprResult A = TheCall->getA
@@ -20955,6 +20955,25 @@ Value *CodeGenFunction::EmitSPIRVBuiltinExpr(unsigned
BuiltinID,
/*ReturnType=*/I->getType(), Intrinsic::spv_reflect,
ArrayRef{I, N}, nullptr, "spv.reflect");
}
+ case SPIRV::BI__builtin_spirv_smoothstep: {
+Value *Min = EmitScal
@@ -20955,6 +20955,25 @@ Value *CodeGenFunction::EmitSPIRVBuiltinExpr(unsigned
BuiltinID,
/*ReturnType=*/I->getType(), Intrinsic::spv_reflect,
ArrayRef{I, N}, nullptr, "spv.reflect");
}
+ case SPIRV::BI__builtin_spirv_smoothstep: {
+Value *Min = EmitScal
https://github.com/kmpeng created
https://github.com/llvm/llvm-project/pull/132288
Closes #99156.
Tasks completed:
- Implement `smoothstep` using HLSL source in `hlsl_intrinsics.h`
- Implement the `smoothstep` SPIR-V target built-in in
`clang/include/clang/Basic/BuiltinsSPIRV.td`
- Add sema c
68 matches
Mail list logo