Add const-eval for `exp` and `exp2`.

This CL adds const-eval routines for `exp` and `exp2`.

Bug: tint:1581
Change-Id: I59cc77aee64bfadf6ff10548f27f3d253b68a129
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/111322
Reviewed-by: Antonio Maiorano <amaiorano@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
This commit is contained in:
dan sinclair 2022-11-23 16:37:21 +00:00 committed by Dawn LUCI CQ
parent e9ad15ae7f
commit ae739d6d1c
226 changed files with 6186 additions and 397 deletions

View File

@ -460,10 +460,10 @@ fn dot4U8Packed(u32, u32) -> u32
@stage("fragment") fn dpdyCoarse<N: num>(vec<N, f32>) -> vec<N, f32>
@stage("fragment") fn dpdyFine(f32) -> f32
@stage("fragment") fn dpdyFine<N: num>(vec<N, f32>) -> vec<N, f32>
fn exp<T: f32_f16>(T) -> T
fn exp<N: num, T: f32_f16>(vec<N, T>) -> vec<N, T>
fn exp2<T: f32_f16>(T) -> T
fn exp2<N: num, T: f32_f16>(vec<N, T>) -> vec<N, T>
@const fn exp<T: fa_f32_f16>(T) -> T
@const fn exp<N: num, T: fa_f32_f16>(vec<N, T>) -> vec<N, T>
@const fn exp2<T: fa_f32_f16>(T) -> T
@const fn exp2<N: num, T: fa_f32_f16>(vec<N, T>) -> vec<N, T>
@const fn extractBits<T: iu32>(T, u32, u32) -> T
@const fn extractBits<N: num, T: iu32>(vec<N, T>, u32, u32) -> vec<N, T>
fn faceForward<N: num, T: f32_f16>(vec<N, T>, vec<N, T>, vec<N, T>) -> vec<N, T>

View File

