mirror of
https://github.com/llvm/llvm-project.git
synced 2025-04-21 16:36:12 +00:00
[HLSL] Reorganize aliased intrinsics into their own file (#129619)
- fixes #129616 - alphabetize the or intrinsic
This commit is contained in:
parent
58c869682a
commit
9ee4883c61
clang
lib/Headers
test/SemaHLSL
@ -86,6 +86,7 @@ set(hlsl_h
|
||||
)
|
||||
set(hlsl_subdir_files
|
||||
hlsl/hlsl_basic_types.h
|
||||
hlsl/hlsl_alias_intrinsics.h
|
||||
hlsl/hlsl_intrinsics.h
|
||||
hlsl/hlsl_detail.h
|
||||
)
|
||||
|
2776
clang/lib/Headers/hlsl/hlsl_alias_intrinsics.h
Normal file
2776
clang/lib/Headers/hlsl/hlsl_alias_intrinsics.h
Normal file
File diff suppressed because it is too large
Load Diff
@ -9,6 +9,8 @@
|
||||
#ifndef _HLSL_HLSL_DETAILS_H_
|
||||
#define _HLSL_HLSL_DETAILS_H_
|
||||
|
||||
#include "hlsl_alias_intrinsics.h"
|
||||
|
||||
namespace hlsl {
|
||||
|
||||
namespace __detail {
|
||||
@ -55,7 +57,7 @@ constexpr vector<uint, 4> d3d_color_to_ubyte4_impl(vector<float, 4> V) {
|
||||
template <typename T>
|
||||
constexpr enable_if_t<is_same<float, T>::value || is_same<half, T>::value, T>
|
||||
length_impl(T X) {
|
||||
return __builtin_elementwise_abs(X);
|
||||
return abs(X);
|
||||
}
|
||||
|
||||
template <typename T, int N>
|
||||
@ -64,7 +66,7 @@ length_vec_impl(vector<T, N> X) {
|
||||
#if (__has_builtin(__builtin_spirv_length))
|
||||
return __builtin_spirv_length(X);
|
||||
#else
|
||||
return __builtin_elementwise_sqrt(__builtin_hlsl_dot(X, X));
|
||||
return sqrt(dot(X, X));
|
||||
#endif
|
||||
}
|
||||
|
||||
@ -91,7 +93,7 @@ constexpr vector<T, L> reflect_vec_impl(vector<T, L> I, vector<T, L> N) {
|
||||
#if (__has_builtin(__builtin_spirv_reflect))
|
||||
return __builtin_spirv_reflect(I, N);
|
||||
#else
|
||||
return I - 2 * N * __builtin_hlsl_dot(I, N);
|
||||
return I - 2 * N * dot(I, N);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -5,6 +5,6 @@
|
||||
[numthreads(8,8,1)]
|
||||
unsigned foo() {
|
||||
// expected-error@#site {{'WaveActiveCountBits' is only available on Shader Model 6.0 or newer}}
|
||||
// expected-note@hlsl/hlsl_intrinsics.h:* {{'WaveActiveCountBits' has been marked as being introduced in Shader Model 6.0 here, but the deployment target is Shader Model 5.0}}
|
||||
// expected-note@hlsl/hlsl_alias_intrinsics.h:* {{'WaveActiveCountBits' has been marked as being introduced in Shader Model 6.0 here, but the deployment target is Shader Model 5.0}}
|
||||
return hlsl::WaveActiveCountBits(1); // #site
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user