#include "src/tint/lang/wgsl/ast/transform/builtin_polyfill.h"
#include <utility>
#include "src/tint/lang/wgsl/ast/transform/direct_variable_access.h"
#include "src/tint/lang/wgsl/ast/transform/helper_test.h"
namespace tint::ast::transform {
namespace {
Level;
BuiltinPolyfillTest;
TEST_F(BuiltinPolyfillTest, ShouldRunEmptyModule) { … }
TEST_F(BuiltinPolyfillTest, ShouldRun_OverrideCall) { … }
TEST_F(BuiltinPolyfillTest, ShouldRun_OverrideBinary) { … }
DataMap polyfillAcosh(Level level) { … }
TEST_F(BuiltinPolyfillTest, ShouldRunAcosh) { … }
TEST_F(BuiltinPolyfillTest, Acosh_ConstantExpression) { … }
TEST_F(BuiltinPolyfillTest, Acosh_Full_f32) { … }
TEST_F(BuiltinPolyfillTest, Acosh_Full_vec3_f32) { … }
TEST_F(BuiltinPolyfillTest, Acosh_Range_f32) { … }
TEST_F(BuiltinPolyfillTest, Acosh_Range_vec3_f32) { … }
DataMap polyfillSinh() { … }
TEST_F(BuiltinPolyfillTest, ShouldRunAsinh) { … }
TEST_F(BuiltinPolyfillTest, Asinh_ConstantExpression) { … }
TEST_F(BuiltinPolyfillTest, Asinh_f32) { … }
TEST_F(BuiltinPolyfillTest, Asinh_vec3_f32) { … }
DataMap polyfillAtanh(Level level) { … }
TEST_F(BuiltinPolyfillTest, ShouldRunAtanh) { … }
TEST_F(BuiltinPolyfillTest, Atanh_ConstantExpression) { … }
TEST_F(BuiltinPolyfillTest, Atanh_Full_f32) { … }
TEST_F(BuiltinPolyfillTest, Atanh_Full_vec3_f32) { … }
TEST_F(BuiltinPolyfillTest, Atanh_Range_f32) { … }
TEST_F(BuiltinPolyfillTest, Atanh_Range_vec3_f32) { … }
DataMap polyfillBgra8unorm() { … }
TEST_F(BuiltinPolyfillTest, ShouldRunBgra8unorm_StorageTextureVar) { … }
TEST_F(BuiltinPolyfillTest, ShouldRunBgra8unorm_StorageTextureParam) { … }
TEST_F(BuiltinPolyfillTest, Bgra8unorm_StorageTextureVar) { … }
TEST_F(BuiltinPolyfillTest, Bgra8unorm_StorageTextureParam) { … }
TEST_F(BuiltinPolyfillTest, Bgra8unorm_TextureLoad) { … }
TEST_F(BuiltinPolyfillTest, Bgra8unorm_TextureStore) { … }
TEST_F(BuiltinPolyfillTest, Bgra8unorm_TextureStore_Param) { … }
TEST_F(BuiltinPolyfillTest, Bgra8unorm_TextureStore_WithAtanh) { … }
TEST_F(BuiltinPolyfillTest, Bgra8unorm_TextureLoadAndStore) { … }
DataMap polyfillBitshiftModulo() { … }
TEST_F(BuiltinPolyfillTest, ShouldRunBitshiftModulo_shl_scalar) { … }
TEST_F(BuiltinPolyfillTest, ShouldRunBitshiftModulo_shl_vector) { … }
TEST_F(BuiltinPolyfillTest, ShouldRunBitshiftModulo_shr_scalar) { … }
TEST_F(BuiltinPolyfillTest, ShouldRunBitshiftModulo_shr_vector) { … }
TEST_F(BuiltinPolyfillTest, BitshiftModulo_shl_scalar) { … }
TEST_F(BuiltinPolyfillTest, BitshiftModulo_shl_vector) { … }
TEST_F(BuiltinPolyfillTest, BitshiftModulo_shr_scalar) { … }
TEST_F(BuiltinPolyfillTest, BitshiftModulo_shr_vector) { … }
DataMap polyfillClampInteger() { … }
TEST_F(BuiltinPolyfillTest, ShouldRunClampInteger_i32) { … }
TEST_F(BuiltinPolyfillTest, ShouldRunClampInteger_u32) { … }
TEST_F(BuiltinPolyfillTest, ShouldRunClampInteger_f32) { … }
TEST_F(BuiltinPolyfillTest, ShouldRunClampInteger_f16) { … }
TEST_F(BuiltinPolyfillTest, ClampInteger_ConstantExpression) { … }
TEST_F(BuiltinPolyfillTest, ClampInteger_i32) { … }
TEST_F(BuiltinPolyfillTest, ClampInteger_vec3_i32) { … }
TEST_F(BuiltinPolyfillTest, ClampInteger_u32) { … }
TEST_F(BuiltinPolyfillTest, ClampInteger_vec3_u32) { … }
DataMap polyfillConvF32ToIU32() { … }
TEST_F(BuiltinPolyfillTest, ShouldRunConvF32ToI32) { … }
TEST_F(BuiltinPolyfillTest, ShouldRunConvF32ToU32) { … }
TEST_F(BuiltinPolyfillTest, ShouldRunConvVec3F32ToVec3I32) { … }
TEST_F(BuiltinPolyfillTest, ShouldRunConvVec3F32ToVec3U32) { … }
TEST_F(BuiltinPolyfillTest, ConvF32ToI32) { … }
TEST_F(BuiltinPolyfillTest, ConvF32ToU32) { … }
TEST_F(BuiltinPolyfillTest, ConvVec3F32ToVec3I32) { … }
TEST_F(BuiltinPolyfillTest, ConvVec3F32ToVec3U32) { … }
DataMap polyfillCountLeadingZeros() { … }
TEST_F(BuiltinPolyfillTest, ShouldRunCountLeadingZeros) { … }
TEST_F(BuiltinPolyfillTest, CountLeadingZeros_ConstantExpression) { … }
TEST_F(BuiltinPolyfillTest, CountLeadingZeros_i32) { … }
TEST_F(BuiltinPolyfillTest, CountLeadingZeros_u32) { … }
TEST_F(BuiltinPolyfillTest, CountLeadingZeros_vec3_i32) { … }
TEST_F(BuiltinPolyfillTest, CountLeadingZeros_vec3_u32) { … }
DataMap polyfillCountTrailingZeros() { … }
TEST_F(BuiltinPolyfillTest, ShouldRunCountTrailingZeros) { … }
TEST_F(BuiltinPolyfillTest, CountTrailingZeros_ConstantExpression) { … }
TEST_F(BuiltinPolyfillTest, CountTrailingZeros_i32) { … }
TEST_F(BuiltinPolyfillTest, CountTrailingZeros_u32) { … }
TEST_F(BuiltinPolyfillTest, CountTrailingZeros_vec3_i32) { … }
TEST_F(BuiltinPolyfillTest, CountTrailingZeros_vec3_u32) { … }
DataMap polyfillExtractBits(Level level) { … }
TEST_F(BuiltinPolyfillTest, ShouldRunExtractBits) { … }
TEST_F(BuiltinPolyfillTest, ExtractBits_ConstantExpression) { … }
TEST_F(BuiltinPolyfillTest, ExtractBits_Full_i32) { … }
TEST_F(BuiltinPolyfillTest, ExtractBits_Full_u32) { … }
TEST_F(BuiltinPolyfillTest, ExtractBits_Full_vec3_i32) { … }
TEST_F(BuiltinPolyfillTest, ExtractBits_Full_vec3_u32) { … }
TEST_F(BuiltinPolyfillTest, ExtractBits_Clamp_i32) { … }
TEST_F(BuiltinPolyfillTest, ExtractBits_Clamp_u32) { … }
TEST_F(BuiltinPolyfillTest, ExtractBits_Clamp_vec3_i32) { … }
TEST_F(BuiltinPolyfillTest, ExtractBits_Clamp_vec3_u32) { … }
DataMap polyfillFirstLeadingBit() { … }
TEST_F(BuiltinPolyfillTest, ShouldRunFirstLeadingBit) { … }
TEST_F(BuiltinPolyfillTest, FirstLeadingBit_ConstantExpression) { … }
TEST_F(BuiltinPolyfillTest, FirstLeadingBit_i32) { … }
TEST_F(BuiltinPolyfillTest, FirstLeadingBit_u32) { … }
TEST_F(BuiltinPolyfillTest, FirstLeadingBit_vec3_i32) { … }
TEST_F(BuiltinPolyfillTest, FirstLeadingBit_vec3_u32) { … }
DataMap polyfillFirstTrailingBit() { … }
TEST_F(BuiltinPolyfillTest, ShouldRunFirstTrailingBit) { … }
TEST_F(BuiltinPolyfillTest, FirstTrailingBit_ConstantExpression) { … }
TEST_F(BuiltinPolyfillTest, FirstTrailingBit_i32) { … }
TEST_F(BuiltinPolyfillTest, FirstTrailingBit_u32) { … }
TEST_F(BuiltinPolyfillTest, FirstTrailingBit_vec3_i32) { … }
TEST_F(BuiltinPolyfillTest, FirstTrailingBit_vec3_u32) { … }
DataMap polyfillFwidthFine() { … }
TEST_F(BuiltinPolyfillTest, ShouldRunFwidthFine) { … }
TEST_F(BuiltinPolyfillTest, FwidthFine_f32) { … }
TEST_F(BuiltinPolyfillTest, FwidthFine_vec3_f32) { … }
DataMap polyfillInsertBits(Level level) { … }
TEST_F(BuiltinPolyfillTest, ShouldRunInsertBits) { … }
TEST_F(BuiltinPolyfillTest, InsertBits_ConstantExpression) { … }
TEST_F(BuiltinPolyfillTest, InsertBits_Full_i32) { … }
TEST_F(BuiltinPolyfillTest, InsertBits_Full_u32) { … }
TEST_F(BuiltinPolyfillTest, InsertBits_Full_vec3_i32) { … }
TEST_F(BuiltinPolyfillTest, InsertBits_Full_vec3_u32) { … }
TEST_F(BuiltinPolyfillTest, InsertBits_Clamp_i32) { … }
TEST_F(BuiltinPolyfillTest, InsertBits_Clamp_u32) { … }
TEST_F(BuiltinPolyfillTest, InsertBits_Clamp_vec3_i32) { … }
TEST_F(BuiltinPolyfillTest, InsertBits_Clamp_vec3_u32) { … }
DataMap polyfillPreciseFloatMod() { … }
TEST_F(BuiltinPolyfillTest, ShouldRunPreciseFloatMod) { … }
TEST_F(BuiltinPolyfillTest, PreciseFloatMod_af_f32) { … }
TEST_F(BuiltinPolyfillTest, PreciseFloatMod_f32_af) { … }
TEST_F(BuiltinPolyfillTest, PreciseFloatMod_f32_f32) { … }
TEST_F(BuiltinPolyfillTest, PreciseFloatMod_Overloads) { … }
TEST_F(BuiltinPolyfillTest, PreciseFloatMod_vec3_af_f32) { … }
TEST_F(BuiltinPolyfillTest, PreciseFloatMod_vec3_f32_af) { … }
TEST_F(BuiltinPolyfillTest, PreciseFloatMod_vec3_f32_f32) { … }
TEST_F(BuiltinPolyfillTest, PreciseFloatMod_vec3_f32_vec3_f32) { … }
DataMap polyfillIntDivMod() { … }
TEST_F(BuiltinPolyfillTest, ShouldRunIntDiv) { … }
TEST_F(BuiltinPolyfillTest, ShouldRunIntMod) { … }
TEST_F(BuiltinPolyfillTest, IntDiv_ai_i32) { … }
TEST_F(BuiltinPolyfillTest, IntMod_ai_i32) { … }
TEST_F(BuiltinPolyfillTest, IntDiv_i32_ai) { … }
TEST_F(BuiltinPolyfillTest, IntMod_i32_ai) { … }
TEST_F(BuiltinPolyfillTest, IntDiv_i32_i32) { … }
TEST_F(BuiltinPolyfillTest, IntMod_i32_i32) { … }
TEST_F(BuiltinPolyfillTest, IntDiv_ai_u32) { … }
TEST_F(BuiltinPolyfillTest, IntMod_ai_u32) { … }
TEST_F(BuiltinPolyfillTest, IntDiv_u32_ai) { … }
TEST_F(BuiltinPolyfillTest, IntMod_u32_ai) { … }
TEST_F(BuiltinPolyfillTest, IntDiv_u32_u32) { … }
TEST_F(BuiltinPolyfillTest, IntMod_u32_u32) { … }
TEST_F(BuiltinPolyfillTest, IntDiv_vec3_ai_i32) { … }
TEST_F(BuiltinPolyfillTest, IntMod_vec3_ai_i32) { … }
TEST_F(BuiltinPolyfillTest, IntDiv_vec3_i32_ai) { … }
TEST_F(BuiltinPolyfillTest, IntMod_vec3_i32_ai) { … }
TEST_F(BuiltinPolyfillTest, IntDiv_vec3_i32_i32) { … }
TEST_F(BuiltinPolyfillTest, IntMod_vec3_i32_i32) { … }
TEST_F(BuiltinPolyfillTest, IntDiv_vec3_u32_u32) { … }
TEST_F(BuiltinPolyfillTest, IntMod_vec3_u32_u32) { … }
TEST_F(BuiltinPolyfillTest, IntDiv_ai_vec3_i32) { … }
TEST_F(BuiltinPolyfillTest, IntMod_ai_vec3_i32) { … }
TEST_F(BuiltinPolyfillTest, IntDiv_i32_vec3_i32) { … }
TEST_F(BuiltinPolyfillTest, IntMod_i32_vec3_i32) { … }
TEST_F(BuiltinPolyfillTest, IntDiv_u32_vec3_u32) { … }
TEST_F(BuiltinPolyfillTest, IntMod_u32_vec3_u32) { … }
TEST_F(BuiltinPolyfillTest, IntDiv_vec3_i32_vec3_i32) { … }
TEST_F(BuiltinPolyfillTest, IntMod_vec3_i32_vec3_i32) { … }
TEST_F(BuiltinPolyfillTest, IntDiv_vec3_u32_vec3_u32) { … }
TEST_F(BuiltinPolyfillTest, IntMod_vec3_u32_vec3_u32) { … }
DataMap polyfillReflectVec2F32() { … }
TEST_F(BuiltinPolyfillTest, ShouldRunReflect_vec2_f32) { … }
TEST_F(BuiltinPolyfillTest, ShouldRunReflect_vec2_f16) { … }
TEST_F(BuiltinPolyfillTest, ShouldRunReflect_vec3_f32) { … }
TEST_F(BuiltinPolyfillTest, ShouldRunReflect_vec3_f16) { … }
TEST_F(BuiltinPolyfillTest, ShouldRunReflect_vec4_f32) { … }
TEST_F(BuiltinPolyfillTest, ShouldRunReflect_vec4_f16) { … }
TEST_F(BuiltinPolyfillTest, Reflect_ConstantExpression) { … }
TEST_F(BuiltinPolyfillTest, Reflect_vec2_f32) { … }
TEST_F(BuiltinPolyfillTest, Reflect_multiple_types) { … }
DataMap polyfillSaturate() { … }
TEST_F(BuiltinPolyfillTest, ShouldRunSaturate) { … }
TEST_F(BuiltinPolyfillTest, Saturate_ConstantExpression) { … }
TEST_F(BuiltinPolyfillTest, Saturate_f32) { … }
TEST_F(BuiltinPolyfillTest, Saturate_f16) { … }
TEST_F(BuiltinPolyfillTest, Saturate_vec3_f32) { … }
TEST_F(BuiltinPolyfillTest, Saturate_vec3_f16) { … }
DataMap polyfillSignInt() { … }
TEST_F(BuiltinPolyfillTest, ShouldRunSign_i32) { … }
TEST_F(BuiltinPolyfillTest, ShouldRunSign_f32) { … }
TEST_F(BuiltinPolyfillTest, SignInt_ConstantExpression) { … }
TEST_F(BuiltinPolyfillTest, SignInt_i32) { … }
TEST_F(BuiltinPolyfillTest, SignInt_vec3_i32) { … }
DataMap polyfillTextureSampleBaseClampToEdge_2d_f32() { … }
TEST_F(BuiltinPolyfillTest, ShouldRunTextureSampleBaseClampToEdge_2d_f32) { … }
TEST_F(BuiltinPolyfillTest, ShouldRunTextureSampleBaseClampToEdge_external) { … }
TEST_F(BuiltinPolyfillTest, TextureSampleBaseClampToEdge_2d_f32_f32) { … }
DataMap polyfillWorkgroupUniformLoad() { … }
DataMap polyfillWorkgroupUniformLoadWithDirectVariableAccess() { … }
TEST_F(BuiltinPolyfillTest, ShouldRunWorkgroupUniformLoad) { … }
TEST_F(BuiltinPolyfillTest, WorkgroupUniformLoad_i32) { … }
TEST_F(BuiltinPolyfillTest, WorkgroupUniformLoad_ComplexType) { … }
TEST_F(BuiltinPolyfillTest, WorkgroupUniformLoad_AvoidDuplicateEnables) { … }
TEST_F(BuiltinPolyfillTest, WorkgroupUniformLoad_DirectVariableAccess) { … }
DataMap polyfillPacked4x8IntegerDotProduct() { … }
TEST_F(BuiltinPolyfillTest, Dot4I8Packed) { … }
TEST_F(BuiltinPolyfillTest, Dot4U8Packed) { … }
TEST_F(BuiltinPolyfillTest, Pack4xI8) { … }
TEST_F(BuiltinPolyfillTest, Pack4xU8) { … }
TEST_F(BuiltinPolyfillTest, Pack4xI8Clamp) { … }
TEST_F(BuiltinPolyfillTest, Pack4xU8Clamp) { … }
TEST_F(BuiltinPolyfillTest, Unpack4xI8) { … }
TEST_F(BuiltinPolyfillTest, Unpack4xU8) { … }
TEST_F(BuiltinPolyfillTest, BitshiftAndModulo) { … }
}
}