@ -202,6 +202,15 @@ std::string OverflowErrorMessage(VALUE_TY value, std::string_view target_ty) {
return ss.str();
}
template <typename NumberT>
std::string OverflowExpErrorMessage(std::string_view base, NumberT value) {
std::stringstream ss;
ss << std::setprecision(20);
ss << base << "^" << value << " cannot be represented as "
<< "'" << FriendlyName<NumberT>() << "'";
return ss.str();
}
/// @returns the number of consecutive leading bits in `@p e` set to `@p bit_value_to_count`.
template <typename T>
std::make_unsigned_t<T> CountLeadingBits(T e, T bit_value_to_count) {
@ -2037,6 +2046,42 @@ ConstEval::Result ConstEval::dot(const sem::Type*,
return r;
}
ConstEval::Result ConstEval::exp(const sem::Type* ty,
utils::VectorRef<const sem::Constant*> args,
const Source& source) {
auto transform = [&](const sem::Constant* c0) {
auto create = [&](auto e0) -> ImplResult {
using NumberT = decltype(e0);
auto val = NumberT(std::exp(e0));
if (!std::isfinite(val.value)) {
AddError(OverflowExpErrorMessage("e", e0), source);
return utils::Failure;
}
return CreateElement(builder, source, c0->Type(), val);
};
return Dispatch_fa_f32_f16(create, c0);
};
return TransformElements(builder, ty, transform, args[0]);
}
ConstEval::Result ConstEval::exp2(const sem::Type* ty,
utils::VectorRef<const sem::Constant*> args,
const Source& source) {
auto transform = [&](const sem::Constant* c0) {
auto create = [&](auto e0) -> ImplResult {
using NumberT = decltype(e0);
auto val = NumberT(std::exp2(e0));
if (!std::isfinite(val.value)) {
AddError(OverflowExpErrorMessage("2", e0), source);
return utils::Failure;
}
return CreateElement(builder, source, c0->Type(), val);
};
return Dispatch_fa_f32_f16(create, c0);
};
return TransformElements(builder, ty, transform, args[0]);
}
ConstEval::Result ConstEval::extractBits(const sem::Type* ty,
utils::VectorRef<const sem::Constant*> args,
const Source& source) {

View File

@ -556,6 +556,24 @@ class ConstEval {
utils::VectorRef<const sem::Constant*> args,
const Source& source);
/// exp builtin
/// @param ty the expression type
/// @param args the input arguments
/// @param source the source location
/// @return the result value, or null if the value cannot be calculated
Result exp(const sem::Type* ty,
utils::VectorRef<const sem::Constant*> args,
const Source& source);
/// exp2 builtin
/// @param ty the expression type
/// @param args the input arguments
/// @param source the source location
/// @return the result value, or null if the value cannot be calculated
Result exp2(const sem::Type* ty,
utils::VectorRef<const sem::Constant*> args,
const Source& source);
/// extractBits builtin
/// @param ty the expression type
/// @param args the input arguments

View File

@ -1101,6 +1101,46 @@ INSTANTIATE_TEST_SUITE_P( //
testing::Combine(testing::Values(sem::BuiltinType::kDegrees),
testing::ValuesIn(DegreesF16Cases<f16>())));
template <typename T>
std::vector<Case> ExpCases() {
auto error_msg = [](auto a) { return "12:34 error: " + OverflowExpErrorMessage("e", a); };
return std::vector<Case>{C({T(0)}, T(1)), //
C({-T(0)}, T(1)), //
C({T(2)}, T(7.3890562)).FloatComp(),
C({-T(2)}, T(0.13533528)).FloatComp(), //
C({T::Lowest()}, T(0)),
E({T::Highest()}, error_msg(T::Highest()))};
}
INSTANTIATE_TEST_SUITE_P( //
Exp,
ResolverConstEvalBuiltinTest,
testing::Combine(testing::Values(sem::BuiltinType::kExp),
testing::ValuesIn(Concat(ExpCases<AFloat>(), //
ExpCases<f32>(),
ExpCases<f16>()))));
template <typename T>
std::vector<Case> Exp2Cases() {
auto error_msg = [](auto a) { return "12:34 error: " + OverflowExpErrorMessage("2", a); };
return std::vector<Case>{
C({T(0)}, T(1)), //
C({-T(0)}, T(1)), //
C({T(2)}, T(4.0)),
C({-T(2)}, T(0.25)), //
C({T::Lowest()}, T(0)),
E({T::Highest()}, error_msg(T::Highest())),
};
}
INSTANTIATE_TEST_SUITE_P( //
Exp2,
ResolverConstEvalBuiltinTest,
testing::Combine(testing::Values(sem::BuiltinType::kExp2),
testing::ValuesIn(Concat(Exp2Cases<AFloat>(), //
Exp2Cases<f32>(),
Exp2Cases<f16>()))));
template <typename T>
std::vector<Case> ExtractBitsCases() {
using UT = Number<std::make_unsigned_t<UnwrapNumber<T>>>;

View File

@ -223,7 +223,7 @@ inline std::string OverflowErrorMessage(NumberT lhs, const char* op, NumberT rhs
return ss.str();
}
/// Returns the overflow error message for converions
/// Returns the overflow error message for conversions
template <typename VALUE_TY>
std::string OverflowErrorMessage(VALUE_TY value, std::string_view target_ty) {
std::stringstream ss;
@ -233,6 +233,16 @@ std::string OverflowErrorMessage(VALUE_TY value, std::string_view target_ty) {
return ss.str();
}
/// Returns the overflow error message for exponentiation
template <typename NumberT>
std::string OverflowExpErrorMessage(std::string_view base, NumberT value) {
std::stringstream ss;
ss << std::setprecision(20);
ss << base << "^" << value << " cannot be represented as "
<< "'" << FriendlyName<NumberT>() << "'";
return ss.str();
}
using builder::IsValue;
using builder::Mat;
using builder::Val;

View File

@ -12366,48 +12366,48 @@ constexpr OverloadInfo kOverloads[] = {
/* num parameters */ 1,
/* num template types */ 1,
/* num template numbers */ 0,
/* template types */ &kTemplateTypes[26],
/* template types */ &kTemplateTypes[23],
/* template numbers */ &kTemplateNumbers[10],
/* parameters */ &kParameters[850],
/* return matcher indices */ &kMatcherIndices[3],
/* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline),
/* const eval */ nullptr,
/* const eval */ &ConstEval::exp,
},
{
/* [338] */
/* num parameters */ 1,
/* num template types */ 1,
/* num template numbers */ 1,
/* template types */ &kTemplateTypes[26],
/* template types */ &kTemplateTypes[23],
/* template numbers */ &kTemplateNumbers[4],
/* parameters */ &kParameters[851],
/* return matcher indices */ &kMatcherIndices[30],
/* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline),
/* const eval */ nullptr,
/* const eval */ &ConstEval::exp,
},
{
/* [339] */
/* num parameters */ 1,
/* num template types */ 1,
/* num template numbers */ 0,
/* template types */ &kTemplateTypes[26],
/* template types */ &kTemplateTypes[23],
/* template numbers */ &kTemplateNumbers[10],
/* parameters */ &kParameters[852],
/* return matcher indices */ &kMatcherIndices[3],
/* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline),
/* const eval */ nullptr,
/* const eval */ &ConstEval::exp2,
},
{
/* [340] */
/* num parameters */ 1,
/* num template types */ 1,
/* num template numbers */ 1,
/* template types */ &kTemplateTypes[26],
/* template types */ &kTemplateTypes[23],
/* template numbers */ &kTemplateNumbers[4],
/* parameters */ &kParameters[853],
/* return matcher indices */ &kMatcherIndices[30],
/* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline),
/* const eval */ nullptr,
/* const eval */ &ConstEval::exp2,
},
{
/* [341] */
@ -14197,15 +14197,15 @@ constexpr IntrinsicInfo kBuiltins[] = {
},
{
/* [31] */
/* fn exp<T : f32_f16>(T) -> T */
/* fn exp<N : num, T : f32_f16>(vec<N, T>) -> vec<N, T> */
/* fn exp<T : fa_f32_f16>(T) -> T */
/* fn exp<N : num, T : fa_f32_f16>(vec<N, T>) -> vec<N, T> */
/* num overloads */ 2,
/* overloads */ &kOverloads[337],
},
{
/* [32] */
/* fn exp2<T : f32_f16>(T) -> T */
/* fn exp2<N : num, T : f32_f16>(vec<N, T>) -> vec<N, T> */
/* fn exp2<T : fa_f32_f16>(T) -> T */
/* fn exp2<N : num, T : fa_f32_f16>(vec<N, T>) -> vec<N, T> */
/* num overloads */ 2,
/* overloads */ &kOverloads[339],
},

View File

@ -1,5 +1,5 @@
void exp_0f70eb() {
float4 res = exp((1.0f).xxxx);
float4 res = (2.718281746f).xxxx;
}
struct tint_symbol {

View File

@ -1,5 +1,5 @@
void exp_0f70eb() {
float4 res = exp((1.0f).xxxx);
float4 res = (2.718281746f).xxxx;
}
struct tint_symbol {

View File

@ -1,7 +1,7 @@
#version 310 es
void exp_0f70eb() {
vec4 res = exp(vec4(1.0f));
vec4 res = vec4(2.718281746f);
}
vec4 vertex_main() {
@ -21,7 +21,7 @@ void main() {
precision mediump float;
void exp_0f70eb() {
vec4 res = exp(vec4(1.0f));
vec4 res = vec4(2.718281746f);
}
void fragment_main() {
@ -35,7 +35,7 @@ void main() {
#version 310 es
void exp_0f70eb() {
vec4 res = exp(vec4(1.0f));
vec4 res = vec4(2.718281746f);
}
void compute_main() {

View File

@ -2,7 +2,7 @@
using namespace metal;
void exp_0f70eb() {
float4 res = exp(float4(1.0f));
float4 res = float4(2.718281746f);
}
struct tint_symbol {

View File

@ -1,10 +1,9 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
; Bound: 32
; Bound: 31
; Schema: 0
OpCapability Shader
%14 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
OpEntryPoint Fragment %fragment_main "fragment_main"
@ -31,36 +30,36 @@
%vertex_point_size = OpVariable %_ptr_Output_float Output %8
%void = OpTypeVoid
%9 = OpTypeFunction %void
%float_1 = OpConstant %float 1
%16 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
%float_2_71828175 = OpConstant %float 2.71828175
%14 = OpConstantComposite %v4float %float_2_71828175 %float_2_71828175 %float_2_71828175 %float_2_71828175
%_ptr_Function_v4float = OpTypePointer Function %v4float
%19 = OpTypeFunction %v4float
%17 = OpTypeFunction %v4float
%float_1 = OpConstant %float 1
%exp_0f70eb = OpFunction %void None %9
%12 = OpLabel
%res = OpVariable %_ptr_Function_v4float Function %5
%13 = OpExtInst %v4float %14 Exp %16
OpStore %res %13
OpStore %res %14
OpReturn
OpFunctionEnd
%vertex_main_inner = OpFunction %v4float None %19
%21 = OpLabel
%22 = OpFunctionCall %void %exp_0f70eb
%vertex_main_inner = OpFunction %v4float None %17
%19 = OpLabel
%20 = OpFunctionCall %void %exp_0f70eb
OpReturnValue %5
OpFunctionEnd
%vertex_main = OpFunction %void None %9
%24 = OpLabel
%25 = OpFunctionCall %v4float %vertex_main_inner
OpStore %value %25
%22 = OpLabel
%23 = OpFunctionCall %v4float %vertex_main_inner
OpStore %value %23
OpStore %vertex_point_size %float_1
OpReturn
OpFunctionEnd
%fragment_main = OpFunction %void None %9
%27 = OpLabel
%28 = OpFunctionCall %void %exp_0f70eb
%26 = OpLabel
%27 = OpFunctionCall %void %exp_0f70eb
OpReturn
OpFunctionEnd
%compute_main = OpFunction %void None %9
%30 = OpLabel
%31 = OpFunctionCall %void %exp_0f70eb
%29 = OpLabel
%30 = OpFunctionCall %void %exp_0f70eb
OpReturn
OpFunctionEnd

View File

@ -1,5 +1,5 @@
void exp_13806d() {
vector<float16_t, 3> res = exp((float16_t(1.0h)).xxx);
vector<float16_t, 3> res = (float16_t(2.716796875h)).xxx;
}
struct tint_symbol {

View File

@ -2,7 +2,7 @@
#extension GL_AMD_gpu_shader_half_float : require
void exp_13806d() {
f16vec3 res = exp(f16vec3(1.0hf));
f16vec3 res = f16vec3(2.716796875hf);
}
vec4 vertex_main() {
@ -23,7 +23,7 @@ void main() {
precision mediump float;
void exp_13806d() {
f16vec3 res = exp(f16vec3(1.0hf));
f16vec3 res = f16vec3(2.716796875hf);
}
void fragment_main() {
@ -38,7 +38,7 @@ void main() {
#extension GL_AMD_gpu_shader_half_float : require
void exp_13806d() {
f16vec3 res = exp(f16vec3(1.0hf));
f16vec3 res = f16vec3(2.716796875hf);
}
void compute_main() {

View File

@ -2,7 +2,7 @@
using namespace metal;
void exp_13806d() {
half3 res = exp(half3(1.0h));
half3 res = half3(2.716796875h);
}
struct tint_symbol {

View File

@ -1,14 +1,13 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
; Bound: 36
; Bound: 34
; Schema: 0
OpCapability Shader
OpCapability Float16
OpCapability UniformAndStorageBuffer16BitAccess
OpCapability StorageBuffer16BitAccess
OpCapability StorageInputOutput16
%16 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
OpEntryPoint Fragment %fragment_main "fragment_main"
@ -37,38 +36,37 @@
%9 = OpTypeFunction %void
%half = OpTypeFloat 16
%v3half = OpTypeVector %half 3
%half_0x1p_0 = OpConstant %half 0x1p+0
%18 = OpConstantComposite %v3half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
%half_0x1_5bcp_1 = OpConstant %half 0x1.5bcp+1
%16 = OpConstantComposite %v3half %half_0x1_5bcp_1 %half_0x1_5bcp_1 %half_0x1_5bcp_1
%_ptr_Function_v3half = OpTypePointer Function %v3half
%21 = OpConstantNull %v3half
%22 = OpTypeFunction %v4float
%19 = OpConstantNull %v3half
%20 = OpTypeFunction %v4float
%float_1 = OpConstant %float 1
%exp_13806d = OpFunction %void None %9
%12 = OpLabel
%res = OpVariable %_ptr_Function_v3half Function %21
%13 = OpExtInst %v3half %16 Exp %18
OpStore %res %13
%res = OpVariable %_ptr_Function_v3half Function %19
OpStore %res %16
OpReturn
OpFunctionEnd
%vertex_main_inner = OpFunction %v4float None %22
%24 = OpLabel
%25 = OpFunctionCall %void %exp_13806d
%vertex_main_inner = OpFunction %v4float None %20
%22 = OpLabel
%23 = OpFunctionCall %void %exp_13806d
OpReturnValue %5
OpFunctionEnd
%vertex_main = OpFunction %void None %9
%27 = OpLabel
%28 = OpFunctionCall %v4float %vertex_main_inner
OpStore %value %28
%25 = OpLabel
%26 = OpFunctionCall %v4float %vertex_main_inner
OpStore %value %26
OpStore %vertex_point_size %float_1
OpReturn
OpFunctionEnd
%fragment_main = OpFunction %void None %9
%31 = OpLabel
%32 = OpFunctionCall %void %exp_13806d
%29 = OpLabel
%30 = OpFunctionCall %void %exp_13806d
OpReturn
OpFunctionEnd
%compute_main = OpFunction %void None %9
%34 = OpLabel
%35 = OpFunctionCall %void %exp_13806d
%32 = OpLabel
%33 = OpFunctionCall %void %exp_13806d
OpReturn
OpFunctionEnd

View File

@ -1,5 +1,5 @@
void exp_1951e7() {
float2 res = exp((1.0f).xx);
float2 res = (2.718281746f).xx;
}
struct tint_symbol {

View File

@ -1,5 +1,5 @@
void exp_1951e7() {
float2 res = exp((1.0f).xx);
float2 res = (2.718281746f).xx;
}
struct tint_symbol {

View File

@ -1,7 +1,7 @@
#version 310 es
void exp_1951e7() {
vec2 res = exp(vec2(1.0f));
vec2 res = vec2(2.718281746f);
}
vec4 vertex_main() {
@ -21,7 +21,7 @@ void main() {
precision mediump float;
void exp_1951e7() {
vec2 res = exp(vec2(1.0f));
vec2 res = vec2(2.718281746f);
}
void fragment_main() {
@ -35,7 +35,7 @@ void main() {
#version 310 es
void exp_1951e7() {
vec2 res = exp(vec2(1.0f));
vec2 res = vec2(2.718281746f);
}
void compute_main() {

View File

@ -2,7 +2,7 @@
using namespace metal;
void exp_1951e7() {
float2 res = exp(float2(1.0f));
float2 res = float2(2.718281746f);
}
struct tint_symbol {

View File

@ -1,10 +1,9 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
; Bound: 34
; Bound: 33
; Schema: 0
OpCapability Shader
%15 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
OpEntryPoint Fragment %fragment_main "fragment_main"
@ -32,37 +31,37 @@
%void = OpTypeVoid
%9 = OpTypeFunction %void
%v2float = OpTypeVector %float 2
%float_1 = OpConstant %float 1
%17 = OpConstantComposite %v2float %float_1 %float_1
%float_2_71828175 = OpConstant %float 2.71828175
%15 = OpConstantComposite %v2float %float_2_71828175 %float_2_71828175
%_ptr_Function_v2float = OpTypePointer Function %v2float
%20 = OpConstantNull %v2float
%21 = OpTypeFunction %v4float
%18 = OpConstantNull %v2float
%19 = OpTypeFunction %v4float
%float_1 = OpConstant %float 1
%exp_1951e7 = OpFunction %void None %9
%12 = OpLabel
%res = OpVariable %_ptr_Function_v2float Function %20
%13 = OpExtInst %v2float %15 Exp %17
OpStore %res %13
%res = OpVariable %_ptr_Function_v2float Function %18
OpStore %res %15
OpReturn
OpFunctionEnd
%vertex_main_inner = OpFunction %v4float None %21
%23 = OpLabel
%24 = OpFunctionCall %void %exp_1951e7
%vertex_main_inner = OpFunction %v4float None %19
%21 = OpLabel
%22 = OpFunctionCall %void %exp_1951e7
OpReturnValue %5
OpFunctionEnd
%vertex_main = OpFunction %void None %9
%26 = OpLabel
%27 = OpFunctionCall %v4float %vertex_main_inner
OpStore %value %27
%24 = OpLabel
%25 = OpFunctionCall %v4float %vertex_main_inner
OpStore %value %25
OpStore %vertex_point_size %float_1
OpReturn
OpFunctionEnd
%fragment_main = OpFunction %void None %9
%29 = OpLabel
%30 = OpFunctionCall %void %exp_1951e7
%28 = OpLabel
%29 = OpFunctionCall %void %exp_1951e7
OpReturn
OpFunctionEnd
%compute_main = OpFunction %void None %9
%32 = OpLabel
%33 = OpFunctionCall %void %exp_1951e7
%31 = OpLabel
%32 = OpFunctionCall %void %exp_1951e7
OpReturn
OpFunctionEnd

View File

@ -1,5 +1,5 @@
void exp_2e08e2() {
vector<float16_t, 2> res = exp((float16_t(1.0h)).xx);
vector<float16_t, 2> res = (float16_t(2.716796875h)).xx;
}
struct tint_symbol {

View File

@ -2,7 +2,7 @@
#extension GL_AMD_gpu_shader_half_float : require
void exp_2e08e2() {
f16vec2 res = exp(f16vec2(1.0hf));
f16vec2 res = f16vec2(2.716796875hf);
}
vec4 vertex_main() {
@ -23,7 +23,7 @@ void main() {
precision mediump float;
void exp_2e08e2() {
f16vec2 res = exp(f16vec2(1.0hf));
f16vec2 res = f16vec2(2.716796875hf);
}
void fragment_main() {
@ -38,7 +38,7 @@ void main() {
#extension GL_AMD_gpu_shader_half_float : require
void exp_2e08e2() {
f16vec2 res = exp(f16vec2(1.0hf));
f16vec2 res = f16vec2(2.716796875hf);
}
void compute_main() {

View File

@ -2,7 +2,7 @@
using namespace metal;
void exp_2e08e2() {
half2 res = exp(half2(1.0h));
half2 res = half2(2.716796875h);
}
struct tint_symbol {

View File

@ -1,14 +1,13 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
; Bound: 36
; Bound: 34
; Schema: 0
OpCapability Shader
OpCapability Float16
OpCapability UniformAndStorageBuffer16BitAccess
OpCapability StorageBuffer16BitAccess
OpCapability StorageInputOutput16
%16 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
OpEntryPoint Fragment %fragment_main "fragment_main"
@ -37,38 +36,37 @@
%9 = OpTypeFunction %void
%half = OpTypeFloat 16
%v2half = OpTypeVector %half 2
%half_0x1p_0 = OpConstant %half 0x1p+0
%18 = OpConstantComposite %v2half %half_0x1p_0 %half_0x1p_0
%half_0x1_5bcp_1 = OpConstant %half 0x1.5bcp+1
%16 = OpConstantComposite %v2half %half_0x1_5bcp_1 %half_0x1_5bcp_1
%_ptr_Function_v2half = OpTypePointer Function %v2half
%21 = OpConstantNull %v2half
%22 = OpTypeFunction %v4float
%19 = OpConstantNull %v2half
%20 = OpTypeFunction %v4float
%float_1 = OpConstant %float 1
%exp_2e08e2 = OpFunction %void None %9
%12 = OpLabel
%res = OpVariable %_ptr_Function_v2half Function %21
%13 = OpExtInst %v2half %16 Exp %18
OpStore %res %13
%res = OpVariable %_ptr_Function_v2half Function %19
OpStore %res %16
OpReturn
OpFunctionEnd
%vertex_main_inner = OpFunction %v4float None %22
%24 = OpLabel
%25 = OpFunctionCall %void %exp_2e08e2
%vertex_main_inner = OpFunction %v4float None %20
%22 = OpLabel
%23 = OpFunctionCall %void %exp_2e08e2
OpReturnValue %5
OpFunctionEnd
%vertex_main = OpFunction %void None %9
%27 = OpLabel
%28 = OpFunctionCall %v4float %vertex_main_inner
OpStore %value %28
%25 = OpLabel
%26 = OpFunctionCall %v4float %vertex_main_inner
OpStore %value %26
OpStore %vertex_point_size %float_1
OpReturn
OpFunctionEnd
%fragment_main = OpFunction %void None %9
%31 = OpLabel
%32 = OpFunctionCall %void %exp_2e08e2
%29 = OpLabel
%30 = OpFunctionCall %void %exp_2e08e2
OpReturn
OpFunctionEnd
%compute_main = OpFunction %void None %9
%34 = OpLabel
%35 = OpFunctionCall %void %exp_2e08e2
%32 = OpLabel
%33 = OpFunctionCall %void %exp_2e08e2
OpReturn
OpFunctionEnd

View File

@ -0,0 +1,43 @@
// Copyright 2022 The Tint Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
////////////////////////////////////////////////////////////////////////////////
// File generated by tools/src/cmd/gen
// using the template:
// test/tint/builtins/gen/gen.wgsl.tmpl
//
// Do not modify this file directly
////////////////////////////////////////////////////////////////////////////////
// fn exp(fa) -> fa
fn exp_49e4c5() {
var res = exp(1.);
}
@vertex
fn vertex_main() -> @builtin(position) vec4<f32> {
exp_49e4c5();
return vec4<f32>();
}
@fragment
fn fragment_main() {
exp_49e4c5();
}
@compute @workgroup_size(1)
fn compute_main() {
exp_49e4c5();
}

View File

@ -0,0 +1,30 @@
void exp_49e4c5() {
float res = 2.718281746f;
}
struct tint_symbol {
float4 value : SV_Position;
};
float4 vertex_main_inner() {
exp_49e4c5();
return (0.0f).xxxx;
}
tint_symbol vertex_main() {
const float4 inner_result = vertex_main_inner();
tint_symbol wrapper_result = (tint_symbol)0;
wrapper_result.value = inner_result;
return wrapper_result;
}
void fragment_main() {
exp_49e4c5();
return;
}
[numthreads(1, 1, 1)]
void compute_main() {
exp_49e4c5();
return;
}

View File

@ -0,0 +1,30 @@
void exp_49e4c5() {
float res = 2.718281746f;
}
struct tint_symbol {
float4 value : SV_Position;
};
float4 vertex_main_inner() {
exp_49e4c5();
return (0.0f).xxxx;
}
tint_symbol vertex_main() {
const float4 inner_result = vertex_main_inner();
tint_symbol wrapper_result = (tint_symbol)0;
wrapper_result.value = inner_result;
return wrapper_result;
}
void fragment_main() {
exp_49e4c5();
return;
}
[numthreads(1, 1, 1)]
void compute_main() {
exp_49e4c5();
return;
}

View File

@ -0,0 +1,49 @@
#version 310 es
void exp_49e4c5() {
float res = 2.718281746f;
}
vec4 vertex_main() {
exp_49e4c5();
return vec4(0.0f);
}
void main() {
gl_PointSize = 1.0;
vec4 inner_result = vertex_main();
gl_Position = inner_result;
gl_Position.y = -(gl_Position.y);
gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
return;
}
#version 310 es
precision mediump float;
void exp_49e4c5() {
float res = 2.718281746f;
}
void fragment_main() {
exp_49e4c5();
}
void main() {
fragment_main();
return;
}
#version 310 es
void exp_49e4c5() {
float res = 2.718281746f;
}
void compute_main() {
exp_49e4c5();
}
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
void main() {
compute_main();
return;
}

View File

@ -0,0 +1,33 @@
#include <metal_stdlib>
using namespace metal;
void exp_49e4c5() {
float res = 2.718281746f;
}
struct tint_symbol {
float4 value [[position]];
};
float4 vertex_main_inner() {
exp_49e4c5();
return float4(0.0f);
}
vertex tint_symbol vertex_main() {
float4 const inner_result = vertex_main_inner();
tint_symbol wrapper_result = {};
wrapper_result.value = inner_result;
return wrapper_result;
}
fragment void fragment_main() {
exp_49e4c5();
return;
}
kernel void compute_main() {
exp_49e4c5();
return;
}

View File

@ -0,0 +1,64 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
; Bound: 30
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %value "value"
OpName %vertex_point_size "vertex_point_size"
OpName %exp_49e4c5 "exp_49e4c5"
OpName %res "res"
OpName %vertex_main_inner "vertex_main_inner"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %value BuiltIn Position
OpDecorate %vertex_point_size BuiltIn PointSize
%float = OpTypeFloat 32
%v4float = OpTypeVector %float 4
%_ptr_Output_v4float = OpTypePointer Output %v4float
%5 = OpConstantNull %v4float
%value = OpVariable %_ptr_Output_v4float Output %5
%_ptr_Output_float = OpTypePointer Output %float
%8 = OpConstantNull %float
%vertex_point_size = OpVariable %_ptr_Output_float Output %8
%void = OpTypeVoid
%9 = OpTypeFunction %void
%float_2_71828175 = OpConstant %float 2.71828175
%_ptr_Function_float = OpTypePointer Function %float
%16 = OpTypeFunction %v4float
%float_1 = OpConstant %float 1
%exp_49e4c5 = OpFunction %void None %9
%12 = OpLabel
%res = OpVariable %_ptr_Function_float Function %8
OpStore %res %float_2_71828175
OpReturn
OpFunctionEnd
%vertex_main_inner = OpFunction %v4float None %16
%18 = OpLabel
%19 = OpFunctionCall %void %exp_49e4c5
OpReturnValue %5
OpFunctionEnd
%vertex_main = OpFunction %void None %9
%21 = OpLabel
%22 = OpFunctionCall %v4float %vertex_main_inner
OpStore %value %22
OpStore %vertex_point_size %float_1
OpReturn
OpFunctionEnd
%fragment_main = OpFunction %void None %9
%25 = OpLabel
%26 = OpFunctionCall %void %exp_49e4c5
OpReturn
OpFunctionEnd
%compute_main = OpFunction %void None %9
%28 = OpLabel
%29 = OpFunctionCall %void %exp_49e4c5
OpReturn
OpFunctionEnd

View File

@ -0,0 +1,19 @@
fn exp_49e4c5() {
var res = exp(1.0);
}
@vertex
fn vertex_main() -> @builtin(position) vec4<f32> {
exp_49e4c5();
return vec4<f32>();
}
@fragment
fn fragment_main() {
exp_49e4c5();
}
@compute @workgroup_size(1)
fn compute_main() {
exp_49e4c5();
}

View File

@ -1,5 +1,5 @@
void exp_611a87() {
vector<float16_t, 4> res = exp((float16_t(1.0h)).xxxx);
vector<float16_t, 4> res = (float16_t(2.716796875h)).xxxx;
}
struct tint_symbol {

View File

@ -2,7 +2,7 @@
#extension GL_AMD_gpu_shader_half_float : require
void exp_611a87() {
f16vec4 res = exp(f16vec4(1.0hf));
f16vec4 res = f16vec4(2.716796875hf);
}
vec4 vertex_main() {
@ -23,7 +23,7 @@ void main() {
precision mediump float;
void exp_611a87() {
f16vec4 res = exp(f16vec4(1.0hf));
f16vec4 res = f16vec4(2.716796875hf);
}
void fragment_main() {
@ -38,7 +38,7 @@ void main() {
#extension GL_AMD_gpu_shader_half_float : require
void exp_611a87() {
f16vec4 res = exp(f16vec4(1.0hf));
f16vec4 res = f16vec4(2.716796875hf);
}
void compute_main() {

View File

@ -2,7 +2,7 @@
using namespace metal;
void exp_611a87() {
half4 res = exp(half4(1.0h));
half4 res = half4(2.716796875h);
}
struct tint_symbol {

View File

@ -1,14 +1,13 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
; Bound: 36
; Bound: 34
; Schema: 0
OpCapability Shader
OpCapability Float16
OpCapability UniformAndStorageBuffer16BitAccess
OpCapability StorageBuffer16BitAccess
OpCapability StorageInputOutput16
%16 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
OpEntryPoint Fragment %fragment_main "fragment_main"
@ -37,38 +36,37 @@
%9 = OpTypeFunction %void
%half = OpTypeFloat 16
%v4half = OpTypeVector %half 4
%half_0x1p_0 = OpConstant %half 0x1p+0
%18 = OpConstantComposite %v4half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
%half_0x1_5bcp_1 = OpConstant %half 0x1.5bcp+1
%16 = OpConstantComposite %v4half %half_0x1_5bcp_1 %half_0x1_5bcp_1 %half_0x1_5bcp_1 %half_0x1_5bcp_1
%_ptr_Function_v4half = OpTypePointer Function %v4half
%21 = OpConstantNull %v4half
%22 = OpTypeFunction %v4float
%19 = OpConstantNull %v4half
%20 = OpTypeFunction %v4float
%float_1 = OpConstant %float 1
%exp_611a87 = OpFunction %void None %9
%12 = OpLabel
%res = OpVariable %_ptr_Function_v4half Function %21
%13 = OpExtInst %v4half %16 Exp %18
OpStore %res %13
%res = OpVariable %_ptr_Function_v4half Function %19
OpStore %res %16
OpReturn
OpFunctionEnd
%vertex_main_inner = OpFunction %v4float None %22
%24 = OpLabel
%25 = OpFunctionCall %void %exp_611a87
%vertex_main_inner = OpFunction %v4float None %20
%22 = OpLabel
%23 = OpFunctionCall %void %exp_611a87
OpReturnValue %5
OpFunctionEnd
%vertex_main = OpFunction %void None %9
%27 = OpLabel
%28 = OpFunctionCall %v4float %vertex_main_inner
OpStore %value %28
%25 = OpLabel
%26 = OpFunctionCall %v4float %vertex_main_inner
OpStore %value %26
OpStore %vertex_point_size %float_1
OpReturn
OpFunctionEnd
%fragment_main = OpFunction %void None %9
%31 = OpLabel
%32 = OpFunctionCall %void %exp_611a87
%29 = OpLabel
%30 = OpFunctionCall %void %exp_611a87
OpReturn
OpFunctionEnd
%compute_main = OpFunction %void None %9
%34 = OpLabel
%35 = OpFunctionCall %void %exp_611a87
%32 = OpLabel
%33 = OpFunctionCall %void %exp_611a87
OpReturn
OpFunctionEnd

View File

@ -0,0 +1,43 @@
// Copyright 2022 The Tint Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
////////////////////////////////////////////////////////////////////////////////
// File generated by tools/src/cmd/gen
// using the template:
// test/tint/builtins/gen/gen.wgsl.tmpl
//
// Do not modify this file directly
////////////////////////////////////////////////////////////////////////////////
// fn exp(vec<2, fa>) -> vec<2, fa>
fn exp_699629() {
var res = exp(vec2(1.));
}
@vertex
fn vertex_main() -> @builtin(position) vec4<f32> {
exp_699629();
return vec4<f32>();
}
@fragment
fn fragment_main() {
exp_699629();
}
@compute @workgroup_size(1)
fn compute_main() {
exp_699629();
}

View File

@ -0,0 +1,30 @@
void exp_699629() {
float2 res = (2.718281746f).xx;
}
struct tint_symbol {
float4 value : SV_Position;
};
float4 vertex_main_inner() {
exp_699629();
return (0.0f).xxxx;
}
tint_symbol vertex_main() {
const float4 inner_result = vertex_main_inner();
tint_symbol wrapper_result = (tint_symbol)0;
wrapper_result.value = inner_result;
return wrapper_result;
}
void fragment_main() {
exp_699629();
return;
}
[numthreads(1, 1, 1)]
void compute_main() {
exp_699629();
return;
}

View File

@ -0,0 +1,30 @@
void exp_699629() {
float2 res = (2.718281746f).xx;
}
struct tint_symbol {
float4 value : SV_Position;
};
float4 vertex_main_inner() {
exp_699629();
return (0.0f).xxxx;
}
tint_symbol vertex_main() {
const float4 inner_result = vertex_main_inner();
tint_symbol wrapper_result = (tint_symbol)0;
wrapper_result.value = inner_result;
return wrapper_result;
}
void fragment_main() {
exp_699629();
return;
}
[numthreads(1, 1, 1)]
void compute_main() {
exp_699629();
return;
}

View File

@ -0,0 +1,49 @@
#version 310 es
void exp_699629() {
vec2 res = vec2(2.718281746f);
}
vec4 vertex_main() {
exp_699629();
return vec4(0.0f);
}
void main() {
gl_PointSize = 1.0;
vec4 inner_result = vertex_main();
gl_Position = inner_result;
gl_Position.y = -(gl_Position.y);
gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
return;
}
#version 310 es
precision mediump float;
void exp_699629() {
vec2 res = vec2(2.718281746f);
}
void fragment_main() {
exp_699629();
}
void main() {
fragment_main();
return;
}
#version 310 es
void exp_699629() {
vec2 res = vec2(2.718281746f);
}
void compute_main() {
exp_699629();
}
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
void main() {
compute_main();
return;
}

View File

@ -0,0 +1,33 @@
#include <metal_stdlib>
using namespace metal;
void exp_699629() {
float2 res = float2(2.718281746f);
}
struct tint_symbol {
float4 value [[position]];
};
float4 vertex_main_inner() {
exp_699629();
return float4(0.0f);
}
vertex tint_symbol vertex_main() {
float4 const inner_result = vertex_main_inner();
tint_symbol wrapper_result = {};
wrapper_result.value = inner_result;
return wrapper_result;
}
fragment void fragment_main() {
exp_699629();
return;
}
kernel void compute_main() {
exp_699629();
return;
}

View File

@ -0,0 +1,67 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
; Bound: 33
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %value "value"
OpName %vertex_point_size "vertex_point_size"
OpName %exp_699629 "exp_699629"
OpName %res "res"
OpName %vertex_main_inner "vertex_main_inner"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %value BuiltIn Position
OpDecorate %vertex_point_size BuiltIn PointSize
%float = OpTypeFloat 32
%v4float = OpTypeVector %float 4
%_ptr_Output_v4float = OpTypePointer Output %v4float
%5 = OpConstantNull %v4float
%value = OpVariable %_ptr_Output_v4float Output %5
%_ptr_Output_float = OpTypePointer Output %float
%8 = OpConstantNull %float
%vertex_point_size = OpVariable %_ptr_Output_float Output %8
%void = OpTypeVoid
%9 = OpTypeFunction %void
%v2float = OpTypeVector %float 2
%float_2_71828175 = OpConstant %float 2.71828175
%15 = OpConstantComposite %v2float %float_2_71828175 %float_2_71828175
%_ptr_Function_v2float = OpTypePointer Function %v2float
%18 = OpConstantNull %v2float
%19 = OpTypeFunction %v4float
%float_1 = OpConstant %float 1
%exp_699629 = OpFunction %void None %9
%12 = OpLabel
%res = OpVariable %_ptr_Function_v2float Function %18
OpStore %res %15
OpReturn
OpFunctionEnd
%vertex_main_inner = OpFunction %v4float None %19
%21 = OpLabel
%22 = OpFunctionCall %void %exp_699629
OpReturnValue %5
OpFunctionEnd
%vertex_main = OpFunction %void None %9
%24 = OpLabel
%25 = OpFunctionCall %v4float %vertex_main_inner
OpStore %value %25
OpStore %vertex_point_size %float_1
OpReturn
OpFunctionEnd
%fragment_main = OpFunction %void None %9
%28 = OpLabel
%29 = OpFunctionCall %void %exp_699629
OpReturn
OpFunctionEnd
%compute_main = OpFunction %void None %9
%31 = OpLabel
%32 = OpFunctionCall %void %exp_699629
OpReturn
OpFunctionEnd

View File

@ -0,0 +1,19 @@
fn exp_699629() {
var res = exp(vec2(1.0));
}
@vertex
fn vertex_main() -> @builtin(position) vec4<f32> {
exp_699629();
return vec4<f32>();
}
@fragment
fn fragment_main() {
exp_699629();
}
@compute @workgroup_size(1)
fn compute_main() {
exp_699629();
}

View File

@ -1,5 +1,5 @@
void exp_771fd2() {
float res = exp(1.0f);
float res = 2.718281746f;
}
struct tint_symbol {

View File

@ -1,5 +1,5 @@
void exp_771fd2() {
float res = exp(1.0f);
float res = 2.718281746f;
}
struct tint_symbol {

View File

@ -1,7 +1,7 @@
#version 310 es
void exp_771fd2() {
float res = exp(1.0f);
float res = 2.718281746f;
}
vec4 vertex_main() {
@ -21,7 +21,7 @@ void main() {
precision mediump float;
void exp_771fd2() {
float res = exp(1.0f);
float res = 2.718281746f;
}
void fragment_main() {
@ -35,7 +35,7 @@ void main() {
#version 310 es
void exp_771fd2() {
float res = exp(1.0f);
float res = 2.718281746f;
}
void compute_main() {

View File

@ -2,7 +2,7 @@
using namespace metal;
void exp_771fd2() {
float res = exp(1.0f);
float res = 2.718281746f;
}
struct tint_symbol {

View File

@ -1,10 +1,9 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
; Bound: 31
; Bound: 30
; Schema: 0
OpCapability Shader
%14 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
OpEntryPoint Fragment %fragment_main "fragment_main"
@ -31,35 +30,35 @@
%vertex_point_size = OpVariable %_ptr_Output_float Output %8
%void = OpTypeVoid
%9 = OpTypeFunction %void
%float_1 = OpConstant %float 1
%float_2_71828175 = OpConstant %float 2.71828175
%_ptr_Function_float = OpTypePointer Function %float
%18 = OpTypeFunction %v4float
%16 = OpTypeFunction %v4float
%float_1 = OpConstant %float 1
%exp_771fd2 = OpFunction %void None %9
%12 = OpLabel
%res = OpVariable %_ptr_Function_float Function %8
%13 = OpExtInst %float %14 Exp %float_1
OpStore %res %13
OpStore %res %float_2_71828175
OpReturn
OpFunctionEnd
%vertex_main_inner = OpFunction %v4float None %18
%20 = OpLabel
%21 = OpFunctionCall %void %exp_771fd2
%vertex_main_inner = OpFunction %v4float None %16
%18 = OpLabel
%19 = OpFunctionCall %void %exp_771fd2
OpReturnValue %5
OpFunctionEnd
%vertex_main = OpFunction %void None %9
%23 = OpLabel
%24 = OpFunctionCall %v4float %vertex_main_inner
OpStore %value %24
%21 = OpLabel
%22 = OpFunctionCall %v4float %vertex_main_inner
OpStore %value %22
OpStore %vertex_point_size %float_1
OpReturn
OpFunctionEnd
%fragment_main = OpFunction %void None %9
%26 = OpLabel
%27 = OpFunctionCall %void %exp_771fd2
%25 = OpLabel
%26 = OpFunctionCall %void %exp_771fd2
OpReturn
OpFunctionEnd
%compute_main = OpFunction %void None %9
%29 = OpLabel
%30 = OpFunctionCall %void %exp_771fd2
%28 = OpLabel
%29 = OpFunctionCall %void %exp_771fd2
OpReturn
OpFunctionEnd

View File

@ -0,0 +1,43 @@
// Copyright 2022 The Tint Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
////////////////////////////////////////////////////////////////////////////////
// File generated by tools/src/cmd/gen
// using the template:
// test/tint/builtins/gen/gen.wgsl.tmpl
//
// Do not modify this file directly
////////////////////////////////////////////////////////////////////////////////
// fn exp(vec<3, fa>) -> vec<3, fa>
fn exp_bda5bb() {
var res = exp(vec3(1.));
}
@vertex
fn vertex_main() -> @builtin(position) vec4<f32> {
exp_bda5bb();
return vec4<f32>();
}
@fragment
fn fragment_main() {
exp_bda5bb();
}
@compute @workgroup_size(1)
fn compute_main() {
exp_bda5bb();
}

View File

@ -0,0 +1,30 @@
void exp_bda5bb() {
float3 res = (2.718281746f).xxx;
}
struct tint_symbol {
float4 value : SV_Position;
};
float4 vertex_main_inner() {
exp_bda5bb();
return (0.0f).xxxx;
}
tint_symbol vertex_main() {
const float4 inner_result = vertex_main_inner();
tint_symbol wrapper_result = (tint_symbol)0;
wrapper_result.value = inner_result;
return wrapper_result;
}
void fragment_main() {
exp_bda5bb();
return;
}
[numthreads(1, 1, 1)]
void compute_main() {
exp_bda5bb();
return;
}

View File

@ -0,0 +1,30 @@
void exp_bda5bb() {
float3 res = (2.718281746f).xxx;
}
struct tint_symbol {
float4 value : SV_Position;
};
float4 vertex_main_inner() {
exp_bda5bb();
return (0.0f).xxxx;
}
tint_symbol vertex_main() {
const float4 inner_result = vertex_main_inner();
tint_symbol wrapper_result = (tint_symbol)0;
wrapper_result.value = inner_result;
return wrapper_result;
}
void fragment_main() {
exp_bda5bb();
return;
}
[numthreads(1, 1, 1)]
void compute_main() {
exp_bda5bb();
return;
}

View File

@ -0,0 +1,49 @@
#version 310 es
void exp_bda5bb() {
vec3 res = vec3(2.718281746f);
}
vec4 vertex_main() {
exp_bda5bb();
return vec4(0.0f);
}
void main() {
gl_PointSize = 1.0;
vec4 inner_result = vertex_main();
gl_Position = inner_result;
gl_Position.y = -(gl_Position.y);
gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
return;
}
#version 310 es
precision mediump float;
void exp_bda5bb() {
vec3 res = vec3(2.718281746f);
}
void fragment_main() {
exp_bda5bb();
}
void main() {
fragment_main();
return;
}
#version 310 es
void exp_bda5bb() {
vec3 res = vec3(2.718281746f);
}
void compute_main() {
exp_bda5bb();
}
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
void main() {
compute_main();
return;
}

View File

@ -0,0 +1,33 @@
#include <metal_stdlib>
using namespace metal;
void exp_bda5bb() {
float3 res = float3(2.718281746f);
}
struct tint_symbol {
float4 value [[position]];
};
float4 vertex_main_inner() {
exp_bda5bb();
return float4(0.0f);
}
vertex tint_symbol vertex_main() {
float4 const inner_result = vertex_main_inner();
tint_symbol wrapper_result = {};
wrapper_result.value = inner_result;
return wrapper_result;
}
fragment void fragment_main() {
exp_bda5bb();
return;
}
kernel void compute_main() {
exp_bda5bb();
return;
}

View File

@ -0,0 +1,67 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
; Bound: 33
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %value "value"
OpName %vertex_point_size "vertex_point_size"
OpName %exp_bda5bb "exp_bda5bb"
OpName %res "res"
OpName %vertex_main_inner "vertex_main_inner"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %value BuiltIn Position
OpDecorate %vertex_point_size BuiltIn PointSize
%float = OpTypeFloat 32
%v4float = OpTypeVector %float 4
%_ptr_Output_v4float = OpTypePointer Output %v4float
%5 = OpConstantNull %v4float
%value = OpVariable %_ptr_Output_v4float Output %5
%_ptr_Output_float = OpTypePointer Output %float
%8 = OpConstantNull %float
%vertex_point_size = OpVariable %_ptr_Output_float Output %8
%void = OpTypeVoid
%9 = OpTypeFunction %void
%v3float = OpTypeVector %float 3
%float_2_71828175 = OpConstant %float 2.71828175
%15 = OpConstantComposite %v3float %float_2_71828175 %float_2_71828175 %float_2_71828175
%_ptr_Function_v3float = OpTypePointer Function %v3float
%18 = OpConstantNull %v3float
%19 = OpTypeFunction %v4float
%float_1 = OpConstant %float 1
%exp_bda5bb = OpFunction %void None %9
%12 = OpLabel
%res = OpVariable %_ptr_Function_v3float Function %18
OpStore %res %15
OpReturn
OpFunctionEnd
%vertex_main_inner = OpFunction %v4float None %19
%21 = OpLabel
%22 = OpFunctionCall %void %exp_bda5bb
OpReturnValue %5
OpFunctionEnd
%vertex_main = OpFunction %void None %9
%24 = OpLabel
%25 = OpFunctionCall %v4float %vertex_main_inner
OpStore %value %25
OpStore %vertex_point_size %float_1
OpReturn
OpFunctionEnd
%fragment_main = OpFunction %void None %9
%28 = OpLabel
%29 = OpFunctionCall %void %exp_bda5bb
OpReturn
OpFunctionEnd
%compute_main = OpFunction %void None %9
%31 = OpLabel
%32 = OpFunctionCall %void %exp_bda5bb
OpReturn
OpFunctionEnd

View File

@ -0,0 +1,19 @@
fn exp_bda5bb() {
var res = exp(vec3(1.0));
}
@vertex
fn vertex_main() -> @builtin(position) vec4<f32> {
exp_bda5bb();
return vec4<f32>();
}
@fragment
fn fragment_main() {
exp_bda5bb();
}
@compute @workgroup_size(1)
fn compute_main() {
exp_bda5bb();
}

View File

@ -1,5 +1,5 @@
void exp_c18fe9() {
float16_t res = exp(float16_t(1.0h));
float16_t res = float16_t(2.716796875h);
}
struct tint_symbol {

View File

@ -2,7 +2,7 @@
#extension GL_AMD_gpu_shader_half_float : require
void exp_c18fe9() {
float16_t res = exp(1.0hf);
float16_t res = 2.716796875hf;
}
vec4 vertex_main() {
@ -23,7 +23,7 @@ void main() {
precision mediump float;
void exp_c18fe9() {
float16_t res = exp(1.0hf);
float16_t res = 2.716796875hf;
}
void fragment_main() {
@ -38,7 +38,7 @@ void main() {
#extension GL_AMD_gpu_shader_half_float : require
void exp_c18fe9() {
float16_t res = exp(1.0hf);
float16_t res = 2.716796875hf;
}
void compute_main() {

View File

@ -2,7 +2,7 @@
using namespace metal;
void exp_c18fe9() {
half res = exp(1.0h);
half res = 2.716796875h;
}
struct tint_symbol {

View File

@ -1,14 +1,13 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
; Bound: 34
; Bound: 32
; Schema: 0
OpCapability Shader
OpCapability Float16
OpCapability UniformAndStorageBuffer16BitAccess
OpCapability StorageBuffer16BitAccess
OpCapability StorageInputOutput16
%15 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
OpEntryPoint Fragment %fragment_main "fragment_main"
@ -36,37 +35,36 @@
%void = OpTypeVoid
%9 = OpTypeFunction %void
%half = OpTypeFloat 16
%half_0x1p_0 = OpConstant %half 0x1p+0
%half_0x1_5bcp_1 = OpConstant %half 0x1.5bcp+1
%_ptr_Function_half = OpTypePointer Function %half
%19 = OpConstantNull %half
%20 = OpTypeFunction %v4float
%17 = OpConstantNull %half
%18 = OpTypeFunction %v4float
%float_1 = OpConstant %float 1
%exp_c18fe9 = OpFunction %void None %9
%12 = OpLabel
%res = OpVariable %_ptr_Function_half Function %19
%13 = OpExtInst %half %15 Exp %half_0x1p_0
OpStore %res %13
%res = OpVariable %_ptr_Function_half Function %17
OpStore %res %half_0x1_5bcp_1
OpReturn
OpFunctionEnd
%vertex_main_inner = OpFunction %v4float None %20
%22 = OpLabel
%23 = OpFunctionCall %void %exp_c18fe9
%vertex_main_inner = OpFunction %v4float None %18
%20 = OpLabel
%21 = OpFunctionCall %void %exp_c18fe9
OpReturnValue %5
OpFunctionEnd
%vertex_main = OpFunction %void None %9
%25 = OpLabel
%26 = OpFunctionCall %v4float %vertex_main_inner
OpStore %value %26
%23 = OpLabel
%24 = OpFunctionCall %v4float %vertex_main_inner
OpStore %value %24
OpStore %vertex_point_size %float_1
OpReturn
OpFunctionEnd
%fragment_main = OpFunction %void None %9
%29 = OpLabel
%30 = OpFunctionCall %void %exp_c18fe9
%27 = OpLabel
%28 = OpFunctionCall %void %exp_c18fe9
OpReturn
OpFunctionEnd
%compute_main = OpFunction %void None %9
%32 = OpLabel
%33 = OpFunctionCall %void %exp_c18fe9
%30 = OpLabel
%31 = OpFunctionCall %void %exp_c18fe9
OpReturn
OpFunctionEnd

View File

@ -1,5 +1,5 @@
void exp_d98450() {
float3 res = exp((1.0f).xxx);
float3 res = (2.718281746f).xxx;
}
struct tint_symbol {

View File

@ -1,5 +1,5 @@
void exp_d98450() {
float3 res = exp((1.0f).xxx);
float3 res = (2.718281746f).xxx;
}
struct tint_symbol {

View File

@ -1,7 +1,7 @@
#version 310 es
void exp_d98450() {
vec3 res = exp(vec3(1.0f));
vec3 res = vec3(2.718281746f);
}
vec4 vertex_main() {
@ -21,7 +21,7 @@ void main() {
precision mediump float;
void exp_d98450() {
vec3 res = exp(vec3(1.0f));
vec3 res = vec3(2.718281746f);
}
void fragment_main() {
@ -35,7 +35,7 @@ void main() {
#version 310 es
void exp_d98450() {
vec3 res = exp(vec3(1.0f));
vec3 res = vec3(2.718281746f);
}
void compute_main() {

View File

@ -2,7 +2,7 @@
using namespace metal;
void exp_d98450() {
float3 res = exp(float3(1.0f));
float3 res = float3(2.718281746f);
}
struct tint_symbol {

View File

@ -1,10 +1,9 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
; Bound: 34
; Bound: 33
; Schema: 0
OpCapability Shader
%15 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
OpEntryPoint Fragment %fragment_main "fragment_main"
@ -32,37 +31,37 @@
%void = OpTypeVoid
%9 = OpTypeFunction %void
%v3float = OpTypeVector %float 3
%float_1 = OpConstant %float 1
%17 = OpConstantComposite %v3float %float_1 %float_1 %float_1
%float_2_71828175 = OpConstant %float 2.71828175
%15 = OpConstantComposite %v3float %float_2_71828175 %float_2_71828175 %float_2_71828175
%_ptr_Function_v3float = OpTypePointer Function %v3float
%20 = OpConstantNull %v3float
%21 = OpTypeFunction %v4float
%18 = OpConstantNull %v3float
%19 = OpTypeFunction %v4float
%float_1 = OpConstant %float 1
%exp_d98450 = OpFunction %void None %9
%12 = OpLabel
%res = OpVariable %_ptr_Function_v3float Function %20
%13 = OpExtInst %v3float %15 Exp %17
OpStore %res %13
%res = OpVariable %_ptr_Function_v3float Function %18
OpStore %res %15
OpReturn
OpFunctionEnd
%vertex_main_inner = OpFunction %v4float None %21
%23 = OpLabel
%24 = OpFunctionCall %void %exp_d98450
%vertex_main_inner = OpFunction %v4float None %19
%21 = OpLabel
%22 = OpFunctionCall %void %exp_d98450
OpReturnValue %5
OpFunctionEnd
%vertex_main = OpFunction %void None %9
%26 = OpLabel
%27 = OpFunctionCall %v4float %vertex_main_inner
OpStore %value %27
%24 = OpLabel
%25 = OpFunctionCall %v4float %vertex_main_inner
OpStore %value %25
OpStore %vertex_point_size %float_1
OpReturn
OpFunctionEnd
%fragment_main = OpFunction %void None %9
%29 = OpLabel
%30 = OpFunctionCall %void %exp_d98450
%28 = OpLabel
%29 = OpFunctionCall %void %exp_d98450
OpReturn
OpFunctionEnd
%compute_main = OpFunction %void None %9
%32 = OpLabel
%33 = OpFunctionCall %void %exp_d98450
%31 = OpLabel
%32 = OpFunctionCall %void %exp_d98450
OpReturn
OpFunctionEnd

View File

@ -0,0 +1,43 @@
// Copyright 2022 The Tint Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
////////////////////////////////////////////////////////////////////////////////
// File generated by tools/src/cmd/gen
// using the template:
// test/tint/builtins/gen/gen.wgsl.tmpl
//
// Do not modify this file directly
////////////////////////////////////////////////////////////////////////////////
// fn exp(vec<4, fa>) -> vec<4, fa>
fn exp_dad791() {
var res = exp(vec4(1.));
}
@vertex
fn vertex_main() -> @builtin(position) vec4<f32> {
exp_dad791();
return vec4<f32>();
}
@fragment
fn fragment_main() {
exp_dad791();
}
@compute @workgroup_size(1)
fn compute_main() {
exp_dad791();
}

View File

@ -0,0 +1,30 @@
void exp_dad791() {
float4 res = (2.718281746f).xxxx;
}
struct tint_symbol {
float4 value : SV_Position;
};
float4 vertex_main_inner() {
exp_dad791();
return (0.0f).xxxx;
}
tint_symbol vertex_main() {
const float4 inner_result = vertex_main_inner();
tint_symbol wrapper_result = (tint_symbol)0;
wrapper_result.value = inner_result;
return wrapper_result;
}
void fragment_main() {
exp_dad791();
return;
}
[numthreads(1, 1, 1)]
void compute_main() {
exp_dad791();
return;
}

View File

@ -0,0 +1,30 @@
void exp_dad791() {
float4 res = (2.718281746f).xxxx;
}
struct tint_symbol {
float4 value : SV_Position;
};
float4 vertex_main_inner() {
exp_dad791();
return (0.0f).xxxx;
}
tint_symbol vertex_main() {
const float4 inner_result = vertex_main_inner();
tint_symbol wrapper_result = (tint_symbol)0;
wrapper_result.value = inner_result;
return wrapper_result;
}
void fragment_main() {
exp_dad791();
return;
}
[numthreads(1, 1, 1)]
void compute_main() {
exp_dad791();
return;
}

View File

@ -0,0 +1,49 @@
#version 310 es
void exp_dad791() {
vec4 res = vec4(2.718281746f);
}
vec4 vertex_main() {
exp_dad791();
return vec4(0.0f);
}
void main() {
gl_PointSize = 1.0;
vec4 inner_result = vertex_main();
gl_Position = inner_result;
gl_Position.y = -(gl_Position.y);
gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
return;
}
#version 310 es
precision mediump float;
void exp_dad791() {
vec4 res = vec4(2.718281746f);
}
void fragment_main() {
exp_dad791();
}
void main() {
fragment_main();
return;
}
#version 310 es
void exp_dad791() {
vec4 res = vec4(2.718281746f);
}
void compute_main() {
exp_dad791();
}
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
void main() {
compute_main();
return;
}

View File

@ -0,0 +1,33 @@
#include <metal_stdlib>
using namespace metal;
void exp_dad791() {
float4 res = float4(2.718281746f);
}
struct tint_symbol {
float4 value [[position]];
};
float4 vertex_main_inner() {
exp_dad791();
return float4(0.0f);
}
vertex tint_symbol vertex_main() {
float4 const inner_result = vertex_main_inner();
tint_symbol wrapper_result = {};
wrapper_result.value = inner_result;
return wrapper_result;
}
fragment void fragment_main() {
exp_dad791();
return;
}
kernel void compute_main() {
exp_dad791();
return;
}

View File

@ -0,0 +1,65 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
; Bound: 31
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %value "value"
OpName %vertex_point_size "vertex_point_size"
OpName %exp_dad791 "exp_dad791"
OpName %res "res"
OpName %vertex_main_inner "vertex_main_inner"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %value BuiltIn Position
OpDecorate %vertex_point_size BuiltIn PointSize
%float = OpTypeFloat 32
%v4float = OpTypeVector %float 4
%_ptr_Output_v4float = OpTypePointer Output %v4float
%5 = OpConstantNull %v4float
%value = OpVariable %_ptr_Output_v4float Output %5
%_ptr_Output_float = OpTypePointer Output %float
%8 = OpConstantNull %float
%vertex_point_size = OpVariable %_ptr_Output_float Output %8
%void = OpTypeVoid
%9 = OpTypeFunction %void
%float_2_71828175 = OpConstant %float 2.71828175
%14 = OpConstantComposite %v4float %float_2_71828175 %float_2_71828175 %float_2_71828175 %float_2_71828175
%_ptr_Function_v4float = OpTypePointer Function %v4float
%17 = OpTypeFunction %v4float
%float_1 = OpConstant %float 1
%exp_dad791 = OpFunction %void None %9
%12 = OpLabel
%res = OpVariable %_ptr_Function_v4float Function %5
OpStore %res %14
OpReturn
OpFunctionEnd
%vertex_main_inner = OpFunction %v4float None %17
%19 = OpLabel
%20 = OpFunctionCall %void %exp_dad791
OpReturnValue %5
OpFunctionEnd
%vertex_main = OpFunction %void None %9
%22 = OpLabel
%23 = OpFunctionCall %v4float %vertex_main_inner
OpStore %value %23
OpStore %vertex_point_size %float_1
OpReturn
OpFunctionEnd
%fragment_main = OpFunction %void None %9
%26 = OpLabel
%27 = OpFunctionCall %void %exp_dad791
OpReturn
OpFunctionEnd
%compute_main = OpFunction %void None %9
%29 = OpLabel
%30 = OpFunctionCall %void %exp_dad791
OpReturn
OpFunctionEnd

View File

@ -0,0 +1,19 @@
fn exp_dad791() {
var res = exp(vec4(1.0));
}
@vertex
fn vertex_main() -> @builtin(position) vec4<f32> {
exp_dad791();
return vec4<f32>();
}
@fragment
fn fragment_main() {
exp_dad791();
}
@compute @workgroup_size(1)
fn compute_main() {
exp_dad791();
}

View File

@ -1,5 +1,5 @@
void exp2_151a4c() {
vector<float16_t, 2> res = exp2((float16_t(1.0h)).xx);
vector<float16_t, 2> res = (float16_t(2.0h)).xx;
}
struct tint_symbol {

View File

@ -2,7 +2,7 @@
#extension GL_AMD_gpu_shader_half_float : require
void exp2_151a4c() {
f16vec2 res = exp2(f16vec2(1.0hf));
f16vec2 res = f16vec2(2.0hf);
}
vec4 vertex_main() {
@ -23,7 +23,7 @@ void main() {
precision mediump float;
void exp2_151a4c() {
f16vec2 res = exp2(f16vec2(1.0hf));
f16vec2 res = f16vec2(2.0hf);
}
void fragment_main() {
@ -38,7 +38,7 @@ void main() {
#extension GL_AMD_gpu_shader_half_float : require
void exp2_151a4c() {
f16vec2 res = exp2(f16vec2(1.0hf));
f16vec2 res = f16vec2(2.0hf);
}
void compute_main() {

View File

@ -2,7 +2,7 @@
using namespace metal;
void exp2_151a4c() {
half2 res = exp2(half2(1.0h));
half2 res = half2(2.0h);
}
struct tint_symbol {

View File

@ -1,14 +1,13 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
; Bound: 36
; Bound: 34
; Schema: 0
OpCapability Shader
OpCapability Float16
OpCapability UniformAndStorageBuffer16BitAccess
OpCapability StorageBuffer16BitAccess
OpCapability StorageInputOutput16
%16 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
OpEntryPoint Fragment %fragment_main "fragment_main"
@ -37,38 +36,37 @@
%9 = OpTypeFunction %void
%half = OpTypeFloat 16
%v2half = OpTypeVector %half 2
%half_0x1p_0 = OpConstant %half 0x1p+0
%18 = OpConstantComposite %v2half %half_0x1p_0 %half_0x1p_0
%half_0x1p_1 = OpConstant %half 0x1p+1
%16 = OpConstantComposite %v2half %half_0x1p_1 %half_0x1p_1
%_ptr_Function_v2half = OpTypePointer Function %v2half
%21 = OpConstantNull %v2half
%22 = OpTypeFunction %v4float
%19 = OpConstantNull %v2half
%20 = OpTypeFunction %v4float
%float_1 = OpConstant %float 1
%exp2_151a4c = OpFunction %void None %9
%12 = OpLabel
%res = OpVariable %_ptr_Function_v2half Function %21
%13 = OpExtInst %v2half %16 Exp2 %18
OpStore %res %13
%res = OpVariable %_ptr_Function_v2half Function %19
OpStore %res %16
OpReturn
OpFunctionEnd
%vertex_main_inner = OpFunction %v4float None %22
%24 = OpLabel
%25 = OpFunctionCall %void %exp2_151a4c
%vertex_main_inner = OpFunction %v4float None %20
%22 = OpLabel
%23 = OpFunctionCall %void %exp2_151a4c
OpReturnValue %5
OpFunctionEnd
%vertex_main = OpFunction %void None %9
%27 = OpLabel
%28 = OpFunctionCall %v4float %vertex_main_inner
OpStore %value %28
%25 = OpLabel
%26 = OpFunctionCall %v4float %vertex_main_inner
OpStore %value %26
OpStore %vertex_point_size %float_1
OpReturn
OpFunctionEnd
%fragment_main = OpFunction %void None %9
%31 = OpLabel
%32 = OpFunctionCall %void %exp2_151a4c
%29 = OpLabel
%30 = OpFunctionCall %void %exp2_151a4c
OpReturn
OpFunctionEnd
%compute_main = OpFunction %void None %9
%34 = OpLabel
%35 = OpFunctionCall %void %exp2_151a4c
%32 = OpLabel
%33 = OpFunctionCall %void %exp2_151a4c
OpReturn
OpFunctionEnd

View File

@ -0,0 +1,43 @@
// Copyright 2022 The Tint Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
////////////////////////////////////////////////////////////////////////////////
// File generated by tools/src/cmd/gen
// using the template:
// test/tint/builtins/gen/gen.wgsl.tmpl
//
// Do not modify this file directly
////////////////////////////////////////////////////////////////////////////////
// fn exp2(vec<2, fa>) -> vec<2, fa>
fn exp2_18aa76() {
var res = exp2(vec2(1.));
}
@vertex
fn vertex_main() -> @builtin(position) vec4<f32> {
exp2_18aa76();
return vec4<f32>();
}
@fragment
fn fragment_main() {
exp2_18aa76();
}
@compute @workgroup_size(1)
fn compute_main() {
exp2_18aa76();
}

View File

@ -0,0 +1,30 @@
void exp2_18aa76() {
float2 res = (2.0f).xx;
}
struct tint_symbol {
float4 value : SV_Position;
};
float4 vertex_main_inner() {
exp2_18aa76();
return (0.0f).xxxx;
}
tint_symbol vertex_main() {
const float4 inner_result = vertex_main_inner();
tint_symbol wrapper_result = (tint_symbol)0;
wrapper_result.value = inner_result;
return wrapper_result;
}
void fragment_main() {
exp2_18aa76();
return;
}
[numthreads(1, 1, 1)]
void compute_main() {
exp2_18aa76();
return;
}

View File

@ -0,0 +1,30 @@
void exp2_18aa76() {
float2 res = (2.0f).xx;
}
struct tint_symbol {
float4 value : SV_Position;
};
float4 vertex_main_inner() {
exp2_18aa76();
return (0.0f).xxxx;
}
tint_symbol vertex_main() {
const float4 inner_result = vertex_main_inner();
tint_symbol wrapper_result = (tint_symbol)0;
wrapper_result.value = inner_result;
return wrapper_result;
}
void fragment_main() {
exp2_18aa76();
return;
}
[numthreads(1, 1, 1)]
void compute_main() {
exp2_18aa76();
return;
}

View File

@ -0,0 +1,49 @@
#version 310 es
void exp2_18aa76() {
vec2 res = vec2(2.0f);
}
vec4 vertex_main() {
exp2_18aa76();
return vec4(0.0f);
}
void main() {
gl_PointSize = 1.0;
vec4 inner_result = vertex_main();
gl_Position = inner_result;
gl_Position.y = -(gl_Position.y);
gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
return;
}
#version 310 es
precision mediump float;
void exp2_18aa76() {
vec2 res = vec2(2.0f);
}
void fragment_main() {
exp2_18aa76();
}
void main() {
fragment_main();
return;
}
#version 310 es
void exp2_18aa76() {
vec2 res = vec2(2.0f);
}
void compute_main() {
exp2_18aa76();
}
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
void main() {
compute_main();
return;
}

View File

@ -0,0 +1,33 @@
#include <metal_stdlib>
using namespace metal;
void exp2_18aa76() {
float2 res = float2(2.0f);
}
struct tint_symbol {
float4 value [[position]];
};
float4 vertex_main_inner() {
exp2_18aa76();
return float4(0.0f);
}
vertex tint_symbol vertex_main() {
float4 const inner_result = vertex_main_inner();
tint_symbol wrapper_result = {};
wrapper_result.value = inner_result;
return wrapper_result;
}
fragment void fragment_main() {
exp2_18aa76();
return;
}
kernel void compute_main() {
exp2_18aa76();
return;
}

View File

@ -0,0 +1,67 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
; Bound: 33
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %value "value"
OpName %vertex_point_size "vertex_point_size"
OpName %exp2_18aa76 "exp2_18aa76"
OpName %res "res"
OpName %vertex_main_inner "vertex_main_inner"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %value BuiltIn Position
OpDecorate %vertex_point_size BuiltIn PointSize
%float = OpTypeFloat 32
%v4float = OpTypeVector %float 4
%_ptr_Output_v4float = OpTypePointer Output %v4float
%5 = OpConstantNull %v4float
%value = OpVariable %_ptr_Output_v4float Output %5
%_ptr_Output_float = OpTypePointer Output %float
%8 = OpConstantNull %float
%vertex_point_size = OpVariable %_ptr_Output_float Output %8
%void = OpTypeVoid
%9 = OpTypeFunction %void
%v2float = OpTypeVector %float 2
%float_2 = OpConstant %float 2
%15 = OpConstantComposite %v2float %float_2 %float_2
%_ptr_Function_v2float = OpTypePointer Function %v2float
%18 = OpConstantNull %v2float
%19 = OpTypeFunction %v4float
%float_1 = OpConstant %float 1
%exp2_18aa76 = OpFunction %void None %9
%12 = OpLabel
%res = OpVariable %_ptr_Function_v2float Function %18
OpStore %res %15
OpReturn
OpFunctionEnd
%vertex_main_inner = OpFunction %v4float None %19
%21 = OpLabel
%22 = OpFunctionCall %void %exp2_18aa76
OpReturnValue %5
OpFunctionEnd
%vertex_main = OpFunction %void None %9
%24 = OpLabel
%25 = OpFunctionCall %v4float %vertex_main_inner
OpStore %value %25
OpStore %vertex_point_size %float_1
OpReturn
OpFunctionEnd
%fragment_main = OpFunction %void None %9
%28 = OpLabel
%29 = OpFunctionCall %void %exp2_18aa76
OpReturn
OpFunctionEnd
%compute_main = OpFunction %void None %9
%31 = OpLabel
%32 = OpFunctionCall %void %exp2_18aa76
OpReturn
OpFunctionEnd

View File

@ -0,0 +1,19 @@
fn exp2_18aa76() {
var res = exp2(vec2(1.0));
}
@vertex
fn vertex_main() -> @builtin(position) vec4<f32> {
exp2_18aa76();
return vec4<f32>();
}
@fragment
fn fragment_main() {
exp2_18aa76();
}
@compute @workgroup_size(1)
fn compute_main() {
exp2_18aa76();
}

View File

@ -1,5 +1,5 @@
void exp2_1f8680() {
float3 res = exp2((1.0f).xxx);
float3 res = (2.0f).xxx;
}
struct tint_symbol {

View File

@ -1,5 +1,5 @@
void exp2_1f8680() {
float3 res = exp2((1.0f).xxx);
float3 res = (2.0f).xxx;
}
struct tint_symbol {

View File

@ -1,7 +1,7 @@
#version 310 es
void exp2_1f8680() {
vec3 res = exp2(vec3(1.0f));
vec3 res = vec3(2.0f);
}
vec4 vertex_main() {
@ -21,7 +21,7 @@ void main() {
precision mediump float;
void exp2_1f8680() {
vec3 res = exp2(vec3(1.0f));
vec3 res = vec3(2.0f);
}
void fragment_main() {
@ -35,7 +35,7 @@ void main() {
#version 310 es
void exp2_1f8680() {
vec3 res = exp2(vec3(1.0f));
vec3 res = vec3(2.0f);
}
void compute_main() {

View File

@ -2,7 +2,7 @@
using namespace metal;
void exp2_1f8680() {
float3 res = exp2(float3(1.0f));
float3 res = float3(2.0f);
}
struct tint_symbol {

View File

@ -1,10 +1,9 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
; Bound: 34
; Bound: 33
; Schema: 0
OpCapability Shader
%15 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
OpEntryPoint Fragment %fragment_main "fragment_main"
@ -32,37 +31,37 @@
%void = OpTypeVoid
%9 = OpTypeFunction %void
%v3float = OpTypeVector %float 3
%float_1 = OpConstant %float 1
%17 = OpConstantComposite %v3float %float_1 %float_1 %float_1
%float_2 = OpConstant %float 2
%15 = OpConstantComposite %v3float %float_2 %float_2 %float_2
%_ptr_Function_v3float = OpTypePointer Function %v3float
%20 = OpConstantNull %v3float
%21 = OpTypeFunction %v4float
%18 = OpConstantNull %v3float
%19 = OpTypeFunction %v4float
%float_1 = OpConstant %float 1
%exp2_1f8680 = OpFunction %void None %9
%12 = OpLabel
%res = OpVariable %_ptr_Function_v3float Function %20
%13 = OpExtInst %v3float %15 Exp2 %17
OpStore %res %13
%res = OpVariable %_ptr_Function_v3float Function %18
OpStore %res %15
OpReturn
OpFunctionEnd
%vertex_main_inner = OpFunction %v4float None %21
%23 = OpLabel
%24 = OpFunctionCall %void %exp2_1f8680
%vertex_main_inner = OpFunction %v4float None %19
%21 = OpLabel
%22 = OpFunctionCall %void %exp2_1f8680
OpReturnValue %5
OpFunctionEnd
%vertex_main = OpFunction %void None %9
%26 = OpLabel
%27 = OpFunctionCall %v4float %vertex_main_inner
OpStore %value %27
%24 = OpLabel
%25 = OpFunctionCall %v4float %vertex_main_inner
OpStore %value %25
OpStore %vertex_point_size %float_1
OpReturn
OpFunctionEnd
%fragment_main = OpFunction %void None %9
%29 = OpLabel
%30 = OpFunctionCall %void %exp2_1f8680
%28 = OpLabel
%29 = OpFunctionCall %void %exp2_1f8680
OpReturn
OpFunctionEnd
%compute_main = OpFunction %void None %9
%32 = OpLabel
%33 = OpFunctionCall %void %exp2_1f8680
%31 = OpLabel
%32 = OpFunctionCall %void %exp2_1f8680
OpReturn
OpFunctionEnd

View File

@ -0,0 +1,43 @@
// Copyright 2022 The Tint Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
////////////////////////////////////////////////////////////////////////////////
// File generated by tools/src/cmd/gen
// using the template:
// test/tint/builtins/gen/gen.wgsl.tmpl
//
// Do not modify this file directly
////////////////////////////////////////////////////////////////////////////////
// fn exp2(vec<3, fa>) -> vec<3, fa>
fn exp2_303753() {
var res = exp2(vec3(1.));
}
@vertex
fn vertex_main() -> @builtin(position) vec4<f32> {
exp2_303753();
return vec4<f32>();
}
@fragment
fn fragment_main() {
exp2_303753();
}
@compute @workgroup_size(1)
fn compute_main() {
exp2_303753();
}

View File

@ -0,0 +1,30 @@
void exp2_303753() {
float3 res = (2.0f).xxx;
}
struct tint_symbol {
float4 value : SV_Position;
};
float4 vertex_main_inner() {
exp2_303753();
return (0.0f).xxxx;
}
tint_symbol vertex_main() {
const float4 inner_result = vertex_main_inner();
tint_symbol wrapper_result = (tint_symbol)0;
wrapper_result.value = inner_result;
return wrapper_result;
}
void fragment_main() {
exp2_303753();
return;
}
[numthreads(1, 1, 1)]
void compute_main() {
exp2_303753();
return;
}

View File

@ -0,0 +1,30 @@
void exp2_303753() {
float3 res = (2.0f).xxx;
}
struct tint_symbol {
float4 value : SV_Position;
};
float4 vertex_main_inner() {
exp2_303753();
return (0.0f).xxxx;
}
tint_symbol vertex_main() {
const float4 inner_result = vertex_main_inner();
tint_symbol wrapper_result = (tint_symbol)0;
wrapper_result.value = inner_result;
return wrapper_result;
}
void fragment_main() {
exp2_303753();
return;
}
[numthreads(1, 1, 1)]
void compute_main() {
exp2_303753();
return;
}

View File

@ -0,0 +1,49 @@
#version 310 es
void exp2_303753() {
vec3 res = vec3(2.0f);
}
vec4 vertex_main() {
exp2_303753();
return vec4(0.0f);
}
void main() {
gl_PointSize = 1.0;
vec4 inner_result = vertex_main();
gl_Position = inner_result;
gl_Position.y = -(gl_Position.y);
gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
return;
}
#version 310 es
precision mediump float;
void exp2_303753() {
vec3 res = vec3(2.0f);
}
void fragment_main() {
exp2_303753();
}
void main() {
fragment_main();
return;
}
#version 310 es
void exp2_303753() {
vec3 res = vec3(2.0f);
}
void compute_main() {
exp2_303753();
}
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
void main() {
compute_main();
return;
}

View File

@ -0,0 +1,33 @@
#include <metal_stdlib>
using namespace metal;
void exp2_303753() {
float3 res = float3(2.0f);
}
struct tint_symbol {
float4 value [[position]];
};
float4 vertex_main_inner() {
exp2_303753();
return float4(0.0f);
}
vertex tint_symbol vertex_main() {
float4 const inner_result = vertex_main_inner();
tint_symbol wrapper_result = {};
wrapper_result.value = inner_result;
return wrapper_result;
}
fragment void fragment_main() {
exp2_303753();
return;
}
kernel void compute_main() {
exp2_303753();
return;
}

View File

@ -0,0 +1,67 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
; Bound: 33
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %value "value"
OpName %vertex_point_size "vertex_point_size"
OpName %exp2_303753 "exp2_303753"
OpName %res "res"
OpName %vertex_main_inner "vertex_main_inner"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %value BuiltIn Position
OpDecorate %vertex_point_size BuiltIn PointSize
%float = OpTypeFloat 32
%v4float = OpTypeVector %float 4
%_ptr_Output_v4float = OpTypePointer Output %v4float
%5 = OpConstantNull %v4float
%value = OpVariable %_ptr_Output_v4float Output %5
%_ptr_Output_float = OpTypePointer Output %float
%8 = OpConstantNull %float
%vertex_point_size = OpVariable %_ptr_Output_float Output %8
%void = OpTypeVoid
%9 = OpTypeFunction %void
%v3float = OpTypeVector %float 3
%float_2 = OpConstant %float 2
%15 = OpConstantComposite %v3float %float_2 %float_2 %float_2
%_ptr_Function_v3float = OpTypePointer Function %v3float
%18 = OpConstantNull %v3float
%19 = OpTypeFunction %v4float
%float_1 = OpConstant %float 1
%exp2_303753 = OpFunction %void None %9
%12 = OpLabel
%res = OpVariable %_ptr_Function_v3float Function %18
OpStore %res %15
OpReturn
OpFunctionEnd
%vertex_main_inner = OpFunction %v4float None %19
%21 = OpLabel
%22 = OpFunctionCall %void %exp2_303753
OpReturnValue %5
OpFunctionEnd
%vertex_main = OpFunction %void None %9
%24 = OpLabel
%25 = OpFunctionCall %v4float %vertex_main_inner
OpStore %value %25
OpStore %vertex_point_size %float_1
OpReturn
OpFunctionEnd
%fragment_main = OpFunction %void None %9
%28 = OpLabel
%29 = OpFunctionCall %void %exp2_303753
OpReturn
OpFunctionEnd
%compute_main = OpFunction %void None %9
%31 = OpLabel
%32 = OpFunctionCall %void %exp2_303753
OpReturn
OpFunctionEnd

View File

@ -0,0 +1,19 @@
fn exp2_303753() {
var res = exp2(vec3(1.0));
}
@vertex
fn vertex_main() -> @builtin(position) vec4<f32> {
exp2_303753();
return vec4<f32>();
}
@fragment
fn fragment_main() {
exp2_303753();
}
@compute @workgroup_size(1)
fn compute_main() {
exp2_303753();
}

View File

@ -1,5 +1,5 @@
void exp2_751377() {
vector<float16_t, 3> res = exp2((float16_t(1.0h)).xxx);
vector<float16_t, 3> res = (float16_t(2.0h)).xxx;
}
struct tint_symbol {

View File

@ -2,7 +2,7 @@
#extension GL_AMD_gpu_shader_half_float : require
void exp2_751377() {
f16vec3 res = exp2(f16vec3(1.0hf));
f16vec3 res = f16vec3(2.0hf);
}
vec4 vertex_main() {
@ -23,7 +23,7 @@ void main() {
precision mediump float;
void exp2_751377() {
f16vec3 res = exp2(f16vec3(1.0hf));
f16vec3 res = f16vec3(2.0hf);
}
void fragment_main() {
@ -38,7 +38,7 @@ void main() {
#extension GL_AMD_gpu_shader_half_float : require
void exp2_751377() {
f16vec3 res = exp2(f16vec3(1.0hf));
f16vec3 res = f16vec3(2.0hf);
}
void compute_main() {

View File

@ -2,7 +2,7 @@
using namespace metal;
void exp2_751377() {
half3 res = exp2(half3(1.0h));
half3 res = half3(2.0h);
}
struct tint_symbol {

View File

@ -1,14 +1,13 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
; Bound: 36
; Bound: 34
; Schema: 0
OpCapability Shader
OpCapability Float16
OpCapability UniformAndStorageBuffer16BitAccess
OpCapability StorageBuffer16BitAccess
OpCapability StorageInputOutput16
%16 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
OpEntryPoint Fragment %fragment_main "fragment_main"
@ -37,38 +36,37 @@
%9 = OpTypeFunction %void
%half = OpTypeFloat 16
%v3half = OpTypeVector %half 3
%half_0x1p_0 = OpConstant %half 0x1p+0
%18 = OpConstantComposite %v3half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
%half_0x1p_1 = OpConstant %half 0x1p+1
%16 = OpConstantComposite %v3half %half_0x1p_1 %half_0x1p_1 %half_0x1p_1
%_ptr_Function_v3half = OpTypePointer Function %v3half
%21 = OpConstantNull %v3half
%22 = OpTypeFunction %v4float
%19 = OpConstantNull %v3half
%20 = OpTypeFunction %v4float
%float_1 = OpConstant %float 1
%exp2_751377 = OpFunction %void None %9
%12 = OpLabel
%res = OpVariable %_ptr_Function_v3half Function %21
%13 = OpExtInst %v3half %16 Exp2 %18
OpStore %res %13
%res = OpVariable %_ptr_Function_v3half Function %19
OpStore %res %16
OpReturn
OpFunctionEnd
%vertex_main_inner = OpFunction %v4float None %22
%24 = OpLabel
%25 = OpFunctionCall %void %exp2_751377
%vertex_main_inner = OpFunction %v4float None %20
%22 = OpLabel
%23 = OpFunctionCall %void %exp2_751377
OpReturnValue %5
OpFunctionEnd
%vertex_main = OpFunction %void None %9
%27 = OpLabel
%28 = OpFunctionCall %v4float %vertex_main_inner
OpStore %value %28
%25 = OpLabel
%26 = OpFunctionCall %v4float %vertex_main_inner
OpStore %value %26
OpStore %vertex_point_size %float_1
OpReturn
OpFunctionEnd
%fragment_main = OpFunction %void None %9
%31 = OpLabel
%32 = OpFunctionCall %void %exp2_751377
%29 = OpLabel
%30 = OpFunctionCall %void %exp2_751377
OpReturn
OpFunctionEnd
%compute_main = OpFunction %void None %9
%34 = OpLabel
%35 = OpFunctionCall %void %exp2_751377
%32 = OpLabel
%33 = OpFunctionCall %void %exp2_751377
OpReturn
OpFunctionEnd

View File

@ -0,0 +1,43 @@
// Copyright 2022 The Tint Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
////////////////////////////////////////////////////////////////////////////////
// File generated by tools/src/cmd/gen
// using the template:
// test/tint/builtins/gen/gen.wgsl.tmpl
//
// Do not modify this file directly
////////////////////////////////////////////////////////////////////////////////
// fn exp2(vec<4, fa>) -> vec<4, fa>
fn exp2_8bd72d() {
var res = exp2(vec4(1.));
}
@vertex
fn vertex_main() -> @builtin(position) vec4<f32> {
exp2_8bd72d();
return vec4<f32>();
}
@fragment
fn fragment_main() {
exp2_8bd72d();
}
@compute @workgroup_size(1)
fn compute_main() {
exp2_8bd72d();
}

View File

@ -0,0 +1,30 @@
void exp2_8bd72d() {
float4 res = (2.0f).xxxx;
}
struct tint_symbol {
float4 value : SV_Position;
};
float4 vertex_main_inner() {
exp2_8bd72d();
return (0.0f).xxxx;
}
tint_symbol vertex_main() {
const float4 inner_result = vertex_main_inner();
tint_symbol wrapper_result = (tint_symbol)0;
wrapper_result.value = inner_result;
return wrapper_result;
}
void fragment_main() {
exp2_8bd72d();
return;
}
[numthreads(1, 1, 1)]
void compute_main() {
exp2_8bd72d();
return;
}

View File

@ -0,0 +1,30 @@
void exp2_8bd72d() {
float4 res = (2.0f).xxxx;
}
struct tint_symbol {
float4 value : SV_Position;
};
float4 vertex_main_inner() {
exp2_8bd72d();
return (0.0f).xxxx;
}
tint_symbol vertex_main() {
const float4 inner_result = vertex_main_inner();
tint_symbol wrapper_result = (tint_symbol)0;
wrapper_result.value = inner_result;
return wrapper_result;
}
void fragment_main() {
exp2_8bd72d();
return;
}
[numthreads(1, 1, 1)]
void compute_main() {
exp2_8bd72d();
return;
}

Some files were not shown because too many files have changed in this diff Show More