tint: Normalizing type matcher's name in intrinsics.def
This patch normalize the abstract interger and abstract float type name to `ia` and `fa` and the type matcher name to `fia_fiu32_f16` format in intrinsics.def, and also rename `aiu32Dispatch` and `afi32f16Dispatch` in resolver/const_eval.cc to `Dispatch_ia_iu32` and `Dispatch_fia_fi32_f16`. Bug: tint:1581 Change-Id: Ia48e150d6028e4a7b999f72e57508df369b3e2d7 Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/96721 Reviewed-by: Ben Clayton <bclayton@google.com> Commit-Queue: Antonio Maiorano <amaiorano@google.com> Kokoro: Kokoro <noreply+kokoro@google.com> Reviewed-by: Antonio Maiorano <amaiorano@google.com>
This commit is contained in:
parent
3bc20e3786
commit
1e98a9ba4a
|
@ -71,8 +71,8 @@ enum texel_format {
|
||||||
|
|
||||||
// https://gpuweb.github.io/gpuweb/wgsl/#plain-types-section
|
// https://gpuweb.github.io/gpuweb/wgsl/#plain-types-section
|
||||||
type bool
|
type bool
|
||||||
@precedence(5) @display("abstract-float") type af
|
@precedence(5) @display("abstract-float") type fa
|
||||||
@precedence(4) @display("abstract-int") type ai
|
@precedence(4) @display("abstract-int") type ia
|
||||||
@precedence(3) type i32
|
@precedence(3) type i32
|
||||||
@precedence(2) type u32
|
@precedence(2) type u32
|
||||||
@precedence(1) type f32
|
@precedence(1) type f32
|
||||||
|
@ -127,23 +127,22 @@ type __atomic_compare_exchange_result<T>
|
||||||
// A type matcher that can match one or more types. //
|
// A type matcher that can match one or more types. //
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
match f32f16: f32 | f16
|
match abstract_or_scalar: ia | fa | f32 | f16 | i32 | u32 | bool
|
||||||
match fiu32: f32 | i32 | u32
|
|
||||||
match fiu32f16: f32 | f16 | i32 | u32
|
|
||||||
match fi32: f32 | i32
|
|
||||||
match fi32f16: f32 | f16 | i32
|
|
||||||
match iu32: i32 | u32
|
|
||||||
match aiu32: ai | i32 | u32
|
|
||||||
match afi32f16: ai | af | f32 | i32 | f16
|
|
||||||
match scalar: f32 | f16 | i32 | u32 | bool
|
match scalar: f32 | f16 | i32 | u32 | bool
|
||||||
match abstract_or_scalar: ai | af | f32 | f16 | i32 | u32 | bool
|
|
||||||
match af_f32: af | f32
|
|
||||||
match af_f32f16: af | f32 | f16
|
|
||||||
match scalar_no_f32: i32 | f16 | u32 | bool
|
match scalar_no_f32: i32 | f16 | u32 | bool
|
||||||
match scalar_no_f16: f32 | i32 | u32 | bool
|
match scalar_no_f16: f32 | i32 | u32 | bool
|
||||||
match scalar_no_i32: f32 | f16 | u32 | bool
|
match scalar_no_i32: f32 | f16 | u32 | bool
|
||||||
match scalar_no_u32: f32 | f16 | i32 | bool
|
match scalar_no_u32: f32 | f16 | i32 | bool
|
||||||
match scalar_no_bool: f32 | f16 | i32 | u32
|
match scalar_no_bool: f32 | f16 | i32 | u32
|
||||||
|
match fia_fi32_f16: fa | ia | f32 | i32 | f16
|
||||||
|
match fa_f32_f16: fa | f32 | f16
|
||||||
|
match ia_iu32: ia | i32 | u32
|
||||||
|
match fiu32_f16: f32 | i32 | u32 | f16
|
||||||
|
match fiu32: f32 | i32 | u32
|
||||||
|
match fi32_f16: f32 | i32 | f16
|
||||||
|
match fi32: f32 | i32
|
||||||
|
match f32_f16: f32 | f16
|
||||||
|
match iu32: i32 | u32
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
// Enum matchers //
|
// Enum matchers //
|
||||||
|
@ -648,15 +647,15 @@ fn textureLoad(texture: texture_external, coords: vec2<i32>) -> vec4<f32>
|
||||||
@const("Zero") ctor vec2<T: scalar>() -> vec2<T>
|
@const("Zero") ctor vec2<T: scalar>() -> vec2<T>
|
||||||
@const("Zero") ctor vec3<T: scalar>() -> vec3<T>
|
@const("Zero") ctor vec3<T: scalar>() -> vec3<T>
|
||||||
@const("Zero") ctor vec4<T: scalar>() -> vec4<T>
|
@const("Zero") ctor vec4<T: scalar>() -> vec4<T>
|
||||||
@const("Zero") ctor mat2x2<T: f32f16>() -> mat2x2<T>
|
@const("Zero") ctor mat2x2<T: f32_f16>() -> mat2x2<T>
|
||||||
@const("Zero") ctor mat2x3<T: f32f16>() -> mat2x3<T>
|
@const("Zero") ctor mat2x3<T: f32_f16>() -> mat2x3<T>
|
||||||
@const("Zero") ctor mat2x4<T: f32f16>() -> mat2x4<T>
|
@const("Zero") ctor mat2x4<T: f32_f16>() -> mat2x4<T>
|
||||||
@const("Zero") ctor mat3x2<T: f32f16>() -> mat3x2<T>
|
@const("Zero") ctor mat3x2<T: f32_f16>() -> mat3x2<T>
|
||||||
@const("Zero") ctor mat3x3<T: f32f16>() -> mat3x3<T>
|
@const("Zero") ctor mat3x3<T: f32_f16>() -> mat3x3<T>
|
||||||
@const("Zero") ctor mat3x4<T: f32f16>() -> mat3x4<T>
|
@const("Zero") ctor mat3x4<T: f32_f16>() -> mat3x4<T>
|
||||||
@const("Zero") ctor mat4x2<T: f32f16>() -> mat4x2<T>
|
@const("Zero") ctor mat4x2<T: f32_f16>() -> mat4x2<T>
|
||||||
@const("Zero") ctor mat4x3<T: f32f16>() -> mat4x3<T>
|
@const("Zero") ctor mat4x3<T: f32_f16>() -> mat4x3<T>
|
||||||
@const("Zero") ctor mat4x4<T: f32f16>() -> mat4x4<T>
|
@const("Zero") ctor mat4x4<T: f32_f16>() -> mat4x4<T>
|
||||||
|
|
||||||
// Identity constructors
|
// Identity constructors
|
||||||
@const("Identity") ctor i32(i32) -> i32
|
@const("Identity") ctor i32(i32) -> i32
|
||||||
|
@ -667,15 +666,15 @@ fn textureLoad(texture: texture_external, coords: vec2<i32>) -> vec4<f32>
|
||||||
@const("Identity") ctor vec2<T: scalar>(vec2<T>) -> vec2<T>
|
@const("Identity") ctor vec2<T: scalar>(vec2<T>) -> vec2<T>
|
||||||
@const("Identity") ctor vec3<T: scalar>(vec3<T>) -> vec3<T>
|
@const("Identity") ctor vec3<T: scalar>(vec3<T>) -> vec3<T>
|
||||||
@const("Identity") ctor vec4<T: scalar>(vec4<T>) -> vec4<T>
|
@const("Identity") ctor vec4<T: scalar>(vec4<T>) -> vec4<T>
|
||||||
@const("Identity") ctor mat2x2<T: f32f16>(mat2x2<T>) -> mat2x2<T>
|
@const("Identity") ctor mat2x2<T: f32_f16>(mat2x2<T>) -> mat2x2<T>
|
||||||
@const("Identity") ctor mat2x3<T: f32f16>(mat2x3<T>) -> mat2x3<T>
|
@const("Identity") ctor mat2x3<T: f32_f16>(mat2x3<T>) -> mat2x3<T>
|
||||||
@const("Identity") ctor mat2x4<T: f32f16>(mat2x4<T>) -> mat2x4<T>
|
@const("Identity") ctor mat2x4<T: f32_f16>(mat2x4<T>) -> mat2x4<T>
|
||||||
@const("Identity") ctor mat3x2<T: f32f16>(mat3x2<T>) -> mat3x2<T>
|
@const("Identity") ctor mat3x2<T: f32_f16>(mat3x2<T>) -> mat3x2<T>
|
||||||
@const("Identity") ctor mat3x3<T: f32f16>(mat3x3<T>) -> mat3x3<T>
|
@const("Identity") ctor mat3x3<T: f32_f16>(mat3x3<T>) -> mat3x3<T>
|
||||||
@const("Identity") ctor mat3x4<T: f32f16>(mat3x4<T>) -> mat3x4<T>
|
@const("Identity") ctor mat3x4<T: f32_f16>(mat3x4<T>) -> mat3x4<T>
|
||||||
@const("Identity") ctor mat4x2<T: f32f16>(mat4x2<T>) -> mat4x2<T>
|
@const("Identity") ctor mat4x2<T: f32_f16>(mat4x2<T>) -> mat4x2<T>
|
||||||
@const("Identity") ctor mat4x3<T: f32f16>(mat4x3<T>) -> mat4x3<T>
|
@const("Identity") ctor mat4x3<T: f32_f16>(mat4x3<T>) -> mat4x3<T>
|
||||||
@const("Identity") ctor mat4x4<T: f32f16>(mat4x4<T>) -> mat4x4<T>
|
@const("Identity") ctor mat4x4<T: f32_f16>(mat4x4<T>) -> mat4x4<T>
|
||||||
|
|
||||||
// Vector constructors (splat)
|
// Vector constructors (splat)
|
||||||
@const("VecSplat") ctor vec2<T: abstract_or_scalar>(T) -> vec2<T>
|
@const("VecSplat") ctor vec2<T: abstract_or_scalar>(T) -> vec2<T>
|
||||||
|
@ -699,61 +698,61 @@ fn textureLoad(texture: texture_external, coords: vec2<i32>) -> vec4<f32>
|
||||||
|
|
||||||
// Matrix constructors (scalar)
|
// Matrix constructors (scalar)
|
||||||
@const("MatCtorS")
|
@const("MatCtorS")
|
||||||
ctor mat2x2<T: af_f32f16>(T, T,
|
ctor mat2x2<T: fa_f32_f16>(T, T,
|
||||||
T, T) -> mat2x2<T>
|
T, T) -> mat2x2<T>
|
||||||
@const("MatCtorS")
|
@const("MatCtorS")
|
||||||
ctor mat2x3<T: af_f32f16>(T, T, T,
|
ctor mat2x3<T: fa_f32_f16>(T, T, T,
|
||||||
T, T, T) -> mat2x3<T>
|
T, T, T) -> mat2x3<T>
|
||||||
@const("MatCtorS")
|
@const("MatCtorS")
|
||||||
ctor mat2x4<T: af_f32f16>(T, T, T, T,
|
ctor mat2x4<T: fa_f32_f16>(T, T, T, T,
|
||||||
T, T, T, T) -> mat2x4<T>
|
T, T, T, T) -> mat2x4<T>
|
||||||
@const("MatCtorS")
|
@const("MatCtorS")
|
||||||
ctor mat3x2<T: af_f32f16>(T, T,
|
ctor mat3x2<T: fa_f32_f16>(T, T,
|
||||||
T, T,
|
T, T,
|
||||||
T, T) -> mat3x2<T>
|
T, T) -> mat3x2<T>
|
||||||
@const("MatCtorS")
|
@const("MatCtorS")
|
||||||
ctor mat3x3<T: af_f32f16>(T, T, T,
|
ctor mat3x3<T: fa_f32_f16>(T, T, T,
|
||||||
T, T, T,
|
T, T, T,
|
||||||
T, T, T) -> mat3x3<T>
|
T, T, T) -> mat3x3<T>
|
||||||
@const("MatCtorS")
|
@const("MatCtorS")
|
||||||
ctor mat3x4<T: af_f32f16>(T, T, T, T,
|
ctor mat3x4<T: fa_f32_f16>(T, T, T, T,
|
||||||
T, T, T, T,
|
T, T, T, T,
|
||||||
T, T, T, T) -> mat3x4<T>
|
T, T, T, T) -> mat3x4<T>
|
||||||
@const("MatCtorS")
|
@const("MatCtorS")
|
||||||
ctor mat4x2<T: af_f32f16>(T, T,
|
ctor mat4x2<T: fa_f32_f16>(T, T,
|
||||||
T, T,
|
T, T,
|
||||||
T, T,
|
T, T,
|
||||||
T, T) -> mat4x2<T>
|
T, T) -> mat4x2<T>
|
||||||
@const("MatCtorS")
|
@const("MatCtorS")
|
||||||
ctor mat4x3<T: af_f32f16>(T, T, T,
|
ctor mat4x3<T: fa_f32_f16>(T, T, T,
|
||||||
T, T, T,
|
T, T, T,
|
||||||
T, T, T,
|
T, T, T,
|
||||||
T, T, T) -> mat4x3<T>
|
T, T, T) -> mat4x3<T>
|
||||||
@const("MatCtorS")
|
@const("MatCtorS")
|
||||||
ctor mat4x4<T: af_f32f16>(T, T, T, T,
|
ctor mat4x4<T: fa_f32_f16>(T, T, T, T,
|
||||||
T, T, T, T,
|
T, T, T, T,
|
||||||
T, T, T, T,
|
T, T, T, T,
|
||||||
T, T, T, T) -> mat4x4<T>
|
T, T, T, T) -> mat4x4<T>
|
||||||
|
|
||||||
// Matrix constructors (column vectors)
|
// Matrix constructors (column vectors)
|
||||||
@const("MatCtorV")
|
@const("MatCtorV")
|
||||||
ctor mat2x2<T: af_f32f16>(vec2<T>, vec2<T>) -> mat2x2<T>
|
ctor mat2x2<T: fa_f32_f16>(vec2<T>, vec2<T>) -> mat2x2<T>
|
||||||
@const("MatCtorV")
|
@const("MatCtorV")
|
||||||
ctor mat2x3<T: af_f32f16>(vec3<T>, vec3<T>) -> mat2x3<T>
|
ctor mat2x3<T: fa_f32_f16>(vec3<T>, vec3<T>) -> mat2x3<T>
|
||||||
@const("MatCtorV")
|
@const("MatCtorV")
|
||||||
ctor mat2x4<T: af_f32f16>(vec4<T>, vec4<T>) -> mat2x4<T>
|
ctor mat2x4<T: fa_f32_f16>(vec4<T>, vec4<T>) -> mat2x4<T>
|
||||||
@const("MatCtorV")
|
@const("MatCtorV")
|
||||||
ctor mat3x2<T: af_f32f16>(vec2<T>, vec2<T>, vec2<T>) -> mat3x2<T>
|
ctor mat3x2<T: fa_f32_f16>(vec2<T>, vec2<T>, vec2<T>) -> mat3x2<T>
|
||||||
@const("MatCtorV")
|
@const("MatCtorV")
|
||||||
ctor mat3x3<T: af_f32f16>(vec3<T>, vec3<T>, vec3<T>) -> mat3x3<T>
|
ctor mat3x3<T: fa_f32_f16>(vec3<T>, vec3<T>, vec3<T>) -> mat3x3<T>
|
||||||
@const("MatCtorV")
|
@const("MatCtorV")
|
||||||
ctor mat3x4<T: af_f32f16>(vec4<T>, vec4<T>, vec4<T>) -> mat3x4<T>
|
ctor mat3x4<T: fa_f32_f16>(vec4<T>, vec4<T>, vec4<T>) -> mat3x4<T>
|
||||||
@const("MatCtorV")
|
@const("MatCtorV")
|
||||||
ctor mat4x2<T: af_f32f16>(vec2<T>, vec2<T>, vec2<T>, vec2<T>) -> mat4x2<T>
|
ctor mat4x2<T: fa_f32_f16>(vec2<T>, vec2<T>, vec2<T>, vec2<T>) -> mat4x2<T>
|
||||||
@const("MatCtorV")
|
@const("MatCtorV")
|
||||||
ctor mat4x3<T: af_f32f16>(vec3<T>, vec3<T>, vec3<T>, vec3<T>) -> mat4x3<T>
|
ctor mat4x3<T: fa_f32_f16>(vec3<T>, vec3<T>, vec3<T>, vec3<T>) -> mat4x3<T>
|
||||||
@const("MatCtorV")
|
@const("MatCtorV")
|
||||||
ctor mat4x4<T: af_f32f16>(vec4<T>, vec4<T>, vec4<T>, vec4<T>) -> mat4x4<T>
|
ctor mat4x4<T: fa_f32_f16>(vec4<T>, vec4<T>, vec4<T>, vec4<T>) -> mat4x4<T>
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
// Type conversions //
|
// Type conversions //
|
||||||
|
@ -820,46 +819,46 @@ ctor mat4x4<T: af_f32f16>(vec4<T>, vec4<T>, vec4<T>, vec4<T>) -> mat4x4<T>
|
||||||
op ! (bool) -> bool
|
op ! (bool) -> bool
|
||||||
op ! <N: num> (vec<N, bool>) -> vec<N, bool>
|
op ! <N: num> (vec<N, bool>) -> vec<N, bool>
|
||||||
|
|
||||||
@const op ~ <T: aiu32>(T) -> T
|
@const op ~ <T: ia_iu32>(T) -> T
|
||||||
@const op ~ <T: aiu32, N: num> (vec<N, T>) -> vec<N, T>
|
@const op ~ <T: ia_iu32, N: num> (vec<N, T>) -> vec<N, T>
|
||||||
|
|
||||||
@const op - <T: afi32f16>(T) -> T
|
@const op - <T: fia_fi32_f16>(T) -> T
|
||||||
@const op - <T: afi32f16, N: num> (vec<N, T>) -> vec<N, T>
|
@const op - <T: fia_fi32_f16, N: num> (vec<N, T>) -> vec<N, T>
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
// Binary Operators //
|
// Binary Operators //
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
op + <T: fiu32f16>(T, T) -> T
|
op + <T: fiu32_f16>(T, T) -> T
|
||||||
op + <T: fiu32f16, N: num> (vec<N, T>, vec<N, T>) -> vec<N, T>
|
op + <T: fiu32_f16, N: num> (vec<N, T>, vec<N, T>) -> vec<N, T>
|
||||||
op + <T: fiu32f16, N: num> (vec<N, T>, T) -> vec<N, T>
|
op + <T: fiu32_f16, N: num> (vec<N, T>, T) -> vec<N, T>
|
||||||
op + <T: fiu32f16, N: num> (T, vec<N, T>) -> vec<N, T>
|
op + <T: fiu32_f16, N: num> (T, vec<N, T>) -> vec<N, T>
|
||||||
op + <T: f32f16, N: num, M: num> (mat<N, M, T>, mat<N, M, T>) -> mat<N, M, T>
|
op + <T: f32_f16, N: num, M: num> (mat<N, M, T>, mat<N, M, T>) -> mat<N, M, T>
|
||||||
|
|
||||||
op - <T: fiu32f16>(T, T) -> T
|
op - <T: fiu32_f16>(T, T) -> T
|
||||||
op - <T: fiu32f16, N: num> (vec<N, T>, vec<N, T>) -> vec<N, T>
|
op - <T: fiu32_f16, N: num> (vec<N, T>, vec<N, T>) -> vec<N, T>
|
||||||
op - <T: fiu32f16, N: num> (vec<N, T>, T) -> vec<N, T>
|
op - <T: fiu32_f16, N: num> (vec<N, T>, T) -> vec<N, T>
|
||||||
op - <T: fiu32f16, N: num> (T, vec<N, T>) -> vec<N, T>
|
op - <T: fiu32_f16, N: num> (T, vec<N, T>) -> vec<N, T>
|
||||||
op - <T: f32f16, N: num, M: num> (mat<N, M, T>, mat<N, M, T>) -> mat<N, M, T>
|
op - <T: f32_f16, N: num, M: num> (mat<N, M, T>, mat<N, M, T>) -> mat<N, M, T>
|
||||||
|
|
||||||
op * <T: fiu32f16>(T, T) -> T
|
op * <T: fiu32_f16>(T, T) -> T
|
||||||
op * <T: fiu32f16, N: num> (vec<N, T>, vec<N, T>) -> vec<N, T>
|
op * <T: fiu32_f16, N: num> (vec<N, T>, vec<N, T>) -> vec<N, T>
|
||||||
op * <T: fiu32f16, N: num> (vec<N, T>, T) -> vec<N, T>
|
op * <T: fiu32_f16, N: num> (vec<N, T>, T) -> vec<N, T>
|
||||||
op * <T: fiu32f16, N: num> (T, vec<N, T>) -> vec<N, T>
|
op * <T: fiu32_f16, N: num> (T, vec<N, T>) -> vec<N, T>
|
||||||
op * <T: f32f16, N: num, M: num> (T, mat<N, M, T>) -> mat<N, M, T>
|
op * <T: f32_f16, N: num, M: num> (T, mat<N, M, T>) -> mat<N, M, T>
|
||||||
op * <T: f32f16, N: num, M: num> (mat<N, M, T>, T) -> mat<N, M, T>
|
op * <T: f32_f16, N: num, M: num> (mat<N, M, T>, T) -> mat<N, M, T>
|
||||||
op * <T: f32f16, C: num, R: num> (mat<C, R, T>, vec<C, T>) -> vec<R, T>
|
op * <T: f32_f16, C: num, R: num> (mat<C, R, T>, vec<C, T>) -> vec<R, T>
|
||||||
op * <T: f32f16, C: num, R: num> (vec<R, T>, mat<C, R, T>) -> vec<C, T>
|
op * <T: f32_f16, C: num, R: num> (vec<R, T>, mat<C, R, T>) -> vec<C, T>
|
||||||
op * <T: f32f16, K: num, C: num, R: num> (mat<K, R, T>, mat<C, K, T>) -> mat<C, R, T>
|
op * <T: f32_f16, K: num, C: num, R: num> (mat<K, R, T>, mat<C, K, T>) -> mat<C, R, T>
|
||||||
|
|
||||||
op / <T: fiu32f16>(T, T) -> T
|
op / <T: fiu32_f16>(T, T) -> T
|
||||||
op / <T: fiu32f16, N: num> (vec<N, T>, vec<N, T>) -> vec<N, T>
|
op / <T: fiu32_f16, N: num> (vec<N, T>, vec<N, T>) -> vec<N, T>
|
||||||
op / <T: fiu32f16, N: num> (vec<N, T>, T) -> vec<N, T>
|
op / <T: fiu32_f16, N: num> (vec<N, T>, T) -> vec<N, T>
|
||||||
op / <T: fiu32f16, N: num> (T, vec<N, T>) -> vec<N, T>
|
op / <T: fiu32_f16, N: num> (T, vec<N, T>) -> vec<N, T>
|
||||||
|
|
||||||
op % <T: fiu32f16>(T, T) -> T
|
op % <T: fiu32_f16>(T, T) -> T
|
||||||
op % <T: fiu32f16, N: num> (vec<N, T>, vec<N, T>) -> vec<N, T>
|
op % <T: fiu32_f16, N: num> (vec<N, T>, vec<N, T>) -> vec<N, T>
|
||||||
op % <T: fiu32f16, N: num> (vec<N, T>, T) -> vec<N, T>
|
op % <T: fiu32_f16, N: num> (vec<N, T>, T) -> vec<N, T>
|
||||||
op % <T: fiu32f16, N: num> (T, vec<N, T>) -> vec<N, T>
|
op % <T: fiu32_f16, N: num> (T, vec<N, T>) -> vec<N, T>
|
||||||
|
|
||||||
op ^ <T: iu32>(T, T) -> T
|
op ^ <T: iu32>(T, T) -> T
|
||||||
op ^ <T: iu32, N: num> (vec<N, T>, vec<N, T>) -> vec<N, T>
|
op ^ <T: iu32, N: num> (vec<N, T>, vec<N, T>) -> vec<N, T>
|
||||||
|
@ -883,17 +882,17 @@ op == <T: scalar, N: num> (vec<N, T>, vec<N, T>) -> vec<N, bool>
|
||||||
op != <T: scalar>(T, T) -> bool
|
op != <T: scalar>(T, T) -> bool
|
||||||
op != <T: scalar, N: num> (vec<N, T>, vec<N, T>) -> vec<N, bool>
|
op != <T: scalar, N: num> (vec<N, T>, vec<N, T>) -> vec<N, bool>
|
||||||
|
|
||||||
op < <T: fiu32f16>(T, T) -> bool
|
op < <T: fiu32_f16>(T, T) -> bool
|
||||||
op < <T: fiu32f16, N: num> (vec<N, T>, vec<N, T>) -> vec<N, bool>
|
op < <T: fiu32_f16, N: num> (vec<N, T>, vec<N, T>) -> vec<N, bool>
|
||||||
|
|
||||||
op > <T: fiu32f16>(T, T) -> bool
|
op > <T: fiu32_f16>(T, T) -> bool
|
||||||
op > <T: fiu32f16, N: num> (vec<N, T>, vec<N, T>) -> vec<N, bool>
|
op > <T: fiu32_f16, N: num> (vec<N, T>, vec<N, T>) -> vec<N, bool>
|
||||||
|
|
||||||
op <= <T: fiu32f16>(T, T) -> bool
|
op <= <T: fiu32_f16>(T, T) -> bool
|
||||||
op <= <T: fiu32f16, N: num> (vec<N, T>, vec<N, T>) -> vec<N, bool>
|
op <= <T: fiu32_f16, N: num> (vec<N, T>, vec<N, T>) -> vec<N, bool>
|
||||||
|
|
||||||
op >= <T: fiu32f16>(T, T) -> bool
|
op >= <T: fiu32_f16>(T, T) -> bool
|
||||||
op >= <T: fiu32f16, N: num> (vec<N, T>, vec<N, T>) -> vec<N, bool>
|
op >= <T: fiu32_f16, N: num> (vec<N, T>, vec<N, T>) -> vec<N, bool>
|
||||||
|
|
||||||
op << <T: iu32>(T, u32) -> T
|
op << <T: iu32>(T, u32) -> T
|
||||||
op << <T: iu32, N: num> (vec<N, T>, vec<N, u32>) -> vec<N, T>
|
op << <T: iu32, N: num> (vec<N, T>, vec<N, u32>) -> vec<N, T>
|
||||||
|
|
|
@ -48,7 +48,7 @@ namespace {
|
||||||
|
|
||||||
/// Helper that calls 'f' passing in `c`'s value
|
/// Helper that calls 'f' passing in `c`'s value
|
||||||
template <typename F>
|
template <typename F>
|
||||||
auto aiu32Dispatch(const sem::Constant* c, F&& f) {
|
auto Dispatch_ia_iu32(const sem::Constant* c, F&& f) {
|
||||||
return Switch(
|
return Switch(
|
||||||
c->Type(), [&](const sem::AbstractInt*) { return f(c->As<AInt>()); },
|
c->Type(), [&](const sem::AbstractInt*) { return f(c->As<AInt>()); },
|
||||||
[&](const sem::I32*) { return f(c->As<i32>()); },
|
[&](const sem::I32*) { return f(c->As<i32>()); },
|
||||||
|
@ -57,7 +57,7 @@ auto aiu32Dispatch(const sem::Constant* c, F&& f) {
|
||||||
|
|
||||||
/// Helper that calls 'f' passing in `c`'s value
|
/// Helper that calls 'f' passing in `c`'s value
|
||||||
template <typename F>
|
template <typename F>
|
||||||
auto afi32f16Dispatch(const sem::Constant* c, F&& f) {
|
auto Dispatch_fia_fi32_f16(const sem::Constant* c, F&& f) {
|
||||||
return Switch(
|
return Switch(
|
||||||
c->Type(), [&](const sem::AbstractInt*) { return f(c->As<AInt>()); },
|
c->Type(), [&](const sem::AbstractInt*) { return f(c->As<AInt>()); },
|
||||||
[&](const sem::AbstractFloat*) { return f(c->As<AFloat>()); },
|
[&](const sem::AbstractFloat*) { return f(c->As<AFloat>()); },
|
||||||
|
@ -654,7 +654,7 @@ const sem::Constant* ConstEval::OpComplement(const sem::Type*,
|
||||||
sem::Expression const* const* args,
|
sem::Expression const* const* args,
|
||||||
size_t) {
|
size_t) {
|
||||||
return TransformElements(builder, args[0]->ConstantValue(), [&](const sem::Constant* c) {
|
return TransformElements(builder, args[0]->ConstantValue(), [&](const sem::Constant* c) {
|
||||||
return aiu32Dispatch(c, [&](auto i) { //
|
return Dispatch_ia_iu32(c, [&](auto i) { //
|
||||||
return CreateElement(builder, c->Type(), decltype(i)(~i.value));
|
return CreateElement(builder, c->Type(), decltype(i)(~i.value));
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@ -664,7 +664,7 @@ const sem::Constant* ConstEval::OpMinus(const sem::Type*,
|
||||||
sem::Expression const* const* args,
|
sem::Expression const* const* args,
|
||||||
size_t) {
|
size_t) {
|
||||||
return TransformElements(builder, args[0]->ConstantValue(), [&](const sem::Constant* c) {
|
return TransformElements(builder, args[0]->ConstantValue(), [&](const sem::Constant* c) {
|
||||||
return afi32f16Dispatch(c, [&](auto i) { //
|
return Dispatch_fia_fi32_f16(c, [&](auto i) { //
|
||||||
// For signed integrals, avoid C++ UB by not negating the smallest negative number. In
|
// For signed integrals, avoid C++ UB by not negating the smallest negative number. In
|
||||||
// WGSL, this operation is well defined to return the same value, see:
|
// WGSL, this operation is well defined to return the same value, see:
|
||||||
// https://gpuweb.github.io/gpuweb/wgsl/#arithmetic-expr.
|
// https://gpuweb.github.io/gpuweb/wgsl/#arithmetic-expr.
|
||||||
|
|
|
@ -322,19 +322,19 @@ bool match_bool(const sem::Type* ty) {
|
||||||
return ty->IsAnyOf<Any, sem::Bool>();
|
return ty->IsAnyOf<Any, sem::Bool>();
|
||||||
}
|
}
|
||||||
|
|
||||||
const sem::AbstractFloat* build_af(MatchState& state) {
|
const sem::AbstractFloat* build_fa(MatchState& state) {
|
||||||
return state.builder.create<sem::AbstractFloat>();
|
return state.builder.create<sem::AbstractFloat>();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool match_af(const sem::Type* ty) {
|
bool match_fa(const sem::Type* ty) {
|
||||||
return ty->IsAnyOf<Any, sem::AbstractFloat>();
|
return ty->IsAnyOf<Any, sem::AbstractFloat>();
|
||||||
}
|
}
|
||||||
|
|
||||||
const sem::AbstractInt* build_ai(MatchState& state) {
|
const sem::AbstractInt* build_ia(MatchState& state) {
|
||||||
return state.builder.create<sem::AbstractInt>();
|
return state.builder.create<sem::AbstractInt>();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool match_ai(const sem::Type* ty) {
|
bool match_ia(const sem::Type* ty) {
|
||||||
return ty->IsAnyOf<Any, sem::AbstractInt>();
|
return ty->IsAnyOf<Any, sem::AbstractInt>();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -604,8 +604,8 @@ TEST_F(IntrinsicTableTest, MismatchUnaryOp) {
|
||||||
EXPECT_EQ(Diagnostics().str(), R"(12:34 error: no matching overload for operator - (bool)
|
EXPECT_EQ(Diagnostics().str(), R"(12:34 error: no matching overload for operator - (bool)
|
||||||
|
|
||||||
2 candidate operators:
|
2 candidate operators:
|
||||||
operator - (T) -> T where: T is abstract-int, abstract-float, f32, i32 or f16
|
operator - (T) -> T where: T is abstract-float, abstract-int, f32, i32 or f16
|
||||||
operator - (vecN<T>) -> vecN<T> where: T is abstract-int, abstract-float, f32, i32 or f16
|
operator - (vecN<T>) -> vecN<T> where: T is abstract-float, abstract-int, f32, i32 or f16
|
||||||
)");
|
)");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -629,12 +629,12 @@ TEST_F(IntrinsicTableTest, MismatchBinaryOp) {
|
||||||
EXPECT_EQ(Diagnostics().str(), R"(12:34 error: no matching overload for operator * (f32, bool)
|
EXPECT_EQ(Diagnostics().str(), R"(12:34 error: no matching overload for operator * (f32, bool)
|
||||||
|
|
||||||
9 candidate operators:
|
9 candidate operators:
|
||||||
operator * (T, T) -> T where: T is f32, f16, i32 or u32
|
operator * (T, T) -> T where: T is f32, i32, u32 or f16
|
||||||
operator * (vecN<T>, T) -> vecN<T> where: T is f32, f16, i32 or u32
|
operator * (vecN<T>, T) -> vecN<T> where: T is f32, i32, u32 or f16
|
||||||
operator * (T, vecN<T>) -> vecN<T> where: T is f32, f16, i32 or u32
|
operator * (T, vecN<T>) -> vecN<T> where: T is f32, i32, u32 or f16
|
||||||
operator * (T, matNxM<T>) -> matNxM<T> where: T is f32 or f16
|
operator * (T, matNxM<T>) -> matNxM<T> where: T is f32 or f16
|
||||||
operator * (matNxM<T>, T) -> matNxM<T> where: T is f32 or f16
|
operator * (matNxM<T>, T) -> matNxM<T> where: T is f32 or f16
|
||||||
operator * (vecN<T>, vecN<T>) -> vecN<T> where: T is f32, f16, i32 or u32
|
operator * (vecN<T>, vecN<T>) -> vecN<T> where: T is f32, i32, u32 or f16
|
||||||
operator * (matCxR<T>, vecC<T>) -> vecR<T> where: T is f32 or f16
|
operator * (matCxR<T>, vecC<T>) -> vecR<T> where: T is f32 or f16
|
||||||
operator * (vecR<T>, matCxR<T>) -> vecC<T> where: T is f32 or f16
|
operator * (vecR<T>, matCxR<T>) -> vecC<T> where: T is f32 or f16
|
||||||
operator * (matKxR<T>, matCxK<T>) -> matCxR<T> where: T is f32 or f16
|
operator * (matKxR<T>, matCxK<T>) -> matCxR<T> where: T is f32 or f16
|
||||||
|
@ -661,12 +661,12 @@ TEST_F(IntrinsicTableTest, MismatchCompoundOp) {
|
||||||
EXPECT_EQ(Diagnostics().str(), R"(12:34 error: no matching overload for operator *= (f32, bool)
|
EXPECT_EQ(Diagnostics().str(), R"(12:34 error: no matching overload for operator *= (f32, bool)
|
||||||
|
|
||||||
9 candidate operators:
|
9 candidate operators:
|
||||||
operator *= (T, T) -> T where: T is f32, f16, i32 or u32
|
operator *= (T, T) -> T where: T is f32, i32, u32 or f16
|
||||||
operator *= (vecN<T>, T) -> vecN<T> where: T is f32, f16, i32 or u32
|
operator *= (vecN<T>, T) -> vecN<T> where: T is f32, i32, u32 or f16
|
||||||
operator *= (T, vecN<T>) -> vecN<T> where: T is f32, f16, i32 or u32
|
operator *= (T, vecN<T>) -> vecN<T> where: T is f32, i32, u32 or f16
|
||||||
operator *= (T, matNxM<T>) -> matNxM<T> where: T is f32 or f16
|
operator *= (T, matNxM<T>) -> matNxM<T> where: T is f32 or f16
|
||||||
operator *= (matNxM<T>, T) -> matNxM<T> where: T is f32 or f16
|
operator *= (matNxM<T>, T) -> matNxM<T> where: T is f32 or f16
|
||||||
operator *= (vecN<T>, vecN<T>) -> vecN<T> where: T is f32, f16, i32 or u32
|
operator *= (vecN<T>, vecN<T>) -> vecN<T> where: T is f32, i32, u32 or f16
|
||||||
operator *= (matCxR<T>, vecC<T>) -> vecR<T> where: T is f32 or f16
|
operator *= (matCxR<T>, vecC<T>) -> vecR<T> where: T is f32 or f16
|
||||||
operator *= (vecR<T>, matCxR<T>) -> vecC<T> where: T is f32 or f16
|
operator *= (vecR<T>, matCxR<T>) -> vecC<T> where: T is f32 or f16
|
||||||
operator *= (matKxR<T>, matCxK<T>) -> matCxR<T> where: T is f32 or f16
|
operator *= (matKxR<T>, matCxK<T>) -> matCxR<T> where: T is f32 or f16
|
||||||
|
|
|
@ -332,7 +332,7 @@ func validate(fqn sem.FullyQualifiedName, uses *sem.StageUses) bool {
|
||||||
strings.Contains(elTyName, "sampler"),
|
strings.Contains(elTyName, "sampler"),
|
||||||
strings.Contains(elTyName, "texture"):
|
strings.Contains(elTyName, "texture"):
|
||||||
return false // Not storable
|
return false // Not storable
|
||||||
case elTyName == "af" || elTyName == "ai":
|
case elTyName == "fa" || elTyName == "ia":
|
||||||
return false // Abstract types are not typeable nor supported by arrays
|
return false // Abstract types are not typeable nor supported by arrays
|
||||||
}
|
}
|
||||||
case "ptr":
|
case "ptr":
|
||||||
|
|
Loading…
Reference in New Issue