@@ -280,6 +280,22 @@ constexpr bool4 isinf(double4 V) { return
isinf((float4)V); }
_DXC_COMPAT_TERNARY_DOUBLE_OVERLOADS(lerp)
_DXC_COMPAT_TERNARY_INTEGER_OVERLOADS(lerp)
+//===--===//
+// lit builtins overloa
Icohedron wrote:
In my opinion, we should just define `lit` without templates, thereby following
Clang's overload resolution rules and allowing implicit vector truncation.
Overload resolution and implicit vector truncation are behaviors that should be
consistent across the language. To me, it
@@ -280,6 +280,22 @@ constexpr bool4 isinf(double4 V) { return
isinf((float4)V); }
_DXC_COMPAT_TERNARY_DOUBLE_OVERLOADS(lerp)
_DXC_COMPAT_TERNARY_INTEGER_OVERLOADS(lerp)
+//===--===//
+// lit builtins overloa
@@ -0,0 +1,37 @@
+// RUN: %clang_cc1 -std=hlsl202y -finclude-default-header -x hlsl -triple
dxil-pc-shadermodel6.6-library %s -fnative-half-type -emit-llvm-only
-disable-llvm-passes -verify
+
+double4 test_double_inputs(double p0, double p1, double p2) {
+ return lit(p0, p1, p2
https://github.com/Icohedron edited
https://github.com/llvm/llvm-project/pull/134171
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
Icohedron wrote:
If you add a test here that uses `half`
```c++
half4 test_lit_half(half NDotL, half NDotH, half M) { return lit(NDotL, NDotH,
M); }
```
Will it convert the `half` types to float?
https://github.com/llvm/llvm-project/pull/134171
___
https://github.com/Icohedron edited
https://github.com/llvm/llvm-project/pull/134171
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -101,6 +101,16 @@ constexpr vector smoothstep_vec_impl(vector
Min, vector Max,
#endif
}
+template constexpr vector lit_impl(T NDotL, T NDotH, T M) {
+ bool DiffuseCond = NDotL < 0;
+ T Diffuse = select(DiffuseCond, 0, NDotL);
+ vector Result = {1, Diffuse, 0, 1};
+ bo
https://github.com/Icohedron edited
https://github.com/llvm/llvm-project/pull/134439
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -0,0 +1,23 @@
+//===- SemaDirectX.cpp - Semantic Analysis for DirectX
constructs--===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM
Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apa
https://github.com/Icohedron approved this pull request.
I like this change. It helps makes implementing builtins more consistent
between SPIR-V and DirectX/DXIL
https://github.com/llvm/llvm-project/pull/134439
___
cfe-commits mailing list
cfe-commits
https://github.com/Icohedron edited
https://github.com/llvm/llvm-project/pull/134439
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/Icohedron edited
https://github.com/llvm/llvm-project/pull/134171
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/Icohedron edited
https://github.com/llvm/llvm-project/pull/134171
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/Icohedron edited
https://github.com/llvm/llvm-project/pull/134171
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -280,6 +280,22 @@ constexpr bool4 isinf(double4 V) { return
isinf((float4)V); }
_DXC_COMPAT_TERNARY_DOUBLE_OVERLOADS(lerp)
_DXC_COMPAT_TERNARY_INTEGER_OVERLOADS(lerp)
+//===--===//
+// lit builtins overloa
@@ -253,6 +253,37 @@ const inline float
length(__detail::HLSL_FIXED_VECTOR X) {
return __detail::length_vec_impl(X);
}
+//===--===//
+// lit builtins
+//===--
https://github.com/Icohedron approved this pull request.
https://github.com/llvm/llvm-project/pull/134136
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/Icohedron edited
https://github.com/llvm/llvm-project/pull/134171
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/Icohedron edited
https://github.com/llvm/llvm-project/pull/134171
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/Icohedron edited
https://github.com/llvm/llvm-project/pull/134171
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -280,6 +280,22 @@ constexpr bool4 isinf(double4 V) { return
isinf((float4)V); }
_DXC_COMPAT_TERNARY_DOUBLE_OVERLOADS(lerp)
_DXC_COMPAT_TERNARY_INTEGER_OVERLOADS(lerp)
+//===--===//
+// lit builtins overloa
https://github.com/Icohedron edited
https://github.com/llvm/llvm-project/pull/134171
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/Icohedron edited
https://github.com/llvm/llvm-project/pull/134171
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/Icohedron edited
https://github.com/llvm/llvm-project/pull/134171
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/Icohedron edited
https://github.com/llvm/llvm-project/pull/134171
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/Icohedron edited
https://github.com/llvm/llvm-project/pull/134171
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/Icohedron deleted
https://github.com/llvm/llvm-project/pull/134171
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -101,6 +101,16 @@ constexpr vector smoothstep_vec_impl(vector
Min, vector Max,
#endif
}
+template constexpr vector lit_impl(T NDotL, T NDotH, T M) {
+ bool DiffuseCond = NDotL < 0;
+ T Diffuse = select(DiffuseCond, 0, NDotL);
+ vector Result = {1, Diffuse, 0, 1};
+ bo
@@ -101,6 +101,16 @@ constexpr vector smoothstep_vec_impl(vector
Min, vector Max,
#endif
}
+template constexpr vector lit_impl(T NDotL, T NDotH, T M) {
+ bool DiffuseCond = NDotL < 0;
+ T Diffuse = select(DiffuseCond, 0, NDotL);
+ vector Result = {1, Diffuse, 0, 1};
+ bo
@@ -101,6 +101,16 @@ constexpr vector smoothstep_vec_impl(vector
Min, vector Max,
#endif
}
+template constexpr vector lit_impl(T NDotL, T NDotH, T M) {
+ bool DiffuseCond = NDotL < 0;
+ T Diffuse = select(DiffuseCond, 0, NDotL);
+ vector Result = {1, Diffuse, 0, 1};
+ bo
@@ -22,10 +22,10 @@
// HLSL standard library function declarations/definitions.
#include "hlsl/hlsl_alias_intrinsics.h"
+#include "hlsl/hlsl_intrinsics.h"
#if __HLSL_VERSION <= __HLSL_202x
#include "hlsl/hlsl_compat_overloads.h"
#endif
-#include "hlsl/hlsl_intrinsics.h"
---
@@ -253,6 +253,37 @@ const inline float
length(__detail::HLSL_FIXED_VECTOR X) {
return __detail::length_vec_impl(X);
}
+//===--===//
+// lit builtins
+//===--
@@ -101,6 +101,16 @@ constexpr vector smoothstep_vec_impl(vector
Min, vector Max,
#endif
}
+template constexpr vector lit_impl(T NDotL, T NDotH, T M) {
+ bool DiffuseCond = NDotL < 0;
+ T Diffuse = select(DiffuseCond, 0, NDotL);
+ vector Result = {1, Diffuse, 0, 1};
+ bo
https://github.com/Icohedron edited
https://github.com/llvm/llvm-project/pull/134288
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/Icohedron updated
https://github.com/llvm/llvm-project/pull/134288
>From c482c96c99ab76458904b3f94b1146ccfee0f55c Mon Sep 17 00:00:00 2001
From: Icohedron
Date: Wed, 2 Apr 2025 21:16:16 +
Subject: [PATCH 1/3] Add test for UseNativeLowPrecision shader flag
---
.../Shader
@@ -253,6 +253,37 @@ const inline float
length(__detail::HLSL_FIXED_VECTOR X) {
return __detail::length_vec_impl(X);
}
+//===--===//
+// lit builtins
+//===--
https://github.com/Icohedron edited
https://github.com/llvm/llvm-project/pull/134288
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/Icohedron updated
https://github.com/llvm/llvm-project/pull/134288
>From c482c96c99ab76458904b3f94b1146ccfee0f55c Mon Sep 17 00:00:00 2001
From: Icohedron
Date: Wed, 2 Apr 2025 21:16:16 +
Subject: [PATCH 1/4] Add test for UseNativeLowPrecision shader flag
---
.../Shader
https://github.com/Icohedron created
https://github.com/llvm/llvm-project/pull/134288
Fixes #112267
>From c482c96c99ab76458904b3f94b1146ccfee0f55c Mon Sep 17 00:00:00 2001
From: Icohedron
Date: Wed, 2 Apr 2025 21:16:16 +
Subject: [PATCH 1/2] Add test for UseNativeLowPrecision shader flag
https://github.com/Icohedron edited
https://github.com/llvm/llvm-project/pull/131070
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/Icohedron edited
https://github.com/llvm/llvm-project/pull/131070
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/Icohedron edited
https://github.com/llvm/llvm-project/pull/131070
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/Icohedron updated
https://github.com/llvm/llvm-project/pull/131070
>From 81196e016dbf1209637dd13315efff7eac461d42 Mon Sep 17 00:00:00 2001
From: Icohedron
Date: Fri, 14 Mar 2025 00:24:26 +
Subject: [PATCH 1/3] Implement ResMayNotAlias DXIL shader flag analysis
---
clang
https://github.com/Icohedron edited
https://github.com/llvm/llvm-project/pull/131070
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/Icohedron created
https://github.com/llvm/llvm-project/pull/131070
Fixes #112270
Completed ACs:
- `-res-may-alias` clang-dxc command-line option added
- Shader flag set appropriately:
- CASE 1: command-line option -res-may-alias is NOT specified AND DXIL
Version > 1.7 AND
https://github.com/Icohedron edited
https://github.com/llvm/llvm-project/pull/131070
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/Icohedron approved this pull request.
https://github.com/llvm/llvm-project/pull/130320
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -22,56 +22,128 @@
//
// RUN: %clang_cc1 -finclude-default-header -x hlsl -triple \
// RUN: spirv-unknown-vulkan-compute %s -fnative-half-type \
-// RUN: -emit-llvm -disable-llvm-passes -o - | FileCheck %s \
+// RUN: -emit-llvm -o - | FileCheck %s \
// RUN: -DFNATTRS
https://github.com/Icohedron edited
https://github.com/llvm/llvm-project/pull/130320
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -22,56 +22,128 @@
//
// RUN: %clang_cc1 -finclude-default-header -x hlsl -triple \
// RUN: spirv-unknown-vulkan-compute %s -fnative-half-type \
-// RUN: -emit-llvm -disable-llvm-passes -o - | FileCheck %s \
+// RUN: -emit-llvm -o - | FileCheck %s \
// RUN: -DFNATTRS
@@ -22,56 +22,136 @@
//
// RUN: %clang_cc1 -finclude-default-header -x hlsl -triple \
// RUN: spirv-unknown-vulkan-compute %s -fnative-half-type \
-// RUN: -emit-llvm -disable-llvm-passes -o - | FileCheck %s \
+// RUN: -emit-llvm -o - | FileCheck %s \
// RUN: -DFNATTRS
@@ -22,56 +22,136 @@
//
// RUN: %clang_cc1 -finclude-default-header -x hlsl -triple \
// RUN: spirv-unknown-vulkan-compute %s -fnative-half-type \
-// RUN: -emit-llvm -disable-llvm-passes -o - | FileCheck %s \
+// RUN: -emit-llvm -o - | FileCheck %s \
// RUN: -DFNATTRS
@@ -22,56 +22,136 @@
//
// RUN: %clang_cc1 -finclude-default-header -x hlsl -triple \
// RUN: spirv-unknown-vulkan-compute %s -fnative-half-type \
-// RUN: -emit-llvm -disable-llvm-passes -o - | FileCheck %s \
+// RUN: -emit-llvm -o - | FileCheck %s \
// RUN: -DFNATTRS
https://github.com/Icohedron requested changes to this pull request.
https://github.com/llvm/llvm-project/pull/130320
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/Icohedron edited
https://github.com/llvm/llvm-project/pull/130320
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -22,56 +22,136 @@
//
// RUN: %clang_cc1 -finclude-default-header -x hlsl -triple \
// RUN: spirv-unknown-vulkan-compute %s -fnative-half-type \
-// RUN: -emit-llvm -disable-llvm-passes -o - | FileCheck %s \
-// RUN: -DFNATTRS="spir_func noundef nofpclass(nan inf)" -DTY
https://github.com/Icohedron edited
https://github.com/llvm/llvm-project/pull/130320
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/Icohedron edited
https://github.com/llvm/llvm-project/pull/130320
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -22,56 +22,136 @@
//
// RUN: %clang_cc1 -finclude-default-header -x hlsl -triple \
// RUN: spirv-unknown-vulkan-compute %s -fnative-half-type \
-// RUN: -emit-llvm -disable-llvm-passes -o - | FileCheck %s \
-// RUN: -DFNATTRS="spir_func noundef nofpclass(nan inf)" -DTY
@@ -22,56 +22,136 @@
//
// RUN: %clang_cc1 -finclude-default-header -x hlsl -triple \
// RUN: spirv-unknown-vulkan-compute %s -fnative-half-type \
-// RUN: -emit-llvm -disable-llvm-passes -o - | FileCheck %s \
-// RUN: -DFNATTRS="spir_func noundef nofpclass(nan inf)" -DTY
@@ -22,56 +22,144 @@
//
// RUN: %clang_cc1 -finclude-default-header -x hlsl -triple \
// RUN: spirv-unknown-vulkan-compute %s -fnative-half-type \
-// RUN: -emit-llvm -disable-llvm-passes -o - | FileCheck %s \
+// RUN: -emit-llvm -o - | FileCheck %s \
// RUN: -DFNATTRS
@@ -22,56 +22,144 @@
//
// RUN: %clang_cc1 -finclude-default-header -x hlsl -triple \
// RUN: spirv-unknown-vulkan-compute %s -fnative-half-type \
-// RUN: -emit-llvm -disable-llvm-passes -o - | FileCheck %s \
+// RUN: -emit-llvm -o - | FileCheck %s \
// RUN: -DFNATTRS
@@ -22,56 +22,144 @@
//
// RUN: %clang_cc1 -finclude-default-header -x hlsl -triple \
// RUN: spirv-unknown-vulkan-compute %s -fnative-half-type \
-// RUN: -emit-llvm -disable-llvm-passes -o - | FileCheck %s \
+// RUN: -emit-llvm -o - | FileCheck %s \
// RUN: -DFNATTRS
@@ -22,56 +22,144 @@
//
// RUN: %clang_cc1 -finclude-default-header -x hlsl -triple \
// RUN: spirv-unknown-vulkan-compute %s -fnative-half-type \
-// RUN: -emit-llvm -disable-llvm-passes -o - | FileCheck %s \
+// RUN: -emit-llvm -o - | FileCheck %s \
// RUN: -DFNATTRS
@@ -22,56 +22,144 @@
//
// RUN: %clang_cc1 -finclude-default-header -x hlsl -triple \
// RUN: spirv-unknown-vulkan-compute %s -fnative-half-type \
-// RUN: -emit-llvm -disable-llvm-passes -o - | FileCheck %s \
+// RUN: -emit-llvm -o - | FileCheck %s \
// RUN: -DFNATTRS
https://github.com/Icohedron requested changes to this pull request.
For the most part, this PR looks good! Just needs some changes to the codegen
test to make it more clear that the implementation is correctly being tested.
https://github.com/llvm/llvm-project/pull/130320
_
https://github.com/Icohedron edited
https://github.com/llvm/llvm-project/pull/130320
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/Icohedron closed
https://github.com/llvm/llvm-project/pull/127137
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/Icohedron updated
https://github.com/llvm/llvm-project/pull/127137
>From 4fae5642c6e8e305cdc687b4968ba5eabaa44b50 Mon Sep 17 00:00:00 2001
From: Icohedron
Date: Mon, 27 Jan 2025 11:18:09 -0800
Subject: [PATCH 01/14] Add the AddUint64 HLSL builtin function
- Defines the AddUi
70 matches
Mail list logo