@@ -24017,21 +24017,24 @@ T workgroupUniformLoad<T>(__ref T v)
24017
24017
}
24018
24018
24019
24019
//
24020
- // Pack/Unpack Math Intrinsics
24020
+ // HLSL Pack/Unpack Math Intrinsics
24021
24021
//
24022
24022
// These were introduced in SM 6.6 but requirements are dropped to SM 5.0 here
24023
24023
// to expose these intrinsics on targets that do not have SM 6.6 features.
24024
24024
//
24025
24025
24026
24026
//@public:
24027
24027
24028
+ typealias uint8_t4_packed = uint;
24029
+ typealias int8_t4_packed = uint;
24030
+
24028
24031
/// Unpack 4 signed 8-bit values into a vector of 16 bit integers.
24029
24032
[__readNone]
24030
24033
[ForceInline]
24031
24034
[require(cpp_cuda_glsl_hlsl_metal_spirv_wgsl, shader5_sm_5_0)]
24032
24035
int16_t4 unpack_s8s16(int8_t4_packed packed)
24033
24036
{
24034
- return unpackInt4x8ToInt16(uint( packed) );
24037
+ return unpackInt4x8ToInt16(packed);
24035
24038
}
24036
24039
24037
24040
/// Unpack 4 unsigned 8-bit values into a vector of 16 bit integers.
@@ -24040,7 +24043,7 @@ int16_t4 unpack_s8s16(int8_t4_packed packed)
24040
24043
[require(cpp_cuda_glsl_hlsl_metal_spirv_wgsl, shader5_sm_5_0)]
24041
24044
uint16_t4 unpack_u8u16(uint8_t4_packed packed)
24042
24045
{
24043
- return unpackUint4x8ToUint16(uint( packed) );
24046
+ return unpackUint4x8ToUint16(packed);
24044
24047
}
24045
24048
24046
24049
/// Unpack 4 signed 8-bit values into a vector of 32 bit integers.
@@ -24049,7 +24052,7 @@ uint16_t4 unpack_u8u16(uint8_t4_packed packed)
24049
24052
[require(cpp_cuda_glsl_hlsl_metal_spirv_wgsl, shader5_sm_5_0)]
24050
24053
int32_t4 unpack_s8s32(int8_t4_packed packed)
24051
24054
{
24052
- return unpackInt4x8ToInt32(uint( packed) );
24055
+ return unpackInt4x8ToInt32(packed);
24053
24056
}
24054
24057
24055
24058
/// Unpack 4 unsigned 8-bit values into a vector of 32 bit integers.
@@ -24058,7 +24061,7 @@ int32_t4 unpack_s8s32(int8_t4_packed packed)
24058
24061
[require(cpp_cuda_glsl_hlsl_metal_spirv_wgsl, shader5_sm_5_0)]
24059
24062
uint32_t4 unpack_u8u32(uint8_t4_packed packed)
24060
24063
{
24061
- return unpackUint4x8ToUint32(uint( packed) );
24064
+ return unpackUint4x8ToUint32(packed);
24062
24065
}
24063
24066
24064
24067
/// Pack a vector of 4 unsigned 32 bit integers into a packed value of 4 8-bit integers, dropping unused bits.
@@ -24067,7 +24070,7 @@ uint32_t4 unpack_u8u32(uint8_t4_packed packed)
24067
24070
[require(cpp_cuda_glsl_hlsl_metal_spirv_wgsl, shader5_sm_5_0)]
24068
24071
uint8_t4_packed pack_u8(uint32_t4 unpackedValue)
24069
24072
{
24070
- return uint8_t4_packed( packUint4x8(unpackedValue) );
24073
+ return packUint4x8(unpackedValue);
24071
24074
}
24072
24075
24073
24076
/// Pack a vector of 4 signed 32 bit integers into a packed value of 4 8-bit integers, dropping unused bits.
@@ -24076,7 +24079,7 @@ uint8_t4_packed pack_u8(uint32_t4 unpackedValue)
24076
24079
[require(cpp_cuda_glsl_hlsl_metal_spirv_wgsl, shader5_sm_5_0)]
24077
24080
int8_t4_packed pack_s8(int32_t4 unpackedValue)
24078
24081
{
24079
- return int8_t4_packed( packInt4x8(unpackedValue) );
24082
+ return packInt4x8(unpackedValue);
24080
24083
}
24081
24084
24082
24085
/// Pack a vector of 4 unsigned 16 bit integers into a packed value of 4 8-bit integers, dropping unused bits.
@@ -24085,7 +24088,7 @@ int8_t4_packed pack_s8(int32_t4 unpackedValue)
24085
24088
[require(cpp_cuda_glsl_hlsl_metal_spirv_wgsl, shader5_sm_5_0)]
24086
24089
uint8_t4_packed pack_u8(uint16_t4 unpackedValue)
24087
24090
{
24088
- return uint8_t4_packed( packUint4x8(unpackedValue) );
24091
+ return packUint4x8(unpackedValue);
24089
24092
}
24090
24093
24091
24094
/// Pack a vector of 4 signed 16 bit integers into a packed value of 4 8-bit integers, dropping unused bits.
@@ -24094,7 +24097,7 @@ uint8_t4_packed pack_u8(uint16_t4 unpackedValue)
24094
24097
[require(cpp_cuda_glsl_hlsl_metal_spirv_wgsl, shader5_sm_5_0)]
24095
24098
int8_t4_packed pack_s8(int16_t4 unpackedValue)
24096
24099
{
24097
- return int8_t4_packed( packInt4x8(unpackedValue) );
24100
+ return packInt4x8(unpackedValue);
24098
24101
}
24099
24102
24100
24103
/// Pack a vector of 4 unsigned 32 bit integers into a packed value of 4 8-bit integers,
@@ -24104,7 +24107,7 @@ int8_t4_packed pack_s8(int16_t4 unpackedValue)
24104
24107
[require(cpp_cuda_glsl_hlsl_metal_spirv_wgsl, shader5_sm_5_0)]
24105
24108
uint8_t4_packed pack_clamp_u8(int32_t4 unpackedValue)
24106
24109
{
24107
- return uint8_t4_packed( packUint4x8Clamp(unpackedValue) );
24110
+ return packUint4x8Clamp(unpackedValue);
24108
24111
}
24109
24112
24110
24113
/// Pack a vector of 4 signed 32 bit integers into a packed value of 4 8-bit integers,
@@ -24114,7 +24117,7 @@ uint8_t4_packed pack_clamp_u8(int32_t4 unpackedValue)
24114
24117
[require(cpp_cuda_glsl_hlsl_metal_spirv_wgsl, shader5_sm_5_0)]
24115
24118
int8_t4_packed pack_clamp_s8(int32_t4 unpackedValue)
24116
24119
{
24117
- return int8_t4_packed( packInt4x8Clamp(unpackedValue) );
24120
+ return packInt4x8Clamp(unpackedValue);
24118
24121
}
24119
24122
24120
24123
/// Pack a vector of 4 unsigned 16 bit integers into a packed value of 4 8-bit integers,
@@ -24124,7 +24127,7 @@ int8_t4_packed pack_clamp_s8(int32_t4 unpackedValue)
24124
24127
[require(cpp_cuda_glsl_hlsl_metal_spirv_wgsl, shader5_sm_5_0)]
24125
24128
uint8_t4_packed pack_clamp_u8(int16_t4 unpackedValue)
24126
24129
{
24127
- return uint8_t4_packed( packUint4x8Clamp(unpackedValue) );
24130
+ return packUint4x8Clamp(unpackedValue);
24128
24131
}
24129
24132
24130
24133
/// Pack a vector of 4 signed 16 bit integers into a packed value of 4 8-bit integers,
@@ -24134,7 +24137,7 @@ uint8_t4_packed pack_clamp_u8(int16_t4 unpackedValue)
24134
24137
[require(cpp_cuda_glsl_hlsl_metal_spirv_wgsl, shader5_sm_5_0)]
24135
24138
int8_t4_packed pack_clamp_s8(int16_t4 unpackedValue)
24136
24139
{
24137
- return int8_t4_packed( packInt4x8Clamp(unpackedValue) );
24140
+ return packInt4x8Clamp(unpackedValue);
24138
24141
}
24139
24142
24140
24143
// Work-graphs
0 commit comments