intrinsics: Add new struct form of modf(), frexp()

Implement these for all the writers.
SPIR-V reader not implemented (the old overloads weren't implemented either).

Deprecate the old overloads.

Fixed: tint:54
Change-Id: If66d26dbac3389ff604734f31b426abe47868b91
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/59302
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: James Price <jrprice@google.com>
This commit is contained in:
Ben Clayton
2021-07-23 16:43:01 +00:00
parent 465c5aa51d
commit 053559d051
236 changed files with 5861 additions and 2658 deletions

View File

@@ -1,5 +1,6 @@
[[stage(compute), workgroup_size(1)]]
fn main() {
var exponent : i32;
let significand : f32 = frexp(1.23, &exponent);
let res = frexp(1.23);
let exp : i32 = res.exp;
let sig : f32 = res.sig;
}

View File

@@ -1,13 +1,18 @@
float tint_frexp(float param_0, inout int param_1) {
float float_exp;
float significand = frexp(param_0, float_exp);
param_1 = int(float_exp);
return significand;
struct frexp_result {
float sig;
int exp;
};
frexp_result tint_frexp(float param_0) {
float exp;
float sig = frexp(param_0, exp);
frexp_result result = {sig, int(exp)};
return result;
}
[numthreads(1, 1, 1)]
void main() {
int exponent = 0;
const float significand = tint_frexp(1.230000019f, exponent);
const frexp_result res = tint_frexp(1.230000019f);
const int exp = res.exp;
const float sig = res.sig;
return;
}

View File

@@ -1,9 +1,21 @@
#include <metal_stdlib>
using namespace metal;
struct frexp_result {
float sig;
int exp;
};
frexp_result tint_frexp(float param_0) {
int exp;
float sig = frexp(param_0, exp);
return {sig, exp};
}
kernel void tint_symbol() {
int exponent = 0;
float const significand = frexp(1.230000019f, *(&(exponent)));
frexp_result const res = tint_frexp(1.230000019f);
int const exp = res.exp;
float const sig = res.sig;
return;
}

View File

@@ -1,25 +1,29 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
; Bound: 14
; Bound: 13
; Schema: 0
OpCapability Shader
%11 = OpExtInstImport "GLSL.std.450"
%9 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
OpEntryPoint GLCompute %main "main"
OpExecutionMode %main LocalSize 1 1 1
OpName %main "main"
OpName %exponent "exponent"
OpName %_frexp_result "_frexp_result"
OpMemberName %_frexp_result 0 "sig"
OpMemberName %_frexp_result 1 "exp"
OpMemberDecorate %_frexp_result 0 Offset 0
OpMemberDecorate %_frexp_result 1 Offset 4
%void = OpTypeVoid
%1 = OpTypeFunction %void
%int = OpTypeInt 32 1
%_ptr_Function_int = OpTypePointer Function %int
%8 = OpConstantNull %int
%float = OpTypeFloat 32
%int = OpTypeInt 32 1
%_frexp_result = OpTypeStruct %float %int
%float_1_23000002 = OpConstant %float 1.23000002
%main = OpFunction %void None %1
%4 = OpLabel
%exponent = OpVariable %_ptr_Function_int Function %8
%9 = OpExtInst %float %11 Frexp %float_1_23000002 %exponent
%5 = OpExtInst %_frexp_result %9 FrexpStruct %float_1_23000002
%11 = OpCompositeExtract %int %5 1
%12 = OpCompositeExtract %float %5 0
OpReturn
OpFunctionEnd

View File

@@ -1,5 +1,6 @@
[[stage(compute), workgroup_size(1)]]
fn main() {
var exponent : i32;
let significand : f32 = frexp(1.230000019, &(exponent));
let res = frexp(1.230000019);
let exp : i32 = res.exp;
let sig : f32 = res.sig;
}

View File

@@ -1,3 +1,7 @@
intrinsics/gen/frexp/013caa.wgsl:29:24 warning: use of deprecated intrinsic
var res: vec4<f32> = frexp(vec4<f32>(), &arg_1);
^^^^^
float4 tint_frexp(float4 param_0, inout int4 param_1) {
float4 float_exp;
float4 significand = frexp(param_0, float_exp);

View File

@@ -1,13 +1,25 @@
intrinsics/gen/frexp/013caa.wgsl:29:24 warning: use of deprecated intrinsic
var res: vec4<f32> = frexp(vec4<f32>(), &arg_1);
^^^^^
#include <metal_stdlib>
using namespace metal;
float4 tint_frexp(float4 param_0, thread int4* param_1) {
int4 exp;
float4 sig = frexp(param_0, exp);
*param_1 = exp;
return sig;
}
struct tint_symbol {
float4 value [[position]];
};
void frexp_013caa() {
int4 arg_1 = 0;
float4 res = frexp(float4(), *(&(arg_1)));
float4 res = tint_frexp(float4(), &(arg_1));
}
vertex tint_symbol vertex_main() {

View File

@@ -1,3 +1,7 @@
intrinsics/gen/frexp/013caa.wgsl:29:24 warning: use of deprecated intrinsic
var res: vec4<f32> = frexp(vec4<f32>(), &arg_1);
^^^^^
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0

View File

@@ -1,3 +1,7 @@
intrinsics/gen/frexp/013caa.wgsl:29:24 warning: use of deprecated intrinsic
var res: vec4<f32> = frexp(vec4<f32>(), &arg_1);
^^^^^
fn frexp_013caa() {
var arg_1 : vec4<i32>;
var res : vec4<f32> = frexp(vec4<f32>(), &(arg_1));

View File

@@ -1,3 +1,7 @@
intrinsics/gen/frexp/0da285.wgsl:29:18 warning: use of deprecated intrinsic
var res: f32 = frexp(1.0, &arg_1);
^^^^^
float tint_frexp(float param_0, inout int param_1) {
float float_exp;
float significand = frexp(param_0, float_exp);

View File

@@ -1,10 +1,20 @@
SKIP: FAILED
intrinsics/gen/frexp/0da285.wgsl:29:18 warning: use of deprecated intrinsic
var res: f32 = frexp(1.0, &arg_1);
^^^^^
#include <metal_stdlib>
using namespace metal;
float tint_frexp(float param_0, threadgroup int* param_1) {
int exp;
float sig = frexp(param_0, exp);
*param_1 = exp;
return sig;
}
void frexp_0da285(threadgroup int* const tint_symbol_1) {
float res = frexp(1.0f, *(&(*(tint_symbol_1))));
float res = tint_frexp(1.0f, &(*(tint_symbol_1)));
}
kernel void compute_main(uint local_invocation_index [[thread_index_in_threadgroup]]) {
@@ -17,44 +27,3 @@ kernel void compute_main(uint local_invocation_index [[thread_index_in_threadgro
return;
}
Compilation failed:
program_source:5:15: error: no matching function for call to 'frexp'
float res = frexp(1.0f, *(&(*(tint_symbol_1))));
^~~~~
/System/Library/PrivateFrameworks/GPUCompiler.framework/Versions/31001/Libraries/lib/clang/31001.189/include/metal/metal_math:4560:18: note: candidate function not viable: address space mismatch in 2nd argument ('threadgroup int'), parameter type must be 'int &'
METAL_FUNC float frexp(float x, thread int &exp)
^
/System/Library/PrivateFrameworks/GPUCompiler.framework/Versions/31001/Libraries/lib/clang/31001.189/include/metal/metal_math:3092:17: note: candidate function not viable: address space mismatch in 2nd argument ('threadgroup int'), parameter type must be 'int &'
METAL_FUNC half frexp(half x, thread int &exp)
^
/System/Library/PrivateFrameworks/GPUCompiler.framework/Versions/31001/Libraries/lib/clang/31001.189/include/metal/metal_math:3336:18: note: candidate function not viable: no known conversion from 'threadgroup int' to 'metal::int2 &' (aka 'int2 &') for 2nd argument
METAL_FUNC half2 frexp(half2 x, thread int2 &exp)
^
/System/Library/PrivateFrameworks/GPUCompiler.framework/Versions/31001/Libraries/lib/clang/31001.189/include/metal/metal_math:3580:18: note: candidate function not viable: no known conversion from 'threadgroup int' to 'metal::int3 &' (aka 'int3 &') for 2nd argument
METAL_FUNC half3 frexp(half3 x, thread int3 &exp)
^
/System/Library/PrivateFrameworks/GPUCompiler.framework/Versions/31001/Libraries/lib/clang/31001.189/include/metal/metal_math:3824:18: note: candidate function not viable: no known conversion from 'threadgroup int' to 'metal::int4 &' (aka 'int4 &') for 2nd argument
METAL_FUNC half4 frexp(half4 x, thread int4 &exp)
^
/System/Library/PrivateFrameworks/GPUCompiler.framework/Versions/31001/Libraries/lib/clang/31001.189/include/metal/metal_math:4804:19: note: candidate function not viable: no known conversion from 'threadgroup int' to 'metal::int2 &' (aka 'int2 &') for 2nd argument
METAL_FUNC float2 frexp(float2 x, thread int2 &exp)
^
/System/Library/PrivateFrameworks/GPUCompiler.framework/Versions/31001/Libraries/lib/clang/31001.189/include/metal/metal_math:5048:19: note: candidate function not viable: no known conversion from 'threadgroup int' to 'metal::int3 &' (aka 'int3 &') for 2nd argument
METAL_FUNC float3 frexp(float3 x, thread int3 &exp)
^
/System/Library/PrivateFrameworks/GPUCompiler.framework/Versions/31001/Libraries/lib/clang/31001.189/include/metal/metal_math:5292:19: note: candidate function not viable: no known conversion from 'threadgroup int' to 'metal::int4 &' (aka 'int4 &') for 2nd argument
METAL_FUNC float4 frexp(float4 x, thread int4 &exp)
^
program_source:10:31: warning: equality comparison with extraneous parentheses
if ((local_invocation_index == 0u)) {
~~~~~~~~~~~~~~~~~~~~~~~^~~~~
program_source:10:31: note: remove extraneous parentheses around the comparison to silence this warning
if ((local_invocation_index == 0u)) {
~ ^ ~
program_source:10:31: note: use '=' to turn this equality comparison into an assignment
if ((local_invocation_index == 0u)) {
^~
=

View File

@@ -1,3 +1,7 @@
intrinsics/gen/frexp/0da285.wgsl:29:18 warning: use of deprecated intrinsic
var res: f32 = frexp(1.0, &arg_1);
^^^^^
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0

View File

@@ -1,3 +1,7 @@
intrinsics/gen/frexp/0da285.wgsl:29:18 warning: use of deprecated intrinsic
var res: f32 = frexp(1.0, &arg_1);
^^^^^
var<workgroup> arg_1 : i32;
fn frexp_0da285() {

View File

@@ -0,0 +1,45 @@
// Copyright 2021 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/intrinsic-gen
// using the template:
// test/intrinsics/intrinsics.wgsl.tmpl
// and the intrinsic defintion file:
// src/intrinsics.def
//
// Do not modify this file directly
////////////////////////////////////////////////////////////////////////////////
// fn frexp(f32) -> _frexp_result
fn frexp_12f1da() {
var res = frexp(1.0);
}
[[stage(vertex)]]
fn vertex_main() -> [[builtin(position)]] vec4<f32> {
frexp_12f1da();
return vec4<f32>();
}
[[stage(fragment)]]
fn fragment_main() {
frexp_12f1da();
}
[[stage(compute), workgroup_size(1)]]
fn compute_main() {
frexp_12f1da();
}

View File

@@ -0,0 +1,35 @@
struct frexp_result {
float sig;
int exp;
};
frexp_result tint_frexp(float param_0) {
float exp;
float sig = frexp(param_0, exp);
frexp_result result = {sig, int(exp)};
return result;
}
void frexp_12f1da() {
frexp_result res = tint_frexp(1.0f);
}
struct tint_symbol {
float4 value : SV_Position;
};
tint_symbol vertex_main() {
frexp_12f1da();
const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
return tint_symbol_1;
}
void fragment_main() {
frexp_12f1da();
return;
}
[numthreads(1, 1, 1)]
void compute_main() {
frexp_12f1da();
return;
}

View File

@@ -0,0 +1,38 @@
#include <metal_stdlib>
using namespace metal;
struct frexp_result {
float sig;
int exp;
};
frexp_result tint_frexp(float param_0) {
int exp;
float sig = frexp(param_0, exp);
return {sig, exp};
}
struct tint_symbol {
float4 value [[position]];
};
void frexp_12f1da() {
frexp_result res = tint_frexp(1.0f);
}
vertex tint_symbol vertex_main() {
frexp_12f1da();
tint_symbol const tint_symbol_1 = {.value=float4()};
return tint_symbol_1;
}
fragment void fragment_main() {
frexp_12f1da();
return;
}
kernel void compute_main() {
frexp_12f1da();
return;
}

View File

@@ -0,0 +1,75 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
; Bound: 35
; Schema: 0
OpCapability Shader
%16 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %tint_symbol_1 "tint_symbol_1"
OpName %frexp_12f1da "frexp_12f1da"
OpName %_frexp_result "_frexp_result"
OpMemberName %_frexp_result 0 "sig"
OpMemberName %_frexp_result 1 "exp"
OpName %res "res"
OpName %tint_symbol_2 "tint_symbol_2"
OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
OpDecorate %tint_symbol_1 BuiltIn Position
OpMemberDecorate %_frexp_result 0 Offset 0
OpMemberDecorate %_frexp_result 1 Offset 4
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
%tint_pointsize = OpVariable %_ptr_Output_float Output %4
%v4float = OpTypeVector %float 4
%_ptr_Output_v4float = OpTypePointer Output %v4float
%8 = OpConstantNull %v4float
%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8
%void = OpTypeVoid
%9 = OpTypeFunction %void
%int = OpTypeInt 32 1
%_frexp_result = OpTypeStruct %float %int
%float_1 = OpConstant %float 1
%_ptr_Function__frexp_result = OpTypePointer Function %_frexp_result
%20 = OpConstantNull %_frexp_result
%21 = OpTypeFunction %void %v4float
%frexp_12f1da = OpFunction %void None %9
%12 = OpLabel
%res = OpVariable %_ptr_Function__frexp_result Function %20
%13 = OpExtInst %_frexp_result %16 FrexpStruct %float_1
OpStore %res %13
OpReturn
OpFunctionEnd
%tint_symbol_2 = OpFunction %void None %21
%tint_symbol = OpFunctionParameter %v4float
%24 = OpLabel
OpStore %tint_symbol_1 %tint_symbol
OpReturn
OpFunctionEnd
%vertex_main = OpFunction %void None %9
%26 = OpLabel
OpStore %tint_pointsize %float_1
%27 = OpFunctionCall %void %frexp_12f1da
%28 = OpFunctionCall %void %tint_symbol_2 %8
OpReturn
OpFunctionEnd
%fragment_main = OpFunction %void None %9
%30 = OpLabel
%31 = OpFunctionCall %void %frexp_12f1da
OpReturn
OpFunctionEnd
%compute_main = OpFunction %void None %9
%33 = OpLabel
%34 = OpFunctionCall %void %frexp_12f1da
OpReturn
OpFunctionEnd

View File

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

View File

@@ -1,3 +1,7 @@
intrinsics/gen/frexp/15edf3.wgsl:29:24 warning: use of deprecated intrinsic
var res: vec2<f32> = frexp(vec2<f32>(), &arg_1);
^^^^^
float2 tint_frexp(float2 param_0, inout int2 param_1) {
float2 float_exp;
float2 significand = frexp(param_0, float_exp);

View File

@@ -1,13 +1,25 @@
intrinsics/gen/frexp/15edf3.wgsl:29:24 warning: use of deprecated intrinsic
var res: vec2<f32> = frexp(vec2<f32>(), &arg_1);
^^^^^
#include <metal_stdlib>
using namespace metal;
float2 tint_frexp(float2 param_0, thread int2* param_1) {
int2 exp;
float2 sig = frexp(param_0, exp);
*param_1 = exp;
return sig;
}
struct tint_symbol {
float4 value [[position]];
};
void frexp_15edf3() {
int2 arg_1 = 0;
float2 res = frexp(float2(), *(&(arg_1)));
float2 res = tint_frexp(float2(), &(arg_1));
}
vertex tint_symbol vertex_main() {

View File

@@ -1,3 +1,7 @@
intrinsics/gen/frexp/15edf3.wgsl:29:24 warning: use of deprecated intrinsic
var res: vec2<f32> = frexp(vec2<f32>(), &arg_1);
^^^^^
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0

View File

@@ -1,3 +1,7 @@
intrinsics/gen/frexp/15edf3.wgsl:29:24 warning: use of deprecated intrinsic
var res: vec2<f32> = frexp(vec2<f32>(), &arg_1);
^^^^^
fn frexp_15edf3() {
var arg_1 : vec2<i32>;
var res : vec2<f32> = frexp(vec2<f32>(), &(arg_1));

View File

@@ -1,3 +1,7 @@
intrinsics/gen/frexp/19ab15.wgsl:29:24 warning: use of deprecated intrinsic
var res: vec4<f32> = frexp(vec4<f32>(), &arg_1);
^^^^^
float4 tint_frexp(float4 param_0, inout int4 param_1) {
float4 float_exp;
float4 significand = frexp(param_0, float_exp);

View File

@@ -1,13 +1,25 @@
intrinsics/gen/frexp/19ab15.wgsl:29:24 warning: use of deprecated intrinsic
var res: vec4<f32> = frexp(vec4<f32>(), &arg_1);
^^^^^
#include <metal_stdlib>
using namespace metal;
float4 tint_frexp(float4 param_0, thread int4* param_1) {
int4 exp;
float4 sig = frexp(param_0, exp);
*param_1 = exp;
return sig;
}
struct tint_symbol {
float4 value [[position]];
};
void frexp_19ab15() {
int4 arg_1 = 0;
float4 res = frexp(float4(), *(&(arg_1)));
float4 res = tint_frexp(float4(), &(arg_1));
}
vertex tint_symbol vertex_main() {

View File

@@ -1,3 +1,7 @@
intrinsics/gen/frexp/19ab15.wgsl:29:24 warning: use of deprecated intrinsic
var res: vec4<f32> = frexp(vec4<f32>(), &arg_1);
^^^^^
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0

View File

@@ -1,3 +1,7 @@
intrinsics/gen/frexp/19ab15.wgsl:29:24 warning: use of deprecated intrinsic
var res: vec4<f32> = frexp(vec4<f32>(), &arg_1);
^^^^^
fn frexp_19ab15() {
var arg_1 : vec4<i32>;
var res : vec4<f32> = frexp(vec4<f32>(), &(arg_1));

View File

@@ -1,3 +1,7 @@
intrinsics/gen/frexp/2052e9.wgsl:29:24 warning: use of deprecated intrinsic
var res: vec4<f32> = frexp(vec4<f32>(), &arg_1);
^^^^^
float4 tint_frexp(float4 param_0, inout int4 param_1) {
float4 float_exp;
float4 significand = frexp(param_0, float_exp);

View File

@@ -1,13 +1,25 @@
intrinsics/gen/frexp/2052e9.wgsl:29:24 warning: use of deprecated intrinsic
var res: vec4<f32> = frexp(vec4<f32>(), &arg_1);
^^^^^
#include <metal_stdlib>
using namespace metal;
float4 tint_frexp(float4 param_0, thread int4* param_1) {
int4 exp;
float4 sig = frexp(param_0, exp);
*param_1 = exp;
return sig;
}
struct tint_symbol {
float4 value [[position]];
};
void frexp_2052e9() {
int4 arg_1 = 0;
float4 res = frexp(float4(), *(&(arg_1)));
float4 res = tint_frexp(float4(), &(arg_1));
}
vertex tint_symbol vertex_main() {

View File

@@ -1,3 +1,7 @@
intrinsics/gen/frexp/2052e9.wgsl:29:24 warning: use of deprecated intrinsic
var res: vec4<f32> = frexp(vec4<f32>(), &arg_1);
^^^^^
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0

View File

@@ -1,3 +1,7 @@
intrinsics/gen/frexp/2052e9.wgsl:29:24 warning: use of deprecated intrinsic
var res: vec4<f32> = frexp(vec4<f32>(), &arg_1);
^^^^^
fn frexp_2052e9() {
var arg_1 : vec4<i32>;
var res : vec4<f32> = frexp(vec4<f32>(), &(arg_1));

View File

@@ -1,3 +1,7 @@
intrinsics/gen/frexp/40fc9b.wgsl:29:24 warning: use of deprecated intrinsic
var res: vec3<f32> = frexp(vec3<f32>(), &arg_1);
^^^^^
float3 tint_frexp(float3 param_0, inout int3 param_1) {
float3 float_exp;
float3 significand = frexp(param_0, float_exp);

View File

@@ -1,10 +1,20 @@
SKIP: FAILED
intrinsics/gen/frexp/40fc9b.wgsl:29:24 warning: use of deprecated intrinsic
var res: vec3<f32> = frexp(vec3<f32>(), &arg_1);
^^^^^
#include <metal_stdlib>
using namespace metal;
float3 tint_frexp(float3 param_0, threadgroup int3* param_1) {
int3 exp;
float3 sig = frexp(param_0, exp);
*param_1 = exp;
return sig;
}
void frexp_40fc9b(threadgroup int3* const tint_symbol_1) {
float3 res = frexp(float3(), *(&(*(tint_symbol_1))));
float3 res = tint_frexp(float3(), &(*(tint_symbol_1)));
}
kernel void compute_main(uint local_invocation_index [[thread_index_in_threadgroup]]) {
@@ -17,44 +27,3 @@ kernel void compute_main(uint local_invocation_index [[thread_index_in_threadgro
return;
}
Compilation failed:
program_source:5:16: error: no matching function for call to 'frexp'
float3 res = frexp(float3(), *(&(*(tint_symbol_1))));
^~~~~
/System/Library/PrivateFrameworks/GPUCompiler.framework/Versions/31001/Libraries/lib/clang/31001.189/include/metal/metal_math:5048:19: note: candidate function not viable: address space mismatch in 2nd argument ('threadgroup int3' (vector of 3 'int' values)), parameter type must be 'metal::int3 &' (aka 'int3 &')
METAL_FUNC float3 frexp(float3 x, thread int3 &exp)
^
/System/Library/PrivateFrameworks/GPUCompiler.framework/Versions/31001/Libraries/lib/clang/31001.189/include/metal/metal_math:3092:17: note: candidate function not viable: no known conversion from 'float3' (vector of 3 'float' values) to 'half' for 1st argument
METAL_FUNC half frexp(half x, thread int &exp)
^
/System/Library/PrivateFrameworks/GPUCompiler.framework/Versions/31001/Libraries/lib/clang/31001.189/include/metal/metal_math:3336:18: note: candidate function not viable: no known conversion from 'float3' (vector of 3 'float' values) to 'metal::half2' (aka 'half2') for 1st argument
METAL_FUNC half2 frexp(half2 x, thread int2 &exp)
^
/System/Library/PrivateFrameworks/GPUCompiler.framework/Versions/31001/Libraries/lib/clang/31001.189/include/metal/metal_math:3580:18: note: candidate function not viable: no known conversion from 'float3' (vector of 3 'float' values) to 'metal::half3' (aka 'half3') for 1st argument
METAL_FUNC half3 frexp(half3 x, thread int3 &exp)
^
/System/Library/PrivateFrameworks/GPUCompiler.framework/Versions/31001/Libraries/lib/clang/31001.189/include/metal/metal_math:3824:18: note: candidate function not viable: no known conversion from 'float3' (vector of 3 'float' values) to 'metal::half4' (aka 'half4') for 1st argument
METAL_FUNC half4 frexp(half4 x, thread int4 &exp)
^
/System/Library/PrivateFrameworks/GPUCompiler.framework/Versions/31001/Libraries/lib/clang/31001.189/include/metal/metal_math:4560:18: note: candidate function not viable: no known conversion from 'float3' (vector of 3 'float' values) to 'float' for 1st argument
METAL_FUNC float frexp(float x, thread int &exp)
^
/System/Library/PrivateFrameworks/GPUCompiler.framework/Versions/31001/Libraries/lib/clang/31001.189/include/metal/metal_math:4804:19: note: candidate function not viable: no known conversion from 'float3' (vector of 3 'float' values) to 'metal::float2' (aka 'float2') for 1st argument
METAL_FUNC float2 frexp(float2 x, thread int2 &exp)
^
/System/Library/PrivateFrameworks/GPUCompiler.framework/Versions/31001/Libraries/lib/clang/31001.189/include/metal/metal_math:5292:19: note: candidate function not viable: no known conversion from 'float3' (vector of 3 'float' values) to 'metal::float4' (aka 'float4') for 1st argument
METAL_FUNC float4 frexp(float4 x, thread int4 &exp)
^
program_source:10:31: warning: equality comparison with extraneous parentheses
if ((local_invocation_index == 0u)) {
~~~~~~~~~~~~~~~~~~~~~~~^~~~~
program_source:10:31: note: remove extraneous parentheses around the comparison to silence this warning
if ((local_invocation_index == 0u)) {
~ ^ ~
program_source:10:31: note: use '=' to turn this equality comparison into an assignment
if ((local_invocation_index == 0u)) {
^~
=

View File

@@ -1,3 +1,7 @@
intrinsics/gen/frexp/40fc9b.wgsl:29:24 warning: use of deprecated intrinsic
var res: vec3<f32> = frexp(vec3<f32>(), &arg_1);
^^^^^
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0

View File

@@ -1,3 +1,7 @@
intrinsics/gen/frexp/40fc9b.wgsl:29:24 warning: use of deprecated intrinsic
var res: vec3<f32> = frexp(vec3<f32>(), &arg_1);
^^^^^
var<workgroup> arg_1 : vec3<i32>;
fn frexp_40fc9b() {

View File

@@ -1,3 +1,7 @@
intrinsics/gen/frexp/41e931.wgsl:29:18 warning: use of deprecated intrinsic
var res: f32 = frexp(1.0, &arg_1);
^^^^^
float tint_frexp(float param_0, inout int param_1) {
float float_exp;
float significand = frexp(param_0, float_exp);

View File

@@ -1,13 +1,25 @@
intrinsics/gen/frexp/41e931.wgsl:29:18 warning: use of deprecated intrinsic
var res: f32 = frexp(1.0, &arg_1);
^^^^^
#include <metal_stdlib>
using namespace metal;
float tint_frexp(float param_0, thread int* param_1) {
int exp;
float sig = frexp(param_0, exp);
*param_1 = exp;
return sig;
}
struct tint_symbol {
float4 value [[position]];
};
void frexp_41e931() {
int arg_1 = 0;
float res = frexp(1.0f, *(&(arg_1)));
float res = tint_frexp(1.0f, &(arg_1));
}
vertex tint_symbol vertex_main() {

View File

@@ -1,3 +1,7 @@
intrinsics/gen/frexp/41e931.wgsl:29:18 warning: use of deprecated intrinsic
var res: f32 = frexp(1.0, &arg_1);
^^^^^
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0

View File

@@ -1,3 +1,7 @@
intrinsics/gen/frexp/41e931.wgsl:29:18 warning: use of deprecated intrinsic
var res: f32 = frexp(1.0, &arg_1);
^^^^^
fn frexp_41e931() {
var arg_1 : i32;
var res : f32 = frexp(1.0, &(arg_1));

View File

@@ -1,3 +1,7 @@
intrinsics/gen/frexp/481e59.wgsl:29:18 warning: use of deprecated intrinsic
var res: f32 = frexp(1.0, &arg_1);
^^^^^
float tint_frexp(float param_0, inout int param_1) {
float float_exp;
float significand = frexp(param_0, float_exp);

View File

@@ -1,13 +1,25 @@
intrinsics/gen/frexp/481e59.wgsl:29:18 warning: use of deprecated intrinsic
var res: f32 = frexp(1.0, &arg_1);
^^^^^
#include <metal_stdlib>
using namespace metal;
float tint_frexp(float param_0, thread int* param_1) {
int exp;
float sig = frexp(param_0, exp);
*param_1 = exp;
return sig;
}
struct tint_symbol {
float4 value [[position]];
};
void frexp_481e59() {
int arg_1 = 0;
float res = frexp(1.0f, *(&(arg_1)));
float res = tint_frexp(1.0f, &(arg_1));
}
vertex tint_symbol vertex_main() {

View File

@@ -1,3 +1,7 @@
intrinsics/gen/frexp/481e59.wgsl:29:18 warning: use of deprecated intrinsic
var res: f32 = frexp(1.0, &arg_1);
^^^^^
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0

View File

@@ -1,3 +1,7 @@
intrinsics/gen/frexp/481e59.wgsl:29:18 warning: use of deprecated intrinsic
var res: f32 = frexp(1.0, &arg_1);
^^^^^
fn frexp_481e59() {
var arg_1 : i32;
var res : f32 = frexp(1.0, &(arg_1));

View File

@@ -1,3 +1,7 @@
intrinsics/gen/frexp/5a141e.wgsl:29:24 warning: use of deprecated intrinsic
var res: vec3<f32> = frexp(vec3<f32>(), &arg_1);
^^^^^
float3 tint_frexp(float3 param_0, inout int3 param_1) {
float3 float_exp;
float3 significand = frexp(param_0, float_exp);

View File

@@ -1,13 +1,25 @@
intrinsics/gen/frexp/5a141e.wgsl:29:24 warning: use of deprecated intrinsic
var res: vec3<f32> = frexp(vec3<f32>(), &arg_1);
^^^^^
#include <metal_stdlib>
using namespace metal;
float3 tint_frexp(float3 param_0, thread int3* param_1) {
int3 exp;
float3 sig = frexp(param_0, exp);
*param_1 = exp;
return sig;
}
struct tint_symbol {
float4 value [[position]];
};
void frexp_5a141e() {
int3 arg_1 = 0;
float3 res = frexp(float3(), *(&(arg_1)));
float3 res = tint_frexp(float3(), &(arg_1));
}
vertex tint_symbol vertex_main() {

View File

@@ -1,3 +1,7 @@
intrinsics/gen/frexp/5a141e.wgsl:29:24 warning: use of deprecated intrinsic
var res: vec3<f32> = frexp(vec3<f32>(), &arg_1);
^^^^^
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0

View File

@@ -1,3 +1,7 @@
intrinsics/gen/frexp/5a141e.wgsl:29:24 warning: use of deprecated intrinsic
var res: vec3<f32> = frexp(vec3<f32>(), &arg_1);
^^^^^
fn frexp_5a141e() {
var arg_1 : vec3<i32>;
var res : vec3<f32> = frexp(vec3<f32>(), &(arg_1));

View File

@@ -1,3 +1,7 @@
intrinsics/gen/frexp/6d0058.wgsl:29:24 warning: use of deprecated intrinsic
var res: vec3<f32> = frexp(vec3<f32>(), &arg_1);
^^^^^
float3 tint_frexp(float3 param_0, inout int3 param_1) {
float3 float_exp;
float3 significand = frexp(param_0, float_exp);

View File

@@ -1,13 +1,25 @@
intrinsics/gen/frexp/6d0058.wgsl:29:24 warning: use of deprecated intrinsic
var res: vec3<f32> = frexp(vec3<f32>(), &arg_1);
^^^^^
#include <metal_stdlib>
using namespace metal;
float3 tint_frexp(float3 param_0, thread int3* param_1) {
int3 exp;
float3 sig = frexp(param_0, exp);
*param_1 = exp;
return sig;
}
struct tint_symbol {
float4 value [[position]];
};
void frexp_6d0058() {
int3 arg_1 = 0;
float3 res = frexp(float3(), *(&(arg_1)));
float3 res = tint_frexp(float3(), &(arg_1));
}
vertex tint_symbol vertex_main() {

View File

@@ -1,3 +1,7 @@
intrinsics/gen/frexp/6d0058.wgsl:29:24 warning: use of deprecated intrinsic
var res: vec3<f32> = frexp(vec3<f32>(), &arg_1);
^^^^^
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0

View File

@@ -1,3 +1,7 @@
intrinsics/gen/frexp/6d0058.wgsl:29:24 warning: use of deprecated intrinsic
var res: vec3<f32> = frexp(vec3<f32>(), &arg_1);
^^^^^
fn frexp_6d0058() {
var arg_1 : vec3<i32>;
var res : vec3<f32> = frexp(vec3<f32>(), &(arg_1));

View File

@@ -1,3 +1,7 @@
intrinsics/gen/frexp/6efa09.wgsl:29:24 warning: use of deprecated intrinsic
var res: vec3<f32> = frexp(vec3<f32>(), &arg_1);
^^^^^
float3 tint_frexp(float3 param_0, inout int3 param_1) {
float3 float_exp;
float3 significand = frexp(param_0, float_exp);

View File

@@ -1,12 +1,24 @@
intrinsics/gen/frexp/6efa09.wgsl:29:24 warning: use of deprecated intrinsic
var res: vec3<f32> = frexp(vec3<f32>(), &arg_1);
^^^^^
#include <metal_stdlib>
using namespace metal;
float3 tint_frexp(float3 param_0, thread int3* param_1) {
int3 exp;
float3 sig = frexp(param_0, exp);
*param_1 = exp;
return sig;
}
struct tint_symbol {
float4 value [[position]];
};
void frexp_6efa09(thread int3* const tint_symbol_2) {
float3 res = frexp(float3(), *(&(*(tint_symbol_2))));
float3 res = tint_frexp(float3(), &(*(tint_symbol_2)));
}
vertex tint_symbol vertex_main() {

View File

@@ -1,3 +1,7 @@
intrinsics/gen/frexp/6efa09.wgsl:29:24 warning: use of deprecated intrinsic
var res: vec3<f32> = frexp(vec3<f32>(), &arg_1);
^^^^^
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0

View File

@@ -1,3 +1,7 @@
intrinsics/gen/frexp/6efa09.wgsl:29:24 warning: use of deprecated intrinsic
var res: vec3<f32> = frexp(vec3<f32>(), &arg_1);
^^^^^
var<private> arg_1 : vec3<i32>;
fn frexp_6efa09() {

View File

@@ -0,0 +1,45 @@
// Copyright 2021 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/intrinsic-gen
// using the template:
// test/intrinsics/intrinsics.wgsl.tmpl
// and the intrinsic defintion file:
// src/intrinsics.def
//
// Do not modify this file directly
////////////////////////////////////////////////////////////////////////////////
// fn frexp(vec<3, f32>) -> _frexp_result_vec<3>
fn frexp_a0eb3b() {
var res = frexp(vec3<f32>());
}
[[stage(vertex)]]
fn vertex_main() -> [[builtin(position)]] vec4<f32> {
frexp_a0eb3b();
return vec4<f32>();
}
[[stage(fragment)]]
fn fragment_main() {
frexp_a0eb3b();
}
[[stage(compute), workgroup_size(1)]]
fn compute_main() {
frexp_a0eb3b();
}

View File

@@ -0,0 +1,35 @@
struct frexp_result_vec3 {
float3 sig;
int3 exp;
};
frexp_result_vec3 tint_frexp(float3 param_0) {
float3 exp;
float3 sig = frexp(param_0, exp);
frexp_result_vec3 result = {sig, int3(exp)};
return result;
}
void frexp_a0eb3b() {
frexp_result_vec3 res = tint_frexp(float3(0.0f, 0.0f, 0.0f));
}
struct tint_symbol {
float4 value : SV_Position;
};
tint_symbol vertex_main() {
frexp_a0eb3b();
const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
return tint_symbol_1;
}
void fragment_main() {
frexp_a0eb3b();
return;
}
[numthreads(1, 1, 1)]
void compute_main() {
frexp_a0eb3b();
return;
}

View File

@@ -0,0 +1,38 @@
#include <metal_stdlib>
using namespace metal;
struct frexp_result_vec3 {
float3 sig;
int3 exp;
};
frexp_result_vec3 tint_frexp(float3 param_0) {
int3 exp;
float3 sig = frexp(param_0, exp);
return {sig, exp};
}
struct tint_symbol {
float4 value [[position]];
};
void frexp_a0eb3b() {
frexp_result_vec3 res = tint_frexp(float3());
}
vertex tint_symbol vertex_main() {
frexp_a0eb3b();
tint_symbol const tint_symbol_1 = {.value=float4()};
return tint_symbol_1;
}
fragment void fragment_main() {
frexp_a0eb3b();
return;
}
kernel void compute_main() {
frexp_a0eb3b();
return;
}

View File

@@ -0,0 +1,78 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
; Bound: 38
; Schema: 0
OpCapability Shader
%18 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %tint_symbol_1 "tint_symbol_1"
OpName %frexp_a0eb3b "frexp_a0eb3b"
OpName %_frexp_result_vec3 "_frexp_result_vec3"
OpMemberName %_frexp_result_vec3 0 "sig"
OpMemberName %_frexp_result_vec3 1 "exp"
OpName %res "res"
OpName %tint_symbol_2 "tint_symbol_2"
OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
OpDecorate %tint_symbol_1 BuiltIn Position
OpMemberDecorate %_frexp_result_vec3 0 Offset 0
OpMemberDecorate %_frexp_result_vec3 1 Offset 16
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
%tint_pointsize = OpVariable %_ptr_Output_float Output %4
%v4float = OpTypeVector %float 4
%_ptr_Output_v4float = OpTypePointer Output %v4float
%8 = OpConstantNull %v4float
%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8
%void = OpTypeVoid
%9 = OpTypeFunction %void
%v3float = OpTypeVector %float 3
%int = OpTypeInt 32 1
%v3int = OpTypeVector %int 3
%_frexp_result_vec3 = OpTypeStruct %v3float %v3int
%19 = OpConstantNull %v3float
%_ptr_Function__frexp_result_vec3 = OpTypePointer Function %_frexp_result_vec3
%22 = OpConstantNull %_frexp_result_vec3
%23 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
%frexp_a0eb3b = OpFunction %void None %9
%12 = OpLabel
%res = OpVariable %_ptr_Function__frexp_result_vec3 Function %22
%13 = OpExtInst %_frexp_result_vec3 %18 FrexpStruct %19
OpStore %res %13
OpReturn
OpFunctionEnd
%tint_symbol_2 = OpFunction %void None %23
%tint_symbol = OpFunctionParameter %v4float
%26 = OpLabel
OpStore %tint_symbol_1 %tint_symbol
OpReturn
OpFunctionEnd
%vertex_main = OpFunction %void None %9
%28 = OpLabel
OpStore %tint_pointsize %float_1
%30 = OpFunctionCall %void %frexp_a0eb3b
%31 = OpFunctionCall %void %tint_symbol_2 %8
OpReturn
OpFunctionEnd
%fragment_main = OpFunction %void None %9
%33 = OpLabel
%34 = OpFunctionCall %void %frexp_a0eb3b
OpReturn
OpFunctionEnd
%compute_main = OpFunction %void None %9
%36 = OpLabel
%37 = OpFunctionCall %void %frexp_a0eb3b
OpReturn
OpFunctionEnd

View File

@@ -0,0 +1,19 @@
fn frexp_a0eb3b() {
var res = frexp(vec3<f32>());
}
[[stage(vertex)]]
fn vertex_main() -> [[builtin(position)]] vec4<f32> {
frexp_a0eb3b();
return vec4<f32>();
}
[[stage(fragment)]]
fn fragment_main() {
frexp_a0eb3b();
}
[[stage(compute), workgroup_size(1)]]
fn compute_main() {
frexp_a0eb3b();
}

View File

@@ -1,3 +1,7 @@
intrinsics/gen/frexp/a2a617.wgsl:29:18 warning: use of deprecated intrinsic
var res: f32 = frexp(1.0, &arg_1);
^^^^^
float tint_frexp(float param_0, inout int param_1) {
float float_exp;
float significand = frexp(param_0, float_exp);

View File

@@ -1,12 +1,24 @@
intrinsics/gen/frexp/a2a617.wgsl:29:18 warning: use of deprecated intrinsic
var res: f32 = frexp(1.0, &arg_1);
^^^^^
#include <metal_stdlib>
using namespace metal;
float tint_frexp(float param_0, thread int* param_1) {
int exp;
float sig = frexp(param_0, exp);
*param_1 = exp;
return sig;
}
struct tint_symbol {
float4 value [[position]];
};
void frexp_a2a617(thread int* const tint_symbol_2) {
float res = frexp(1.0f, *(&(*(tint_symbol_2))));
float res = tint_frexp(1.0f, &(*(tint_symbol_2)));
}
vertex tint_symbol vertex_main() {

View File

@@ -1,3 +1,7 @@
intrinsics/gen/frexp/a2a617.wgsl:29:18 warning: use of deprecated intrinsic
var res: f32 = frexp(1.0, &arg_1);
^^^^^
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0

View File

@@ -1,3 +1,7 @@
intrinsics/gen/frexp/a2a617.wgsl:29:18 warning: use of deprecated intrinsic
var res: f32 = frexp(1.0, &arg_1);
^^^^^
var<private> arg_1 : i32;
fn frexp_a2a617() {

View File

@@ -1,3 +1,7 @@
intrinsics/gen/frexp/a3f940.wgsl:29:24 warning: use of deprecated intrinsic
var res: vec2<f32> = frexp(vec2<f32>(), &arg_1);
^^^^^
float2 tint_frexp(float2 param_0, inout int2 param_1) {
float2 float_exp;
float2 significand = frexp(param_0, float_exp);

View File

@@ -1,10 +1,20 @@
SKIP: FAILED
intrinsics/gen/frexp/a3f940.wgsl:29:24 warning: use of deprecated intrinsic
var res: vec2<f32> = frexp(vec2<f32>(), &arg_1);
^^^^^
#include <metal_stdlib>
using namespace metal;
float2 tint_frexp(float2 param_0, threadgroup int2* param_1) {
int2 exp;
float2 sig = frexp(param_0, exp);
*param_1 = exp;
return sig;
}
void frexp_a3f940(threadgroup int2* const tint_symbol_1) {
float2 res = frexp(float2(), *(&(*(tint_symbol_1))));
float2 res = tint_frexp(float2(), &(*(tint_symbol_1)));
}
kernel void compute_main(uint local_invocation_index [[thread_index_in_threadgroup]]) {
@@ -17,44 +27,3 @@ kernel void compute_main(uint local_invocation_index [[thread_index_in_threadgro
return;
}
Compilation failed:
program_source:5:16: error: no matching function for call to 'frexp'
float2 res = frexp(float2(), *(&(*(tint_symbol_1))));
^~~~~
/System/Library/PrivateFrameworks/GPUCompiler.framework/Versions/31001/Libraries/lib/clang/31001.189/include/metal/metal_math:4804:19: note: candidate function not viable: address space mismatch in 2nd argument ('threadgroup int2' (vector of 2 'int' values)), parameter type must be 'metal::int2 &' (aka 'int2 &')
METAL_FUNC float2 frexp(float2 x, thread int2 &exp)
^
/System/Library/PrivateFrameworks/GPUCompiler.framework/Versions/31001/Libraries/lib/clang/31001.189/include/metal/metal_math:3092:17: note: candidate function not viable: no known conversion from 'float2' (vector of 2 'float' values) to 'half' for 1st argument
METAL_FUNC half frexp(half x, thread int &exp)
^
/System/Library/PrivateFrameworks/GPUCompiler.framework/Versions/31001/Libraries/lib/clang/31001.189/include/metal/metal_math:3336:18: note: candidate function not viable: no known conversion from 'float2' (vector of 2 'float' values) to 'metal::half2' (aka 'half2') for 1st argument
METAL_FUNC half2 frexp(half2 x, thread int2 &exp)
^
/System/Library/PrivateFrameworks/GPUCompiler.framework/Versions/31001/Libraries/lib/clang/31001.189/include/metal/metal_math:3580:18: note: candidate function not viable: no known conversion from 'float2' (vector of 2 'float' values) to 'metal::half3' (aka 'half3') for 1st argument
METAL_FUNC half3 frexp(half3 x, thread int3 &exp)
^
/System/Library/PrivateFrameworks/GPUCompiler.framework/Versions/31001/Libraries/lib/clang/31001.189/include/metal/metal_math:3824:18: note: candidate function not viable: no known conversion from 'float2' (vector of 2 'float' values) to 'metal::half4' (aka 'half4') for 1st argument
METAL_FUNC half4 frexp(half4 x, thread int4 &exp)
^
/System/Library/PrivateFrameworks/GPUCompiler.framework/Versions/31001/Libraries/lib/clang/31001.189/include/metal/metal_math:4560:18: note: candidate function not viable: no known conversion from 'float2' (vector of 2 'float' values) to 'float' for 1st argument
METAL_FUNC float frexp(float x, thread int &exp)
^
/System/Library/PrivateFrameworks/GPUCompiler.framework/Versions/31001/Libraries/lib/clang/31001.189/include/metal/metal_math:5048:19: note: candidate function not viable: no known conversion from 'float2' (vector of 2 'float' values) to 'metal::float3' (aka 'float3') for 1st argument
METAL_FUNC float3 frexp(float3 x, thread int3 &exp)
^
/System/Library/PrivateFrameworks/GPUCompiler.framework/Versions/31001/Libraries/lib/clang/31001.189/include/metal/metal_math:5292:19: note: candidate function not viable: no known conversion from 'float2' (vector of 2 'float' values) to 'metal::float4' (aka 'float4') for 1st argument
METAL_FUNC float4 frexp(float4 x, thread int4 &exp)
^
program_source:10:31: warning: equality comparison with extraneous parentheses
if ((local_invocation_index == 0u)) {
~~~~~~~~~~~~~~~~~~~~~~~^~~~~
program_source:10:31: note: remove extraneous parentheses around the comparison to silence this warning
if ((local_invocation_index == 0u)) {
~ ^ ~
program_source:10:31: note: use '=' to turn this equality comparison into an assignment
if ((local_invocation_index == 0u)) {
^~
=

View File

@@ -1,3 +1,7 @@
intrinsics/gen/frexp/a3f940.wgsl:29:24 warning: use of deprecated intrinsic
var res: vec2<f32> = frexp(vec2<f32>(), &arg_1);
^^^^^
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0

View File

@@ -1,3 +1,7 @@
intrinsics/gen/frexp/a3f940.wgsl:29:24 warning: use of deprecated intrinsic
var res: vec2<f32> = frexp(vec2<f32>(), &arg_1);
^^^^^
var<workgroup> arg_1 : vec2<i32>;
fn frexp_a3f940() {

View File

@@ -1,3 +1,7 @@
intrinsics/gen/frexp/a951b5.wgsl:29:24 warning: use of deprecated intrinsic
var res: vec2<f32> = frexp(vec2<f32>(), &arg_1);
^^^^^
float2 tint_frexp(float2 param_0, inout int2 param_1) {
float2 float_exp;
float2 significand = frexp(param_0, float_exp);

View File

@@ -1,13 +1,25 @@
intrinsics/gen/frexp/a951b5.wgsl:29:24 warning: use of deprecated intrinsic
var res: vec2<f32> = frexp(vec2<f32>(), &arg_1);
^^^^^
#include <metal_stdlib>
using namespace metal;
float2 tint_frexp(float2 param_0, thread int2* param_1) {
int2 exp;
float2 sig = frexp(param_0, exp);
*param_1 = exp;
return sig;
}
struct tint_symbol {
float4 value [[position]];
};
void frexp_a951b5() {
int2 arg_1 = 0;
float2 res = frexp(float2(), *(&(arg_1)));
float2 res = tint_frexp(float2(), &(arg_1));
}
vertex tint_symbol vertex_main() {

View File

@@ -1,3 +1,7 @@
intrinsics/gen/frexp/a951b5.wgsl:29:24 warning: use of deprecated intrinsic
var res: vec2<f32> = frexp(vec2<f32>(), &arg_1);
^^^^^
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0

View File

@@ -1,3 +1,7 @@
intrinsics/gen/frexp/a951b5.wgsl:29:24 warning: use of deprecated intrinsic
var res: vec2<f32> = frexp(vec2<f32>(), &arg_1);
^^^^^
fn frexp_a951b5() {
var arg_1 : vec2<i32>;
var res : vec2<f32> = frexp(vec2<f32>(), &(arg_1));

View File

@@ -1,3 +1,7 @@
intrinsics/gen/frexp/b45525.wgsl:29:24 warning: use of deprecated intrinsic
var res: vec4<f32> = frexp(vec4<f32>(), &arg_1);
^^^^^
float4 tint_frexp(float4 param_0, inout int4 param_1) {
float4 float_exp;
float4 significand = frexp(param_0, float_exp);

View File

@@ -1,12 +1,24 @@
intrinsics/gen/frexp/b45525.wgsl:29:24 warning: use of deprecated intrinsic
var res: vec4<f32> = frexp(vec4<f32>(), &arg_1);
^^^^^
#include <metal_stdlib>
using namespace metal;
float4 tint_frexp(float4 param_0, thread int4* param_1) {
int4 exp;
float4 sig = frexp(param_0, exp);
*param_1 = exp;
return sig;
}
struct tint_symbol {
float4 value [[position]];
};
void frexp_b45525(thread int4* const tint_symbol_2) {
float4 res = frexp(float4(), *(&(*(tint_symbol_2))));
float4 res = tint_frexp(float4(), &(*(tint_symbol_2)));
}
vertex tint_symbol vertex_main() {

View File

@@ -1,3 +1,7 @@
intrinsics/gen/frexp/b45525.wgsl:29:24 warning: use of deprecated intrinsic
var res: vec4<f32> = frexp(vec4<f32>(), &arg_1);
^^^^^
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0

View File

@@ -1,3 +1,7 @@
intrinsics/gen/frexp/b45525.wgsl:29:24 warning: use of deprecated intrinsic
var res: vec4<f32> = frexp(vec4<f32>(), &arg_1);
^^^^^
var<private> arg_1 : vec4<i32>;
fn frexp_b45525() {

View File

@@ -1,3 +1,7 @@
intrinsics/gen/frexp/b87f4e.wgsl:29:24 warning: use of deprecated intrinsic
var res: vec4<f32> = frexp(vec4<f32>(), &arg_1);
^^^^^
float4 tint_frexp(float4 param_0, inout int4 param_1) {
float4 float_exp;
float4 significand = frexp(param_0, float_exp);

View File

@@ -1,10 +1,20 @@
SKIP: FAILED
intrinsics/gen/frexp/b87f4e.wgsl:29:24 warning: use of deprecated intrinsic
var res: vec4<f32> = frexp(vec4<f32>(), &arg_1);
^^^^^
#include <metal_stdlib>
using namespace metal;
float4 tint_frexp(float4 param_0, threadgroup int4* param_1) {
int4 exp;
float4 sig = frexp(param_0, exp);
*param_1 = exp;
return sig;
}
void frexp_b87f4e(threadgroup int4* const tint_symbol_1) {
float4 res = frexp(float4(), *(&(*(tint_symbol_1))));
float4 res = tint_frexp(float4(), &(*(tint_symbol_1)));
}
kernel void compute_main(uint local_invocation_index [[thread_index_in_threadgroup]]) {
@@ -17,44 +27,3 @@ kernel void compute_main(uint local_invocation_index [[thread_index_in_threadgro
return;
}
Compilation failed:
program_source:5:16: error: no matching function for call to 'frexp'
float4 res = frexp(float4(), *(&(*(tint_symbol_1))));
^~~~~
/System/Library/PrivateFrameworks/GPUCompiler.framework/Versions/31001/Libraries/lib/clang/31001.189/include/metal/metal_math:5292:19: note: candidate function not viable: address space mismatch in 2nd argument ('threadgroup int4' (vector of 4 'int' values)), parameter type must be 'metal::int4 &' (aka 'int4 &')
METAL_FUNC float4 frexp(float4 x, thread int4 &exp)
^
/System/Library/PrivateFrameworks/GPUCompiler.framework/Versions/31001/Libraries/lib/clang/31001.189/include/metal/metal_math:3092:17: note: candidate function not viable: no known conversion from 'float4' (vector of 4 'float' values) to 'half' for 1st argument
METAL_FUNC half frexp(half x, thread int &exp)
^
/System/Library/PrivateFrameworks/GPUCompiler.framework/Versions/31001/Libraries/lib/clang/31001.189/include/metal/metal_math:3336:18: note: candidate function not viable: no known conversion from 'float4' (vector of 4 'float' values) to 'metal::half2' (aka 'half2') for 1st argument
METAL_FUNC half2 frexp(half2 x, thread int2 &exp)
^
/System/Library/PrivateFrameworks/GPUCompiler.framework/Versions/31001/Libraries/lib/clang/31001.189/include/metal/metal_math:3580:18: note: candidate function not viable: no known conversion from 'float4' (vector of 4 'float' values) to 'metal::half3' (aka 'half3') for 1st argument
METAL_FUNC half3 frexp(half3 x, thread int3 &exp)
^
/System/Library/PrivateFrameworks/GPUCompiler.framework/Versions/31001/Libraries/lib/clang/31001.189/include/metal/metal_math:3824:18: note: candidate function not viable: no known conversion from 'float4' (vector of 4 'float' values) to 'metal::half4' (aka 'half4') for 1st argument
METAL_FUNC half4 frexp(half4 x, thread int4 &exp)
^
/System/Library/PrivateFrameworks/GPUCompiler.framework/Versions/31001/Libraries/lib/clang/31001.189/include/metal/metal_math:4560:18: note: candidate function not viable: no known conversion from 'float4' (vector of 4 'float' values) to 'float' for 1st argument
METAL_FUNC float frexp(float x, thread int &exp)
^
/System/Library/PrivateFrameworks/GPUCompiler.framework/Versions/31001/Libraries/lib/clang/31001.189/include/metal/metal_math:4804:19: note: candidate function not viable: no known conversion from 'float4' (vector of 4 'float' values) to 'metal::float2' (aka 'float2') for 1st argument
METAL_FUNC float2 frexp(float2 x, thread int2 &exp)
^
/System/Library/PrivateFrameworks/GPUCompiler.framework/Versions/31001/Libraries/lib/clang/31001.189/include/metal/metal_math:5048:19: note: candidate function not viable: no known conversion from 'float4' (vector of 4 'float' values) to 'metal::float3' (aka 'float3') for 1st argument
METAL_FUNC float3 frexp(float3 x, thread int3 &exp)
^
program_source:10:31: warning: equality comparison with extraneous parentheses
if ((local_invocation_index == 0u)) {
~~~~~~~~~~~~~~~~~~~~~~~^~~~~
program_source:10:31: note: remove extraneous parentheses around the comparison to silence this warning
if ((local_invocation_index == 0u)) {
~ ^ ~
program_source:10:31: note: use '=' to turn this equality comparison into an assignment
if ((local_invocation_index == 0u)) {
^~
=

View File

@@ -1,3 +1,7 @@
intrinsics/gen/frexp/b87f4e.wgsl:29:24 warning: use of deprecated intrinsic
var res: vec4<f32> = frexp(vec4<f32>(), &arg_1);
^^^^^
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0

View File

@@ -1,3 +1,7 @@
intrinsics/gen/frexp/b87f4e.wgsl:29:24 warning: use of deprecated intrinsic
var res: vec4<f32> = frexp(vec4<f32>(), &arg_1);
^^^^^
var<workgroup> arg_1 : vec4<i32>;
fn frexp_b87f4e() {

View File

@@ -1,3 +1,7 @@
intrinsics/gen/frexp/b9e4de.wgsl:29:24 warning: use of deprecated intrinsic
var res: vec3<f32> = frexp(vec3<f32>(), &arg_1);
^^^^^
float3 tint_frexp(float3 param_0, inout int3 param_1) {
float3 float_exp;
float3 significand = frexp(param_0, float_exp);

View File

@@ -1,13 +1,25 @@
intrinsics/gen/frexp/b9e4de.wgsl:29:24 warning: use of deprecated intrinsic
var res: vec3<f32> = frexp(vec3<f32>(), &arg_1);
^^^^^
#include <metal_stdlib>
using namespace metal;
float3 tint_frexp(float3 param_0, thread int3* param_1) {
int3 exp;
float3 sig = frexp(param_0, exp);
*param_1 = exp;
return sig;
}
struct tint_symbol {
float4 value [[position]];
};
void frexp_b9e4de() {
int3 arg_1 = 0;
float3 res = frexp(float3(), *(&(arg_1)));
float3 res = tint_frexp(float3(), &(arg_1));
}
vertex tint_symbol vertex_main() {

View File

@@ -1,3 +1,7 @@
intrinsics/gen/frexp/b9e4de.wgsl:29:24 warning: use of deprecated intrinsic
var res: vec3<f32> = frexp(vec3<f32>(), &arg_1);
^^^^^
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0

View File

@@ -1,3 +1,7 @@
intrinsics/gen/frexp/b9e4de.wgsl:29:24 warning: use of deprecated intrinsic
var res: vec3<f32> = frexp(vec3<f32>(), &arg_1);
^^^^^
fn frexp_b9e4de() {
var arg_1 : vec3<i32>;
var res : vec3<f32> = frexp(vec3<f32>(), &(arg_1));

View File

@@ -1,3 +1,7 @@
intrinsics/gen/frexp/c084e3.wgsl:29:24 warning: use of deprecated intrinsic
var res: vec2<f32> = frexp(vec2<f32>(), &arg_1);
^^^^^
float2 tint_frexp(float2 param_0, inout int2 param_1) {
float2 float_exp;
float2 significand = frexp(param_0, float_exp);

View File

@@ -1,12 +1,24 @@
intrinsics/gen/frexp/c084e3.wgsl:29:24 warning: use of deprecated intrinsic
var res: vec2<f32> = frexp(vec2<f32>(), &arg_1);
^^^^^
#include <metal_stdlib>
using namespace metal;
float2 tint_frexp(float2 param_0, thread int2* param_1) {
int2 exp;
float2 sig = frexp(param_0, exp);
*param_1 = exp;
return sig;
}
struct tint_symbol {
float4 value [[position]];
};
void frexp_c084e3(thread int2* const tint_symbol_2) {
float2 res = frexp(float2(), *(&(*(tint_symbol_2))));
float2 res = tint_frexp(float2(), &(*(tint_symbol_2)));
}
vertex tint_symbol vertex_main() {

View File

@@ -1,3 +1,7 @@
intrinsics/gen/frexp/c084e3.wgsl:29:24 warning: use of deprecated intrinsic
var res: vec2<f32> = frexp(vec2<f32>(), &arg_1);
^^^^^
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0

View File

@@ -1,3 +1,7 @@
intrinsics/gen/frexp/c084e3.wgsl:29:24 warning: use of deprecated intrinsic
var res: vec2<f32> = frexp(vec2<f32>(), &arg_1);
^^^^^
var<private> arg_1 : vec2<i32>;
fn frexp_c084e3() {

View File

@@ -1,3 +1,7 @@
intrinsics/gen/frexp/d06c2c.wgsl:29:24 warning: use of deprecated intrinsic
var res: vec2<f32> = frexp(vec2<f32>(), &arg_1);
^^^^^
float2 tint_frexp(float2 param_0, inout int2 param_1) {
float2 float_exp;
float2 significand = frexp(param_0, float_exp);

View File

@@ -1,13 +1,25 @@
intrinsics/gen/frexp/d06c2c.wgsl:29:24 warning: use of deprecated intrinsic
var res: vec2<f32> = frexp(vec2<f32>(), &arg_1);
^^^^^
#include <metal_stdlib>
using namespace metal;
float2 tint_frexp(float2 param_0, thread int2* param_1) {
int2 exp;
float2 sig = frexp(param_0, exp);
*param_1 = exp;
return sig;
}
struct tint_symbol {
float4 value [[position]];
};
void frexp_d06c2c() {
int2 arg_1 = 0;
float2 res = frexp(float2(), *(&(arg_1)));
float2 res = tint_frexp(float2(), &(arg_1));
}
vertex tint_symbol vertex_main() {

View File

@@ -1,3 +1,7 @@
intrinsics/gen/frexp/d06c2c.wgsl:29:24 warning: use of deprecated intrinsic
var res: vec2<f32> = frexp(vec2<f32>(), &arg_1);
^^^^^
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0

View File

@@ -1,3 +1,7 @@
intrinsics/gen/frexp/d06c2c.wgsl:29:24 warning: use of deprecated intrinsic
var res: vec2<f32> = frexp(vec2<f32>(), &arg_1);
^^^^^
fn frexp_d06c2c() {
var arg_1 : vec2<i32>;
var res : vec2<f32> = frexp(vec2<f32>(), &(arg_1));

View File

@@ -0,0 +1,45 @@
// Copyright 2021 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/intrinsic-gen
// using the template:
// test/intrinsics/intrinsics.wgsl.tmpl
// and the intrinsic defintion file:
// src/intrinsics.def
//
// Do not modify this file directly
////////////////////////////////////////////////////////////////////////////////
// fn frexp(vec<4, f32>) -> _frexp_result_vec<4>
fn frexp_d80367() {
var res = frexp(vec4<f32>());
}
[[stage(vertex)]]
fn vertex_main() -> [[builtin(position)]] vec4<f32> {
frexp_d80367();
return vec4<f32>();
}
[[stage(fragment)]]
fn fragment_main() {
frexp_d80367();
}
[[stage(compute), workgroup_size(1)]]
fn compute_main() {
frexp_d80367();
}

View File

@@ -0,0 +1,35 @@
struct frexp_result_vec4 {
float4 sig;
int4 exp;
};
frexp_result_vec4 tint_frexp(float4 param_0) {
float4 exp;
float4 sig = frexp(param_0, exp);
frexp_result_vec4 result = {sig, int4(exp)};
return result;
}
void frexp_d80367() {
frexp_result_vec4 res = tint_frexp(float4(0.0f, 0.0f, 0.0f, 0.0f));
}
struct tint_symbol {
float4 value : SV_Position;
};
tint_symbol vertex_main() {
frexp_d80367();
const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
return tint_symbol_1;
}
void fragment_main() {
frexp_d80367();
return;
}
[numthreads(1, 1, 1)]
void compute_main() {
frexp_d80367();
return;
}

View File

@@ -0,0 +1,38 @@
#include <metal_stdlib>
using namespace metal;
struct frexp_result_vec4 {
float4 sig;
int4 exp;
};
frexp_result_vec4 tint_frexp(float4 param_0) {
int4 exp;
float4 sig = frexp(param_0, exp);
return {sig, exp};
}
struct tint_symbol {
float4 value [[position]];
};
void frexp_d80367() {
frexp_result_vec4 res = tint_frexp(float4());
}
vertex tint_symbol vertex_main() {
frexp_d80367();
tint_symbol const tint_symbol_1 = {.value=float4()};
return tint_symbol_1;
}
fragment void fragment_main() {
frexp_d80367();
return;
}
kernel void compute_main() {
frexp_d80367();
return;
}

View File

@@ -0,0 +1,76 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
; Bound: 36
; Schema: 0
OpCapability Shader
%17 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %tint_symbol_1 "tint_symbol_1"
OpName %frexp_d80367 "frexp_d80367"
OpName %_frexp_result_vec4 "_frexp_result_vec4"
OpMemberName %_frexp_result_vec4 0 "sig"
OpMemberName %_frexp_result_vec4 1 "exp"
OpName %res "res"
OpName %tint_symbol_2 "tint_symbol_2"
OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
OpDecorate %tint_symbol_1 BuiltIn Position
OpMemberDecorate %_frexp_result_vec4 0 Offset 0
OpMemberDecorate %_frexp_result_vec4 1 Offset 16
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
%tint_pointsize = OpVariable %_ptr_Output_float Output %4
%v4float = OpTypeVector %float 4
%_ptr_Output_v4float = OpTypePointer Output %v4float
%8 = OpConstantNull %v4float
%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8
%void = OpTypeVoid
%9 = OpTypeFunction %void
%int = OpTypeInt 32 1
%v4int = OpTypeVector %int 4
%_frexp_result_vec4 = OpTypeStruct %v4float %v4int
%_ptr_Function__frexp_result_vec4 = OpTypePointer Function %_frexp_result_vec4
%20 = OpConstantNull %_frexp_result_vec4
%21 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
%frexp_d80367 = OpFunction %void None %9
%12 = OpLabel
%res = OpVariable %_ptr_Function__frexp_result_vec4 Function %20
%13 = OpExtInst %_frexp_result_vec4 %17 FrexpStruct %8
OpStore %res %13
OpReturn
OpFunctionEnd
%tint_symbol_2 = OpFunction %void None %21
%tint_symbol = OpFunctionParameter %v4float
%24 = OpLabel
OpStore %tint_symbol_1 %tint_symbol
OpReturn
OpFunctionEnd
%vertex_main = OpFunction %void None %9
%26 = OpLabel
OpStore %tint_pointsize %float_1
%28 = OpFunctionCall %void %frexp_d80367
%29 = OpFunctionCall %void %tint_symbol_2 %8
OpReturn
OpFunctionEnd
%fragment_main = OpFunction %void None %9
%31 = OpLabel
%32 = OpFunctionCall %void %frexp_d80367
OpReturn
OpFunctionEnd
%compute_main = OpFunction %void None %9
%34 = OpLabel
%35 = OpFunctionCall %void %frexp_d80367
OpReturn
OpFunctionEnd

View File

@@ -0,0 +1,19 @@
fn frexp_d80367() {
var res = frexp(vec4<f32>());
}
[[stage(vertex)]]
fn vertex_main() -> [[builtin(position)]] vec4<f32> {
frexp_d80367();
return vec4<f32>();
}
[[stage(fragment)]]
fn fragment_main() {
frexp_d80367();
}
[[stage(compute), workgroup_size(1)]]
fn compute_main() {
frexp_d80367();
}

View File

@@ -0,0 +1,45 @@
// Copyright 2021 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/intrinsic-gen
// using the template:
// test/intrinsics/intrinsics.wgsl.tmpl
// and the intrinsic defintion file:
// src/intrinsics.def
//
// Do not modify this file directly
////////////////////////////////////////////////////////////////////////////////
// fn frexp(vec<2, f32>) -> _frexp_result_vec<2>
fn frexp_db0637() {
var res = frexp(vec2<f32>());
}
[[stage(vertex)]]
fn vertex_main() -> [[builtin(position)]] vec4<f32> {
frexp_db0637();
return vec4<f32>();
}
[[stage(fragment)]]
fn fragment_main() {
frexp_db0637();
}
[[stage(compute), workgroup_size(1)]]
fn compute_main() {
frexp_db0637();
}

View File

@@ -0,0 +1,35 @@
struct frexp_result_vec2 {
float2 sig;
int2 exp;
};
frexp_result_vec2 tint_frexp(float2 param_0) {
float2 exp;
float2 sig = frexp(param_0, exp);
frexp_result_vec2 result = {sig, int2(exp)};
return result;
}
void frexp_db0637() {
frexp_result_vec2 res = tint_frexp(float2(0.0f, 0.0f));
}
struct tint_symbol {
float4 value : SV_Position;
};
tint_symbol vertex_main() {
frexp_db0637();
const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
return tint_symbol_1;
}
void fragment_main() {
frexp_db0637();
return;
}
[numthreads(1, 1, 1)]
void compute_main() {
frexp_db0637();
return;
}

View File

@@ -0,0 +1,38 @@
#include <metal_stdlib>
using namespace metal;
struct frexp_result_vec2 {
float2 sig;
int2 exp;
};
frexp_result_vec2 tint_frexp(float2 param_0) {
int2 exp;
float2 sig = frexp(param_0, exp);
return {sig, exp};
}
struct tint_symbol {
float4 value [[position]];
};
void frexp_db0637() {
frexp_result_vec2 res = tint_frexp(float2());
}
vertex tint_symbol vertex_main() {
frexp_db0637();
tint_symbol const tint_symbol_1 = {.value=float4()};
return tint_symbol_1;
}
fragment void fragment_main() {
frexp_db0637();
return;
}
kernel void compute_main() {
frexp_db0637();
return;
}

View File

@@ -0,0 +1,78 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
; Bound: 38
; Schema: 0
OpCapability Shader
%18 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %tint_symbol_1 "tint_symbol_1"
OpName %frexp_db0637 "frexp_db0637"
OpName %_frexp_result_vec2 "_frexp_result_vec2"
OpMemberName %_frexp_result_vec2 0 "sig"
OpMemberName %_frexp_result_vec2 1 "exp"
OpName %res "res"
OpName %tint_symbol_2 "tint_symbol_2"
OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
OpDecorate %tint_symbol_1 BuiltIn Position
OpMemberDecorate %_frexp_result_vec2 0 Offset 0
OpMemberDecorate %_frexp_result_vec2 1 Offset 8
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
%tint_pointsize = OpVariable %_ptr_Output_float Output %4
%v4float = OpTypeVector %float 4
%_ptr_Output_v4float = OpTypePointer Output %v4float
%8 = OpConstantNull %v4float
%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8
%void = OpTypeVoid
%9 = OpTypeFunction %void
%v2float = OpTypeVector %float 2
%int = OpTypeInt 32 1
%v2int = OpTypeVector %int 2
%_frexp_result_vec2 = OpTypeStruct %v2float %v2int
%19 = OpConstantNull %v2float
%_ptr_Function__frexp_result_vec2 = OpTypePointer Function %_frexp_result_vec2
%22 = OpConstantNull %_frexp_result_vec2
%23 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
%frexp_db0637 = OpFunction %void None %9
%12 = OpLabel
%res = OpVariable %_ptr_Function__frexp_result_vec2 Function %22
%13 = OpExtInst %_frexp_result_vec2 %18 FrexpStruct %19
OpStore %res %13
OpReturn
OpFunctionEnd
%tint_symbol_2 = OpFunction %void None %23
%tint_symbol = OpFunctionParameter %v4float
%26 = OpLabel
OpStore %tint_symbol_1 %tint_symbol
OpReturn
OpFunctionEnd
%vertex_main = OpFunction %void None %9
%28 = OpLabel
OpStore %tint_pointsize %float_1
%30 = OpFunctionCall %void %frexp_db0637
%31 = OpFunctionCall %void %tint_symbol_2 %8
OpReturn
OpFunctionEnd
%fragment_main = OpFunction %void None %9
%33 = OpLabel
%34 = OpFunctionCall %void %frexp_db0637
OpReturn
OpFunctionEnd
%compute_main = OpFunction %void None %9
%36 = OpLabel
%37 = OpFunctionCall %void %frexp_db0637
OpReturn
OpFunctionEnd

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