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/
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/
tgymnich wrote:
Rebased. All ready to go.
https://github.com/llvm/llvm-project/pull/101989
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
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
+//===--
@@ -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/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
@@ -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(...)";
--
@@ -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
+//===--
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/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
@@ -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 edited
https://github.com/llvm/llvm-project/pull/101989
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
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
@@ -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 edited
https://github.com/llvm/llvm-project/pull/101989
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
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
cfe-commits@lists.llvm.org
https://lists.llvm.org/c
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/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
@@ -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 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
https://github.com/tgymnich edited
https://github.com/llvm/llvm-project/pull/101989
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
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
cfe-commits@lists.llvm.org
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
cfe-commits@lists.llvm.org
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
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/tgymnich ready_for_review
https://github.com/llvm/llvm-project/pull/101989
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
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
https://github.com/tgymnich ready_for_review
https://github.com/llvm/llvm-project/pull/108396
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/tgymnich edited
https://github.com/llvm/llvm-project/pull/108396
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/tgymnich edited
https://github.com/llvm/llvm-project/pull/108396
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/tgymnich edited
https://github.com/llvm/llvm-project/pull/108396
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/tgymnich edited
https://github.com/llvm/llvm-project/pull/108396
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/tgymnich edited
https://github.com/llvm/llvm-project/pull/108396
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/tgymnich created
https://github.com/llvm/llvm-project/pull/108396
- add handling for unsigned integers to hlsl_elementwise_sign
### Related PRs
- https://github.com/llvm/llvm-project/pull/101987
- https://github.com/llvm/llvm-project/pull/101988
- https://github.com/llvm/llvm
tgymnich wrote:
Will do that. I just rebased the PR, so feel free to merge this for me in the
meanwhile.
https://github.com/llvm/llvm-project/pull/108396
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/li
https://github.com/tgymnich updated
https://github.com/llvm/llvm-project/pull/108396
>From 74c195399a0ea08de31c7fd546917432aeca5337 Mon Sep 17 00:00:00 2001
From: Tim Gymnich
Date: Thu, 12 Sep 2024 15:57:20 +0200
Subject: [PATCH] [clang][HLSL] Add sign intrinsic part 4
- add handling for unsig
https://github.com/tgymnich edited
https://github.com/llvm/llvm-project/pull/112602
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/tgymnich created
https://github.com/llvm/llvm-project/pull/112602
Fix test names changing `int` to `uint`.
@bob80905
>From 68c7d969fcda4422c08132860478257849d9b587 Mon Sep 17 00:00:00 2001
From: Tim Gymnich
Date: Wed, 16 Oct 2024 20:56:54 +0200
Subject: [PATCH] Fix function
@@ -155,3 +197,24 @@ int3 test_sign_int64_t3(int64_t3 p0) { return sign(p0); }
// CHECK: %hlsl.sign = call <4 x i32> @llvm.[[TARGET]].sign.v4i64(
// CHECK: ret <4 x i32> %hlsl.sign
int4 test_sign_int64_t4(int64_t4 p0) { return sign(p0); }
+
+
+// CHECK: define [[FNATTRS]] i32 @
https://github.com/tgymnich edited
https://github.com/llvm/llvm-project/pull/112602
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
tgymnich wrote:
@bob80905 feel free to merge this for me.
https://github.com/llvm/llvm-project/pull/112602
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
46 matches
Mail list logo