https://github.com/farzonl closed
https://github.com/llvm/llvm-project/pull/101989
___
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
tgymnich wrote:
Rebased. All ready to go.
https://github.com/llvm/llvm-project/pull/101989
___
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/tgymnich updated
https://github.com/llvm/llvm-project/pull/101989
>From fb977f072b27cc385051e23365c1391a9064d47e Mon Sep 17 00:00:00 2001
From: Tim Gymnich
Date: Fri, 2 Aug 2024 21:40:24 +0200
Subject: [PATCH] [clang][HLSL] Add sign intrinsic part 3
---
clang/include/clang/
https://github.com/tgymnich updated
https://github.com/llvm/llvm-project/pull/101989
>From 6f9a5267593a3d8263aef13899b84bb3c2e7749d Mon Sep 17 00:00:00 2001
From: Tim Gymnich
Date: Fri, 2 Aug 2024 21:40:24 +0200
Subject: [PATCH] [clang][HLSL] Add sign intrinsic part 3
---
clang/include/clang/
farzonl wrote:
@tgymnich with part 1 and 2 merged I think we are ready for this. If you fix
the conflicts in the PR i'll merge it for you.
https://github.com/llvm/llvm-project/pull/101989
___
cfe-commits mailing list
[email protected]
https:/
https://github.com/bogner approved this pull request.
https://github.com/llvm/llvm-project/pull/101989
___
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -916,7 +916,7 @@ float4 lerp(float4, float4, float4);
/// \brief Returns the length of the specified floating-point vector.
/// \param x [in] The vector of floats, or a scalar float.
///
-/// Length is based on the following formula: sqrt(x[0]^2 + x[1]^2 + �).
+/// Length is
https://github.com/tgymnich updated
https://github.com/llvm/llvm-project/pull/101989
>From 4516f38d4cba70f2368dc68c72e0024f3f3e0732 Mon Sep 17 00:00:00 2001
From: Tim Gymnich
Date: Fri, 2 Aug 2024 21:40:24 +0200
Subject: [PATCH 1/6] [clang][HLSL] Add sign intrinsic part 3
---
clang/include/cl
farzonl wrote:
> @farzonl This PR requires the SPIRV part (#101987) to be merged.
I haven't signed off on that one because I wanted input from others. I'll ping
some folks.
If the pr is still sitting we can make a small change in this pr that will
unbloc it. Add the spirv intrinsic to this pr t
https://github.com/tgymnich updated
https://github.com/llvm/llvm-project/pull/101989
>From 4516f38d4cba70f2368dc68c72e0024f3f3e0732 Mon Sep 17 00:00:00 2001
From: Tim Gymnich
Date: Fri, 2 Aug 2024 21:40:24 +0200
Subject: [PATCH 1/5] [clang][HLSL] Add sign intrinsic part 3
---
clang/include/cl
https://github.com/farzonl edited
https://github.com/llvm/llvm-project/pull/101989
___
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -0,0 +1,209 @@
+// RUN: %clang_cc1 -finclude-default-header -x hlsl -triple \
+// RUN: dxil-pc-shadermodel6.3-library %s -fnative-half-type \
+// RUN: -emit-llvm -disable-llvm-passes -o - | FileCheck %s \
+// RUN: --check-prefixes=CHECK,DXIL_CHECK,DXIL_NATIVE_HALF,NATIVE_
tgymnich wrote:
@farzonl This PR requires the SPIRV part
(https://github.com/llvm/llvm-project/pull/101987) to be merged.
https://github.com/llvm/llvm-project/pull/101989
___
cfe-commits mailing list
[email protected]
https://lists.llvm.org/c
farzonl wrote:
@tgymnich you got approval on this PR, is there something you are waiting on?
https://github.com/llvm/llvm-project/pull/101989
___
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-co
https://github.com/tgymnich edited
https://github.com/llvm/llvm-project/pull/101989
___
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -18662,6 +18662,23 @@ case Builtin::BI__builtin_hlsl_elementwise_isinf: {
llvm::FunctionType::get(IntTy, {}, false),
"__hlsl_wave_get_lane_index",
{}, false, true));
}
+ case Builtin::BI__builtin_hlsl_elementwise_sign: {
+Value *Op0 = EmitScalarExpr(E
https://github.com/tgymnich updated
https://github.com/llvm/llvm-project/pull/101989
>From c7f7a3683805c6a9a1d696905321a1e161ec8beb Mon Sep 17 00:00:00 2001
From: Tim Gymnich
Date: Fri, 2 Aug 2024 21:40:24 +0200
Subject: [PATCH 1/5] [clang][HLSL] Add sign intrinsic part 3
---
clang/include/cl
https://github.com/tgymnich edited
https://github.com/llvm/llvm-project/pull/101989
___
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -916,7 +916,7 @@ float4 lerp(float4, float4, float4);
/// \brief Returns the length of the specified floating-point vector.
/// \param x [in] The vector of floats, or a scalar float.
///
-/// Length is based on the following formula: sqrt(x[0]^2 + x[1]^2 + �).
+/// Length is
@@ -916,7 +916,7 @@ float4 lerp(float4, float4, float4);
/// \brief Returns the length of the specified floating-point vector.
/// \param x [in] The vector of floats, or a scalar float.
///
-/// Length is based on the following formula: sqrt(x[0]^2 + x[1]^2 + �).
+/// Length is
https://github.com/tgymnich updated
https://github.com/llvm/llvm-project/pull/101989
>From c7f7a3683805c6a9a1d696905321a1e161ec8beb Mon Sep 17 00:00:00 2001
From: Tim Gymnich
Date: Fri, 2 Aug 2024 21:40:24 +0200
Subject: [PATCH 1/4] [clang][HLSL] Add sign intrinsic part 3
---
clang/include/cl
https://github.com/farzonl approved this pull request.
https://github.com/llvm/llvm-project/pull/101989
___
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -1725,5 +1725,76 @@ _HLSL_AVAILABILITY(shadermodel, 6.0)
_HLSL_BUILTIN_ALIAS(__builtin_hlsl_wave_get_lane_index)
__attribute__((convergent)) uint WaveGetLaneIndex();
+//===--===//
+// sign builtins
+//===--
@@ -916,7 +916,7 @@ float4 lerp(float4, float4, float4);
/// \brief Returns the length of the specified floating-point vector.
/// \param x [in] The vector of floats, or a scalar float.
///
-/// Length is based on the following formula: sqrt(x[0]^2 + x[1]^2 + �).
+/// Length is
@@ -18662,6 +18662,23 @@ case Builtin::BI__builtin_hlsl_elementwise_isinf: {
llvm::FunctionType::get(IntTy, {}, false),
"__hlsl_wave_get_lane_index",
{}, false, true));
}
+ case Builtin::BI__builtin_hlsl_elementwise_sign: {
+Value *Op0 = EmitScalarExpr(E
https://github.com/tgymnich updated
https://github.com/llvm/llvm-project/pull/101989
>From c7f7a3683805c6a9a1d696905321a1e161ec8beb Mon Sep 17 00:00:00 2001
From: Tim Gymnich
Date: Fri, 2 Aug 2024 21:40:24 +0200
Subject: [PATCH 1/4] [clang][HLSL] Add sign intrinsic part 3
---
clang/include/cl
@@ -1725,5 +1725,76 @@ _HLSL_AVAILABILITY(shadermodel, 6.0)
_HLSL_BUILTIN_ALIAS(__builtin_hlsl_wave_get_lane_index)
__attribute__((convergent)) uint WaveGetLaneIndex();
+//===--===//
+// sign builtins
+//===--
@@ -1725,5 +1725,76 @@ _HLSL_AVAILABILITY(shadermodel, 6.0)
_HLSL_BUILTIN_ALIAS(__builtin_hlsl_wave_get_lane_index)
__attribute__((convergent)) uint WaveGetLaneIndex();
+//===--===//
+// sign builtins
+//===--
@@ -1725,5 +1725,76 @@ _HLSL_AVAILABILITY(shadermodel, 6.0)
_HLSL_BUILTIN_ALIAS(__builtin_hlsl_wave_get_lane_index)
__attribute__((convergent)) uint WaveGetLaneIndex();
+//===--===//
+// sign builtins
+//===--
@@ -4737,6 +4737,12 @@ def HLSLRSqrt : LangBuiltin<"HLSL_LANG"> {
let Prototype = "void(...)";
}
+def HLSLSign : LangBuiltin<"HLSL_LANG"> {
+ let Spellings = ["__builtin_hlsl_elementwise_sign"];
+ let Attributes = [NoThrow, Const];
+ let Prototype = "int(...)";
--
https://github.com/tgymnich updated
https://github.com/llvm/llvm-project/pull/101989
>From c7f7a3683805c6a9a1d696905321a1e161ec8beb Mon Sep 17 00:00:00 2001
From: Tim Gymnich
Date: Fri, 2 Aug 2024 21:40:24 +0200
Subject: [PATCH 1/4] [clang][HLSL] Add sign intrinsic part 3
---
clang/include/cl
@@ -1108,6 +1117,14 @@ bool SemaHLSL::CheckBuiltinFunctionCall(unsigned
BuiltinID, CallExpr *TheCall) {
return true;
break;
}
+ case Builtin::BI__builtin_hlsl_elementwise_sign: {
+if (CheckFloatingOrSignedIntRepresentation(&SemaRef, TheCall))
+ return tru
@@ -1725,5 +1725,76 @@ _HLSL_AVAILABILITY(shadermodel, 6.0)
_HLSL_BUILTIN_ALIAS(__builtin_hlsl_wave_get_lane_index)
__attribute__((convergent)) uint WaveGetLaneIndex();
+//===--===//
+// sign builtins
+//===--
https://github.com/farzonl edited
https://github.com/llvm/llvm-project/pull/101989
___
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/farzonl edited
https://github.com/llvm/llvm-project/pull/101989
___
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -1108,6 +1117,14 @@ bool SemaHLSL::CheckBuiltinFunctionCall(unsigned
BuiltinID, CallExpr *TheCall) {
return true;
break;
}
+ case Builtin::BI__builtin_hlsl_elementwise_sign: {
+if (CheckFloatingOrSignedIntRepresentation(&SemaRef, TheCall))
+ return tru
https://github.com/farzonl edited
https://github.com/llvm/llvm-project/pull/101989
___
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -1725,5 +1725,76 @@ _HLSL_AVAILABILITY(shadermodel, 6.0)
_HLSL_BUILTIN_ALIAS(__builtin_hlsl_wave_get_lane_index)
__attribute__((convergent)) uint WaveGetLaneIndex();
+//===--===//
+// sign builtins
+//===--
@@ -1725,5 +1725,76 @@ _HLSL_AVAILABILITY(shadermodel, 6.0)
_HLSL_BUILTIN_ALIAS(__builtin_hlsl_wave_get_lane_index)
__attribute__((convergent)) uint WaveGetLaneIndex();
+//===--===//
+// sign builtins
+//===--
@@ -1725,5 +1725,76 @@ _HLSL_AVAILABILITY(shadermodel, 6.0)
_HLSL_BUILTIN_ALIAS(__builtin_hlsl_wave_get_lane_index)
__attribute__((convergent)) uint WaveGetLaneIndex();
+//===--===//
+// sign builtins
+//===--
@@ -1725,5 +1725,76 @@ _HLSL_AVAILABILITY(shadermodel, 6.0)
_HLSL_BUILTIN_ALIAS(__builtin_hlsl_wave_get_lane_index)
__attribute__((convergent)) uint WaveGetLaneIndex();
+//===--===//
+// sign builtins
+//===--
@@ -4737,6 +4737,12 @@ def HLSLRSqrt : LangBuiltin<"HLSL_LANG"> {
let Prototype = "void(...)";
}
+def HLSLSign : LangBuiltin<"HLSL_LANG"> {
+ let Spellings = ["__builtin_hlsl_elementwise_sign"];
+ let Attributes = [NoThrow, Const];
+ let Prototype = "int(...)";
--
@@ -916,7 +916,7 @@ float4 lerp(float4, float4, float4);
/// \brief Returns the length of the specified floating-point vector.
/// \param x [in] The vector of floats, or a scalar float.
///
-/// Length is based on the following formula: sqrt(x[0]^2 + x[1]^2 + �).
+/// Length is
https://github.com/tgymnich updated
https://github.com/llvm/llvm-project/pull/101989
>From c7f7a3683805c6a9a1d696905321a1e161ec8beb Mon Sep 17 00:00:00 2001
From: Tim Gymnich
Date: Fri, 2 Aug 2024 21:40:24 +0200
Subject: [PATCH 1/2] [clang][HLSL] Add sign intrinsic part 3
---
clang/include/cl
@@ -916,7 +916,7 @@ float4 lerp(float4, float4, float4);
/// \brief Returns the length of the specified floating-point vector.
/// \param x [in] The vector of floats, or a scalar float.
///
-/// Length is based on the following formula: sqrt(x[0]^2 + x[1]^2 + �).
+/// Length is
llvmbot wrote:
@llvm/pr-subscribers-backend-x86
@llvm/pr-subscribers-clang
@llvm/pr-subscribers-clang-codegen
Author: Tim Gymnich (tgymnich)
Changes
partially fixes #70078
### Changes
- Implemented `sign` clang builtin
- Linked `sign` clang builtin with `hlsl_intrinsics.h`
- Added sema ch
https://github.com/tgymnich ready_for_review
https://github.com/llvm/llvm-project/pull/101989
___
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/tgymnich edited
https://github.com/llvm/llvm-project/pull/101989
___
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/tgymnich updated
https://github.com/llvm/llvm-project/pull/101989
>From a8a34780fe3311312cb37d48836e63e40bb6f4e0 Mon Sep 17 00:00:00 2001
From: Tim Gymnich
Date: Fri, 2 Aug 2024 21:40:24 +0200
Subject: [PATCH 1/2] [clang][HLSL] Add sign intrinsic part 3
---
clang/include/cl
https://github.com/tgymnich edited
https://github.com/llvm/llvm-project/pull/101989
___
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/tgymnich edited
https://github.com/llvm/llvm-project/pull/101989
___
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/tgymnich updated
https://github.com/llvm/llvm-project/pull/101989
>From a8a34780fe3311312cb37d48836e63e40bb6f4e0 Mon Sep 17 00:00:00 2001
From: Tim Gymnich
Date: Fri, 2 Aug 2024 21:40:24 +0200
Subject: [PATCH 1/2] [clang][HLSL] Add sign intrinsic part 3
---
clang/include/cl
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 04f65043bc8711996a4ade05c67ae2d087ae8be5
03e05cc3ee4746b760750515e884ab8ba4674e87 --e
https://github.com/tgymnich edited
https://github.com/llvm/llvm-project/pull/101989
___
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/tgymnich created
https://github.com/llvm/llvm-project/pull/101989
partially fixes #70078
### Changes
- Implemented `sign` clang builtin
- Linked `sign` clang builtin with `hlsl_intrinsics.h`
- Added sema checks for `sign` to `CheckHLSLBuiltinFunctionCall` in
`SemaChecking.cp
55 matches
Mail list logo