9#ifndef _HLSL_HLSL_INTRINSICS_H_
10#define _HLSL_HLSL_INTRINSICS_H_
21#define _HLSL_BUILTIN_ALIAS(builtin) \
22 __attribute__((clang_builtin_alias(builtin)))
23#define _HLSL_AVAILABILITY(platform, version) \
24 __attribute__((availability(platform, introduced = version)))
25#define _HLSL_AVAILABILITY_STAGE(platform, version, stage) \
27 availability(platform, introduced = version, environment = stage)))
29#ifdef __HLSL_ENABLE_16_BIT
30#define _HLSL_16BIT_AVAILABILITY(platform, version) \
31 __attribute__((availability(platform, introduced = version)))
32#define _HLSL_16BIT_AVAILABILITY_STAGE(platform, version, stage) \
34 availability(platform, introduced = version, environment = stage)))
36#define _HLSL_16BIT_AVAILABILITY(environment, version)
37#define _HLSL_16BIT_AVAILABILITY_STAGE(environment, version, stage)
48#ifdef __HLSL_ENABLE_16_BIT
54int16_t2
abs(int16_t2);
57int16_t3
abs(int16_t3);
60int16_t4
abs(int16_t4);
120#ifdef __HLSL_ENABLE_16_BIT
148#ifdef __HLSL_ENABLE_16_BIT
260#ifdef __HLSL_ENABLE_16_BIT
390template <typename T,
int N>
391constexpr vector<
float, N>
asfloat(vector<T, N>
V) {
392 return __detail::bit_cast<float, T, N>(
V);
395template <
typename T>
constexpr float asfloat(T F) {
396 return __detail::bit_cast<float, T>(F);
407template <
typename T,
int N>
constexpr vector<int, N>
asint(vector<T, N>
V) {
408 return __detail::bit_cast<int, T, N>(
V);
411template <
typename T>
constexpr int asint(T F) {
412 return __detail::bit_cast<int, T>(F);
423#ifdef __HLSL_ENABLE_16_BIT
451template <typename T,
int N> constexpr vector<
uint, N>
asuint(vector<T, N>
V) {
452 return __detail::bit_cast<uint, T, N>(
V);
456 return __detail::bit_cast<uint, T>(F);
485#ifdef __HLSL_ENABLE_16_BIT
515#ifdef __HLSL_ENABLE_16_BIT
517half
atan2(half y, half x);
594#ifdef __HLSL_ENABLE_16_BIT
597int16_t
clamp(int16_t, int16_t, int16_t);
600int16_t2
clamp(int16_t2, int16_t2, int16_t2);
603int16_t3
clamp(int16_t3, int16_t3, int16_t3);
606int16_t4
clamp(int16_t4, int16_t4, int16_t4);
610uint16_t
clamp(uint16_t, uint16_t, uint16_t);
613uint16_t2
clamp(uint16_t2, uint16_t2, uint16_t2);
616uint16_t3
clamp(uint16_t3, uint16_t3, uint16_t3);
619uint16_t4
clamp(uint16_t4, uint16_t4, uint16_t4);
668double clamp(
double,
double,
double);
731#ifdef __HLSL_ENABLE_16_BIT
759#ifdef __HLSL_ENABLE_16_BIT
762 return __builtin_elementwise_popcount(x);
766 return __builtin_elementwise_popcount(x);
770 return __builtin_elementwise_popcount(x);
774 return __builtin_elementwise_popcount(x);
778 return __builtin_elementwise_popcount(x);
782 return __builtin_elementwise_popcount(x);
786 return __builtin_elementwise_popcount(x);
790 return __builtin_elementwise_popcount(x);
794const inline uint countbits(
int x) {
return __builtin_elementwise_popcount(x); }
796 return __builtin_elementwise_popcount(x);
799 return __builtin_elementwise_popcount(x);
802 return __builtin_elementwise_popcount(x);
806 return __builtin_elementwise_popcount(x);
809 return __builtin_elementwise_popcount(x);
812 return __builtin_elementwise_popcount(x);
815 return __builtin_elementwise_popcount(x);
819 return __builtin_elementwise_popcount(x);
822 return __builtin_elementwise_popcount(x);
825 return __builtin_elementwise_popcount(x);
828 return __builtin_elementwise_popcount(x);
832 return __builtin_elementwise_popcount(x);
835 return __builtin_elementwise_popcount(x);
838 return __builtin_elementwise_popcount(x);
841 return __builtin_elementwise_popcount(x);
896#ifdef __HLSL_ENABLE_16_BIT
899int16_t
dot(int16_t, int16_t);
902int16_t
dot(int16_t2, int16_t2);
905int16_t
dot(int16_t3, int16_t3);
908int16_t
dot(int16_t4, int16_t4);
912uint16_t
dot(uint16_t, uint16_t);
915uint16_t
dot(uint16_t2, uint16_t2);
918uint16_t
dot(uint16_t3, uint16_t3);
921uint16_t
dot(uint16_t4, uint16_t4);
934double dot(
double,
double);
1061#ifdef __HLSL_ENABLE_16_BIT
1444#ifdef __HLSL_ENABLE_16_BIT
1447int16_t
mad(int16_t, int16_t, int16_t);
1450int16_t2
mad(int16_t2, int16_t2, int16_t2);
1453int16_t3
mad(int16_t3, int16_t3, int16_t3);
1456int16_t4
mad(int16_t4, int16_t4, int16_t4);
1460uint16_t
mad(uint16_t, uint16_t, uint16_t);
1463uint16_t2
mad(uint16_t2, uint16_t2, uint16_t2);
1466uint16_t3
mad(uint16_t3, uint16_t3, uint16_t3);
1469uint16_t4
mad(uint16_t4, uint16_t4, uint16_t4);
1509float mad(
float,
float,
float);
1518double mad(
double,
double,
double);
1548#ifdef __HLSL_ENABLE_16_BIT
1551int16_t
max(int16_t, int16_t);
1554int16_t2
max(int16_t2, int16_t2);
1557int16_t3
max(int16_t3, int16_t3);
1560int16_t4
max(int16_t4, int16_t4);
1564uint16_t
max(uint16_t, uint16_t);
1567uint16_t2
max(uint16_t2, uint16_t2);
1570uint16_t3
max(uint16_t3, uint16_t3);
1573uint16_t4
max(uint16_t4, uint16_t4);
1652#ifdef __HLSL_ENABLE_16_BIT
1655int16_t
min(int16_t, int16_t);
1658int16_t2
min(int16_t2, int16_t2);
1661int16_t3
min(int16_t3, int16_t3);
1664int16_t4
min(int16_t4, int16_t4);
1668uint16_t
min(uint16_t, uint16_t);
1671uint16_t2
min(uint16_t2, uint16_t2);
1674uint16_t3
min(uint16_t3, uint16_t3);
1677uint16_t4
min(uint16_t4, uint16_t4);
1805#ifdef __HLSL_ENABLE_16_BIT
2017template <typename T>
2029template <typename T,
int Sz>
2031vector<T, Sz>
select(vector<
bool, Sz>, vector<T, Sz>, vector<T, Sz>);
2071#ifdef __HLSL_ENABLE_16_BIT
2162#ifdef __HLSL_ENABLE_16_BIT
2190#ifdef __HLSL_ENABLE_16_BIT
2260__attribute__((convergent))
bool WaveActiveAnyTrue(
bool Val);
2297#ifdef __HLSL_ENABLE_16_BIT
2369#ifdef __HLSL_ENABLE_16_BIT
_Float16 __2f16 __attribute__((ext_vector_type(2)))
Zeroes the upper 128 bits (bits 255:128) of all YMM registers.
#define _HLSL_BUILTIN_ALIAS(builtin)
#define _HLSL_AVAILABILITY(platform, version)
#define _HLSL_16BIT_AVAILABILITY(environment, version)
double asdouble(uint, uint)
Reinterprets a cast value (two 32-bit values) into a double.
half mad(half, half, half)
T select(bool, T, T)
ternary operator.
const uint countbits(int x)
vector< uint64_t, 2 > uint64_t2
half3 cross(half3, half3)
vector< float, 4 > float4
vector< int64_t, 4 > int64_t4
int dot4add_i8packed(uint, uint, int)
vector< uint64_t, 3 > uint64_t3
half lerp(half, half, half)
void GroupMemoryBarrierWithGroupSync(void)
Blocks execution of all threads in a group until all group shared accesses have been completed and al...
vector< int64_t, 3 > int64_t3
half clamp(half, half, half)
vector< uint64_t, 4 > uint64_t4
constexpr vector< uint, N > asuint(vector< T, N > V)
vector< double, 3 > double3
vector< float, 2 > float2
vector< float, 3 > float3
vector< int64_t, 2 > int64_t2
vector< double, 4 > double4
vector< double, 2 > double2
uint dot4add_u8packed(uint, uint, uint)
constexpr vector< int, N > asint(vector< T, N > V)
constexpr vector< float, N > asfloat(vector< T, N > V)
unsigned int uint
An unsigned 32-bit integer.