[clang] [llvm] [HLSL] Add WaveActiveBitOr HLSL function (PR #178056)
Tex Riddell via cfe-commits
cfe-commits at lists.llvm.org
Thu Jan 29 11:51:52 PST 2026
================
@@ -0,0 +1,30 @@
+// RUN: %clang_cc1 -finclude-default-header -fnative-int16-type -fnative-half-type \
+// RUN: -fmath-errno -ffp-contract=on -fno-rounding-math -finclude-default-header \
+// RUN: -triple dxil-pc-shadermodel6.6-library %s -emit-llvm-only -disable-llvm-passes -verify
+
+int test_too_few_arg() {
+ return __builtin_hlsl_wave_active_bit_or();
+ // expected-error at -1 {{too few arguments to function call, expected 1, have 0}}
+}
+
+int test_too_many_arg(int p0) {
+ return __builtin_hlsl_wave_active_bit_or(p0, p0);
+ // expected-error at -1 {{too many arguments to function call, expected 1, have 2}}
+}
+
+float test_expr_bool_type_check(float p0) {
+ return __builtin_hlsl_wave_active_bit_or(p0);
+ // expected-error at -1 {{invalid operand of type 'float'}}
+}
+
+float2 test_expr_bool_vec_type_check(float2 p0) {
+ return __builtin_hlsl_wave_active_bit_or(p0);
+ // expected-error at -1 {{invalid operand of type 'float2' (aka 'vector<float, 2>')}}
----------------
tex3d wrote:
But it should support vectors of supported component types, like `int2`.
https://github.com/llvm/llvm-project/pull/178056
More information about the cfe-commits
mailing list