Implement const-eval for `acosh`
This CL adds const-eval for the `acosh` test case. The generation of `f16` values into test files is also fixed because `acosh` requires the value to be `>= 1.0` Bug: tint:1581 Change-Id: Iba2ca4d9d114034845475679346f042c8c66e571 Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/109341 Reviewed-by: Ben Clayton <bclayton@google.com> Kokoro: Kokoro <noreply+kokoro@google.com> Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
This commit is contained in:
parent
da92e5cc84
commit
e2fd5e09c6
|
@ -408,8 +408,8 @@ match storage
|
|||
@const fn abs<N: num, T: fia_fiu32_f16>(vec<N, T>) -> vec<N, T>
|
||||
@const fn acos<T: fa_f32_f16>(@test_value(0.96891242171) T) -> T
|
||||
@const fn acos<N: num, T: fa_f32_f16>(@test_value(0.96891242171) vec<N, T>) -> vec<N, T>
|
||||
fn acosh<T: f32_f16>(T) -> T
|
||||
fn acosh<N: num, T: f32_f16>(vec<N, T>) -> vec<N, T>
|
||||
@const fn acosh<T: fa_f32_f16>(@test_value(2.0) T) -> T
|
||||
@const fn acosh<N: num, T: fa_f32_f16>(@test_value(2.0) vec<N, T>) -> vec<N, T>
|
||||
@const fn all(bool) -> bool
|
||||
@const fn all<N: num>(vec<N, bool>) -> bool
|
||||
@const fn any(bool) -> bool
|
||||
|
|
|
@ -276,7 +276,12 @@ TEST_P(ResolverBuiltinTest_FloatBuiltin_IdenticalType, Error_NoParams) {
|
|||
TEST_P(ResolverBuiltinTest_FloatBuiltin_IdenticalType, OneParam_Scalar_f32) {
|
||||
auto param = GetParam();
|
||||
|
||||
auto* call = Call(param.name, 0.5_f);
|
||||
auto val = 0.5_f;
|
||||
if (param.name == std::string("acosh")) {
|
||||
val = 1.0_f;
|
||||
}
|
||||
|
||||
auto* call = Call(param.name, val);
|
||||
WrapInFunction(call);
|
||||
|
||||
if (param.args_number == 1u) {
|
||||
|
@ -297,7 +302,10 @@ TEST_P(ResolverBuiltinTest_FloatBuiltin_IdenticalType, OneParam_Scalar_f32) {
|
|||
TEST_P(ResolverBuiltinTest_FloatBuiltin_IdenticalType, OneParam_Vector_f32) {
|
||||
auto param = GetParam();
|
||||
|
||||
auto* call = Call(param.name, vec3<f32>(0.5_f, 0.5_f, 0.8_f));
|
||||
auto val = param.name == std::string("acosh") ? vec3<f32>(1.0_f, 2.0_f, 3.0_f)
|
||||
: vec3<f32>(0.5_f, 0.5_f, 0.8_f);
|
||||
|
||||
auto* call = Call(param.name, val);
|
||||
WrapInFunction(call);
|
||||
|
||||
if (param.args_number == 1u) {
|
||||
|
@ -462,7 +470,12 @@ TEST_P(ResolverBuiltinTest_FloatBuiltin_IdenticalType, OneParam_Scalar_f16) {
|
|||
|
||||
Enable(ast::Extension::kF16);
|
||||
|
||||
auto* call = Call(param.name, 0.5_h);
|
||||
auto val = 0.5_h;
|
||||
if (param.name == std::string("acosh")) {
|
||||
val = 1.0_h;
|
||||
}
|
||||
|
||||
auto* call = Call(param.name, val);
|
||||
WrapInFunction(call);
|
||||
|
||||
if (param.args_number == 1u) {
|
||||
|
@ -485,7 +498,10 @@ TEST_P(ResolverBuiltinTest_FloatBuiltin_IdenticalType, OneParam_Vector_f16) {
|
|||
|
||||
Enable(ast::Extension::kF16);
|
||||
|
||||
auto* call = Call(param.name, vec3<f16>(0.5_h, 0.5_h, 0.8_h));
|
||||
auto val = param.name == std::string("acosh") ? vec3<f16>(1.0_h, 2.0_h, 3.0_h)
|
||||
: vec3<f16>(0.5_h, 0.5_h, 0.8_h);
|
||||
|
||||
auto* call = Call(param.name, val);
|
||||
WrapInFunction(call);
|
||||
|
||||
if (param.args_number == 1u) {
|
||||
|
|
|
@ -1674,6 +1674,24 @@ ConstEval::Result ConstEval::acos(const sem::Type* ty,
|
|||
return TransformElements(builder, ty, transform, args[0]);
|
||||
}
|
||||
|
||||
ConstEval::Result ConstEval::acosh(const sem::Type* ty,
|
||||
utils::VectorRef<const sem::Constant*> args,
|
||||
const Source& source) {
|
||||
auto transform = [&](const sem::Constant* c0) {
|
||||
auto create = [&](auto i) -> ImplResult {
|
||||
using NumberT = decltype(i);
|
||||
if (i < NumberT(1.0)) {
|
||||
AddError("acosh must be called with a value >= 1.0", source);
|
||||
return utils::Failure;
|
||||
}
|
||||
return CreateElement(builder, c0->Type(), NumberT(std::acosh(i.value)));
|
||||
};
|
||||
return Dispatch_fa_f32_f16(create, c0);
|
||||
};
|
||||
|
||||
return TransformElements(builder, ty, transform, args[0]);
|
||||
}
|
||||
|
||||
ConstEval::Result ConstEval::all(const sem::Type* ty,
|
||||
utils::VectorRef<const sem::Constant*> args,
|
||||
const Source&) {
|
||||
|
|
|
@ -386,15 +386,6 @@ class ConstEval {
|
|||
utils::VectorRef<const sem::Constant*> args,
|
||||
const Source& source);
|
||||
|
||||
/// all builtin
|
||||
/// @param ty the expression type
|
||||
/// @param args the input arguments
|
||||
/// @param source the source location of the conversion
|
||||
/// @return the result value, or null if the value cannot be calculated
|
||||
Result all(const sem::Type* ty,
|
||||
utils::VectorRef<const sem::Constant*> args,
|
||||
const Source& source);
|
||||
|
||||
/// acos builtin
|
||||
/// @param ty the expression type
|
||||
/// @param args the input arguments
|
||||
|
@ -404,6 +395,24 @@ class ConstEval {
|
|||
utils::VectorRef<const sem::Constant*> args,
|
||||
const Source& source);
|
||||
|
||||
/// acosh builtin
|
||||
/// @param ty the expression type
|
||||
/// @param args the input arguments
|
||||
/// @param source the source location of the conversion
|
||||
/// @return the result value, or null if the value cannot be calculated
|
||||
Result acosh(const sem::Type* ty,
|
||||
utils::VectorRef<const sem::Constant*> args,
|
||||
const Source& source);
|
||||
|
||||
/// all builtin
|
||||
/// @param ty the expression type
|
||||
/// @param args the input arguments
|
||||
/// @param source the source location of the conversion
|
||||
/// @return the result value, or null if the value cannot be calculated
|
||||
Result all(const sem::Type* ty,
|
||||
utils::VectorRef<const sem::Constant*> args,
|
||||
const Source& source);
|
||||
|
||||
/// any builtin
|
||||
/// @param ty the expression type
|
||||
/// @param args the input arguments
|
||||
|
|
|
@ -506,6 +506,33 @@ INSTANTIATE_TEST_SUITE_P( //
|
|||
AcosCases<f32, false>(),
|
||||
AcosCases<f16, false>()))));
|
||||
|
||||
template <typename T, bool finite_only>
|
||||
std::vector<Case> AcoshCases() {
|
||||
std::vector<Case> cases = {
|
||||
C({T(1.0)}, T(0.0)),
|
||||
C({T(11.5919532755)}, kPi<T>).FloatComp(),
|
||||
|
||||
// Vector tests
|
||||
C({Vec(T(1.0), T(11.5919532755))}, Vec(T(0), kPi<T>)).FloatComp(),
|
||||
};
|
||||
|
||||
ConcatIntoIf<finite_only>( //
|
||||
cases, std::vector<Case>{
|
||||
E({T::Smallest()}, "12:34 error: acosh must be called with a value >= 1.0"),
|
||||
E({-1.1_a}, "12:34 error: acosh must be called with a value >= 1.0"),
|
||||
E({0_a}, "12:34 error: acosh must be called with a value >= 1.0"),
|
||||
});
|
||||
|
||||
return cases;
|
||||
}
|
||||
INSTANTIATE_TEST_SUITE_P( //
|
||||
Acosh,
|
||||
ResolverConstEvalBuiltinTest,
|
||||
testing::Combine(testing::Values(sem::BuiltinType::kAcosh),
|
||||
testing::ValuesIn(Concat(AcoshCases<AFloat, true>(), //
|
||||
AcoshCases<f32, false>(),
|
||||
AcoshCases<f16, false>()))));
|
||||
|
||||
template <typename T, bool finite_only>
|
||||
std::vector<Case> AsinCases() {
|
||||
std::vector<Case> cases = {
|
||||
|
|
|
@ -12153,24 +12153,24 @@ constexpr OverloadInfo kOverloads[] = {
|
|||
/* num parameters */ 1,
|
||||
/* num template types */ 1,
|
||||
/* num template numbers */ 0,
|
||||
/* template types */ &kTemplateTypes[25],
|
||||
/* template types */ &kTemplateTypes[24],
|
||||
/* template numbers */ &kTemplateNumbers[10],
|
||||
/* parameters */ &kParameters[958],
|
||||
/* return matcher indices */ &kMatcherIndices[1],
|
||||
/* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline),
|
||||
/* const eval */ nullptr,
|
||||
/* const eval */ &ConstEval::acosh,
|
||||
},
|
||||
{
|
||||
/* [319] */
|
||||
/* num parameters */ 1,
|
||||
/* num template types */ 1,
|
||||
/* num template numbers */ 1,
|
||||
/* template types */ &kTemplateTypes[25],
|
||||
/* template types */ &kTemplateTypes[24],
|
||||
/* template numbers */ &kTemplateNumbers[5],
|
||||
/* parameters */ &kParameters[996],
|
||||
/* return matcher indices */ &kMatcherIndices[30],
|
||||
/* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline),
|
||||
/* const eval */ nullptr,
|
||||
/* const eval */ &ConstEval::acosh,
|
||||
},
|
||||
{
|
||||
/* [320] */
|
||||
|
@ -14027,8 +14027,8 @@ constexpr IntrinsicInfo kBuiltins[] = {
|
|||
},
|
||||
{
|
||||
/* [2] */
|
||||
/* fn acosh<T : f32_f16>(T) -> T */
|
||||
/* fn acosh<N : num, T : f32_f16>(vec<N, T>) -> vec<N, T> */
|
||||
/* fn acosh<T : fa_f32_f16>(@test_value(2) T) -> T */
|
||||
/* fn acosh<N : num, T : fa_f32_f16>(@test_value(2) vec<N, T>) -> vec<N, T> */
|
||||
/* num overloads */ 2,
|
||||
/* overloads */ &kOverloads[318],
|
||||
},
|
||||
|
|
|
@ -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 acosh(vec<2, fa>) -> vec<2, fa>
|
||||
fn acosh_17260e() {
|
||||
var res = acosh(vec2(2.));
|
||||
}
|
||||
|
||||
@vertex
|
||||
fn vertex_main() -> @builtin(position) vec4<f32> {
|
||||
acosh_17260e();
|
||||
return vec4<f32>();
|
||||
}
|
||||
|
||||
@fragment
|
||||
fn fragment_main() {
|
||||
acosh_17260e();
|
||||
}
|
||||
|
||||
@compute @workgroup_size(1)
|
||||
fn compute_main() {
|
||||
acosh_17260e();
|
||||
}
|
|
@ -0,0 +1,30 @@
|
|||
void acosh_17260e() {
|
||||
float2 res = (1.316957951f).xx;
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
float4 value : SV_Position;
|
||||
};
|
||||
|
||||
float4 vertex_main_inner() {
|
||||
acosh_17260e();
|
||||
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() {
|
||||
acosh_17260e();
|
||||
return;
|
||||
}
|
||||
|
||||
[numthreads(1, 1, 1)]
|
||||
void compute_main() {
|
||||
acosh_17260e();
|
||||
return;
|
||||
}
|
|
@ -0,0 +1,30 @@
|
|||
void acosh_17260e() {
|
||||
float2 res = (1.316957951f).xx;
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
float4 value : SV_Position;
|
||||
};
|
||||
|
||||
float4 vertex_main_inner() {
|
||||
acosh_17260e();
|
||||
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() {
|
||||
acosh_17260e();
|
||||
return;
|
||||
}
|
||||
|
||||
[numthreads(1, 1, 1)]
|
||||
void compute_main() {
|
||||
acosh_17260e();
|
||||
return;
|
||||
}
|
|
@ -0,0 +1,49 @@
|
|||
#version 310 es
|
||||
|
||||
void acosh_17260e() {
|
||||
vec2 res = vec2(1.316957951f);
|
||||
}
|
||||
|
||||
vec4 vertex_main() {
|
||||
acosh_17260e();
|
||||
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 acosh_17260e() {
|
||||
vec2 res = vec2(1.316957951f);
|
||||
}
|
||||
|
||||
void fragment_main() {
|
||||
acosh_17260e();
|
||||
}
|
||||
|
||||
void main() {
|
||||
fragment_main();
|
||||
return;
|
||||
}
|
||||
#version 310 es
|
||||
|
||||
void acosh_17260e() {
|
||||
vec2 res = vec2(1.316957951f);
|
||||
}
|
||||
|
||||
void compute_main() {
|
||||
acosh_17260e();
|
||||
}
|
||||
|
||||
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||
void main() {
|
||||
compute_main();
|
||||
return;
|
||||
}
|
|
@ -0,0 +1,33 @@
|
|||
#include <metal_stdlib>
|
||||
|
||||
using namespace metal;
|
||||
void acosh_17260e() {
|
||||
float2 res = float2(1.316957951f);
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
float4 value [[position]];
|
||||
};
|
||||
|
||||
float4 vertex_main_inner() {
|
||||
acosh_17260e();
|
||||
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() {
|
||||
acosh_17260e();
|
||||
return;
|
||||
}
|
||||
|
||||
kernel void compute_main() {
|
||||
acosh_17260e();
|
||||
return;
|
||||
}
|
||||
|
|
@ -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 %acosh_17260e "acosh_17260e"
|
||||
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_1_31695795 = OpConstant %float 1.31695795
|
||||
%15 = OpConstantComposite %v2float %float_1_31695795 %float_1_31695795
|
||||
%_ptr_Function_v2float = OpTypePointer Function %v2float
|
||||
%18 = OpConstantNull %v2float
|
||||
%19 = OpTypeFunction %v4float
|
||||
%float_1 = OpConstant %float 1
|
||||
%acosh_17260e = 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 %acosh_17260e
|
||||
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 %acosh_17260e
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%compute_main = OpFunction %void None %9
|
||||
%31 = OpLabel
|
||||
%32 = OpFunctionCall %void %acosh_17260e
|
||||
OpReturn
|
||||
OpFunctionEnd
|
|
@ -0,0 +1,19 @@
|
|||
fn acosh_17260e() {
|
||||
var res = acosh(vec2(2.0));
|
||||
}
|
||||
|
||||
@vertex
|
||||
fn vertex_main() -> @builtin(position) vec4<f32> {
|
||||
acosh_17260e();
|
||||
return vec4<f32>();
|
||||
}
|
||||
|
||||
@fragment
|
||||
fn fragment_main() {
|
||||
acosh_17260e();
|
||||
}
|
||||
|
||||
@compute @workgroup_size(1)
|
||||
fn compute_main() {
|
||||
acosh_17260e();
|
||||
}
|
|
@ -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 acosh(fa) -> fa
|
||||
fn acosh_3433e8() {
|
||||
var res = acosh(2.);
|
||||
}
|
||||
|
||||
@vertex
|
||||
fn vertex_main() -> @builtin(position) vec4<f32> {
|
||||
acosh_3433e8();
|
||||
return vec4<f32>();
|
||||
}
|
||||
|
||||
@fragment
|
||||
fn fragment_main() {
|
||||
acosh_3433e8();
|
||||
}
|
||||
|
||||
@compute @workgroup_size(1)
|
||||
fn compute_main() {
|
||||
acosh_3433e8();
|
||||
}
|
|
@ -0,0 +1,30 @@
|
|||
void acosh_3433e8() {
|
||||
float res = 1.316957951f;
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
float4 value : SV_Position;
|
||||
};
|
||||
|
||||
float4 vertex_main_inner() {
|
||||
acosh_3433e8();
|
||||
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() {
|
||||
acosh_3433e8();
|
||||
return;
|
||||
}
|
||||
|
||||
[numthreads(1, 1, 1)]
|
||||
void compute_main() {
|
||||
acosh_3433e8();
|
||||
return;
|
||||
}
|
|
@ -0,0 +1,30 @@
|
|||
void acosh_3433e8() {
|
||||
float res = 1.316957951f;
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
float4 value : SV_Position;
|
||||
};
|
||||
|
||||
float4 vertex_main_inner() {
|
||||
acosh_3433e8();
|
||||
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() {
|
||||
acosh_3433e8();
|
||||
return;
|
||||
}
|
||||
|
||||
[numthreads(1, 1, 1)]
|
||||
void compute_main() {
|
||||
acosh_3433e8();
|
||||
return;
|
||||
}
|
|
@ -0,0 +1,49 @@
|
|||
#version 310 es
|
||||
|
||||
void acosh_3433e8() {
|
||||
float res = 1.316957951f;
|
||||
}
|
||||
|
||||
vec4 vertex_main() {
|
||||
acosh_3433e8();
|
||||
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 acosh_3433e8() {
|
||||
float res = 1.316957951f;
|
||||
}
|
||||
|
||||
void fragment_main() {
|
||||
acosh_3433e8();
|
||||
}
|
||||
|
||||
void main() {
|
||||
fragment_main();
|
||||
return;
|
||||
}
|
||||
#version 310 es
|
||||
|
||||
void acosh_3433e8() {
|
||||
float res = 1.316957951f;
|
||||
}
|
||||
|
||||
void compute_main() {
|
||||
acosh_3433e8();
|
||||
}
|
||||
|
||||
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||
void main() {
|
||||
compute_main();
|
||||
return;
|
||||
}
|
|
@ -0,0 +1,33 @@
|
|||
#include <metal_stdlib>
|
||||
|
||||
using namespace metal;
|
||||
void acosh_3433e8() {
|
||||
float res = 1.316957951f;
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
float4 value [[position]];
|
||||
};
|
||||
|
||||
float4 vertex_main_inner() {
|
||||
acosh_3433e8();
|
||||
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() {
|
||||
acosh_3433e8();
|
||||
return;
|
||||
}
|
||||
|
||||
kernel void compute_main() {
|
||||
acosh_3433e8();
|
||||
return;
|
||||
}
|
||||
|
|
@ -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 %acosh_3433e8 "acosh_3433e8"
|
||||
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_1_31695795 = OpConstant %float 1.31695795
|
||||
%_ptr_Function_float = OpTypePointer Function %float
|
||||
%16 = OpTypeFunction %v4float
|
||||
%float_1 = OpConstant %float 1
|
||||
%acosh_3433e8 = OpFunction %void None %9
|
||||
%12 = OpLabel
|
||||
%res = OpVariable %_ptr_Function_float Function %8
|
||||
OpStore %res %float_1_31695795
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%vertex_main_inner = OpFunction %v4float None %16
|
||||
%18 = OpLabel
|
||||
%19 = OpFunctionCall %void %acosh_3433e8
|
||||
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 %acosh_3433e8
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%compute_main = OpFunction %void None %9
|
||||
%28 = OpLabel
|
||||
%29 = OpFunctionCall %void %acosh_3433e8
|
||||
OpReturn
|
||||
OpFunctionEnd
|
|
@ -0,0 +1,19 @@
|
|||
fn acosh_3433e8() {
|
||||
var res = acosh(2.0);
|
||||
}
|
||||
|
||||
@vertex
|
||||
fn vertex_main() -> @builtin(position) vec4<f32> {
|
||||
acosh_3433e8();
|
||||
return vec4<f32>();
|
||||
}
|
||||
|
||||
@fragment
|
||||
fn fragment_main() {
|
||||
acosh_3433e8();
|
||||
}
|
||||
|
||||
@compute @workgroup_size(1)
|
||||
fn compute_main() {
|
||||
acosh_3433e8();
|
||||
}
|
|
@ -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 acosh(vec<4, fa>) -> vec<4, fa>
|
||||
fn acosh_490aae() {
|
||||
var res = acosh(vec4(2.));
|
||||
}
|
||||
|
||||
@vertex
|
||||
fn vertex_main() -> @builtin(position) vec4<f32> {
|
||||
acosh_490aae();
|
||||
return vec4<f32>();
|
||||
}
|
||||
|
||||
@fragment
|
||||
fn fragment_main() {
|
||||
acosh_490aae();
|
||||
}
|
||||
|
||||
@compute @workgroup_size(1)
|
||||
fn compute_main() {
|
||||
acosh_490aae();
|
||||
}
|
|
@ -0,0 +1,30 @@
|
|||
void acosh_490aae() {
|
||||
float4 res = (1.316957951f).xxxx;
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
float4 value : SV_Position;
|
||||
};
|
||||
|
||||
float4 vertex_main_inner() {
|
||||
acosh_490aae();
|
||||
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() {
|
||||
acosh_490aae();
|
||||
return;
|
||||
}
|
||||
|
||||
[numthreads(1, 1, 1)]
|
||||
void compute_main() {
|
||||
acosh_490aae();
|
||||
return;
|
||||
}
|
|
@ -0,0 +1,30 @@
|
|||
void acosh_490aae() {
|
||||
float4 res = (1.316957951f).xxxx;
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
float4 value : SV_Position;
|
||||
};
|
||||
|
||||
float4 vertex_main_inner() {
|
||||
acosh_490aae();
|
||||
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() {
|
||||
acosh_490aae();
|
||||
return;
|
||||
}
|
||||
|
||||
[numthreads(1, 1, 1)]
|
||||
void compute_main() {
|
||||
acosh_490aae();
|
||||
return;
|
||||
}
|
|
@ -0,0 +1,49 @@
|
|||
#version 310 es
|
||||
|
||||
void acosh_490aae() {
|
||||
vec4 res = vec4(1.316957951f);
|
||||
}
|
||||
|
||||
vec4 vertex_main() {
|
||||
acosh_490aae();
|
||||
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 acosh_490aae() {
|
||||
vec4 res = vec4(1.316957951f);
|
||||
}
|
||||
|
||||
void fragment_main() {
|
||||
acosh_490aae();
|
||||
}
|
||||
|
||||
void main() {
|
||||
fragment_main();
|
||||
return;
|
||||
}
|
||||
#version 310 es
|
||||
|
||||
void acosh_490aae() {
|
||||
vec4 res = vec4(1.316957951f);
|
||||
}
|
||||
|
||||
void compute_main() {
|
||||
acosh_490aae();
|
||||
}
|
||||
|
||||
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||
void main() {
|
||||
compute_main();
|
||||
return;
|
||||
}
|
|
@ -0,0 +1,33 @@
|
|||
#include <metal_stdlib>
|
||||
|
||||
using namespace metal;
|
||||
void acosh_490aae() {
|
||||
float4 res = float4(1.316957951f);
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
float4 value [[position]];
|
||||
};
|
||||
|
||||
float4 vertex_main_inner() {
|
||||
acosh_490aae();
|
||||
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() {
|
||||
acosh_490aae();
|
||||
return;
|
||||
}
|
||||
|
||||
kernel void compute_main() {
|
||||
acosh_490aae();
|
||||
return;
|
||||
}
|
||||
|
|
@ -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 %acosh_490aae "acosh_490aae"
|
||||
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_1_31695795 = OpConstant %float 1.31695795
|
||||
%14 = OpConstantComposite %v4float %float_1_31695795 %float_1_31695795 %float_1_31695795 %float_1_31695795
|
||||
%_ptr_Function_v4float = OpTypePointer Function %v4float
|
||||
%17 = OpTypeFunction %v4float
|
||||
%float_1 = OpConstant %float 1
|
||||
%acosh_490aae = 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 %acosh_490aae
|
||||
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 %acosh_490aae
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%compute_main = OpFunction %void None %9
|
||||
%29 = OpLabel
|
||||
%30 = OpFunctionCall %void %acosh_490aae
|
||||
OpReturn
|
||||
OpFunctionEnd
|
|
@ -0,0 +1,19 @@
|
|||
fn acosh_490aae() {
|
||||
var res = acosh(vec4(2.0));
|
||||
}
|
||||
|
||||
@vertex
|
||||
fn vertex_main() -> @builtin(position) vec4<f32> {
|
||||
acosh_490aae();
|
||||
return vec4<f32>();
|
||||
}
|
||||
|
||||
@fragment
|
||||
fn fragment_main() {
|
||||
acosh_490aae();
|
||||
}
|
||||
|
||||
@compute @workgroup_size(1)
|
||||
fn compute_main() {
|
||||
acosh_490aae();
|
||||
}
|
|
@ -25,7 +25,7 @@ enable f16;
|
|||
|
||||
// fn acosh(vec<2, f16>) -> vec<2, f16>
|
||||
fn acosh_5f49d8() {
|
||||
var res: vec2<f16> = acosh(vec2<f16>(1.h));
|
||||
var res: vec2<f16> = acosh(vec2<f16>(2.h));
|
||||
}
|
||||
|
||||
@vertex
|
||||
|
|
|
@ -1,9 +1,5 @@
|
|||
vector<float16_t, 2> tint_acosh(vector<float16_t, 2> x) {
|
||||
return log((x + sqrt(((x * x) - float16_t(1.0h)))));
|
||||
}
|
||||
|
||||
void acosh_5f49d8() {
|
||||
vector<float16_t, 2> res = tint_acosh((float16_t(1.0h)).xx);
|
||||
vector<float16_t, 2> res = (float16_t(1.31640625h)).xx;
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
|
|
|
@ -1,11 +1,7 @@
|
|||
SKIP: FAILED
|
||||
|
||||
vector<float16_t, 2> tint_acosh(vector<float16_t, 2> x) {
|
||||
return log((x + sqrt(((x * x) - float16_t(1.0h)))));
|
||||
}
|
||||
|
||||
void acosh_5f49d8() {
|
||||
vector<float16_t, 2> res = tint_acosh((float16_t(0.0h)).xx);
|
||||
vector<float16_t, 2> res = (float16_t(1.31640625h)).xx;
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
|
|
|
@ -1,12 +1,8 @@
|
|||
#version 310 es
|
||||
#extension GL_AMD_gpu_shader_half_float : require
|
||||
|
||||
f16vec2 tint_acosh(f16vec2 x) {
|
||||
return mix(acosh(x), f16vec2(0.0hf), lessThan(x, f16vec2(1.0hf)));
|
||||
}
|
||||
|
||||
void acosh_5f49d8() {
|
||||
f16vec2 res = tint_acosh(f16vec2(1.0hf));
|
||||
f16vec2 res = f16vec2(1.31640625hf);
|
||||
}
|
||||
|
||||
vec4 vertex_main() {
|
||||
|
@ -26,12 +22,8 @@ void main() {
|
|||
#extension GL_AMD_gpu_shader_half_float : require
|
||||
precision mediump float;
|
||||
|
||||
f16vec2 tint_acosh(f16vec2 x) {
|
||||
return mix(acosh(x), f16vec2(0.0hf), lessThan(x, f16vec2(1.0hf)));
|
||||
}
|
||||
|
||||
void acosh_5f49d8() {
|
||||
f16vec2 res = tint_acosh(f16vec2(1.0hf));
|
||||
f16vec2 res = f16vec2(1.31640625hf);
|
||||
}
|
||||
|
||||
void fragment_main() {
|
||||
|
@ -45,12 +37,8 @@ void main() {
|
|||
#version 310 es
|
||||
#extension GL_AMD_gpu_shader_half_float : require
|
||||
|
||||
f16vec2 tint_acosh(f16vec2 x) {
|
||||
return mix(acosh(x), f16vec2(0.0hf), lessThan(x, f16vec2(1.0hf)));
|
||||
}
|
||||
|
||||
void acosh_5f49d8() {
|
||||
f16vec2 res = tint_acosh(f16vec2(1.0hf));
|
||||
f16vec2 res = f16vec2(1.31640625hf);
|
||||
}
|
||||
|
||||
void compute_main() {
|
||||
|
|
|
@ -1,12 +1,8 @@
|
|||
#include <metal_stdlib>
|
||||
|
||||
using namespace metal;
|
||||
half2 tint_acosh(half2 x) {
|
||||
return select(acosh(x), half2(0.0h), (x < half2(1.0h)));
|
||||
}
|
||||
|
||||
void acosh_5f49d8() {
|
||||
half2 res = tint_acosh(half2(1.0h));
|
||||
half2 res = half2(1.31640625h);
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
|
|
|
@ -1,14 +1,13 @@
|
|||
; SPIR-V
|
||||
; Version: 1.3
|
||||
; Generator: Google Tint Compiler; 0
|
||||
; Bound: 45
|
||||
; Bound: 34
|
||||
; Schema: 0
|
||||
OpCapability Shader
|
||||
OpCapability Float16
|
||||
OpCapability UniformAndStorageBuffer16BitAccess
|
||||
OpCapability StorageBuffer16BitAccess
|
||||
OpCapability StorageInputOutput16
|
||||
%23 = OpExtInstImport "GLSL.std.450"
|
||||
OpMemoryModel Logical GLSL450
|
||||
OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
|
||||
OpEntryPoint Fragment %fragment_main "fragment_main"
|
||||
|
@ -17,8 +16,6 @@
|
|||
OpExecutionMode %compute_main LocalSize 1 1 1
|
||||
OpName %value "value"
|
||||
OpName %vertex_point_size "vertex_point_size"
|
||||
OpName %tint_acosh "tint_acosh"
|
||||
OpName %x "x"
|
||||
OpName %acosh_5f49d8 "acosh_5f49d8"
|
||||
OpName %res "res"
|
||||
OpName %vertex_main_inner "vertex_main_inner"
|
||||
|
@ -35,53 +32,41 @@
|
|||
%_ptr_Output_float = OpTypePointer Output %float
|
||||
%8 = OpConstantNull %float
|
||||
%vertex_point_size = OpVariable %_ptr_Output_float Output %8
|
||||
%void = OpTypeVoid
|
||||
%9 = OpTypeFunction %void
|
||||
%half = OpTypeFloat 16
|
||||
%v2half = OpTypeVector %half 2
|
||||
%9 = OpTypeFunction %v2half %v2half
|
||||
%half_0x1p_0 = OpConstant %half 0x1p+0
|
||||
%17 = OpConstantComposite %v2half %half_0x1p_0 %half_0x1p_0
|
||||
%bool = OpTypeBool
|
||||
%v2bool = OpTypeVector %bool 2
|
||||
%21 = OpConstantNull %v2half
|
||||
%void = OpTypeVoid
|
||||
%24 = OpTypeFunction %void
|
||||
%half_0x1_51p_0 = OpConstant %half 0x1.51p+0
|
||||
%16 = OpConstantComposite %v2half %half_0x1_51p_0 %half_0x1_51p_0
|
||||
%_ptr_Function_v2half = OpTypePointer Function %v2half
|
||||
%31 = OpTypeFunction %v4float
|
||||
%19 = OpConstantNull %v2half
|
||||
%20 = OpTypeFunction %v4float
|
||||
%float_1 = OpConstant %float 1
|
||||
%tint_acosh = OpFunction %v2half None %9
|
||||
%x = OpFunctionParameter %v2half
|
||||
%14 = OpLabel
|
||||
%18 = OpFOrdLessThan %v2bool %x %17
|
||||
%22 = OpExtInst %v2half %23 Acosh %x
|
||||
%15 = OpSelect %v2half %18 %21 %22
|
||||
OpReturnValue %15
|
||||
OpFunctionEnd
|
||||
%acosh_5f49d8 = OpFunction %void None %24
|
||||
%27 = OpLabel
|
||||
%res = OpVariable %_ptr_Function_v2half Function %21
|
||||
%28 = OpFunctionCall %v2half %tint_acosh %17
|
||||
OpStore %res %28
|
||||
%acosh_5f49d8 = OpFunction %void None %9
|
||||
%12 = OpLabel
|
||||
%res = OpVariable %_ptr_Function_v2half Function %19
|
||||
OpStore %res %16
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%vertex_main_inner = OpFunction %v4float None %31
|
||||
%33 = OpLabel
|
||||
%34 = OpFunctionCall %void %acosh_5f49d8
|
||||
%vertex_main_inner = OpFunction %v4float None %20
|
||||
%22 = OpLabel
|
||||
%23 = OpFunctionCall %void %acosh_5f49d8
|
||||
OpReturnValue %5
|
||||
OpFunctionEnd
|
||||
%vertex_main = OpFunction %void None %24
|
||||
%36 = OpLabel
|
||||
%37 = OpFunctionCall %v4float %vertex_main_inner
|
||||
OpStore %value %37
|
||||
%vertex_main = OpFunction %void None %9
|
||||
%25 = OpLabel
|
||||
%26 = OpFunctionCall %v4float %vertex_main_inner
|
||||
OpStore %value %26
|
||||
OpStore %vertex_point_size %float_1
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%fragment_main = OpFunction %void None %24
|
||||
%40 = OpLabel
|
||||
%41 = OpFunctionCall %void %acosh_5f49d8
|
||||
%fragment_main = OpFunction %void None %9
|
||||
%29 = OpLabel
|
||||
%30 = OpFunctionCall %void %acosh_5f49d8
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%compute_main = OpFunction %void None %24
|
||||
%43 = OpLabel
|
||||
%44 = OpFunctionCall %void %acosh_5f49d8
|
||||
%compute_main = OpFunction %void None %9
|
||||
%32 = OpLabel
|
||||
%33 = OpFunctionCall %void %acosh_5f49d8
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
enable f16;
|
||||
|
||||
fn acosh_5f49d8() {
|
||||
var res : vec2<f16> = acosh(vec2<f16>(1.0h));
|
||||
var res : vec2<f16> = acosh(vec2<f16>(2.0h));
|
||||
}
|
||||
|
||||
@vertex
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// Copyright 2021 The Tint Authors.
|
||||
// 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.
|
||||
|
@ -23,7 +23,7 @@
|
|||
|
||||
// fn acosh(vec<2, f32>) -> vec<2, f32>
|
||||
fn acosh_640883() {
|
||||
var res: vec2<f32> = acosh(vec2<f32>(1.f));
|
||||
var res: vec2<f32> = acosh(vec2<f32>(2.f));
|
||||
}
|
||||
|
||||
@vertex
|
||||
|
|
|
@ -1,9 +1,5 @@
|
|||
float2 tint_acosh(float2 x) {
|
||||
return log((x + sqrt(((x * x) - 1.0f))));
|
||||
}
|
||||
|
||||
void acosh_640883() {
|
||||
float2 res = tint_acosh((1.0f).xx);
|
||||
float2 res = (1.316957951f).xx;
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
|
|
|
@ -1,9 +1,5 @@
|
|||
float2 tint_acosh(float2 x) {
|
||||
return log((x + sqrt(((x * x) - 1.0f))));
|
||||
}
|
||||
|
||||
void acosh_640883() {
|
||||
float2 res = tint_acosh((1.0f).xx);
|
||||
float2 res = (1.316957951f).xx;
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
|
|
|
@ -1,11 +1,7 @@
|
|||
#version 310 es
|
||||
|
||||
vec2 tint_acosh(vec2 x) {
|
||||
return mix(acosh(x), vec2(0.0f), lessThan(x, vec2(1.0f)));
|
||||
}
|
||||
|
||||
void acosh_640883() {
|
||||
vec2 res = tint_acosh(vec2(1.0f));
|
||||
vec2 res = vec2(1.316957951f);
|
||||
}
|
||||
|
||||
vec4 vertex_main() {
|
||||
|
@ -24,12 +20,8 @@ void main() {
|
|||
#version 310 es
|
||||
precision mediump float;
|
||||
|
||||
vec2 tint_acosh(vec2 x) {
|
||||
return mix(acosh(x), vec2(0.0f), lessThan(x, vec2(1.0f)));
|
||||
}
|
||||
|
||||
void acosh_640883() {
|
||||
vec2 res = tint_acosh(vec2(1.0f));
|
||||
vec2 res = vec2(1.316957951f);
|
||||
}
|
||||
|
||||
void fragment_main() {
|
||||
|
@ -42,12 +34,8 @@ void main() {
|
|||
}
|
||||
#version 310 es
|
||||
|
||||
vec2 tint_acosh(vec2 x) {
|
||||
return mix(acosh(x), vec2(0.0f), lessThan(x, vec2(1.0f)));
|
||||
}
|
||||
|
||||
void acosh_640883() {
|
||||
vec2 res = tint_acosh(vec2(1.0f));
|
||||
vec2 res = vec2(1.316957951f);
|
||||
}
|
||||
|
||||
void compute_main() {
|
||||
|
|
|
@ -1,12 +1,8 @@
|
|||
#include <metal_stdlib>
|
||||
|
||||
using namespace metal;
|
||||
float2 tint_acosh(float2 x) {
|
||||
return select(acosh(x), float2(0.0f), (x < float2(1.0f)));
|
||||
}
|
||||
|
||||
void acosh_640883() {
|
||||
float2 res = tint_acosh(float2(1.0f));
|
||||
float2 res = float2(1.316957951f);
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
|
|
|
@ -1,10 +1,9 @@
|
|||
; SPIR-V
|
||||
; Version: 1.3
|
||||
; Generator: Google Tint Compiler; 0
|
||||
; Bound: 43
|
||||
; Bound: 33
|
||||
; Schema: 0
|
||||
OpCapability Shader
|
||||
%22 = OpExtInstImport "GLSL.std.450"
|
||||
OpMemoryModel Logical GLSL450
|
||||
OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
|
||||
OpEntryPoint Fragment %fragment_main "fragment_main"
|
||||
|
@ -13,8 +12,6 @@
|
|||
OpExecutionMode %compute_main LocalSize 1 1 1
|
||||
OpName %value "value"
|
||||
OpName %vertex_point_size "vertex_point_size"
|
||||
OpName %tint_acosh "tint_acosh"
|
||||
OpName %x "x"
|
||||
OpName %acosh_640883 "acosh_640883"
|
||||
OpName %res "res"
|
||||
OpName %vertex_main_inner "vertex_main_inner"
|
||||
|
@ -31,51 +28,40 @@
|
|||
%_ptr_Output_float = OpTypePointer Output %float
|
||||
%8 = OpConstantNull %float
|
||||
%vertex_point_size = OpVariable %_ptr_Output_float Output %8
|
||||
%v2float = OpTypeVector %float 2
|
||||
%9 = OpTypeFunction %v2float %v2float
|
||||
%float_1 = OpConstant %float 1
|
||||
%16 = OpConstantComposite %v2float %float_1 %float_1
|
||||
%bool = OpTypeBool
|
||||
%v2bool = OpTypeVector %bool 2
|
||||
%20 = OpConstantNull %v2float
|
||||
%void = OpTypeVoid
|
||||
%23 = OpTypeFunction %void
|
||||
%9 = OpTypeFunction %void
|
||||
%v2float = OpTypeVector %float 2
|
||||
%float_1_31695795 = OpConstant %float 1.31695795
|
||||
%15 = OpConstantComposite %v2float %float_1_31695795 %float_1_31695795
|
||||
%_ptr_Function_v2float = OpTypePointer Function %v2float
|
||||
%30 = OpTypeFunction %v4float
|
||||
%tint_acosh = OpFunction %v2float None %9
|
||||
%x = OpFunctionParameter %v2float
|
||||
%13 = OpLabel
|
||||
%17 = OpFOrdLessThan %v2bool %x %16
|
||||
%21 = OpExtInst %v2float %22 Acosh %x
|
||||
%14 = OpSelect %v2float %17 %20 %21
|
||||
OpReturnValue %14
|
||||
OpFunctionEnd
|
||||
%acosh_640883 = OpFunction %void None %23
|
||||
%26 = OpLabel
|
||||
%res = OpVariable %_ptr_Function_v2float Function %20
|
||||
%27 = OpFunctionCall %v2float %tint_acosh %16
|
||||
OpStore %res %27
|
||||
%18 = OpConstantNull %v2float
|
||||
%19 = OpTypeFunction %v4float
|
||||
%float_1 = OpConstant %float 1
|
||||
%acosh_640883 = OpFunction %void None %9
|
||||
%12 = OpLabel
|
||||
%res = OpVariable %_ptr_Function_v2float Function %18
|
||||
OpStore %res %15
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%vertex_main_inner = OpFunction %v4float None %30
|
||||
%32 = OpLabel
|
||||
%33 = OpFunctionCall %void %acosh_640883
|
||||
%vertex_main_inner = OpFunction %v4float None %19
|
||||
%21 = OpLabel
|
||||
%22 = OpFunctionCall %void %acosh_640883
|
||||
OpReturnValue %5
|
||||
OpFunctionEnd
|
||||
%vertex_main = OpFunction %void None %23
|
||||
%35 = OpLabel
|
||||
%36 = OpFunctionCall %v4float %vertex_main_inner
|
||||
OpStore %value %36
|
||||
%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 %23
|
||||
%38 = OpLabel
|
||||
%39 = OpFunctionCall %void %acosh_640883
|
||||
%fragment_main = OpFunction %void None %9
|
||||
%28 = OpLabel
|
||||
%29 = OpFunctionCall %void %acosh_640883
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%compute_main = OpFunction %void None %23
|
||||
%41 = OpLabel
|
||||
%42 = OpFunctionCall %void %acosh_640883
|
||||
%compute_main = OpFunction %void None %9
|
||||
%31 = OpLabel
|
||||
%32 = OpFunctionCall %void %acosh_640883
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
fn acosh_640883() {
|
||||
var res : vec2<f32> = acosh(vec2<f32>(1.0f));
|
||||
var res : vec2<f32> = acosh(vec2<f32>(2.0f));
|
||||
}
|
||||
|
||||
@vertex
|
||||
|
|
|
@ -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 acosh(vec<3, fa>) -> vec<3, fa>
|
||||
fn acosh_9f213e() {
|
||||
var res = acosh(vec3(2.));
|
||||
}
|
||||
|
||||
@vertex
|
||||
fn vertex_main() -> @builtin(position) vec4<f32> {
|
||||
acosh_9f213e();
|
||||
return vec4<f32>();
|
||||
}
|
||||
|
||||
@fragment
|
||||
fn fragment_main() {
|
||||
acosh_9f213e();
|
||||
}
|
||||
|
||||
@compute @workgroup_size(1)
|
||||
fn compute_main() {
|
||||
acosh_9f213e();
|
||||
}
|
|
@ -0,0 +1,30 @@
|
|||
void acosh_9f213e() {
|
||||
float3 res = (1.316957951f).xxx;
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
float4 value : SV_Position;
|
||||
};
|
||||
|
||||
float4 vertex_main_inner() {
|
||||
acosh_9f213e();
|
||||
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() {
|
||||
acosh_9f213e();
|
||||
return;
|
||||
}
|
||||
|
||||
[numthreads(1, 1, 1)]
|
||||
void compute_main() {
|
||||
acosh_9f213e();
|
||||
return;
|
||||
}
|
|
@ -0,0 +1,30 @@
|
|||
void acosh_9f213e() {
|
||||
float3 res = (1.316957951f).xxx;
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
float4 value : SV_Position;
|
||||
};
|
||||
|
||||
float4 vertex_main_inner() {
|
||||
acosh_9f213e();
|
||||
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() {
|
||||
acosh_9f213e();
|
||||
return;
|
||||
}
|
||||
|
||||
[numthreads(1, 1, 1)]
|
||||
void compute_main() {
|
||||
acosh_9f213e();
|
||||
return;
|
||||
}
|
|
@ -0,0 +1,49 @@
|
|||
#version 310 es
|
||||
|
||||
void acosh_9f213e() {
|
||||
vec3 res = vec3(1.316957951f);
|
||||
}
|
||||
|
||||
vec4 vertex_main() {
|
||||
acosh_9f213e();
|
||||
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 acosh_9f213e() {
|
||||
vec3 res = vec3(1.316957951f);
|
||||
}
|
||||
|
||||
void fragment_main() {
|
||||
acosh_9f213e();
|
||||
}
|
||||
|
||||
void main() {
|
||||
fragment_main();
|
||||
return;
|
||||
}
|
||||
#version 310 es
|
||||
|
||||
void acosh_9f213e() {
|
||||
vec3 res = vec3(1.316957951f);
|
||||
}
|
||||
|
||||
void compute_main() {
|
||||
acosh_9f213e();
|
||||
}
|
||||
|
||||
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||
void main() {
|
||||
compute_main();
|
||||
return;
|
||||
}
|
|
@ -0,0 +1,33 @@
|
|||
#include <metal_stdlib>
|
||||
|
||||
using namespace metal;
|
||||
void acosh_9f213e() {
|
||||
float3 res = float3(1.316957951f);
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
float4 value [[position]];
|
||||
};
|
||||
|
||||
float4 vertex_main_inner() {
|
||||
acosh_9f213e();
|
||||
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() {
|
||||
acosh_9f213e();
|
||||
return;
|
||||
}
|
||||
|
||||
kernel void compute_main() {
|
||||
acosh_9f213e();
|
||||
return;
|
||||
}
|
||||
|
|
@ -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 %acosh_9f213e "acosh_9f213e"
|
||||
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_1_31695795 = OpConstant %float 1.31695795
|
||||
%15 = OpConstantComposite %v3float %float_1_31695795 %float_1_31695795 %float_1_31695795
|
||||
%_ptr_Function_v3float = OpTypePointer Function %v3float
|
||||
%18 = OpConstantNull %v3float
|
||||
%19 = OpTypeFunction %v4float
|
||||
%float_1 = OpConstant %float 1
|
||||
%acosh_9f213e = 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 %acosh_9f213e
|
||||
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 %acosh_9f213e
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%compute_main = OpFunction %void None %9
|
||||
%31 = OpLabel
|
||||
%32 = OpFunctionCall %void %acosh_9f213e
|
||||
OpReturn
|
||||
OpFunctionEnd
|
|
@ -0,0 +1,19 @@
|
|||
fn acosh_9f213e() {
|
||||
var res = acosh(vec3(2.0));
|
||||
}
|
||||
|
||||
@vertex
|
||||
fn vertex_main() -> @builtin(position) vec4<f32> {
|
||||
acosh_9f213e();
|
||||
return vec4<f32>();
|
||||
}
|
||||
|
||||
@fragment
|
||||
fn fragment_main() {
|
||||
acosh_9f213e();
|
||||
}
|
||||
|
||||
@compute @workgroup_size(1)
|
||||
fn compute_main() {
|
||||
acosh_9f213e();
|
||||
}
|
|
@ -25,7 +25,7 @@ enable f16;
|
|||
|
||||
// fn acosh(f16) -> f16
|
||||
fn acosh_a37dfe() {
|
||||
var res: f16 = acosh(1.h);
|
||||
var res: f16 = acosh(2.h);
|
||||
}
|
||||
|
||||
@vertex
|
||||
|
|
|
@ -1,9 +1,5 @@
|
|||
float16_t tint_acosh(float16_t x) {
|
||||
return log((x + sqrt(((x * x) - float16_t(1.0h)))));
|
||||
}
|
||||
|
||||
void acosh_a37dfe() {
|
||||
float16_t res = tint_acosh(float16_t(1.0h));
|
||||
float16_t res = float16_t(1.31640625h);
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
|
|
|
@ -1,11 +1,7 @@
|
|||
SKIP: FAILED
|
||||
|
||||
float16_t tint_acosh(float16_t x) {
|
||||
return log((x + sqrt(((x * x) - float16_t(1.0h)))));
|
||||
}
|
||||
|
||||
void acosh_a37dfe() {
|
||||
float16_t res = tint_acosh(float16_t(0.0h));
|
||||
float16_t res = float16_t(1.31640625h);
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
|
|
|
@ -1,12 +1,8 @@
|
|||
#version 310 es
|
||||
#extension GL_AMD_gpu_shader_half_float : require
|
||||
|
||||
float16_t tint_acosh(float16_t x) {
|
||||
return ((x < 1.0hf) ? 0.0hf : acosh(x));
|
||||
}
|
||||
|
||||
void acosh_a37dfe() {
|
||||
float16_t res = tint_acosh(1.0hf);
|
||||
float16_t res = 1.31640625hf;
|
||||
}
|
||||
|
||||
vec4 vertex_main() {
|
||||
|
@ -26,12 +22,8 @@ void main() {
|
|||
#extension GL_AMD_gpu_shader_half_float : require
|
||||
precision mediump float;
|
||||
|
||||
float16_t tint_acosh(float16_t x) {
|
||||
return ((x < 1.0hf) ? 0.0hf : acosh(x));
|
||||
}
|
||||
|
||||
void acosh_a37dfe() {
|
||||
float16_t res = tint_acosh(1.0hf);
|
||||
float16_t res = 1.31640625hf;
|
||||
}
|
||||
|
||||
void fragment_main() {
|
||||
|
@ -45,12 +37,8 @@ void main() {
|
|||
#version 310 es
|
||||
#extension GL_AMD_gpu_shader_half_float : require
|
||||
|
||||
float16_t tint_acosh(float16_t x) {
|
||||
return ((x < 1.0hf) ? 0.0hf : acosh(x));
|
||||
}
|
||||
|
||||
void acosh_a37dfe() {
|
||||
float16_t res = tint_acosh(1.0hf);
|
||||
float16_t res = 1.31640625hf;
|
||||
}
|
||||
|
||||
void compute_main() {
|
||||
|
|
|
@ -1,12 +1,8 @@
|
|||
#include <metal_stdlib>
|
||||
|
||||
using namespace metal;
|
||||
half tint_acosh(half x) {
|
||||
return select(acosh(x), 0.0h, (x < 1.0h));
|
||||
}
|
||||
|
||||
void acosh_a37dfe() {
|
||||
half res = tint_acosh(1.0h);
|
||||
half res = 1.31640625h;
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
|
|
|
@ -1,14 +1,13 @@
|
|||
; SPIR-V
|
||||
; Version: 1.3
|
||||
; Generator: Google Tint Compiler; 0
|
||||
; Bound: 42
|
||||
; Bound: 32
|
||||
; Schema: 0
|
||||
OpCapability Shader
|
||||
OpCapability Float16
|
||||
OpCapability UniformAndStorageBuffer16BitAccess
|
||||
OpCapability StorageBuffer16BitAccess
|
||||
OpCapability StorageInputOutput16
|
||||
%20 = OpExtInstImport "GLSL.std.450"
|
||||
OpMemoryModel Logical GLSL450
|
||||
OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
|
||||
OpEntryPoint Fragment %fragment_main "fragment_main"
|
||||
|
@ -17,8 +16,6 @@
|
|||
OpExecutionMode %compute_main LocalSize 1 1 1
|
||||
OpName %value "value"
|
||||
OpName %vertex_point_size "vertex_point_size"
|
||||
OpName %tint_acosh "tint_acosh"
|
||||
OpName %x "x"
|
||||
OpName %acosh_a37dfe "acosh_a37dfe"
|
||||
OpName %res "res"
|
||||
OpName %vertex_main_inner "vertex_main_inner"
|
||||
|
@ -35,50 +32,39 @@
|
|||
%_ptr_Output_float = OpTypePointer Output %float
|
||||
%8 = OpConstantNull %float
|
||||
%vertex_point_size = OpVariable %_ptr_Output_float Output %8
|
||||
%half = OpTypeFloat 16
|
||||
%9 = OpTypeFunction %half %half
|
||||
%half_0x1p_0 = OpConstant %half 0x1p+0
|
||||
%bool = OpTypeBool
|
||||
%18 = OpConstantNull %half
|
||||
%void = OpTypeVoid
|
||||
%21 = OpTypeFunction %void
|
||||
%9 = OpTypeFunction %void
|
||||
%half = OpTypeFloat 16
|
||||
%half_0x1_51p_0 = OpConstant %half 0x1.51p+0
|
||||
%_ptr_Function_half = OpTypePointer Function %half
|
||||
%28 = OpTypeFunction %v4float
|
||||
%17 = OpConstantNull %half
|
||||
%18 = OpTypeFunction %v4float
|
||||
%float_1 = OpConstant %float 1
|
||||
%tint_acosh = OpFunction %half None %9
|
||||
%x = OpFunctionParameter %half
|
||||
%13 = OpLabel
|
||||
%16 = OpFOrdLessThan %bool %x %half_0x1p_0
|
||||
%19 = OpExtInst %half %20 Acosh %x
|
||||
%14 = OpSelect %half %16 %18 %19
|
||||
OpReturnValue %14
|
||||
OpFunctionEnd
|
||||
%acosh_a37dfe = OpFunction %void None %21
|
||||
%24 = OpLabel
|
||||
%res = OpVariable %_ptr_Function_half Function %18
|
||||
%25 = OpFunctionCall %half %tint_acosh %half_0x1p_0
|
||||
OpStore %res %25
|
||||
%acosh_a37dfe = OpFunction %void None %9
|
||||
%12 = OpLabel
|
||||
%res = OpVariable %_ptr_Function_half Function %17
|
||||
OpStore %res %half_0x1_51p_0
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%vertex_main_inner = OpFunction %v4float None %28
|
||||
%30 = OpLabel
|
||||
%31 = OpFunctionCall %void %acosh_a37dfe
|
||||
%vertex_main_inner = OpFunction %v4float None %18
|
||||
%20 = OpLabel
|
||||
%21 = OpFunctionCall %void %acosh_a37dfe
|
||||
OpReturnValue %5
|
||||
OpFunctionEnd
|
||||
%vertex_main = OpFunction %void None %21
|
||||
%33 = OpLabel
|
||||
%34 = OpFunctionCall %v4float %vertex_main_inner
|
||||
OpStore %value %34
|
||||
%vertex_main = OpFunction %void None %9
|
||||
%23 = OpLabel
|
||||
%24 = OpFunctionCall %v4float %vertex_main_inner
|
||||
OpStore %value %24
|
||||
OpStore %vertex_point_size %float_1
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%fragment_main = OpFunction %void None %21
|
||||
%37 = OpLabel
|
||||
%38 = OpFunctionCall %void %acosh_a37dfe
|
||||
%fragment_main = OpFunction %void None %9
|
||||
%27 = OpLabel
|
||||
%28 = OpFunctionCall %void %acosh_a37dfe
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%compute_main = OpFunction %void None %21
|
||||
%40 = OpLabel
|
||||
%41 = OpFunctionCall %void %acosh_a37dfe
|
||||
%compute_main = OpFunction %void None %9
|
||||
%30 = OpLabel
|
||||
%31 = OpFunctionCall %void %acosh_a37dfe
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
enable f16;
|
||||
|
||||
fn acosh_a37dfe() {
|
||||
var res : f16 = acosh(1.0h);
|
||||
var res : f16 = acosh(2.0h);
|
||||
}
|
||||
|
||||
@vertex
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// Copyright 2021 The Tint Authors.
|
||||
// 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.
|
||||
|
@ -23,7 +23,7 @@
|
|||
|
||||
// fn acosh(vec<4, f32>) -> vec<4, f32>
|
||||
fn acosh_d51ccb() {
|
||||
var res: vec4<f32> = acosh(vec4<f32>(1.f));
|
||||
var res: vec4<f32> = acosh(vec4<f32>(2.f));
|
||||
}
|
||||
|
||||
@vertex
|
||||
|
|
|
@ -1,9 +1,5 @@
|
|||
float4 tint_acosh(float4 x) {
|
||||
return log((x + sqrt(((x * x) - 1.0f))));
|
||||
}
|
||||
|
||||
void acosh_d51ccb() {
|
||||
float4 res = tint_acosh((1.0f).xxxx);
|
||||
float4 res = (1.316957951f).xxxx;
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
|
|
|
@ -1,9 +1,5 @@
|
|||
float4 tint_acosh(float4 x) {
|
||||
return log((x + sqrt(((x * x) - 1.0f))));
|
||||
}
|
||||
|
||||
void acosh_d51ccb() {
|
||||
float4 res = tint_acosh((1.0f).xxxx);
|
||||
float4 res = (1.316957951f).xxxx;
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
|
|
|
@ -1,11 +1,7 @@
|
|||
#version 310 es
|
||||
|
||||
vec4 tint_acosh(vec4 x) {
|
||||
return mix(acosh(x), vec4(0.0f), lessThan(x, vec4(1.0f)));
|
||||
}
|
||||
|
||||
void acosh_d51ccb() {
|
||||
vec4 res = tint_acosh(vec4(1.0f));
|
||||
vec4 res = vec4(1.316957951f);
|
||||
}
|
||||
|
||||
vec4 vertex_main() {
|
||||
|
@ -24,12 +20,8 @@ void main() {
|
|||
#version 310 es
|
||||
precision mediump float;
|
||||
|
||||
vec4 tint_acosh(vec4 x) {
|
||||
return mix(acosh(x), vec4(0.0f), lessThan(x, vec4(1.0f)));
|
||||
}
|
||||
|
||||
void acosh_d51ccb() {
|
||||
vec4 res = tint_acosh(vec4(1.0f));
|
||||
vec4 res = vec4(1.316957951f);
|
||||
}
|
||||
|
||||
void fragment_main() {
|
||||
|
@ -42,12 +34,8 @@ void main() {
|
|||
}
|
||||
#version 310 es
|
||||
|
||||
vec4 tint_acosh(vec4 x) {
|
||||
return mix(acosh(x), vec4(0.0f), lessThan(x, vec4(1.0f)));
|
||||
}
|
||||
|
||||
void acosh_d51ccb() {
|
||||
vec4 res = tint_acosh(vec4(1.0f));
|
||||
vec4 res = vec4(1.316957951f);
|
||||
}
|
||||
|
||||
void compute_main() {
|
||||
|
|
|
@ -1,12 +1,8 @@
|
|||
#include <metal_stdlib>
|
||||
|
||||
using namespace metal;
|
||||
float4 tint_acosh(float4 x) {
|
||||
return select(acosh(x), float4(0.0f), (x < float4(1.0f)));
|
||||
}
|
||||
|
||||
void acosh_d51ccb() {
|
||||
float4 res = tint_acosh(float4(1.0f));
|
||||
float4 res = float4(1.316957951f);
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
|
|
|
@ -1,10 +1,9 @@
|
|||
; SPIR-V
|
||||
; Version: 1.3
|
||||
; Generator: Google Tint Compiler; 0
|
||||
; Bound: 41
|
||||
; Bound: 31
|
||||
; Schema: 0
|
||||
OpCapability Shader
|
||||
%20 = OpExtInstImport "GLSL.std.450"
|
||||
OpMemoryModel Logical GLSL450
|
||||
OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
|
||||
OpEntryPoint Fragment %fragment_main "fragment_main"
|
||||
|
@ -13,8 +12,6 @@
|
|||
OpExecutionMode %compute_main LocalSize 1 1 1
|
||||
OpName %value "value"
|
||||
OpName %vertex_point_size "vertex_point_size"
|
||||
OpName %tint_acosh "tint_acosh"
|
||||
OpName %x "x"
|
||||
OpName %acosh_d51ccb "acosh_d51ccb"
|
||||
OpName %res "res"
|
||||
OpName %vertex_main_inner "vertex_main_inner"
|
||||
|
@ -31,49 +28,38 @@
|
|||
%_ptr_Output_float = OpTypePointer Output %float
|
||||
%8 = OpConstantNull %float
|
||||
%vertex_point_size = OpVariable %_ptr_Output_float Output %8
|
||||
%9 = OpTypeFunction %v4float %v4float
|
||||
%float_1 = OpConstant %float 1
|
||||
%15 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
|
||||
%bool = OpTypeBool
|
||||
%v4bool = OpTypeVector %bool 4
|
||||
%void = OpTypeVoid
|
||||
%21 = OpTypeFunction %void
|
||||
%9 = OpTypeFunction %void
|
||||
%float_1_31695795 = OpConstant %float 1.31695795
|
||||
%14 = OpConstantComposite %v4float %float_1_31695795 %float_1_31695795 %float_1_31695795 %float_1_31695795
|
||||
%_ptr_Function_v4float = OpTypePointer Function %v4float
|
||||
%28 = OpTypeFunction %v4float
|
||||
%tint_acosh = OpFunction %v4float None %9
|
||||
%x = OpFunctionParameter %v4float
|
||||
%17 = OpTypeFunction %v4float
|
||||
%float_1 = OpConstant %float 1
|
||||
%acosh_d51ccb = OpFunction %void None %9
|
||||
%12 = OpLabel
|
||||
%16 = OpFOrdLessThan %v4bool %x %15
|
||||
%19 = OpExtInst %v4float %20 Acosh %x
|
||||
%13 = OpSelect %v4float %16 %5 %19
|
||||
OpReturnValue %13
|
||||
OpFunctionEnd
|
||||
%acosh_d51ccb = OpFunction %void None %21
|
||||
%24 = OpLabel
|
||||
%res = OpVariable %_ptr_Function_v4float Function %5
|
||||
%25 = OpFunctionCall %v4float %tint_acosh %15
|
||||
OpStore %res %25
|
||||
OpStore %res %14
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%vertex_main_inner = OpFunction %v4float None %28
|
||||
%30 = OpLabel
|
||||
%31 = OpFunctionCall %void %acosh_d51ccb
|
||||
%vertex_main_inner = OpFunction %v4float None %17
|
||||
%19 = OpLabel
|
||||
%20 = OpFunctionCall %void %acosh_d51ccb
|
||||
OpReturnValue %5
|
||||
OpFunctionEnd
|
||||
%vertex_main = OpFunction %void None %21
|
||||
%33 = OpLabel
|
||||
%34 = OpFunctionCall %v4float %vertex_main_inner
|
||||
OpStore %value %34
|
||||
%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 %21
|
||||
%36 = OpLabel
|
||||
%37 = OpFunctionCall %void %acosh_d51ccb
|
||||
%fragment_main = OpFunction %void None %9
|
||||
%26 = OpLabel
|
||||
%27 = OpFunctionCall %void %acosh_d51ccb
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%compute_main = OpFunction %void None %21
|
||||
%39 = OpLabel
|
||||
%40 = OpFunctionCall %void %acosh_d51ccb
|
||||
%compute_main = OpFunction %void None %9
|
||||
%29 = OpLabel
|
||||
%30 = OpFunctionCall %void %acosh_d51ccb
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
fn acosh_d51ccb() {
|
||||
var res : vec4<f32> = acosh(vec4<f32>(1.0f));
|
||||
var res : vec4<f32> = acosh(vec4<f32>(2.0f));
|
||||
}
|
||||
|
||||
@vertex
|
||||
|
|
|
@ -25,7 +25,7 @@ enable f16;
|
|||
|
||||
// fn acosh(vec<4, f16>) -> vec<4, f16>
|
||||
fn acosh_de60d8() {
|
||||
var res: vec4<f16> = acosh(vec4<f16>(1.h));
|
||||
var res: vec4<f16> = acosh(vec4<f16>(2.h));
|
||||
}
|
||||
|
||||
@vertex
|
||||
|
|
|
@ -1,9 +1,5 @@
|
|||
vector<float16_t, 4> tint_acosh(vector<float16_t, 4> x) {
|
||||
return log((x + sqrt(((x * x) - float16_t(1.0h)))));
|
||||
}
|
||||
|
||||
void acosh_de60d8() {
|
||||
vector<float16_t, 4> res = tint_acosh((float16_t(1.0h)).xxxx);
|
||||
vector<float16_t, 4> res = (float16_t(1.31640625h)).xxxx;
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
|
|
|
@ -1,11 +1,7 @@
|
|||
SKIP: FAILED
|
||||
|
||||
vector<float16_t, 4> tint_acosh(vector<float16_t, 4> x) {
|
||||
return log((x + sqrt(((x * x) - float16_t(1.0h)))));
|
||||
}
|
||||
|
||||
void acosh_de60d8() {
|
||||
vector<float16_t, 4> res = tint_acosh((float16_t(0.0h)).xxxx);
|
||||
vector<float16_t, 4> res = (float16_t(1.31640625h)).xxxx;
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
|
|
|
@ -1,12 +1,8 @@
|
|||
#version 310 es
|
||||
#extension GL_AMD_gpu_shader_half_float : require
|
||||
|
||||
f16vec4 tint_acosh(f16vec4 x) {
|
||||
return mix(acosh(x), f16vec4(0.0hf), lessThan(x, f16vec4(1.0hf)));
|
||||
}
|
||||
|
||||
void acosh_de60d8() {
|
||||
f16vec4 res = tint_acosh(f16vec4(1.0hf));
|
||||
f16vec4 res = f16vec4(1.31640625hf);
|
||||
}
|
||||
|
||||
vec4 vertex_main() {
|
||||
|
@ -26,12 +22,8 @@ void main() {
|
|||
#extension GL_AMD_gpu_shader_half_float : require
|
||||
precision mediump float;
|
||||
|
||||
f16vec4 tint_acosh(f16vec4 x) {
|
||||
return mix(acosh(x), f16vec4(0.0hf), lessThan(x, f16vec4(1.0hf)));
|
||||
}
|
||||
|
||||
void acosh_de60d8() {
|
||||
f16vec4 res = tint_acosh(f16vec4(1.0hf));
|
||||
f16vec4 res = f16vec4(1.31640625hf);
|
||||
}
|
||||
|
||||
void fragment_main() {
|
||||
|
@ -45,12 +37,8 @@ void main() {
|
|||
#version 310 es
|
||||
#extension GL_AMD_gpu_shader_half_float : require
|
||||
|
||||
f16vec4 tint_acosh(f16vec4 x) {
|
||||
return mix(acosh(x), f16vec4(0.0hf), lessThan(x, f16vec4(1.0hf)));
|
||||
}
|
||||
|
||||
void acosh_de60d8() {
|
||||
f16vec4 res = tint_acosh(f16vec4(1.0hf));
|
||||
f16vec4 res = f16vec4(1.31640625hf);
|
||||
}
|
||||
|
||||
void compute_main() {
|
||||
|
|
|
@ -1,12 +1,8 @@
|
|||
#include <metal_stdlib>
|
||||
|
||||
using namespace metal;
|
||||
half4 tint_acosh(half4 x) {
|
||||
return select(acosh(x), half4(0.0h), (x < half4(1.0h)));
|
||||
}
|
||||
|
||||
void acosh_de60d8() {
|
||||
half4 res = tint_acosh(half4(1.0h));
|
||||
half4 res = half4(1.31640625h);
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
|
|
|
@ -1,14 +1,13 @@
|
|||
; SPIR-V
|
||||
; Version: 1.3
|
||||
; Generator: Google Tint Compiler; 0
|
||||
; Bound: 45
|
||||
; Bound: 34
|
||||
; Schema: 0
|
||||
OpCapability Shader
|
||||
OpCapability Float16
|
||||
OpCapability UniformAndStorageBuffer16BitAccess
|
||||
OpCapability StorageBuffer16BitAccess
|
||||
OpCapability StorageInputOutput16
|
||||
%23 = OpExtInstImport "GLSL.std.450"
|
||||
OpMemoryModel Logical GLSL450
|
||||
OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
|
||||
OpEntryPoint Fragment %fragment_main "fragment_main"
|
||||
|
@ -17,8 +16,6 @@
|
|||
OpExecutionMode %compute_main LocalSize 1 1 1
|
||||
OpName %value "value"
|
||||
OpName %vertex_point_size "vertex_point_size"
|
||||
OpName %tint_acosh "tint_acosh"
|
||||
OpName %x "x"
|
||||
OpName %acosh_de60d8 "acosh_de60d8"
|
||||
OpName %res "res"
|
||||
OpName %vertex_main_inner "vertex_main_inner"
|
||||
|
@ -35,53 +32,41 @@
|
|||
%_ptr_Output_float = OpTypePointer Output %float
|
||||
%8 = OpConstantNull %float
|
||||
%vertex_point_size = OpVariable %_ptr_Output_float Output %8
|
||||
%void = OpTypeVoid
|
||||
%9 = OpTypeFunction %void
|
||||
%half = OpTypeFloat 16
|
||||
%v4half = OpTypeVector %half 4
|
||||
%9 = OpTypeFunction %v4half %v4half
|
||||
%half_0x1p_0 = OpConstant %half 0x1p+0
|
||||
%17 = OpConstantComposite %v4half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
|
||||
%bool = OpTypeBool
|
||||
%v4bool = OpTypeVector %bool 4
|
||||
%21 = OpConstantNull %v4half
|
||||
%void = OpTypeVoid
|
||||
%24 = OpTypeFunction %void
|
||||
%half_0x1_51p_0 = OpConstant %half 0x1.51p+0
|
||||
%16 = OpConstantComposite %v4half %half_0x1_51p_0 %half_0x1_51p_0 %half_0x1_51p_0 %half_0x1_51p_0
|
||||
%_ptr_Function_v4half = OpTypePointer Function %v4half
|
||||
%31 = OpTypeFunction %v4float
|
||||
%19 = OpConstantNull %v4half
|
||||
%20 = OpTypeFunction %v4float
|
||||
%float_1 = OpConstant %float 1
|
||||
%tint_acosh = OpFunction %v4half None %9
|
||||
%x = OpFunctionParameter %v4half
|
||||
%14 = OpLabel
|
||||
%18 = OpFOrdLessThan %v4bool %x %17
|
||||
%22 = OpExtInst %v4half %23 Acosh %x
|
||||
%15 = OpSelect %v4half %18 %21 %22
|
||||
OpReturnValue %15
|
||||
OpFunctionEnd
|
||||
%acosh_de60d8 = OpFunction %void None %24
|
||||
%27 = OpLabel
|
||||
%res = OpVariable %_ptr_Function_v4half Function %21
|
||||
%28 = OpFunctionCall %v4half %tint_acosh %17
|
||||
OpStore %res %28
|
||||
%acosh_de60d8 = OpFunction %void None %9
|
||||
%12 = OpLabel
|
||||
%res = OpVariable %_ptr_Function_v4half Function %19
|
||||
OpStore %res %16
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%vertex_main_inner = OpFunction %v4float None %31
|
||||
%33 = OpLabel
|
||||
%34 = OpFunctionCall %void %acosh_de60d8
|
||||
%vertex_main_inner = OpFunction %v4float None %20
|
||||
%22 = OpLabel
|
||||
%23 = OpFunctionCall %void %acosh_de60d8
|
||||
OpReturnValue %5
|
||||
OpFunctionEnd
|
||||
%vertex_main = OpFunction %void None %24
|
||||
%36 = OpLabel
|
||||
%37 = OpFunctionCall %v4float %vertex_main_inner
|
||||
OpStore %value %37
|
||||
%vertex_main = OpFunction %void None %9
|
||||
%25 = OpLabel
|
||||
%26 = OpFunctionCall %v4float %vertex_main_inner
|
||||
OpStore %value %26
|
||||
OpStore %vertex_point_size %float_1
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%fragment_main = OpFunction %void None %24
|
||||
%40 = OpLabel
|
||||
%41 = OpFunctionCall %void %acosh_de60d8
|
||||
%fragment_main = OpFunction %void None %9
|
||||
%29 = OpLabel
|
||||
%30 = OpFunctionCall %void %acosh_de60d8
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%compute_main = OpFunction %void None %24
|
||||
%43 = OpLabel
|
||||
%44 = OpFunctionCall %void %acosh_de60d8
|
||||
%compute_main = OpFunction %void None %9
|
||||
%32 = OpLabel
|
||||
%33 = OpFunctionCall %void %acosh_de60d8
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
enable f16;
|
||||
|
||||
fn acosh_de60d8() {
|
||||
var res : vec4<f16> = acosh(vec4<f16>(1.0h));
|
||||
var res : vec4<f16> = acosh(vec4<f16>(2.0h));
|
||||
}
|
||||
|
||||
@vertex
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// Copyright 2021 The Tint Authors.
|
||||
// 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.
|
||||
|
@ -23,7 +23,7 @@
|
|||
|
||||
// fn acosh(vec<3, f32>) -> vec<3, f32>
|
||||
fn acosh_e38f5c() {
|
||||
var res: vec3<f32> = acosh(vec3<f32>(1.f));
|
||||
var res: vec3<f32> = acosh(vec3<f32>(2.f));
|
||||
}
|
||||
|
||||
@vertex
|
||||
|
|
|
@ -1,9 +1,5 @@
|
|||
float3 tint_acosh(float3 x) {
|
||||
return log((x + sqrt(((x * x) - 1.0f))));
|
||||
}
|
||||
|
||||
void acosh_e38f5c() {
|
||||
float3 res = tint_acosh((1.0f).xxx);
|
||||
float3 res = (1.316957951f).xxx;
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
|
|
|
@ -1,9 +1,5 @@
|
|||
float3 tint_acosh(float3 x) {
|
||||
return log((x + sqrt(((x * x) - 1.0f))));
|
||||
}
|
||||
|
||||
void acosh_e38f5c() {
|
||||
float3 res = tint_acosh((1.0f).xxx);
|
||||
float3 res = (1.316957951f).xxx;
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
|
|
|
@ -1,11 +1,7 @@
|
|||
#version 310 es
|
||||
|
||||
vec3 tint_acosh(vec3 x) {
|
||||
return mix(acosh(x), vec3(0.0f), lessThan(x, vec3(1.0f)));
|
||||
}
|
||||
|
||||
void acosh_e38f5c() {
|
||||
vec3 res = tint_acosh(vec3(1.0f));
|
||||
vec3 res = vec3(1.316957951f);
|
||||
}
|
||||
|
||||
vec4 vertex_main() {
|
||||
|
@ -24,12 +20,8 @@ void main() {
|
|||
#version 310 es
|
||||
precision mediump float;
|
||||
|
||||
vec3 tint_acosh(vec3 x) {
|
||||
return mix(acosh(x), vec3(0.0f), lessThan(x, vec3(1.0f)));
|
||||
}
|
||||
|
||||
void acosh_e38f5c() {
|
||||
vec3 res = tint_acosh(vec3(1.0f));
|
||||
vec3 res = vec3(1.316957951f);
|
||||
}
|
||||
|
||||
void fragment_main() {
|
||||
|
@ -42,12 +34,8 @@ void main() {
|
|||
}
|
||||
#version 310 es
|
||||
|
||||
vec3 tint_acosh(vec3 x) {
|
||||
return mix(acosh(x), vec3(0.0f), lessThan(x, vec3(1.0f)));
|
||||
}
|
||||
|
||||
void acosh_e38f5c() {
|
||||
vec3 res = tint_acosh(vec3(1.0f));
|
||||
vec3 res = vec3(1.316957951f);
|
||||
}
|
||||
|
||||
void compute_main() {
|
||||
|
|
|
@ -1,12 +1,8 @@
|
|||
#include <metal_stdlib>
|
||||
|
||||
using namespace metal;
|
||||
float3 tint_acosh(float3 x) {
|
||||
return select(acosh(x), float3(0.0f), (x < float3(1.0f)));
|
||||
}
|
||||
|
||||
void acosh_e38f5c() {
|
||||
float3 res = tint_acosh(float3(1.0f));
|
||||
float3 res = float3(1.316957951f);
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
|
|
|
@ -1,10 +1,9 @@
|
|||
; SPIR-V
|
||||
; Version: 1.3
|
||||
; Generator: Google Tint Compiler; 0
|
||||
; Bound: 43
|
||||
; Bound: 33
|
||||
; Schema: 0
|
||||
OpCapability Shader
|
||||
%22 = OpExtInstImport "GLSL.std.450"
|
||||
OpMemoryModel Logical GLSL450
|
||||
OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
|
||||
OpEntryPoint Fragment %fragment_main "fragment_main"
|
||||
|
@ -13,8 +12,6 @@
|
|||
OpExecutionMode %compute_main LocalSize 1 1 1
|
||||
OpName %value "value"
|
||||
OpName %vertex_point_size "vertex_point_size"
|
||||
OpName %tint_acosh "tint_acosh"
|
||||
OpName %x "x"
|
||||
OpName %acosh_e38f5c "acosh_e38f5c"
|
||||
OpName %res "res"
|
||||
OpName %vertex_main_inner "vertex_main_inner"
|
||||
|
@ -31,51 +28,40 @@
|
|||
%_ptr_Output_float = OpTypePointer Output %float
|
||||
%8 = OpConstantNull %float
|
||||
%vertex_point_size = OpVariable %_ptr_Output_float Output %8
|
||||
%v3float = OpTypeVector %float 3
|
||||
%9 = OpTypeFunction %v3float %v3float
|
||||
%float_1 = OpConstant %float 1
|
||||
%16 = OpConstantComposite %v3float %float_1 %float_1 %float_1
|
||||
%bool = OpTypeBool
|
||||
%v3bool = OpTypeVector %bool 3
|
||||
%20 = OpConstantNull %v3float
|
||||
%void = OpTypeVoid
|
||||
%23 = OpTypeFunction %void
|
||||
%9 = OpTypeFunction %void
|
||||
%v3float = OpTypeVector %float 3
|
||||
%float_1_31695795 = OpConstant %float 1.31695795
|
||||
%15 = OpConstantComposite %v3float %float_1_31695795 %float_1_31695795 %float_1_31695795
|
||||
%_ptr_Function_v3float = OpTypePointer Function %v3float
|
||||
%30 = OpTypeFunction %v4float
|
||||
%tint_acosh = OpFunction %v3float None %9
|
||||
%x = OpFunctionParameter %v3float
|
||||
%13 = OpLabel
|
||||
%17 = OpFOrdLessThan %v3bool %x %16
|
||||
%21 = OpExtInst %v3float %22 Acosh %x
|
||||
%14 = OpSelect %v3float %17 %20 %21
|
||||
OpReturnValue %14
|
||||
OpFunctionEnd
|
||||
%acosh_e38f5c = OpFunction %void None %23
|
||||
%26 = OpLabel
|
||||
%res = OpVariable %_ptr_Function_v3float Function %20
|
||||
%27 = OpFunctionCall %v3float %tint_acosh %16
|
||||
OpStore %res %27
|
||||
%18 = OpConstantNull %v3float
|
||||
%19 = OpTypeFunction %v4float
|
||||
%float_1 = OpConstant %float 1
|
||||
%acosh_e38f5c = OpFunction %void None %9
|
||||
%12 = OpLabel
|
||||
%res = OpVariable %_ptr_Function_v3float Function %18
|
||||
OpStore %res %15
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%vertex_main_inner = OpFunction %v4float None %30
|
||||
%32 = OpLabel
|
||||
%33 = OpFunctionCall %void %acosh_e38f5c
|
||||
%vertex_main_inner = OpFunction %v4float None %19
|
||||
%21 = OpLabel
|
||||
%22 = OpFunctionCall %void %acosh_e38f5c
|
||||
OpReturnValue %5
|
||||
OpFunctionEnd
|
||||
%vertex_main = OpFunction %void None %23
|
||||
%35 = OpLabel
|
||||
%36 = OpFunctionCall %v4float %vertex_main_inner
|
||||
OpStore %value %36
|
||||
%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 %23
|
||||
%38 = OpLabel
|
||||
%39 = OpFunctionCall %void %acosh_e38f5c
|
||||
%fragment_main = OpFunction %void None %9
|
||||
%28 = OpLabel
|
||||
%29 = OpFunctionCall %void %acosh_e38f5c
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%compute_main = OpFunction %void None %23
|
||||
%41 = OpLabel
|
||||
%42 = OpFunctionCall %void %acosh_e38f5c
|
||||
%compute_main = OpFunction %void None %9
|
||||
%31 = OpLabel
|
||||
%32 = OpFunctionCall %void %acosh_e38f5c
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
fn acosh_e38f5c() {
|
||||
var res : vec3<f32> = acosh(vec3<f32>(1.0f));
|
||||
var res : vec3<f32> = acosh(vec3<f32>(2.0f));
|
||||
}
|
||||
|
||||
@vertex
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// Copyright 2021 The Tint Authors.
|
||||
// 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.
|
||||
|
@ -23,7 +23,7 @@
|
|||
|
||||
// fn acosh(f32) -> f32
|
||||
fn acosh_ecf2d1() {
|
||||
var res: f32 = acosh(1.f);
|
||||
var res: f32 = acosh(2.f);
|
||||
}
|
||||
|
||||
@vertex
|
||||
|
|
|
@ -1,9 +1,5 @@
|
|||
float tint_acosh(float x) {
|
||||
return log((x + sqrt(((x * x) - 1.0f))));
|
||||
}
|
||||
|
||||
void acosh_ecf2d1() {
|
||||
float res = tint_acosh(1.0f);
|
||||
float res = 1.316957951f;
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
|
|
|
@ -1,9 +1,5 @@
|
|||
float tint_acosh(float x) {
|
||||
return log((x + sqrt(((x * x) - 1.0f))));
|
||||
}
|
||||
|
||||
void acosh_ecf2d1() {
|
||||
float res = tint_acosh(1.0f);
|
||||
float res = 1.316957951f;
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
|
|
|
@ -1,11 +1,7 @@
|
|||
#version 310 es
|
||||
|
||||
float tint_acosh(float x) {
|
||||
return ((x < 1.0f) ? 0.0f : acosh(x));
|
||||
}
|
||||
|
||||
void acosh_ecf2d1() {
|
||||
float res = tint_acosh(1.0f);
|
||||
float res = 1.316957951f;
|
||||
}
|
||||
|
||||
vec4 vertex_main() {
|
||||
|
@ -24,12 +20,8 @@ void main() {
|
|||
#version 310 es
|
||||
precision mediump float;
|
||||
|
||||
float tint_acosh(float x) {
|
||||
return ((x < 1.0f) ? 0.0f : acosh(x));
|
||||
}
|
||||
|
||||
void acosh_ecf2d1() {
|
||||
float res = tint_acosh(1.0f);
|
||||
float res = 1.316957951f;
|
||||
}
|
||||
|
||||
void fragment_main() {
|
||||
|
@ -42,12 +34,8 @@ void main() {
|
|||
}
|
||||
#version 310 es
|
||||
|
||||
float tint_acosh(float x) {
|
||||
return ((x < 1.0f) ? 0.0f : acosh(x));
|
||||
}
|
||||
|
||||
void acosh_ecf2d1() {
|
||||
float res = tint_acosh(1.0f);
|
||||
float res = 1.316957951f;
|
||||
}
|
||||
|
||||
void compute_main() {
|
||||
|
|
|
@ -1,12 +1,8 @@
|
|||
#include <metal_stdlib>
|
||||
|
||||
using namespace metal;
|
||||
float tint_acosh(float x) {
|
||||
return select(acosh(x), 0.0f, (x < 1.0f));
|
||||
}
|
||||
|
||||
void acosh_ecf2d1() {
|
||||
float res = tint_acosh(1.0f);
|
||||
float res = 1.316957951f;
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
|
|
|
@ -1,10 +1,9 @@
|
|||
; SPIR-V
|
||||
; Version: 1.3
|
||||
; Generator: Google Tint Compiler; 0
|
||||
; Bound: 39
|
||||
; Bound: 30
|
||||
; Schema: 0
|
||||
OpCapability Shader
|
||||
%18 = OpExtInstImport "GLSL.std.450"
|
||||
OpMemoryModel Logical GLSL450
|
||||
OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
|
||||
OpEntryPoint Fragment %fragment_main "fragment_main"
|
||||
|
@ -13,8 +12,6 @@
|
|||
OpExecutionMode %compute_main LocalSize 1 1 1
|
||||
OpName %value "value"
|
||||
OpName %vertex_point_size "vertex_point_size"
|
||||
OpName %tint_acosh "tint_acosh"
|
||||
OpName %x "x"
|
||||
OpName %acosh_ecf2d1 "acosh_ecf2d1"
|
||||
OpName %res "res"
|
||||
OpName %vertex_main_inner "vertex_main_inner"
|
||||
|
@ -31,47 +28,37 @@
|
|||
%_ptr_Output_float = OpTypePointer Output %float
|
||||
%8 = OpConstantNull %float
|
||||
%vertex_point_size = OpVariable %_ptr_Output_float Output %8
|
||||
%9 = OpTypeFunction %float %float
|
||||
%float_1 = OpConstant %float 1
|
||||
%bool = OpTypeBool
|
||||
%void = OpTypeVoid
|
||||
%19 = OpTypeFunction %void
|
||||
%9 = OpTypeFunction %void
|
||||
%float_1_31695795 = OpConstant %float 1.31695795
|
||||
%_ptr_Function_float = OpTypePointer Function %float
|
||||
%26 = OpTypeFunction %v4float
|
||||
%tint_acosh = OpFunction %float None %9
|
||||
%x = OpFunctionParameter %float
|
||||
%16 = OpTypeFunction %v4float
|
||||
%float_1 = OpConstant %float 1
|
||||
%acosh_ecf2d1 = OpFunction %void None %9
|
||||
%12 = OpLabel
|
||||
%15 = OpFOrdLessThan %bool %x %float_1
|
||||
%17 = OpExtInst %float %18 Acosh %x
|
||||
%13 = OpSelect %float %15 %8 %17
|
||||
OpReturnValue %13
|
||||
OpFunctionEnd
|
||||
%acosh_ecf2d1 = OpFunction %void None %19
|
||||
%22 = OpLabel
|
||||
%res = OpVariable %_ptr_Function_float Function %8
|
||||
%23 = OpFunctionCall %float %tint_acosh %float_1
|
||||
OpStore %res %23
|
||||
OpStore %res %float_1_31695795
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%vertex_main_inner = OpFunction %v4float None %26
|
||||
%28 = OpLabel
|
||||
%29 = OpFunctionCall %void %acosh_ecf2d1
|
||||
%vertex_main_inner = OpFunction %v4float None %16
|
||||
%18 = OpLabel
|
||||
%19 = OpFunctionCall %void %acosh_ecf2d1
|
||||
OpReturnValue %5
|
||||
OpFunctionEnd
|
||||
%vertex_main = OpFunction %void None %19
|
||||
%31 = OpLabel
|
||||
%32 = OpFunctionCall %v4float %vertex_main_inner
|
||||
OpStore %value %32
|
||||
%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 %19
|
||||
%34 = OpLabel
|
||||
%35 = OpFunctionCall %void %acosh_ecf2d1
|
||||
%fragment_main = OpFunction %void None %9
|
||||
%25 = OpLabel
|
||||
%26 = OpFunctionCall %void %acosh_ecf2d1
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%compute_main = OpFunction %void None %19
|
||||
%37 = OpLabel
|
||||
%38 = OpFunctionCall %void %acosh_ecf2d1
|
||||
%compute_main = OpFunction %void None %9
|
||||
%28 = OpLabel
|
||||
%29 = OpFunctionCall %void %acosh_ecf2d1
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
fn acosh_ecf2d1() {
|
||||
var res : f32 = acosh(1.0f);
|
||||
var res : f32 = acosh(2.0f);
|
||||
}
|
||||
|
||||
@vertex
|
||||
|
|
|
@ -25,7 +25,7 @@ enable f16;
|
|||
|
||||
// fn acosh(vec<3, f16>) -> vec<3, f16>
|
||||
fn acosh_f56574() {
|
||||
var res: vec3<f16> = acosh(vec3<f16>(1.h));
|
||||
var res: vec3<f16> = acosh(vec3<f16>(2.h));
|
||||
}
|
||||
|
||||
@vertex
|
||||
|
|
|
@ -1,9 +1,5 @@
|
|||
vector<float16_t, 3> tint_acosh(vector<float16_t, 3> x) {
|
||||
return log((x + sqrt(((x * x) - float16_t(1.0h)))));
|
||||
}
|
||||
|
||||
void acosh_f56574() {
|
||||
vector<float16_t, 3> res = tint_acosh((float16_t(1.0h)).xxx);
|
||||
vector<float16_t, 3> res = (float16_t(1.31640625h)).xxx;
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
|
|
|
@ -1,11 +1,7 @@
|
|||
SKIP: FAILED
|
||||
|
||||
vector<float16_t, 3> tint_acosh(vector<float16_t, 3> x) {
|
||||
return log((x + sqrt(((x * x) - float16_t(1.0h)))));
|
||||
}
|
||||
|
||||
void acosh_f56574() {
|
||||
vector<float16_t, 3> res = tint_acosh((float16_t(0.0h)).xxx);
|
||||
vector<float16_t, 3> res = (float16_t(1.31640625h)).xxx;
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
|
|
|
@ -1,12 +1,8 @@
|
|||
#version 310 es
|
||||
#extension GL_AMD_gpu_shader_half_float : require
|
||||
|
||||
f16vec3 tint_acosh(f16vec3 x) {
|
||||
return mix(acosh(x), f16vec3(0.0hf), lessThan(x, f16vec3(1.0hf)));
|
||||
}
|
||||
|
||||
void acosh_f56574() {
|
||||
f16vec3 res = tint_acosh(f16vec3(1.0hf));
|
||||
f16vec3 res = f16vec3(1.31640625hf);
|
||||
}
|
||||
|
||||
vec4 vertex_main() {
|
||||
|
@ -26,12 +22,8 @@ void main() {
|
|||
#extension GL_AMD_gpu_shader_half_float : require
|
||||
precision mediump float;
|
||||
|
||||
f16vec3 tint_acosh(f16vec3 x) {
|
||||
return mix(acosh(x), f16vec3(0.0hf), lessThan(x, f16vec3(1.0hf)));
|
||||
}
|
||||
|
||||
void acosh_f56574() {
|
||||
f16vec3 res = tint_acosh(f16vec3(1.0hf));
|
||||
f16vec3 res = f16vec3(1.31640625hf);
|
||||
}
|
||||
|
||||
void fragment_main() {
|
||||
|
@ -45,12 +37,8 @@ void main() {
|
|||
#version 310 es
|
||||
#extension GL_AMD_gpu_shader_half_float : require
|
||||
|
||||
f16vec3 tint_acosh(f16vec3 x) {
|
||||
return mix(acosh(x), f16vec3(0.0hf), lessThan(x, f16vec3(1.0hf)));
|
||||
}
|
||||
|
||||
void acosh_f56574() {
|
||||
f16vec3 res = tint_acosh(f16vec3(1.0hf));
|
||||
f16vec3 res = f16vec3(1.31640625hf);
|
||||
}
|
||||
|
||||
void compute_main() {
|
||||
|
|
|
@ -1,12 +1,8 @@
|
|||
#include <metal_stdlib>
|
||||
|
||||
using namespace metal;
|
||||
half3 tint_acosh(half3 x) {
|
||||
return select(acosh(x), half3(0.0h), (x < half3(1.0h)));
|
||||
}
|
||||
|
||||
void acosh_f56574() {
|
||||
half3 res = tint_acosh(half3(1.0h));
|
||||
half3 res = half3(1.31640625h);
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
|
|
|
@ -1,14 +1,13 @@
|
|||
; SPIR-V
|
||||
; Version: 1.3
|
||||
; Generator: Google Tint Compiler; 0
|
||||
; Bound: 45
|
||||
; Bound: 34
|
||||
; Schema: 0
|
||||
OpCapability Shader
|
||||
OpCapability Float16
|
||||
OpCapability UniformAndStorageBuffer16BitAccess
|
||||
OpCapability StorageBuffer16BitAccess
|
||||
OpCapability StorageInputOutput16
|
||||
%23 = OpExtInstImport "GLSL.std.450"
|
||||
OpMemoryModel Logical GLSL450
|
||||
OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
|
||||
OpEntryPoint Fragment %fragment_main "fragment_main"
|
||||
|
@ -17,8 +16,6 @@
|
|||
OpExecutionMode %compute_main LocalSize 1 1 1
|
||||
OpName %value "value"
|
||||
OpName %vertex_point_size "vertex_point_size"
|
||||
OpName %tint_acosh "tint_acosh"
|
||||
OpName %x "x"
|
||||
OpName %acosh_f56574 "acosh_f56574"
|
||||
OpName %res "res"
|
||||
OpName %vertex_main_inner "vertex_main_inner"
|
||||
|
@ -35,53 +32,41 @@
|
|||
%_ptr_Output_float = OpTypePointer Output %float
|
||||
%8 = OpConstantNull %float
|
||||
%vertex_point_size = OpVariable %_ptr_Output_float Output %8
|
||||
%void = OpTypeVoid
|
||||
%9 = OpTypeFunction %void
|
||||
%half = OpTypeFloat 16
|
||||
%v3half = OpTypeVector %half 3
|
||||
%9 = OpTypeFunction %v3half %v3half
|
||||
%half_0x1p_0 = OpConstant %half 0x1p+0
|
||||
%17 = OpConstantComposite %v3half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
|
||||
%bool = OpTypeBool
|
||||
%v3bool = OpTypeVector %bool 3
|
||||
%21 = OpConstantNull %v3half
|
||||
%void = OpTypeVoid
|
||||
%24 = OpTypeFunction %void
|
||||
%half_0x1_51p_0 = OpConstant %half 0x1.51p+0
|
||||
%16 = OpConstantComposite %v3half %half_0x1_51p_0 %half_0x1_51p_0 %half_0x1_51p_0
|
||||
%_ptr_Function_v3half = OpTypePointer Function %v3half
|
||||
%31 = OpTypeFunction %v4float
|
||||
%19 = OpConstantNull %v3half
|
||||
%20 = OpTypeFunction %v4float
|
||||
%float_1 = OpConstant %float 1
|
||||
%tint_acosh = OpFunction %v3half None %9
|
||||
%x = OpFunctionParameter %v3half
|
||||
%14 = OpLabel
|
||||
%18 = OpFOrdLessThan %v3bool %x %17
|
||||
%22 = OpExtInst %v3half %23 Acosh %x
|
||||
%15 = OpSelect %v3half %18 %21 %22
|
||||
OpReturnValue %15
|
||||
OpFunctionEnd
|
||||
%acosh_f56574 = OpFunction %void None %24
|
||||
%27 = OpLabel
|
||||
%res = OpVariable %_ptr_Function_v3half Function %21
|
||||
%28 = OpFunctionCall %v3half %tint_acosh %17
|
||||
OpStore %res %28
|
||||
%acosh_f56574 = OpFunction %void None %9
|
||||
%12 = OpLabel
|
||||
%res = OpVariable %_ptr_Function_v3half Function %19
|
||||
OpStore %res %16
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%vertex_main_inner = OpFunction %v4float None %31
|
||||
%33 = OpLabel
|
||||
%34 = OpFunctionCall %void %acosh_f56574
|
||||
%vertex_main_inner = OpFunction %v4float None %20
|
||||
%22 = OpLabel
|
||||
%23 = OpFunctionCall %void %acosh_f56574
|
||||
OpReturnValue %5
|
||||
OpFunctionEnd
|
||||
%vertex_main = OpFunction %void None %24
|
||||
%36 = OpLabel
|
||||
%37 = OpFunctionCall %v4float %vertex_main_inner
|
||||
OpStore %value %37
|
||||
%vertex_main = OpFunction %void None %9
|
||||
%25 = OpLabel
|
||||
%26 = OpFunctionCall %v4float %vertex_main_inner
|
||||
OpStore %value %26
|
||||
OpStore %vertex_point_size %float_1
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%fragment_main = OpFunction %void None %24
|
||||
%40 = OpLabel
|
||||
%41 = OpFunctionCall %void %acosh_f56574
|
||||
%fragment_main = OpFunction %void None %9
|
||||
%29 = OpLabel
|
||||
%30 = OpFunctionCall %void %acosh_f56574
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%compute_main = OpFunction %void None %24
|
||||
%43 = OpLabel
|
||||
%44 = OpFunctionCall %void %acosh_f56574
|
||||
%compute_main = OpFunction %void None %9
|
||||
%32 = OpLabel
|
||||
%33 = OpFunctionCall %void %acosh_f56574
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
enable f16;
|
||||
|
||||
fn acosh_f56574() {
|
||||
var res : vec3<f16> = acosh(vec3<f16>(1.0h));
|
||||
var res : vec3<f16> = acosh(vec3<f16>(2.0h));
|
||||
}
|
||||
|
||||
@vertex
|
||||
|
|
|
@ -0,0 +1,44 @@
|
|||
// 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 acosh(vec<2, fa>) -> vec<2, fa>
|
||||
fn acosh_17260e() {
|
||||
const arg_0 = vec2(2.);
|
||||
var res = acosh(arg_0);
|
||||
}
|
||||
|
||||
@vertex
|
||||
fn vertex_main() -> @builtin(position) vec4<f32> {
|
||||
acosh_17260e();
|
||||
return vec4<f32>();
|
||||
}
|
||||
|
||||
@fragment
|
||||
fn fragment_main() {
|
||||
acosh_17260e();
|
||||
}
|
||||
|
||||
@compute @workgroup_size(1)
|
||||
fn compute_main() {
|
||||
acosh_17260e();
|
||||
}
|
|
@ -0,0 +1,30 @@
|
|||
void acosh_17260e() {
|
||||
float2 res = (1.316957951f).xx;
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
float4 value : SV_Position;
|
||||
};
|
||||
|
||||
float4 vertex_main_inner() {
|
||||
acosh_17260e();
|
||||
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() {
|
||||
acosh_17260e();
|
||||
return;
|
||||
}
|
||||
|
||||
[numthreads(1, 1, 1)]
|
||||
void compute_main() {
|
||||
acosh_17260e();
|
||||
return;
|
||||
}
|
|
@ -0,0 +1,30 @@
|
|||
void acosh_17260e() {
|
||||
float2 res = (1.316957951f).xx;
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
float4 value : SV_Position;
|
||||
};
|
||||
|
||||
float4 vertex_main_inner() {
|
||||
acosh_17260e();
|
||||
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() {
|
||||
acosh_17260e();
|
||||
return;
|
||||
}
|
||||
|
||||
[numthreads(1, 1, 1)]
|
||||
void compute_main() {
|
||||
acosh_17260e();
|
||||
return;
|
||||
}
|
|
@ -0,0 +1,49 @@
|
|||
#version 310 es
|
||||
|
||||
void acosh_17260e() {
|
||||
vec2 res = vec2(1.316957951f);
|
||||
}
|
||||
|
||||
vec4 vertex_main() {
|
||||
acosh_17260e();
|
||||
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 acosh_17260e() {
|
||||
vec2 res = vec2(1.316957951f);
|
||||
}
|
||||
|
||||
void fragment_main() {
|
||||
acosh_17260e();
|
||||
}
|
||||
|
||||
void main() {
|
||||
fragment_main();
|
||||
return;
|
||||
}
|
||||
#version 310 es
|
||||
|
||||
void acosh_17260e() {
|
||||
vec2 res = vec2(1.316957951f);
|
||||
}
|
||||
|
||||
void compute_main() {
|
||||
acosh_17260e();
|
||||
}
|
||||
|
||||
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||
void main() {
|
||||
compute_main();
|
||||
return;
|
||||
}
|
|
@ -0,0 +1,33 @@
|
|||
#include <metal_stdlib>
|
||||
|
||||
using namespace metal;
|
||||
void acosh_17260e() {
|
||||
float2 res = float2(1.316957951f);
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
float4 value [[position]];
|
||||
};
|
||||
|
||||
float4 vertex_main_inner() {
|
||||
acosh_17260e();
|
||||
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() {
|
||||
acosh_17260e();
|
||||
return;
|
||||
}
|
||||
|
||||
kernel void compute_main() {
|
||||
acosh_17260e();
|
||||
return;
|
||||
}
|
||||
|
|
@ -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 %acosh_17260e "acosh_17260e"
|
||||
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_1_31695795 = OpConstant %float 1.31695795
|
||||
%15 = OpConstantComposite %v2float %float_1_31695795 %float_1_31695795
|
||||
%_ptr_Function_v2float = OpTypePointer Function %v2float
|
||||
%18 = OpConstantNull %v2float
|
||||
%19 = OpTypeFunction %v4float
|
||||
%float_1 = OpConstant %float 1
|
||||
%acosh_17260e = 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 %acosh_17260e
|
||||
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 %acosh_17260e
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%compute_main = OpFunction %void None %9
|
||||
%31 = OpLabel
|
||||
%32 = OpFunctionCall %void %acosh_17260e
|
||||
OpReturn
|
||||
OpFunctionEnd
|
|
@ -0,0 +1,20 @@
|
|||
fn acosh_17260e() {
|
||||
const arg_0 = vec2(2.0);
|
||||
var res = acosh(arg_0);
|
||||
}
|
||||
|
||||
@vertex
|
||||
fn vertex_main() -> @builtin(position) vec4<f32> {
|
||||
acosh_17260e();
|
||||
return vec4<f32>();
|
||||
}
|
||||
|
||||
@fragment
|
||||
fn fragment_main() {
|
||||
acosh_17260e();
|
||||
}
|
||||
|
||||
@compute @workgroup_size(1)
|
||||
fn compute_main() {
|
||||
acosh_17260e();
|
||||
}
|
|
@ -0,0 +1,44 @@
|
|||
// 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 acosh(fa) -> fa
|
||||
fn acosh_3433e8() {
|
||||
const arg_0 = 2.;
|
||||
var res = acosh(arg_0);
|
||||
}
|
||||
|
||||
@vertex
|
||||
fn vertex_main() -> @builtin(position) vec4<f32> {
|
||||
acosh_3433e8();
|
||||
return vec4<f32>();
|
||||
}
|
||||
|
||||
@fragment
|
||||
fn fragment_main() {
|
||||
acosh_3433e8();
|
||||
}
|
||||
|
||||
@compute @workgroup_size(1)
|
||||
fn compute_main() {
|
||||
acosh_3433e8();
|
||||
}
|
|
@ -0,0 +1,30 @@
|
|||
void acosh_3433e8() {
|
||||
float res = 1.316957951f;
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
float4 value : SV_Position;
|
||||
};
|
||||
|
||||
float4 vertex_main_inner() {
|
||||
acosh_3433e8();
|
||||
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() {
|
||||
acosh_3433e8();
|
||||
return;
|
||||
}
|
||||
|
||||
[numthreads(1, 1, 1)]
|
||||
void compute_main() {
|
||||
acosh_3433e8();
|
||||
return;
|
||||
}
|
|
@ -0,0 +1,30 @@
|
|||
void acosh_3433e8() {
|
||||
float res = 1.316957951f;
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
float4 value : SV_Position;
|
||||
};
|
||||
|
||||
float4 vertex_main_inner() {
|
||||
acosh_3433e8();
|
||||
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() {
|
||||
acosh_3433e8();
|
||||
return;
|
||||
}
|
||||
|
||||
[numthreads(1, 1, 1)]
|
||||
void compute_main() {
|
||||
acosh_3433e8();
|
||||
return;
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue