diff --git a/tests/in/constructors.param.ron b/tests/in/constructors.param.ron new file mode 100644 index 0000000000..72873dd667 --- /dev/null +++ b/tests/in/constructors.param.ron @@ -0,0 +1,2 @@ +( +) diff --git a/tests/in/constructors.wgsl b/tests/in/constructors.wgsl new file mode 100644 index 0000000000..d221dc80de --- /dev/null +++ b/tests/in/constructors.wgsl @@ -0,0 +1,67 @@ +struct Foo { + a: vec4, + b: i32, +} + +// const const1 = vec3(0.0); // TODO: this is now a splat and we need to const eval it +const const2 = vec3(0.0, 1.0, 2.0); +const const3 = mat2x2(0.0, 1.0, 2.0, 3.0); +const const4 = array, 1>(mat2x2(0.0, 1.0, 2.0, 3.0)); + +// zero value constructors +const cz0 = bool(); +const cz1 = i32(); +const cz2 = u32(); +const cz3 = f32(); +const cz4 = vec2(); +const cz5 = mat2x2(); +const cz6 = array(); +const cz7 = Foo(); + +// constructors that infer their type from their parameters +// TODO: these also contain splats +// const cp1 = vec2(0u); +// const cp2 = mat2x2(vec2(0.), vec2(0.)); +const cp3 = array(0, 1, 2, 3); + +@compute @workgroup_size(1) +fn main() { + var foo: Foo; + foo = Foo(vec4(1.0), 1); + + let m0 = mat2x2( + 1.0, 0.0, + 0.0, 1.0, + ); + let m1 = mat4x4( + 1.0, 0.0, 0.0, 0.0, + 0.0, 1.0, 0.0, 0.0, + 0.0, 0.0, 1.0, 0.0, + 0.0, 0.0, 0.0, 1.0, + ); + + // zero value constructors + let zvc0 = bool(); + let zvc1 = i32(); + let zvc2 = u32(); + let zvc3 = f32(); + let zvc4 = vec2(); + let zvc5 = mat2x2(); + let zvc6 = array(); + let zvc7 = Foo(); + + // constructors that infer their type from their parameters + let cit0 = vec2(0u); + let cit1 = mat2x2(vec2(0.), vec2(0.)); + let cit2 = array(0, 1, 2, 3); + + // identity constructors + let ic0 = bool(bool()); + let ic1 = i32(i32()); + let ic2 = u32(u32()); + let ic3 = f32(f32()); + let ic4 = vec2(vec2()); + let ic5 = mat2x3(mat2x3()); + let ic6 = vec2(vec2()); + let ic7 = mat2x3(mat2x3()); +} diff --git a/tests/in/operators.wgsl b/tests/in/operators.wgsl index 365a039921..eaf16ab8ff 100644 --- a/tests/in/operators.wgsl +++ b/tests/in/operators.wgsl @@ -1,4 +1,3 @@ -//TODO: support splatting constructors for globals? const v_f32_one = vec4(1.0, 1.0, 1.0, 1.0); const v_f32_zero = vec4(0.0, 0.0, 0.0, 0.0); const v_f32_half = vec4(0.5, 0.5, 0.5, 0.5); @@ -41,54 +40,6 @@ fn bool_cast(x: vec3) -> vec3 { return vec3(y); } -struct Foo { - a: vec4, - b: i32, -} - -fn constructors() -> f32 { - var foo: Foo; - foo = Foo(vec4(1.0), 1); - - let m0 = mat2x2( - 1.0, 0.0, - 0.0, 1.0, - ); - let m1 = mat4x4( - 1.0, 0.0, 0.0, 0.0, - 0.0, 1.0, 0.0, 0.0, - 0.0, 0.0, 1.0, 0.0, - 0.0, 0.0, 0.0, 1.0, - ); - - // zero value constructors - let zvc0 = bool(); - let zvc1 = i32(); - let zvc2 = u32(); - let zvc3 = f32(); - let zvc4 = vec2(); - let zvc5 = mat2x2(); - let zvc6 = array(); - let zvc7 = Foo(); - - // constructors that infer their type from their parameters - let cit0 = vec2(0u); - let cit1 = mat2x2(vec2(0.), vec2(0.)); - let cit2 = array(0, 1, 2, 3); - - // identity constructors - let ic0 = bool(bool()); - let ic1 = i32(i32()); - let ic2 = u32(u32()); - let ic3 = f32(f32()); - let ic4 = vec2(vec2()); - let ic5 = mat2x3(mat2x3()); - let ic6 = vec2(vec2()); - let ic7 = mat2x3(mat2x3()); - - return foo.a.x; -} - fn logical() { // unary let neg0 = !true; @@ -306,7 +257,6 @@ fn main() { builtins(); splat(); bool_cast(v_f32_one.xyz); - constructors(); logical(); arithmetic(); diff --git a/tests/out/glsl/constructors.main.Compute.glsl b/tests/out/glsl/constructors.main.Compute.glsl new file mode 100644 index 0000000000..112795eda1 --- /dev/null +++ b/tests/out/glsl/constructors.main.Compute.glsl @@ -0,0 +1,43 @@ +#version 310 es + +precision highp float; +precision highp int; + +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; + +struct Foo { + vec4 a; + int b; +}; +const vec3 const2_ = vec3(0.0, 1.0, 2.0); +const mat2x2 const3_ = mat2x2(vec2(0.0, 1.0), vec2(2.0, 3.0)); +const mat2x2 const4_[1] = mat2x2[1](mat2x2(vec2(0.0, 1.0), vec2(2.0, 3.0))); +const bool cz0_ = false; +const int cz1_ = 0; +const uint cz2_ = 0u; +const float cz3_ = 0.0; +const uvec2 cz4_ = uvec2(0u); +const mat2x2 cz5_ = mat2x2(0.0); +const Foo cz6_[3] = Foo[3](Foo(vec4(0.0), 0), Foo(vec4(0.0), 0), Foo(vec4(0.0), 0)); +const Foo cz7_ = Foo(vec4(0.0), 0); +const int cp3_[4] = int[4](0, 1, 2, 3); + + +void main() { + Foo foo = Foo(vec4(0.0), 0); + foo = Foo(vec4(1.0), 1); + mat2x2 m0_ = mat2x2(vec2(1.0, 0.0), vec2(0.0, 1.0)); + mat4x4 m1_ = mat4x4(vec4(1.0, 0.0, 0.0, 0.0), vec4(0.0, 1.0, 0.0, 0.0), vec4(0.0, 0.0, 1.0, 0.0), vec4(0.0, 0.0, 0.0, 1.0)); + uvec2 cit0_ = uvec2(0u); + mat2x2 cit1_ = mat2x2(vec2(0.0), vec2(0.0)); + int cit2_[4] = int[4](0, 1, 2, 3); + bool ic0_ = bool(false); + int ic1_ = int(0); + uint ic2_ = uint(0u); + float ic3_ = float(0.0); + uvec2 ic4_ = uvec2(uvec2(0u)); + mat2x3 ic5_ = mat2x3(mat2x3(0.0)); + uvec2 ic6_ = uvec2(0u); + mat2x3 ic7_ = mat2x3(0.0); +} + diff --git a/tests/out/glsl/operators.main.Compute.glsl b/tests/out/glsl/operators.main.Compute.glsl index 51dc36969e..5adfec2f8a 100644 --- a/tests/out/glsl/operators.main.Compute.glsl +++ b/tests/out/glsl/operators.main.Compute.glsl @@ -5,10 +5,6 @@ precision highp int; layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; -struct Foo { - vec4 a; - int b; -}; const vec4 v_f32_one = vec4(1.0, 1.0, 1.0, 1.0); const vec4 v_f32_zero = vec4(0.0, 0.0, 0.0, 0.0); const vec4 v_f32_half = vec4(0.5, 0.5, 0.5, 0.5); @@ -51,26 +47,6 @@ vec3 bool_cast(vec3 x) { return vec3(y); } -float constructors() { - Foo foo = Foo(vec4(0.0), 0); - foo = Foo(vec4(1.0), 1); - mat2x2 m0_ = mat2x2(vec2(1.0, 0.0), vec2(0.0, 1.0)); - mat4x4 m1_1 = mat4x4(vec4(1.0, 0.0, 0.0, 0.0), vec4(0.0, 1.0, 0.0, 0.0), vec4(0.0, 0.0, 1.0, 0.0), vec4(0.0, 0.0, 0.0, 1.0)); - uvec2 cit0_ = uvec2(0u); - mat2x2 cit1_ = mat2x2(vec2(0.0), vec2(0.0)); - int cit2_[4] = int[4](0, 1, 2, 3); - bool ic0_ = bool(false); - int ic1_ = int(0); - uint ic2_ = uint(0u); - float ic3_ = float(0.0); - uvec2 ic4_ = uvec2(uvec2(0u)); - mat2x3 ic5_ = mat2x3(mat2x3(0.0)); - uvec2 ic6_ = uvec2(0u); - mat2x3 ic7_ = mat2x3(0.0); - float _e71 = foo.a.x; - return _e71; -} - void logical() { bool neg0_ = !(true); bvec2 neg1_ = not(bvec2(true)); @@ -274,7 +250,6 @@ void main() { vec4 _e0 = builtins(); vec4 _e1 = splat(); vec3 _e4 = bool_cast(v_f32_one.xyz); - float _e5 = constructors(); logical(); arithmetic(); bit(); diff --git a/tests/out/hlsl/constructors.hlsl b/tests/out/hlsl/constructors.hlsl new file mode 100644 index 0000000000..3b9c06b0c1 --- /dev/null +++ b/tests/out/hlsl/constructors.hlsl @@ -0,0 +1,60 @@ +struct Foo { + float4 a; + int b; + int _end_pad_0; + int _end_pad_1; + int _end_pad_2; +}; + +typedef float2x2 ret_Constructarray1_float2x2_[1]; +ret_Constructarray1_float2x2_ Constructarray1_float2x2_(float2x2 arg0) { + float2x2 ret[1] = { arg0 }; + return ret; +} + +typedef int ret_Constructarray4_int_[4]; +ret_Constructarray4_int_ Constructarray4_int_(int arg0, int arg1, int arg2, int arg3) { + int ret[4] = { arg0, arg1, arg2, arg3 }; + return ret; +} + +static const float3 const2_ = float3(0.0, 1.0, 2.0); +static const float2x2 const3_ = float2x2(float2(0.0, 1.0), float2(2.0, 3.0)); +static const float2x2 const4_[1] = Constructarray1_float2x2_(float2x2(float2(0.0, 1.0), float2(2.0, 3.0))); +static const bool cz0_ = (bool)0; +static const int cz1_ = (int)0; +static const uint cz2_ = (uint)0; +static const float cz3_ = (float)0; +static const uint2 cz4_ = (uint2)0; +static const float2x2 cz5_ = (float2x2)0; +static const Foo cz6_[3] = (Foo[3])0; +static const Foo cz7_ = (Foo)0; +static const int cp3_[4] = Constructarray4_int_(0, 1, 2, 3); + +Foo ConstructFoo(float4 arg0, int arg1) { + Foo ret = (Foo)0; + ret.a = arg0; + ret.b = arg1; + return ret; +} + +[numthreads(1, 1, 1)] +void main() +{ + Foo foo = (Foo)0; + + foo = ConstructFoo((1.0).xxxx, 1); + float2x2 m0_ = float2x2(float2(1.0, 0.0), float2(0.0, 1.0)); + float4x4 m1_ = float4x4(float4(1.0, 0.0, 0.0, 0.0), float4(0.0, 1.0, 0.0, 0.0), float4(0.0, 0.0, 1.0, 0.0), float4(0.0, 0.0, 0.0, 1.0)); + uint2 cit0_ = (0u).xx; + float2x2 cit1_ = float2x2((0.0).xx, (0.0).xx); + int cit2_[4] = Constructarray4_int_(0, 1, 2, 3); + bool ic0_ = bool((bool)0); + int ic1_ = int((int)0); + uint ic2_ = uint((uint)0); + float ic3_ = float((float)0); + uint2 ic4_ = uint2((uint2)0); + float2x3 ic5_ = float2x3((float2x3)0); + uint2 ic6_ = asuint((uint2)0); + float2x3 ic7_ = asfloat((float2x3)0); +} diff --git a/tests/out/hlsl/constructors.hlsl.config b/tests/out/hlsl/constructors.hlsl.config new file mode 100644 index 0000000000..246c485cf7 --- /dev/null +++ b/tests/out/hlsl/constructors.hlsl.config @@ -0,0 +1,3 @@ +vertex=() +fragment=() +compute=(main:cs_5_1 ) diff --git a/tests/out/hlsl/constructors.ron b/tests/out/hlsl/constructors.ron new file mode 100644 index 0000000000..a07b03300b --- /dev/null +++ b/tests/out/hlsl/constructors.ron @@ -0,0 +1,12 @@ +( + vertex:[ + ], + fragment:[ + ], + compute:[ + ( + entry_point:"main", + target_profile:"cs_5_1", + ), + ], +) diff --git a/tests/out/hlsl/operators.hlsl b/tests/out/hlsl/operators.hlsl index a54c90e6bd..4c57f31343 100644 --- a/tests/out/hlsl/operators.hlsl +++ b/tests/out/hlsl/operators.hlsl @@ -1,11 +1,3 @@ -struct Foo { - float4 a; - int b; - int _end_pad_0; - int _end_pad_1; - int _end_pad_2; -}; - static const float4 v_f32_one = float4(1.0, 1.0, 1.0, 1.0); static const float4 v_f32_zero = float4(0.0, 0.0, 0.0, 0.0); static const float4 v_f32_half = float4(0.5, 0.5, 0.5, 0.5); @@ -52,41 +44,6 @@ float3 bool_cast(float3 x) return float3(y); } -Foo ConstructFoo(float4 arg0, int arg1) { - Foo ret = (Foo)0; - ret.a = arg0; - ret.b = arg1; - return ret; -} - -typedef int ret_Constructarray4_int_[4]; -ret_Constructarray4_int_ Constructarray4_int_(int arg0, int arg1, int arg2, int arg3) { - int ret[4] = { arg0, arg1, arg2, arg3 }; - return ret; -} - -float constructors() -{ - Foo foo = (Foo)0; - - foo = ConstructFoo((1.0).xxxx, 1); - float2x2 m0_ = float2x2(float2(1.0, 0.0), float2(0.0, 1.0)); - float4x4 m1_1 = float4x4(float4(1.0, 0.0, 0.0, 0.0), float4(0.0, 1.0, 0.0, 0.0), float4(0.0, 0.0, 1.0, 0.0), float4(0.0, 0.0, 0.0, 1.0)); - uint2 cit0_ = (0u).xx; - float2x2 cit1_ = float2x2((0.0).xx, (0.0).xx); - int cit2_[4] = Constructarray4_int_(0, 1, 2, 3); - bool ic0_ = bool((bool)0); - int ic1_ = int((int)0); - uint ic2_ = uint((uint)0); - float ic3_ = float((float)0); - uint2 ic4_ = uint2((uint2)0); - float2x3 ic5_ = float2x3((float2x3)0); - uint2 ic6_ = asuint((uint2)0); - float2x3 ic7_ = asfloat((float2x3)0); - float _expr71 = foo.a.x; - return _expr71; -} - void logical() { bool neg0_ = !(true); @@ -299,7 +256,6 @@ void main() const float4 _e0 = builtins(); const float4 _e1 = splat(); const float3 _e4 = bool_cast(v_f32_one.xyz); - const float _e5 = constructors(); logical(); arithmetic(); bit(); diff --git a/tests/out/msl/constructors.msl b/tests/out/msl/constructors.msl new file mode 100644 index 0000000000..b3d3b9dd43 --- /dev/null +++ b/tests/out/msl/constructors.msl @@ -0,0 +1,50 @@ +// language: metal2.0 +#include +#include + +using metal::uint; + +struct Foo { + metal::float4 a; + int b; +}; +struct type_5 { + metal::float2x2 inner[1]; +}; +struct type_10 { + Foo inner[3]; +}; +struct type_11 { + int inner[4]; +}; +constant metal::float3 const2_ = metal::float3(0.0, 1.0, 2.0); +constant metal::float2x2 const3_ = metal::float2x2(metal::float2(0.0, 1.0), metal::float2(2.0, 3.0)); +constant type_5 const4_ = type_5 {metal::float2x2(metal::float2(0.0, 1.0), metal::float2(2.0, 3.0))}; +constant bool cz0_ = bool {}; +constant int cz1_ = int {}; +constant uint cz2_ = uint {}; +constant float cz3_ = float {}; +constant metal::uint2 cz4_ = metal::uint2 {}; +constant metal::float2x2 cz5_ = metal::float2x2 {}; +constant type_10 cz6_ = type_10 {}; +constant Foo cz7_ = Foo {}; +constant type_11 cp3_ = type_11 {0, 1, 2, 3}; + +kernel void main_( +) { + Foo foo = {}; + foo = Foo {metal::float4(1.0), 1}; + metal::float2x2 m0_ = metal::float2x2(metal::float2(1.0, 0.0), metal::float2(0.0, 1.0)); + metal::float4x4 m1_ = metal::float4x4(metal::float4(1.0, 0.0, 0.0, 0.0), metal::float4(0.0, 1.0, 0.0, 0.0), metal::float4(0.0, 0.0, 1.0, 0.0), metal::float4(0.0, 0.0, 0.0, 1.0)); + metal::uint2 cit0_ = metal::uint2(0u); + metal::float2x2 cit1_ = metal::float2x2(metal::float2(0.0), metal::float2(0.0)); + type_11 cit2_ = type_11 {0, 1, 2, 3}; + bool ic0_ = static_cast(bool {}); + int ic1_ = static_cast(int {}); + uint ic2_ = static_cast(uint {}); + float ic3_ = static_cast(float {}); + metal::uint2 ic4_ = static_cast(metal::uint2 {}); + metal::float2x3 ic5_ = metal::float2x3(metal::float2x3 {}); + metal::uint2 ic6_ = as_type(metal::uint2 {}); + metal::float2x3 ic7_ = metal::float2x3(metal::float2x3 {}); +} diff --git a/tests/out/msl/operators.msl b/tests/out/msl/operators.msl index 78614ffbd2..de3e990db2 100644 --- a/tests/out/msl/operators.msl +++ b/tests/out/msl/operators.msl @@ -4,16 +4,6 @@ using metal::uint; -struct Foo { - metal::float4 a; - int b; -}; -struct type_13 { - Foo inner[3]; -}; -struct type_14 { - int inner[4]; -}; constant metal::float4 v_f32_one = metal::float4(1.0, 1.0, 1.0, 1.0); constant metal::float4 v_f32_zero = metal::float4(0.0, 0.0, 0.0, 0.0); constant metal::float4 v_f32_half = metal::float4(0.5, 0.5, 0.5, 0.5); @@ -60,27 +50,6 @@ metal::float3 bool_cast( return static_cast(y); } -float constructors( -) { - Foo foo = {}; - foo = Foo {metal::float4(1.0), 1}; - metal::float2x2 m0_ = metal::float2x2(metal::float2(1.0, 0.0), metal::float2(0.0, 1.0)); - metal::float4x4 m1_1 = metal::float4x4(metal::float4(1.0, 0.0, 0.0, 0.0), metal::float4(0.0, 1.0, 0.0, 0.0), metal::float4(0.0, 0.0, 1.0, 0.0), metal::float4(0.0, 0.0, 0.0, 1.0)); - metal::uint2 cit0_ = metal::uint2(0u); - metal::float2x2 cit1_ = metal::float2x2(metal::float2(0.0), metal::float2(0.0)); - type_14 cit2_ = type_14 {0, 1, 2, 3}; - bool ic0_ = static_cast(bool {}); - int ic1_ = static_cast(int {}); - uint ic2_ = static_cast(uint {}); - float ic3_ = static_cast(float {}); - metal::uint2 ic4_ = static_cast(metal::uint2 {}); - metal::float2x3 ic5_ = metal::float2x3(metal::float2x3 {}); - metal::uint2 ic6_ = as_type(metal::uint2 {}); - metal::float2x3 ic7_ = metal::float2x3(metal::float2x3 {}); - float _e71 = foo.a.x; - return _e71; -} - void logical( ) { bool neg0_ = !(true); @@ -291,7 +260,6 @@ kernel void main_( metal::float4 _e0 = builtins(); metal::float4 _e1 = splat(); metal::float3 _e4 = bool_cast(v_f32_one.xyz); - float _e5 = constructors(); logical(); arithmetic(); bit(); diff --git a/tests/out/spv/constructors.spvasm b/tests/out/spv/constructors.spvasm new file mode 100644 index 0000000000..2a2b3ad0f9 --- /dev/null +++ b/tests/out/spv/constructors.spvasm @@ -0,0 +1,100 @@ +; SPIR-V +; Version: 1.1 +; Generator: rspirv +; Bound: 90 +OpCapability Shader +%1 = OpExtInstImport "GLSL.std.450" +OpMemoryModel Logical GLSL450 +OpEntryPoint GLCompute %47 "main" +OpExecutionMode %47 LocalSize 1 1 1 +OpMemberDecorate %6 0 Offset 0 +OpMemberDecorate %6 1 Offset 16 +OpDecorate %10 ArrayStride 16 +OpDecorate %15 ArrayStride 32 +OpDecorate %17 ArrayStride 4 +%2 = OpTypeVoid +%4 = OpTypeFloat 32 +%3 = OpTypeVector %4 4 +%5 = OpTypeInt 32 1 +%6 = OpTypeStruct %3 %5 +%7 = OpTypeVector %4 3 +%9 = OpTypeVector %4 2 +%8 = OpTypeMatrix %9 2 +%12 = OpTypeInt 32 0 +%11 = OpConstant %12 1 +%10 = OpTypeArray %8 %11 +%13 = OpTypeBool +%14 = OpTypeVector %12 2 +%16 = OpConstant %12 3 +%15 = OpTypeArray %6 %16 +%18 = OpConstant %12 4 +%17 = OpTypeArray %5 %18 +%19 = OpTypeMatrix %3 4 +%20 = OpTypeMatrix %7 2 +%21 = OpConstant %4 0.0 +%22 = OpConstant %4 1.0 +%23 = OpConstant %4 2.0 +%24 = OpConstantComposite %7 %21 %22 %23 +%25 = OpConstant %4 3.0 +%26 = OpConstantComposite %9 %21 %22 +%27 = OpConstantComposite %9 %23 %25 +%28 = OpConstantComposite %8 %26 %27 +%29 = OpConstant %5 1 +%30 = OpConstantComposite %10 %28 +%31 = OpConstantNull %13 +%32 = OpConstantNull %5 +%33 = OpConstantNull %12 +%34 = OpConstantNull %4 +%35 = OpConstantNull %14 +%36 = OpConstantNull %8 +%37 = OpConstant %5 3 +%38 = OpConstantNull %15 +%39 = OpConstantNull %6 +%40 = OpConstant %5 0 +%41 = OpConstant %5 2 +%42 = OpConstantComposite %17 %40 %29 %41 %37 +%44 = OpTypePointer Function %6 +%45 = OpConstantNull %6 +%48 = OpTypeFunction %2 +%49 = OpConstantNull %13 +%50 = OpConstantNull %5 +%51 = OpConstantNull %12 +%52 = OpConstantNull %4 +%53 = OpConstantNull %14 +%54 = OpConstantNull %8 +%55 = OpConstantNull %15 +%56 = OpConstantNull %6 +%57 = OpConstant %12 0 +%58 = OpConstantNull %13 +%59 = OpConstantNull %5 +%60 = OpConstantNull %12 +%61 = OpConstantNull %4 +%62 = OpConstantNull %14 +%63 = OpConstantNull %20 +%64 = OpConstantNull %14 +%65 = OpConstantNull %20 +%47 = OpFunction %2 None %48 +%46 = OpLabel +%43 = OpVariable %44 Function %45 +OpBranch %66 +%66 = OpLabel +%67 = OpCompositeConstruct %3 %22 %22 %22 %22 +%68 = OpCompositeConstruct %6 %67 %29 +OpStore %43 %68 +%69 = OpCompositeConstruct %9 %22 %21 +%70 = OpCompositeConstruct %9 %21 %22 +%71 = OpCompositeConstruct %8 %69 %70 +%72 = OpCompositeConstruct %3 %22 %21 %21 %21 +%73 = OpCompositeConstruct %3 %21 %22 %21 %21 +%74 = OpCompositeConstruct %3 %21 %21 %22 %21 +%75 = OpCompositeConstruct %3 %21 %21 %21 %22 +%76 = OpCompositeConstruct %19 %72 %73 %74 %75 +%77 = OpCompositeConstruct %14 %57 %57 +%78 = OpCompositeConstruct %9 %21 %21 +%79 = OpCompositeConstruct %9 %21 %21 +%80 = OpCompositeConstruct %8 %78 %79 +%81 = OpCompositeConstruct %17 %40 %29 %41 %37 +%87 = OpCopyObject %20 %63 +%89 = OpCopyObject %20 %65 +OpReturn +OpFunctionEnd \ No newline at end of file diff --git a/tests/out/spv/operators.spvasm b/tests/out/spv/operators.spvasm index 6e0a51467a..22a67029cd 100644 --- a/tests/out/spv/operators.spvasm +++ b/tests/out/spv/operators.spvasm @@ -1,16 +1,12 @@ ; SPIR-V ; Version: 1.1 ; Generator: rspirv -; Bound: 591 +; Bound: 530 OpCapability Shader %1 = OpExtInstImport "GLSL.std.450" OpMemoryModel Logical GLSL450 -OpEntryPoint GLCompute %579 "main" -OpExecutionMode %579 LocalSize 1 1 1 -OpMemberDecorate %12 0 Offset 0 -OpMemberDecorate %12 1 Offset 16 -OpDecorate %17 ArrayStride 32 -OpDecorate %19 ArrayStride 4 +OpEntryPoint GLCompute %519 "main" +OpExecutionMode %519 LocalSize 1 1 1 %2 = OpTypeVoid %4 = OpTypeFloat 32 %3 = OpTypeVector %4 4 @@ -21,635 +17,576 @@ OpDecorate %19 ArrayStride 4 %9 = OpTypeVector %4 2 %10 = OpTypeVector %4 3 %11 = OpTypeVector %8 3 -%12 = OpTypeStruct %3 %6 -%13 = OpTypeMatrix %9 2 -%14 = OpTypeMatrix %3 4 -%15 = OpTypeInt 32 0 -%16 = OpTypeVector %15 2 -%18 = OpConstant %15 3 -%17 = OpTypeArray %12 %18 -%20 = OpConstant %15 4 -%19 = OpTypeArray %6 %20 -%21 = OpTypeMatrix %10 2 -%22 = OpTypeMatrix %10 3 -%23 = OpTypeMatrix %10 4 -%24 = OpTypeMatrix %3 3 -%25 = OpTypeVector %6 3 -%26 = OpConstant %4 1.0 -%27 = OpConstantComposite %3 %26 %26 %26 %26 -%28 = OpConstant %4 0.0 -%29 = OpConstantComposite %3 %28 %28 %28 %28 -%30 = OpConstant %4 0.5 -%31 = OpConstantComposite %3 %30 %30 %30 %30 -%32 = OpConstant %6 1 -%33 = OpConstantComposite %5 %32 %32 %32 %32 -%34 = OpConstant %6 3 -%37 = OpTypeFunction %3 -%38 = OpConstantTrue %8 -%39 = OpConstant %6 0 -%40 = OpConstantFalse %8 -%41 = OpConstant %4 0.1 -%66 = OpConstant %4 2.0 -%67 = OpConstant %4 3.0 -%68 = OpConstant %4 4.0 -%69 = OpConstant %6 5 -%70 = OpConstant %6 2 -%86 = OpTypePointer Function %9 -%87 = OpConstantNull %9 -%90 = OpTypeFunction %9 -%106 = OpTypeFunction %10 %10 -%108 = OpConstantComposite %10 %28 %28 %28 -%110 = OpConstantComposite %10 %26 %26 %26 -%113 = OpTypePointer Function %12 -%114 = OpConstantNull %12 -%117 = OpTypeFunction %4 -%118 = OpConstantNull %8 -%119 = OpConstantNull %6 -%120 = OpConstantNull %15 -%121 = OpConstantNull %4 -%122 = OpConstantNull %16 -%123 = OpConstantNull %13 -%124 = OpConstantNull %17 +%12 = OpTypeMatrix %10 3 +%13 = OpTypeMatrix %10 4 +%14 = OpTypeMatrix %3 3 +%15 = OpTypeVector %6 3 +%16 = OpConstant %4 1.0 +%17 = OpConstantComposite %3 %16 %16 %16 %16 +%18 = OpConstant %4 0.0 +%19 = OpConstantComposite %3 %18 %18 %18 %18 +%20 = OpConstant %4 0.5 +%21 = OpConstantComposite %3 %20 %20 %20 %20 +%22 = OpConstant %6 1 +%23 = OpConstantComposite %5 %22 %22 %22 %22 +%26 = OpTypeFunction %3 +%27 = OpConstantTrue %8 +%28 = OpConstant %6 0 +%29 = OpConstantFalse %8 +%30 = OpConstant %4 0.1 +%55 = OpConstant %4 2.0 +%56 = OpConstant %4 3.0 +%57 = OpConstant %4 4.0 +%58 = OpConstant %6 5 +%59 = OpConstant %6 2 +%75 = OpTypePointer Function %9 +%76 = OpConstantNull %9 +%79 = OpTypeFunction %9 +%95 = OpTypeFunction %10 %10 +%97 = OpConstantComposite %10 %18 %18 %18 +%99 = OpConstantComposite %10 %16 %16 %16 +%103 = OpTypeFunction %2 +%106 = OpTypeVector %8 2 +%121 = OpConstant %4 -1.0 +%122 = OpTypeInt 32 0 +%123 = OpConstant %122 2 +%124 = OpConstant %122 1 %125 = OpConstantNull %12 -%126 = OpConstant %15 0 -%127 = OpConstantNull %8 -%128 = OpConstantNull %6 -%129 = OpConstantNull %15 -%130 = OpConstantNull %4 -%131 = OpConstantNull %16 -%132 = OpConstantNull %21 -%133 = OpConstantNull %16 -%134 = OpConstantNull %21 -%159 = OpTypePointer Function %3 -%160 = OpTypePointer Function %4 -%165 = OpTypeFunction %2 -%168 = OpTypeVector %8 2 -%183 = OpConstant %4 -1.0 -%184 = OpConstant %15 2 -%185 = OpConstant %15 1 -%186 = OpConstantNull %22 -%187 = OpConstantNull %22 -%188 = OpConstantNull %22 -%189 = OpConstantNull %22 -%190 = OpConstantNull %22 -%191 = OpConstantNull %22 -%192 = OpConstantNull %23 -%193 = OpConstantNull %23 -%194 = OpConstantNull %23 -%195 = OpConstantNull %24 -%197 = OpTypeVector %6 2 -%208 = OpTypeVector %15 3 -%505 = OpTypePointer Function %6 -%506 = OpConstantNull %6 -%508 = OpTypePointer Function %25 -%509 = OpConstantNull %25 -%512 = OpConstantNull %25 -%540 = OpTypePointer Function %6 -%551 = OpConstant %6 -1 -%552 = OpConstant %6 -2 -%553 = OpConstant %6 -3 -%554 = OpConstant %6 4 -%555 = OpConstant %6 -5 -%556 = OpConstant %6 6 -%557 = OpConstant %6 -7 -%558 = OpConstant %6 -8 -%36 = OpFunction %3 None %37 -%35 = OpLabel -OpBranch %42 -%42 = OpLabel -%43 = OpSelect %6 %38 %32 %39 -%45 = OpCompositeConstruct %7 %38 %38 %38 %38 -%44 = OpSelect %3 %45 %27 %29 -%46 = OpCompositeConstruct %7 %40 %40 %40 %40 -%47 = OpSelect %3 %46 %29 %27 -%48 = OpExtInst %3 %1 FMix %29 %27 %31 +%126 = OpConstantNull %12 +%127 = OpConstantNull %12 +%128 = OpConstantNull %12 +%129 = OpConstantNull %12 +%130 = OpConstantNull %12 +%131 = OpConstantNull %13 +%132 = OpConstantNull %13 +%133 = OpConstantNull %13 +%134 = OpConstantNull %14 +%136 = OpTypeVector %6 2 +%147 = OpTypeVector %122 3 +%210 = OpTypeVector %122 2 +%445 = OpTypePointer Function %6 +%446 = OpConstantNull %6 +%448 = OpTypePointer Function %15 +%449 = OpConstantNull %15 +%452 = OpConstantNull %15 +%480 = OpTypePointer Function %6 +%491 = OpConstant %6 -1 +%492 = OpConstant %6 -2 +%493 = OpConstant %6 -3 +%494 = OpConstant %6 4 +%495 = OpConstant %6 -5 +%496 = OpConstant %6 6 +%497 = OpConstant %6 -7 +%498 = OpConstant %6 -8 +%25 = OpFunction %3 None %26 +%24 = OpLabel +OpBranch %31 +%31 = OpLabel +%32 = OpSelect %6 %27 %22 %28 +%34 = OpCompositeConstruct %7 %27 %27 %27 %27 +%33 = OpSelect %3 %34 %17 %19 +%35 = OpCompositeConstruct %7 %29 %29 %29 %29 +%36 = OpSelect %3 %35 %19 %17 +%37 = OpExtInst %3 %1 FMix %19 %17 %21 +%39 = OpCompositeConstruct %3 %30 %30 %30 %30 +%38 = OpExtInst %3 %1 FMix %19 %17 %39 +%40 = OpCompositeExtract %6 %23 0 +%41 = OpBitcast %4 %40 +%42 = OpBitcast %3 %23 +%43 = OpConvertFToS %5 %19 +%44 = OpCompositeConstruct %5 %32 %32 %32 %32 +%45 = OpIAdd %5 %44 %43 +%46 = OpConvertSToF %3 %45 +%47 = OpFAdd %3 %46 %33 +%48 = OpFAdd %3 %47 %37 +%49 = OpFAdd %3 %48 %38 %50 = OpCompositeConstruct %3 %41 %41 %41 %41 -%49 = OpExtInst %3 %1 FMix %29 %27 %50 -%51 = OpCompositeExtract %6 %33 0 -%52 = OpBitcast %4 %51 -%53 = OpBitcast %3 %33 -%54 = OpConvertFToS %5 %29 -%55 = OpCompositeConstruct %5 %43 %43 %43 %43 -%56 = OpIAdd %5 %55 %54 -%57 = OpConvertSToF %3 %56 -%58 = OpFAdd %3 %57 %44 -%59 = OpFAdd %3 %58 %48 -%60 = OpFAdd %3 %59 %49 -%61 = OpCompositeConstruct %3 %52 %52 %52 %52 -%62 = OpFAdd %3 %60 %61 -%63 = OpFAdd %3 %62 %53 -OpReturnValue %63 +%51 = OpFAdd %3 %49 %50 +%52 = OpFAdd %3 %51 %42 +OpReturnValue %52 OpFunctionEnd -%65 = OpFunction %3 None %37 -%64 = OpLabel -OpBranch %71 -%71 = OpLabel -%72 = OpCompositeConstruct %9 %66 %66 -%73 = OpCompositeConstruct %9 %26 %26 -%74 = OpFAdd %9 %73 %72 -%75 = OpCompositeConstruct %9 %67 %67 -%76 = OpFSub %9 %74 %75 -%77 = OpCompositeConstruct %9 %68 %68 -%78 = OpFDiv %9 %76 %77 -%79 = OpCompositeConstruct %5 %69 %69 %69 %69 -%80 = OpCompositeConstruct %5 %70 %70 %70 %70 -%81 = OpSRem %5 %79 %80 -%82 = OpVectorShuffle %3 %78 %78 0 1 0 1 -%83 = OpConvertSToF %3 %81 -%84 = OpFAdd %3 %82 %83 -OpReturnValue %84 +%54 = OpFunction %3 None %26 +%53 = OpLabel +OpBranch %60 +%60 = OpLabel +%61 = OpCompositeConstruct %9 %55 %55 +%62 = OpCompositeConstruct %9 %16 %16 +%63 = OpFAdd %9 %62 %61 +%64 = OpCompositeConstruct %9 %56 %56 +%65 = OpFSub %9 %63 %64 +%66 = OpCompositeConstruct %9 %57 %57 +%67 = OpFDiv %9 %65 %66 +%68 = OpCompositeConstruct %5 %58 %58 %58 %58 +%69 = OpCompositeConstruct %5 %59 %59 %59 %59 +%70 = OpSRem %5 %68 %69 +%71 = OpVectorShuffle %3 %67 %67 0 1 0 1 +%72 = OpConvertSToF %3 %70 +%73 = OpFAdd %3 %71 %72 +OpReturnValue %73 OpFunctionEnd -%89 = OpFunction %9 None %90 -%88 = OpLabel -%85 = OpVariable %86 Function %87 -OpBranch %91 -%91 = OpLabel -%92 = OpCompositeConstruct %9 %66 %66 -OpStore %85 %92 -%93 = OpLoad %9 %85 -%94 = OpCompositeConstruct %9 %26 %26 -%95 = OpFAdd %9 %93 %94 -OpStore %85 %95 -%96 = OpLoad %9 %85 -%97 = OpCompositeConstruct %9 %67 %67 -%98 = OpFSub %9 %96 %97 -OpStore %85 %98 -%99 = OpLoad %9 %85 -%100 = OpCompositeConstruct %9 %68 %68 -%101 = OpFDiv %9 %99 %100 -OpStore %85 %101 -%102 = OpLoad %9 %85 -OpReturnValue %102 +%78 = OpFunction %9 None %79 +%77 = OpLabel +%74 = OpVariable %75 Function %76 +OpBranch %80 +%80 = OpLabel +%81 = OpCompositeConstruct %9 %55 %55 +OpStore %74 %81 +%82 = OpLoad %9 %74 +%83 = OpCompositeConstruct %9 %16 %16 +%84 = OpFAdd %9 %82 %83 +OpStore %74 %84 +%85 = OpLoad %9 %74 +%86 = OpCompositeConstruct %9 %56 %56 +%87 = OpFSub %9 %85 %86 +OpStore %74 %87 +%88 = OpLoad %9 %74 +%89 = OpCompositeConstruct %9 %57 %57 +%90 = OpFDiv %9 %88 %89 +OpStore %74 %90 +%91 = OpLoad %9 %74 +OpReturnValue %91 OpFunctionEnd -%105 = OpFunction %10 None %106 -%104 = OpFunctionParameter %10 -%103 = OpLabel -OpBranch %107 -%107 = OpLabel -%109 = OpFUnordNotEqual %11 %104 %108 -%111 = OpSelect %10 %109 %110 %108 -OpReturnValue %111 +%94 = OpFunction %10 None %95 +%93 = OpFunctionParameter %10 +%92 = OpLabel +OpBranch %96 +%96 = OpLabel +%98 = OpFUnordNotEqual %11 %93 %97 +%100 = OpSelect %10 %98 %99 %97 +OpReturnValue %100 OpFunctionEnd -%116 = OpFunction %4 None %117 -%115 = OpLabel -%112 = OpVariable %113 Function %114 +%102 = OpFunction %2 None %103 +%101 = OpLabel +OpBranch %104 +%104 = OpLabel +%105 = OpLogicalNot %8 %27 +%107 = OpCompositeConstruct %106 %27 %27 +%108 = OpLogicalNot %106 %107 +%109 = OpLogicalOr %8 %27 %29 +%110 = OpLogicalAnd %8 %27 %29 +%111 = OpLogicalOr %8 %27 %29 +%112 = OpCompositeConstruct %11 %27 %27 %27 +%113 = OpCompositeConstruct %11 %29 %29 %29 +%114 = OpLogicalOr %11 %112 %113 +%115 = OpLogicalAnd %8 %27 %29 +%116 = OpCompositeConstruct %7 %27 %27 %27 %27 +%117 = OpCompositeConstruct %7 %29 %29 %29 %29 +%118 = OpLogicalAnd %7 %116 %117 +OpReturn +OpFunctionEnd +%120 = OpFunction %2 None %103 +%119 = OpLabel OpBranch %135 %135 = OpLabel -%136 = OpCompositeConstruct %3 %26 %26 %26 %26 -%137 = OpCompositeConstruct %12 %136 %32 -OpStore %112 %137 -%138 = OpCompositeConstruct %9 %26 %28 -%139 = OpCompositeConstruct %9 %28 %26 -%140 = OpCompositeConstruct %13 %138 %139 -%141 = OpCompositeConstruct %3 %26 %28 %28 %28 -%142 = OpCompositeConstruct %3 %28 %26 %28 %28 -%143 = OpCompositeConstruct %3 %28 %28 %26 %28 -%144 = OpCompositeConstruct %3 %28 %28 %28 %26 -%145 = OpCompositeConstruct %14 %141 %142 %143 %144 -%146 = OpCompositeConstruct %16 %126 %126 -%147 = OpCompositeConstruct %9 %28 %28 -%148 = OpCompositeConstruct %9 %28 %28 -%149 = OpCompositeConstruct %13 %147 %148 -%150 = OpCompositeConstruct %19 %39 %32 %70 %34 -%156 = OpCopyObject %21 %132 -%158 = OpCopyObject %21 %134 -%161 = OpAccessChain %160 %112 %126 %126 -%162 = OpLoad %4 %161 -OpReturnValue %162 -OpFunctionEnd -%164 = OpFunction %2 None %165 -%163 = OpLabel -OpBranch %166 -%166 = OpLabel -%167 = OpLogicalNot %8 %38 -%169 = OpCompositeConstruct %168 %38 %38 -%170 = OpLogicalNot %168 %169 -%171 = OpLogicalOr %8 %38 %40 -%172 = OpLogicalAnd %8 %38 %40 -%173 = OpLogicalOr %8 %38 %40 -%174 = OpCompositeConstruct %11 %38 %38 %38 -%175 = OpCompositeConstruct %11 %40 %40 %40 -%176 = OpLogicalOr %11 %174 %175 -%177 = OpLogicalAnd %8 %38 %40 -%178 = OpCompositeConstruct %7 %38 %38 %38 %38 -%179 = OpCompositeConstruct %7 %40 %40 %40 %40 -%180 = OpLogicalAnd %7 %178 %179 +%137 = OpCompositeConstruct %136 %22 %22 +%138 = OpSNegate %136 %137 +%139 = OpCompositeConstruct %9 %16 %16 +%140 = OpFNegate %9 %139 +%141 = OpIAdd %6 %59 %22 +%142 = OpIAdd %122 %123 %124 +%143 = OpFAdd %4 %55 %16 +%144 = OpCompositeConstruct %136 %59 %59 +%145 = OpCompositeConstruct %136 %22 %22 +%146 = OpIAdd %136 %144 %145 +%148 = OpCompositeConstruct %147 %123 %123 %123 +%149 = OpCompositeConstruct %147 %124 %124 %124 +%150 = OpIAdd %147 %148 %149 +%151 = OpCompositeConstruct %3 %55 %55 %55 %55 +%152 = OpCompositeConstruct %3 %16 %16 %16 %16 +%153 = OpFAdd %3 %151 %152 +%154 = OpISub %6 %59 %22 +%155 = OpISub %122 %123 %124 +%156 = OpFSub %4 %55 %16 +%157 = OpCompositeConstruct %136 %59 %59 +%158 = OpCompositeConstruct %136 %22 %22 +%159 = OpISub %136 %157 %158 +%160 = OpCompositeConstruct %147 %123 %123 %123 +%161 = OpCompositeConstruct %147 %124 %124 %124 +%162 = OpISub %147 %160 %161 +%163 = OpCompositeConstruct %3 %55 %55 %55 %55 +%164 = OpCompositeConstruct %3 %16 %16 %16 %16 +%165 = OpFSub %3 %163 %164 +%166 = OpIMul %6 %59 %22 +%167 = OpIMul %122 %123 %124 +%168 = OpFMul %4 %55 %16 +%169 = OpCompositeConstruct %136 %59 %59 +%170 = OpCompositeConstruct %136 %22 %22 +%171 = OpIMul %136 %169 %170 +%172 = OpCompositeConstruct %147 %123 %123 %123 +%173 = OpCompositeConstruct %147 %124 %124 %124 +%174 = OpIMul %147 %172 %173 +%175 = OpCompositeConstruct %3 %55 %55 %55 %55 +%176 = OpCompositeConstruct %3 %16 %16 %16 %16 +%177 = OpFMul %3 %175 %176 +%178 = OpSDiv %6 %59 %22 +%179 = OpUDiv %122 %123 %124 +%180 = OpFDiv %4 %55 %16 +%181 = OpCompositeConstruct %136 %59 %59 +%182 = OpCompositeConstruct %136 %22 %22 +%183 = OpSDiv %136 %181 %182 +%184 = OpCompositeConstruct %147 %123 %123 %123 +%185 = OpCompositeConstruct %147 %124 %124 %124 +%186 = OpUDiv %147 %184 %185 +%187 = OpCompositeConstruct %3 %55 %55 %55 %55 +%188 = OpCompositeConstruct %3 %16 %16 %16 %16 +%189 = OpFDiv %3 %187 %188 +%190 = OpSRem %6 %59 %22 +%191 = OpUMod %122 %123 %124 +%192 = OpFRem %4 %55 %16 +%193 = OpCompositeConstruct %136 %59 %59 +%194 = OpCompositeConstruct %136 %22 %22 +%195 = OpSRem %136 %193 %194 +%196 = OpCompositeConstruct %147 %123 %123 %123 +%197 = OpCompositeConstruct %147 %124 %124 %124 +%198 = OpUMod %147 %196 %197 +%199 = OpCompositeConstruct %3 %55 %55 %55 %55 +%200 = OpCompositeConstruct %3 %16 %16 %16 %16 +%201 = OpFRem %3 %199 %200 +OpBranch %202 +%202 = OpLabel +%204 = OpCompositeConstruct %136 %59 %59 +%205 = OpCompositeConstruct %136 %22 %22 +%206 = OpIAdd %136 %204 %205 +%207 = OpCompositeConstruct %136 %22 %22 +%208 = OpCompositeConstruct %136 %59 %59 +%209 = OpIAdd %136 %208 %207 +%211 = OpCompositeConstruct %210 %123 %123 +%212 = OpCompositeConstruct %210 %124 %124 +%213 = OpIAdd %210 %211 %212 +%214 = OpCompositeConstruct %210 %124 %124 +%215 = OpCompositeConstruct %210 %123 %123 +%216 = OpIAdd %210 %215 %214 +%217 = OpCompositeConstruct %9 %55 %55 +%218 = OpCompositeConstruct %9 %16 %16 +%219 = OpFAdd %9 %217 %218 +%220 = OpCompositeConstruct %9 %16 %16 +%221 = OpCompositeConstruct %9 %55 %55 +%222 = OpFAdd %9 %221 %220 +%223 = OpCompositeConstruct %136 %59 %59 +%224 = OpCompositeConstruct %136 %22 %22 +%225 = OpISub %136 %223 %224 +%226 = OpCompositeConstruct %136 %22 %22 +%227 = OpCompositeConstruct %136 %59 %59 +%228 = OpISub %136 %227 %226 +%229 = OpCompositeConstruct %210 %123 %123 +%230 = OpCompositeConstruct %210 %124 %124 +%231 = OpISub %210 %229 %230 +%232 = OpCompositeConstruct %210 %124 %124 +%233 = OpCompositeConstruct %210 %123 %123 +%234 = OpISub %210 %233 %232 +%235 = OpCompositeConstruct %9 %55 %55 +%236 = OpCompositeConstruct %9 %16 %16 +%237 = OpFSub %9 %235 %236 +%238 = OpCompositeConstruct %9 %16 %16 +%239 = OpCompositeConstruct %9 %55 %55 +%240 = OpFSub %9 %239 %238 +%241 = OpCompositeConstruct %136 %59 %59 +%243 = OpCompositeConstruct %136 %22 %22 +%242 = OpIMul %136 %241 %243 +%244 = OpCompositeConstruct %136 %22 %22 +%246 = OpCompositeConstruct %136 %59 %59 +%245 = OpIMul %136 %244 %246 +%247 = OpCompositeConstruct %210 %123 %123 +%249 = OpCompositeConstruct %210 %124 %124 +%248 = OpIMul %210 %247 %249 +%250 = OpCompositeConstruct %210 %124 %124 +%252 = OpCompositeConstruct %210 %123 %123 +%251 = OpIMul %210 %250 %252 +%253 = OpCompositeConstruct %9 %55 %55 +%254 = OpVectorTimesScalar %9 %253 %16 +%255 = OpCompositeConstruct %9 %16 %16 +%256 = OpVectorTimesScalar %9 %255 %55 +%257 = OpCompositeConstruct %136 %59 %59 +%258 = OpCompositeConstruct %136 %22 %22 +%259 = OpSDiv %136 %257 %258 +%260 = OpCompositeConstruct %136 %22 %22 +%261 = OpCompositeConstruct %136 %59 %59 +%262 = OpSDiv %136 %261 %260 +%263 = OpCompositeConstruct %210 %123 %123 +%264 = OpCompositeConstruct %210 %124 %124 +%265 = OpUDiv %210 %263 %264 +%266 = OpCompositeConstruct %210 %124 %124 +%267 = OpCompositeConstruct %210 %123 %123 +%268 = OpUDiv %210 %267 %266 +%269 = OpCompositeConstruct %9 %55 %55 +%270 = OpCompositeConstruct %9 %16 %16 +%271 = OpFDiv %9 %269 %270 +%272 = OpCompositeConstruct %9 %16 %16 +%273 = OpCompositeConstruct %9 %55 %55 +%274 = OpFDiv %9 %273 %272 +%275 = OpCompositeConstruct %136 %59 %59 +%276 = OpCompositeConstruct %136 %22 %22 +%277 = OpSRem %136 %275 %276 +%278 = OpCompositeConstruct %136 %22 %22 +%279 = OpCompositeConstruct %136 %59 %59 +%280 = OpSRem %136 %279 %278 +%281 = OpCompositeConstruct %210 %123 %123 +%282 = OpCompositeConstruct %210 %124 %124 +%283 = OpUMod %210 %281 %282 +%284 = OpCompositeConstruct %210 %124 %124 +%285 = OpCompositeConstruct %210 %123 %123 +%286 = OpUMod %210 %285 %284 +%287 = OpCompositeConstruct %9 %55 %55 +%288 = OpCompositeConstruct %9 %16 %16 +%289 = OpFRem %9 %287 %288 +%290 = OpCompositeConstruct %9 %16 %16 +%291 = OpCompositeConstruct %9 %55 %55 +%292 = OpFRem %9 %291 %290 +OpBranch %203 +%203 = OpLabel +%294 = OpCompositeExtract %10 %125 0 +%295 = OpCompositeExtract %10 %126 0 +%296 = OpFAdd %10 %294 %295 +%297 = OpCompositeExtract %10 %125 1 +%298 = OpCompositeExtract %10 %126 1 +%299 = OpFAdd %10 %297 %298 +%300 = OpCompositeExtract %10 %125 2 +%301 = OpCompositeExtract %10 %126 2 +%302 = OpFAdd %10 %300 %301 +%293 = OpCompositeConstruct %12 %296 %299 %302 +%304 = OpCompositeExtract %10 %127 0 +%305 = OpCompositeExtract %10 %128 0 +%306 = OpFSub %10 %304 %305 +%307 = OpCompositeExtract %10 %127 1 +%308 = OpCompositeExtract %10 %128 1 +%309 = OpFSub %10 %307 %308 +%310 = OpCompositeExtract %10 %127 2 +%311 = OpCompositeExtract %10 %128 2 +%312 = OpFSub %10 %310 %311 +%303 = OpCompositeConstruct %12 %306 %309 %312 +%313 = OpMatrixTimesScalar %12 %129 %16 +%314 = OpMatrixTimesScalar %12 %130 %55 +%315 = OpCompositeConstruct %3 %16 %16 %16 %16 +%316 = OpMatrixTimesVector %10 %131 %315 +%317 = OpCompositeConstruct %10 %55 %55 %55 +%318 = OpVectorTimesMatrix %3 %317 %132 +%319 = OpMatrixTimesMatrix %12 %133 %134 OpReturn OpFunctionEnd -%182 = OpFunction %2 None %165 -%181 = OpLabel -OpBranch %196 -%196 = OpLabel -%198 = OpCompositeConstruct %197 %32 %32 -%199 = OpSNegate %197 %198 -%200 = OpCompositeConstruct %9 %26 %26 -%201 = OpFNegate %9 %200 -%202 = OpIAdd %6 %70 %32 -%203 = OpIAdd %15 %184 %185 -%204 = OpFAdd %4 %66 %26 -%205 = OpCompositeConstruct %197 %70 %70 -%206 = OpCompositeConstruct %197 %32 %32 -%207 = OpIAdd %197 %205 %206 -%209 = OpCompositeConstruct %208 %184 %184 %184 -%210 = OpCompositeConstruct %208 %185 %185 %185 -%211 = OpIAdd %208 %209 %210 -%212 = OpCompositeConstruct %3 %66 %66 %66 %66 -%213 = OpCompositeConstruct %3 %26 %26 %26 %26 -%214 = OpFAdd %3 %212 %213 -%215 = OpISub %6 %70 %32 -%216 = OpISub %15 %184 %185 -%217 = OpFSub %4 %66 %26 -%218 = OpCompositeConstruct %197 %70 %70 -%219 = OpCompositeConstruct %197 %32 %32 -%220 = OpISub %197 %218 %219 -%221 = OpCompositeConstruct %208 %184 %184 %184 -%222 = OpCompositeConstruct %208 %185 %185 %185 -%223 = OpISub %208 %221 %222 -%224 = OpCompositeConstruct %3 %66 %66 %66 %66 -%225 = OpCompositeConstruct %3 %26 %26 %26 %26 -%226 = OpFSub %3 %224 %225 -%227 = OpIMul %6 %70 %32 -%228 = OpIMul %15 %184 %185 -%229 = OpFMul %4 %66 %26 -%230 = OpCompositeConstruct %197 %70 %70 -%231 = OpCompositeConstruct %197 %32 %32 -%232 = OpIMul %197 %230 %231 -%233 = OpCompositeConstruct %208 %184 %184 %184 -%234 = OpCompositeConstruct %208 %185 %185 %185 -%235 = OpIMul %208 %233 %234 -%236 = OpCompositeConstruct %3 %66 %66 %66 %66 -%237 = OpCompositeConstruct %3 %26 %26 %26 %26 -%238 = OpFMul %3 %236 %237 -%239 = OpSDiv %6 %70 %32 -%240 = OpUDiv %15 %184 %185 -%241 = OpFDiv %4 %66 %26 -%242 = OpCompositeConstruct %197 %70 %70 -%243 = OpCompositeConstruct %197 %32 %32 -%244 = OpSDiv %197 %242 %243 -%245 = OpCompositeConstruct %208 %184 %184 %184 -%246 = OpCompositeConstruct %208 %185 %185 %185 -%247 = OpUDiv %208 %245 %246 -%248 = OpCompositeConstruct %3 %66 %66 %66 %66 -%249 = OpCompositeConstruct %3 %26 %26 %26 %26 -%250 = OpFDiv %3 %248 %249 -%251 = OpSRem %6 %70 %32 -%252 = OpUMod %15 %184 %185 -%253 = OpFRem %4 %66 %26 -%254 = OpCompositeConstruct %197 %70 %70 -%255 = OpCompositeConstruct %197 %32 %32 -%256 = OpSRem %197 %254 %255 -%257 = OpCompositeConstruct %208 %184 %184 %184 -%258 = OpCompositeConstruct %208 %185 %185 %185 -%259 = OpUMod %208 %257 %258 -%260 = OpCompositeConstruct %3 %66 %66 %66 %66 -%261 = OpCompositeConstruct %3 %26 %26 %26 %26 -%262 = OpFRem %3 %260 %261 -OpBranch %263 -%263 = OpLabel -%265 = OpCompositeConstruct %197 %70 %70 -%266 = OpCompositeConstruct %197 %32 %32 -%267 = OpIAdd %197 %265 %266 -%268 = OpCompositeConstruct %197 %32 %32 -%269 = OpCompositeConstruct %197 %70 %70 -%270 = OpIAdd %197 %269 %268 -%271 = OpCompositeConstruct %16 %184 %184 -%272 = OpCompositeConstruct %16 %185 %185 -%273 = OpIAdd %16 %271 %272 -%274 = OpCompositeConstruct %16 %185 %185 -%275 = OpCompositeConstruct %16 %184 %184 -%276 = OpIAdd %16 %275 %274 -%277 = OpCompositeConstruct %9 %66 %66 -%278 = OpCompositeConstruct %9 %26 %26 -%279 = OpFAdd %9 %277 %278 -%280 = OpCompositeConstruct %9 %26 %26 -%281 = OpCompositeConstruct %9 %66 %66 -%282 = OpFAdd %9 %281 %280 -%283 = OpCompositeConstruct %197 %70 %70 -%284 = OpCompositeConstruct %197 %32 %32 -%285 = OpISub %197 %283 %284 -%286 = OpCompositeConstruct %197 %32 %32 -%287 = OpCompositeConstruct %197 %70 %70 -%288 = OpISub %197 %287 %286 -%289 = OpCompositeConstruct %16 %184 %184 -%290 = OpCompositeConstruct %16 %185 %185 -%291 = OpISub %16 %289 %290 -%292 = OpCompositeConstruct %16 %185 %185 -%293 = OpCompositeConstruct %16 %184 %184 -%294 = OpISub %16 %293 %292 -%295 = OpCompositeConstruct %9 %66 %66 -%296 = OpCompositeConstruct %9 %26 %26 -%297 = OpFSub %9 %295 %296 -%298 = OpCompositeConstruct %9 %26 %26 -%299 = OpCompositeConstruct %9 %66 %66 -%300 = OpFSub %9 %299 %298 -%301 = OpCompositeConstruct %197 %70 %70 -%303 = OpCompositeConstruct %197 %32 %32 -%302 = OpIMul %197 %301 %303 -%304 = OpCompositeConstruct %197 %32 %32 -%306 = OpCompositeConstruct %197 %70 %70 -%305 = OpIMul %197 %304 %306 -%307 = OpCompositeConstruct %16 %184 %184 -%309 = OpCompositeConstruct %16 %185 %185 -%308 = OpIMul %16 %307 %309 -%310 = OpCompositeConstruct %16 %185 %185 -%312 = OpCompositeConstruct %16 %184 %184 -%311 = OpIMul %16 %310 %312 -%313 = OpCompositeConstruct %9 %66 %66 -%314 = OpVectorTimesScalar %9 %313 %26 -%315 = OpCompositeConstruct %9 %26 %26 -%316 = OpVectorTimesScalar %9 %315 %66 -%317 = OpCompositeConstruct %197 %70 %70 -%318 = OpCompositeConstruct %197 %32 %32 -%319 = OpSDiv %197 %317 %318 -%320 = OpCompositeConstruct %197 %32 %32 -%321 = OpCompositeConstruct %197 %70 %70 -%322 = OpSDiv %197 %321 %320 -%323 = OpCompositeConstruct %16 %184 %184 -%324 = OpCompositeConstruct %16 %185 %185 -%325 = OpUDiv %16 %323 %324 -%326 = OpCompositeConstruct %16 %185 %185 -%327 = OpCompositeConstruct %16 %184 %184 -%328 = OpUDiv %16 %327 %326 -%329 = OpCompositeConstruct %9 %66 %66 -%330 = OpCompositeConstruct %9 %26 %26 -%331 = OpFDiv %9 %329 %330 -%332 = OpCompositeConstruct %9 %26 %26 -%333 = OpCompositeConstruct %9 %66 %66 -%334 = OpFDiv %9 %333 %332 -%335 = OpCompositeConstruct %197 %70 %70 -%336 = OpCompositeConstruct %197 %32 %32 -%337 = OpSRem %197 %335 %336 -%338 = OpCompositeConstruct %197 %32 %32 -%339 = OpCompositeConstruct %197 %70 %70 -%340 = OpSRem %197 %339 %338 -%341 = OpCompositeConstruct %16 %184 %184 -%342 = OpCompositeConstruct %16 %185 %185 -%343 = OpUMod %16 %341 %342 -%344 = OpCompositeConstruct %16 %185 %185 -%345 = OpCompositeConstruct %16 %184 %184 -%346 = OpUMod %16 %345 %344 -%347 = OpCompositeConstruct %9 %66 %66 -%348 = OpCompositeConstruct %9 %26 %26 -%349 = OpFRem %9 %347 %348 -%350 = OpCompositeConstruct %9 %26 %26 -%351 = OpCompositeConstruct %9 %66 %66 -%352 = OpFRem %9 %351 %350 -OpBranch %264 -%264 = OpLabel -%354 = OpCompositeExtract %10 %186 0 -%355 = OpCompositeExtract %10 %187 0 -%356 = OpFAdd %10 %354 %355 -%357 = OpCompositeExtract %10 %186 1 -%358 = OpCompositeExtract %10 %187 1 -%359 = OpFAdd %10 %357 %358 -%360 = OpCompositeExtract %10 %186 2 -%361 = OpCompositeExtract %10 %187 2 -%362 = OpFAdd %10 %360 %361 -%353 = OpCompositeConstruct %22 %356 %359 %362 -%364 = OpCompositeExtract %10 %188 0 -%365 = OpCompositeExtract %10 %189 0 -%366 = OpFSub %10 %364 %365 -%367 = OpCompositeExtract %10 %188 1 -%368 = OpCompositeExtract %10 %189 1 -%369 = OpFSub %10 %367 %368 -%370 = OpCompositeExtract %10 %188 2 -%371 = OpCompositeExtract %10 %189 2 -%372 = OpFSub %10 %370 %371 -%363 = OpCompositeConstruct %22 %366 %369 %372 -%373 = OpMatrixTimesScalar %22 %190 %26 -%374 = OpMatrixTimesScalar %22 %191 %66 -%375 = OpCompositeConstruct %3 %26 %26 %26 %26 -%376 = OpMatrixTimesVector %10 %192 %375 -%377 = OpCompositeConstruct %10 %66 %66 %66 -%378 = OpVectorTimesMatrix %3 %377 %193 -%379 = OpMatrixTimesMatrix %22 %194 %195 +%321 = OpFunction %2 None %103 +%320 = OpLabel +OpBranch %322 +%322 = OpLabel +%323 = OpNot %6 %22 +%324 = OpNot %122 %124 +%325 = OpCompositeConstruct %136 %22 %22 +%326 = OpNot %136 %325 +%327 = OpCompositeConstruct %147 %124 %124 %124 +%328 = OpNot %147 %327 +%329 = OpBitwiseOr %6 %59 %22 +%330 = OpBitwiseOr %122 %123 %124 +%331 = OpCompositeConstruct %136 %59 %59 +%332 = OpCompositeConstruct %136 %22 %22 +%333 = OpBitwiseOr %136 %331 %332 +%334 = OpCompositeConstruct %147 %123 %123 %123 +%335 = OpCompositeConstruct %147 %124 %124 %124 +%336 = OpBitwiseOr %147 %334 %335 +%337 = OpBitwiseAnd %6 %59 %22 +%338 = OpBitwiseAnd %122 %123 %124 +%339 = OpCompositeConstruct %136 %59 %59 +%340 = OpCompositeConstruct %136 %22 %22 +%341 = OpBitwiseAnd %136 %339 %340 +%342 = OpCompositeConstruct %147 %123 %123 %123 +%343 = OpCompositeConstruct %147 %124 %124 %124 +%344 = OpBitwiseAnd %147 %342 %343 +%345 = OpBitwiseXor %6 %59 %22 +%346 = OpBitwiseXor %122 %123 %124 +%347 = OpCompositeConstruct %136 %59 %59 +%348 = OpCompositeConstruct %136 %22 %22 +%349 = OpBitwiseXor %136 %347 %348 +%350 = OpCompositeConstruct %147 %123 %123 %123 +%351 = OpCompositeConstruct %147 %124 %124 %124 +%352 = OpBitwiseXor %147 %350 %351 +%353 = OpShiftLeftLogical %6 %59 %124 +%354 = OpShiftLeftLogical %122 %123 %124 +%355 = OpCompositeConstruct %136 %59 %59 +%356 = OpCompositeConstruct %210 %124 %124 +%357 = OpShiftLeftLogical %136 %355 %356 +%358 = OpCompositeConstruct %147 %123 %123 %123 +%359 = OpCompositeConstruct %147 %124 %124 %124 +%360 = OpShiftLeftLogical %147 %358 %359 +%361 = OpShiftRightArithmetic %6 %59 %124 +%362 = OpShiftRightLogical %122 %123 %124 +%363 = OpCompositeConstruct %136 %59 %59 +%364 = OpCompositeConstruct %210 %124 %124 +%365 = OpShiftRightArithmetic %136 %363 %364 +%366 = OpCompositeConstruct %147 %123 %123 %123 +%367 = OpCompositeConstruct %147 %124 %124 %124 +%368 = OpShiftRightLogical %147 %366 %367 OpReturn OpFunctionEnd -%381 = OpFunction %2 None %165 -%380 = OpLabel -OpBranch %382 -%382 = OpLabel -%383 = OpNot %6 %32 -%384 = OpNot %15 %185 -%385 = OpCompositeConstruct %197 %32 %32 -%386 = OpNot %197 %385 -%387 = OpCompositeConstruct %208 %185 %185 %185 -%388 = OpNot %208 %387 -%389 = OpBitwiseOr %6 %70 %32 -%390 = OpBitwiseOr %15 %184 %185 -%391 = OpCompositeConstruct %197 %70 %70 -%392 = OpCompositeConstruct %197 %32 %32 -%393 = OpBitwiseOr %197 %391 %392 -%394 = OpCompositeConstruct %208 %184 %184 %184 -%395 = OpCompositeConstruct %208 %185 %185 %185 -%396 = OpBitwiseOr %208 %394 %395 -%397 = OpBitwiseAnd %6 %70 %32 -%398 = OpBitwiseAnd %15 %184 %185 -%399 = OpCompositeConstruct %197 %70 %70 -%400 = OpCompositeConstruct %197 %32 %32 -%401 = OpBitwiseAnd %197 %399 %400 -%402 = OpCompositeConstruct %208 %184 %184 %184 -%403 = OpCompositeConstruct %208 %185 %185 %185 -%404 = OpBitwiseAnd %208 %402 %403 -%405 = OpBitwiseXor %6 %70 %32 -%406 = OpBitwiseXor %15 %184 %185 -%407 = OpCompositeConstruct %197 %70 %70 -%408 = OpCompositeConstruct %197 %32 %32 -%409 = OpBitwiseXor %197 %407 %408 -%410 = OpCompositeConstruct %208 %184 %184 %184 -%411 = OpCompositeConstruct %208 %185 %185 %185 -%412 = OpBitwiseXor %208 %410 %411 -%413 = OpShiftLeftLogical %6 %70 %185 -%414 = OpShiftLeftLogical %15 %184 %185 -%415 = OpCompositeConstruct %197 %70 %70 -%416 = OpCompositeConstruct %16 %185 %185 -%417 = OpShiftLeftLogical %197 %415 %416 -%418 = OpCompositeConstruct %208 %184 %184 %184 -%419 = OpCompositeConstruct %208 %185 %185 %185 -%420 = OpShiftLeftLogical %208 %418 %419 -%421 = OpShiftRightArithmetic %6 %70 %185 -%422 = OpShiftRightLogical %15 %184 %185 -%423 = OpCompositeConstruct %197 %70 %70 -%424 = OpCompositeConstruct %16 %185 %185 -%425 = OpShiftRightArithmetic %197 %423 %424 -%426 = OpCompositeConstruct %208 %184 %184 %184 -%427 = OpCompositeConstruct %208 %185 %185 %185 -%428 = OpShiftRightLogical %208 %426 %427 +%370 = OpFunction %2 None %103 +%369 = OpLabel +OpBranch %371 +%371 = OpLabel +%372 = OpIEqual %8 %59 %22 +%373 = OpIEqual %8 %123 %124 +%374 = OpFOrdEqual %8 %55 %16 +%375 = OpCompositeConstruct %136 %59 %59 +%376 = OpCompositeConstruct %136 %22 %22 +%377 = OpIEqual %106 %375 %376 +%378 = OpCompositeConstruct %147 %123 %123 %123 +%379 = OpCompositeConstruct %147 %124 %124 %124 +%380 = OpIEqual %11 %378 %379 +%381 = OpCompositeConstruct %3 %55 %55 %55 %55 +%382 = OpCompositeConstruct %3 %16 %16 %16 %16 +%383 = OpFOrdEqual %7 %381 %382 +%384 = OpINotEqual %8 %59 %22 +%385 = OpINotEqual %8 %123 %124 +%386 = OpFOrdNotEqual %8 %55 %16 +%387 = OpCompositeConstruct %136 %59 %59 +%388 = OpCompositeConstruct %136 %22 %22 +%389 = OpINotEqual %106 %387 %388 +%390 = OpCompositeConstruct %147 %123 %123 %123 +%391 = OpCompositeConstruct %147 %124 %124 %124 +%392 = OpINotEqual %11 %390 %391 +%393 = OpCompositeConstruct %3 %55 %55 %55 %55 +%394 = OpCompositeConstruct %3 %16 %16 %16 %16 +%395 = OpFOrdNotEqual %7 %393 %394 +%396 = OpSLessThan %8 %59 %22 +%397 = OpULessThan %8 %123 %124 +%398 = OpFOrdLessThan %8 %55 %16 +%399 = OpCompositeConstruct %136 %59 %59 +%400 = OpCompositeConstruct %136 %22 %22 +%401 = OpSLessThan %106 %399 %400 +%402 = OpCompositeConstruct %147 %123 %123 %123 +%403 = OpCompositeConstruct %147 %124 %124 %124 +%404 = OpULessThan %11 %402 %403 +%405 = OpCompositeConstruct %3 %55 %55 %55 %55 +%406 = OpCompositeConstruct %3 %16 %16 %16 %16 +%407 = OpFOrdLessThan %7 %405 %406 +%408 = OpSLessThanEqual %8 %59 %22 +%409 = OpULessThanEqual %8 %123 %124 +%410 = OpFOrdLessThanEqual %8 %55 %16 +%411 = OpCompositeConstruct %136 %59 %59 +%412 = OpCompositeConstruct %136 %22 %22 +%413 = OpSLessThanEqual %106 %411 %412 +%414 = OpCompositeConstruct %147 %123 %123 %123 +%415 = OpCompositeConstruct %147 %124 %124 %124 +%416 = OpULessThanEqual %11 %414 %415 +%417 = OpCompositeConstruct %3 %55 %55 %55 %55 +%418 = OpCompositeConstruct %3 %16 %16 %16 %16 +%419 = OpFOrdLessThanEqual %7 %417 %418 +%420 = OpSGreaterThan %8 %59 %22 +%421 = OpUGreaterThan %8 %123 %124 +%422 = OpFOrdGreaterThan %8 %55 %16 +%423 = OpCompositeConstruct %136 %59 %59 +%424 = OpCompositeConstruct %136 %22 %22 +%425 = OpSGreaterThan %106 %423 %424 +%426 = OpCompositeConstruct %147 %123 %123 %123 +%427 = OpCompositeConstruct %147 %124 %124 %124 +%428 = OpUGreaterThan %11 %426 %427 +%429 = OpCompositeConstruct %3 %55 %55 %55 %55 +%430 = OpCompositeConstruct %3 %16 %16 %16 %16 +%431 = OpFOrdGreaterThan %7 %429 %430 +%432 = OpSGreaterThanEqual %8 %59 %22 +%433 = OpUGreaterThanEqual %8 %123 %124 +%434 = OpFOrdGreaterThanEqual %8 %55 %16 +%435 = OpCompositeConstruct %136 %59 %59 +%436 = OpCompositeConstruct %136 %22 %22 +%437 = OpSGreaterThanEqual %106 %435 %436 +%438 = OpCompositeConstruct %147 %123 %123 %123 +%439 = OpCompositeConstruct %147 %124 %124 %124 +%440 = OpUGreaterThanEqual %11 %438 %439 +%441 = OpCompositeConstruct %3 %55 %55 %55 %55 +%442 = OpCompositeConstruct %3 %16 %16 %16 %16 +%443 = OpFOrdGreaterThanEqual %7 %441 %442 OpReturn OpFunctionEnd -%430 = OpFunction %2 None %165 -%429 = OpLabel -OpBranch %431 -%431 = OpLabel -%432 = OpIEqual %8 %70 %32 -%433 = OpIEqual %8 %184 %185 -%434 = OpFOrdEqual %8 %66 %26 -%435 = OpCompositeConstruct %197 %70 %70 -%436 = OpCompositeConstruct %197 %32 %32 -%437 = OpIEqual %168 %435 %436 -%438 = OpCompositeConstruct %208 %184 %184 %184 -%439 = OpCompositeConstruct %208 %185 %185 %185 -%440 = OpIEqual %11 %438 %439 -%441 = OpCompositeConstruct %3 %66 %66 %66 %66 -%442 = OpCompositeConstruct %3 %26 %26 %26 %26 -%443 = OpFOrdEqual %7 %441 %442 -%444 = OpINotEqual %8 %70 %32 -%445 = OpINotEqual %8 %184 %185 -%446 = OpFOrdNotEqual %8 %66 %26 -%447 = OpCompositeConstruct %197 %70 %70 -%448 = OpCompositeConstruct %197 %32 %32 -%449 = OpINotEqual %168 %447 %448 -%450 = OpCompositeConstruct %208 %184 %184 %184 -%451 = OpCompositeConstruct %208 %185 %185 %185 -%452 = OpINotEqual %11 %450 %451 -%453 = OpCompositeConstruct %3 %66 %66 %66 %66 -%454 = OpCompositeConstruct %3 %26 %26 %26 %26 -%455 = OpFOrdNotEqual %7 %453 %454 -%456 = OpSLessThan %8 %70 %32 -%457 = OpULessThan %8 %184 %185 -%458 = OpFOrdLessThan %8 %66 %26 -%459 = OpCompositeConstruct %197 %70 %70 -%460 = OpCompositeConstruct %197 %32 %32 -%461 = OpSLessThan %168 %459 %460 -%462 = OpCompositeConstruct %208 %184 %184 %184 -%463 = OpCompositeConstruct %208 %185 %185 %185 -%464 = OpULessThan %11 %462 %463 -%465 = OpCompositeConstruct %3 %66 %66 %66 %66 -%466 = OpCompositeConstruct %3 %26 %26 %26 %26 -%467 = OpFOrdLessThan %7 %465 %466 -%468 = OpSLessThanEqual %8 %70 %32 -%469 = OpULessThanEqual %8 %184 %185 -%470 = OpFOrdLessThanEqual %8 %66 %26 -%471 = OpCompositeConstruct %197 %70 %70 -%472 = OpCompositeConstruct %197 %32 %32 -%473 = OpSLessThanEqual %168 %471 %472 -%474 = OpCompositeConstruct %208 %184 %184 %184 -%475 = OpCompositeConstruct %208 %185 %185 %185 -%476 = OpULessThanEqual %11 %474 %475 -%477 = OpCompositeConstruct %3 %66 %66 %66 %66 -%478 = OpCompositeConstruct %3 %26 %26 %26 %26 -%479 = OpFOrdLessThanEqual %7 %477 %478 -%480 = OpSGreaterThan %8 %70 %32 -%481 = OpUGreaterThan %8 %184 %185 -%482 = OpFOrdGreaterThan %8 %66 %26 -%483 = OpCompositeConstruct %197 %70 %70 -%484 = OpCompositeConstruct %197 %32 %32 -%485 = OpSGreaterThan %168 %483 %484 -%486 = OpCompositeConstruct %208 %184 %184 %184 -%487 = OpCompositeConstruct %208 %185 %185 %185 -%488 = OpUGreaterThan %11 %486 %487 -%489 = OpCompositeConstruct %3 %66 %66 %66 %66 -%490 = OpCompositeConstruct %3 %26 %26 %26 %26 -%491 = OpFOrdGreaterThan %7 %489 %490 -%492 = OpSGreaterThanEqual %8 %70 %32 -%493 = OpUGreaterThanEqual %8 %184 %185 -%494 = OpFOrdGreaterThanEqual %8 %66 %26 -%495 = OpCompositeConstruct %197 %70 %70 -%496 = OpCompositeConstruct %197 %32 %32 -%497 = OpSGreaterThanEqual %168 %495 %496 -%498 = OpCompositeConstruct %208 %184 %184 %184 -%499 = OpCompositeConstruct %208 %185 %185 %185 -%500 = OpUGreaterThanEqual %11 %498 %499 -%501 = OpCompositeConstruct %3 %66 %66 %66 %66 -%502 = OpCompositeConstruct %3 %26 %26 %26 %26 -%503 = OpFOrdGreaterThanEqual %7 %501 %502 +%451 = OpFunction %2 None %103 +%450 = OpLabel +%444 = OpVariable %445 Function %446 +%447 = OpVariable %448 Function %449 +OpBranch %453 +%453 = OpLabel +OpStore %444 %22 +%454 = OpLoad %6 %444 +%455 = OpIAdd %6 %454 %22 +OpStore %444 %455 +%456 = OpLoad %6 %444 +%457 = OpISub %6 %456 %22 +OpStore %444 %457 +%458 = OpLoad %6 %444 +%459 = OpLoad %6 %444 +%460 = OpIMul %6 %459 %458 +OpStore %444 %460 +%461 = OpLoad %6 %444 +%462 = OpLoad %6 %444 +%463 = OpSDiv %6 %462 %461 +OpStore %444 %463 +%464 = OpLoad %6 %444 +%465 = OpSRem %6 %464 %22 +OpStore %444 %465 +%466 = OpLoad %6 %444 +%467 = OpBitwiseAnd %6 %466 %28 +OpStore %444 %467 +%468 = OpLoad %6 %444 +%469 = OpBitwiseOr %6 %468 %28 +OpStore %444 %469 +%470 = OpLoad %6 %444 +%471 = OpBitwiseXor %6 %470 %28 +OpStore %444 %471 +%472 = OpLoad %6 %444 +%473 = OpShiftLeftLogical %6 %472 %123 +OpStore %444 %473 +%474 = OpLoad %6 %444 +%475 = OpShiftRightArithmetic %6 %474 %124 +OpStore %444 %475 +%476 = OpLoad %6 %444 +%477 = OpIAdd %6 %476 %22 +OpStore %444 %477 +%478 = OpLoad %6 %444 +%479 = OpISub %6 %478 %22 +OpStore %444 %479 +OpStore %447 %452 +%481 = OpAccessChain %480 %447 %124 +%482 = OpLoad %6 %481 +%483 = OpIAdd %6 %482 %22 +%484 = OpAccessChain %480 %447 %124 +OpStore %484 %483 +%485 = OpAccessChain %480 %447 %124 +%486 = OpLoad %6 %485 +%487 = OpISub %6 %486 %22 +%488 = OpAccessChain %480 %447 %124 +OpStore %488 %487 OpReturn OpFunctionEnd -%511 = OpFunction %2 None %165 -%510 = OpLabel -%504 = OpVariable %505 Function %506 -%507 = OpVariable %508 Function %509 -OpBranch %513 -%513 = OpLabel -OpStore %504 %32 -%514 = OpLoad %6 %504 -%515 = OpIAdd %6 %514 %32 -OpStore %504 %515 -%516 = OpLoad %6 %504 -%517 = OpISub %6 %516 %32 -OpStore %504 %517 -%518 = OpLoad %6 %504 -%519 = OpLoad %6 %504 -%520 = OpIMul %6 %519 %518 -OpStore %504 %520 -%521 = OpLoad %6 %504 -%522 = OpLoad %6 %504 -%523 = OpSDiv %6 %522 %521 -OpStore %504 %523 -%524 = OpLoad %6 %504 -%525 = OpSRem %6 %524 %32 -OpStore %504 %525 -%526 = OpLoad %6 %504 -%527 = OpBitwiseAnd %6 %526 %39 -OpStore %504 %527 -%528 = OpLoad %6 %504 -%529 = OpBitwiseOr %6 %528 %39 -OpStore %504 %529 -%530 = OpLoad %6 %504 -%531 = OpBitwiseXor %6 %530 %39 -OpStore %504 %531 -%532 = OpLoad %6 %504 -%533 = OpShiftLeftLogical %6 %532 %184 -OpStore %504 %533 -%534 = OpLoad %6 %504 -%535 = OpShiftRightArithmetic %6 %534 %185 -OpStore %504 %535 -%536 = OpLoad %6 %504 -%537 = OpIAdd %6 %536 %32 -OpStore %504 %537 -%538 = OpLoad %6 %504 -%539 = OpISub %6 %538 %32 -OpStore %504 %539 -OpStore %507 %512 -%541 = OpAccessChain %540 %507 %185 -%542 = OpLoad %6 %541 -%543 = OpIAdd %6 %542 %32 -%544 = OpAccessChain %540 %507 %185 -OpStore %544 %543 -%545 = OpAccessChain %540 %507 %185 -%546 = OpLoad %6 %545 -%547 = OpISub %6 %546 %32 -%548 = OpAccessChain %540 %507 %185 -OpStore %548 %547 +%490 = OpFunction %2 None %103 +%489 = OpLabel +OpBranch %499 +%499 = OpLabel +%500 = OpSNegate %6 %492 +%501 = OpSNegate %6 %493 +%502 = OpSNegate %6 %494 +%503 = OpSNegate %6 %502 +%504 = OpSNegate %6 %495 +%505 = OpSNegate %6 %504 +%506 = OpSNegate %6 %496 +%507 = OpSNegate %6 %506 +%508 = OpSNegate %6 %507 +%509 = OpSNegate %6 %508 +%510 = OpSNegate %6 %497 +%511 = OpSNegate %6 %510 +%512 = OpSNegate %6 %511 +%513 = OpSNegate %6 %512 +%514 = OpSNegate %6 %498 +%515 = OpSNegate %6 %514 +%516 = OpSNegate %6 %515 +%517 = OpSNegate %6 %516 OpReturn OpFunctionEnd -%550 = OpFunction %2 None %165 -%549 = OpLabel -OpBranch %559 -%559 = OpLabel -%560 = OpSNegate %6 %552 -%561 = OpSNegate %6 %553 -%562 = OpSNegate %6 %554 -%563 = OpSNegate %6 %562 -%564 = OpSNegate %6 %555 -%565 = OpSNegate %6 %564 -%566 = OpSNegate %6 %556 -%567 = OpSNegate %6 %566 -%568 = OpSNegate %6 %567 -%569 = OpSNegate %6 %568 -%570 = OpSNegate %6 %557 -%571 = OpSNegate %6 %570 -%572 = OpSNegate %6 %571 -%573 = OpSNegate %6 %572 -%574 = OpSNegate %6 %558 -%575 = OpSNegate %6 %574 -%576 = OpSNegate %6 %575 -%577 = OpSNegate %6 %576 -OpReturn -OpFunctionEnd -%579 = OpFunction %2 None %165 -%578 = OpLabel -OpBranch %580 -%580 = OpLabel -%581 = OpFunctionCall %3 %36 -%582 = OpFunctionCall %3 %65 -%583 = OpVectorShuffle %10 %27 %27 0 1 2 -%584 = OpFunctionCall %10 %105 %583 -%585 = OpFunctionCall %4 %116 -%586 = OpFunctionCall %2 %164 -%587 = OpFunctionCall %2 %182 -%588 = OpFunctionCall %2 %381 -%589 = OpFunctionCall %2 %430 -%590 = OpFunctionCall %2 %511 +%519 = OpFunction %2 None %103 +%518 = OpLabel +OpBranch %520 +%520 = OpLabel +%521 = OpFunctionCall %3 %25 +%522 = OpFunctionCall %3 %54 +%523 = OpVectorShuffle %10 %17 %17 0 1 2 +%524 = OpFunctionCall %10 %94 %523 +%525 = OpFunctionCall %2 %102 +%526 = OpFunctionCall %2 %120 +%527 = OpFunctionCall %2 %321 +%528 = OpFunctionCall %2 %370 +%529 = OpFunctionCall %2 %451 OpReturn OpFunctionEnd \ No newline at end of file diff --git a/tests/out/wgsl/constructors.wgsl b/tests/out/wgsl/constructors.wgsl new file mode 100644 index 0000000000..7818e4c39e --- /dev/null +++ b/tests/out/wgsl/constructors.wgsl @@ -0,0 +1,37 @@ +struct Foo { + a: vec4, + b: i32, +} + +const const2_: vec3 = vec3(0.0, 1.0, 2.0); +const const3_: mat2x2 = mat2x2(vec2(0.0, 1.0), vec2(2.0, 3.0)); +const const4_: array, 1> = array, 1>(mat2x2(vec2(0.0, 1.0), vec2(2.0, 3.0))); +const cz0_: bool = bool(); +const cz1_: i32 = i32(); +const cz2_: u32 = u32(); +const cz3_: f32 = f32(); +const cz4_: vec2 = vec2(); +const cz5_: mat2x2 = mat2x2(); +const cz6_: array = array(); +const cz7_: Foo = Foo(); +const cp3_: array = array(0, 1, 2, 3); + +@compute @workgroup_size(1, 1, 1) +fn main() { + var foo: Foo; + + foo = Foo(vec4(1.0), 1); + let m0_ = mat2x2(vec2(1.0, 0.0), vec2(0.0, 1.0)); + let m1_ = mat4x4(vec4(1.0, 0.0, 0.0, 0.0), vec4(0.0, 1.0, 0.0, 0.0), vec4(0.0, 0.0, 1.0, 0.0), vec4(0.0, 0.0, 0.0, 1.0)); + let cit0_ = vec2(0u); + let cit1_ = mat2x2(vec2(0.0), vec2(0.0)); + let cit2_ = array(0, 1, 2, 3); + let ic0_ = bool(bool()); + let ic1_ = i32(i32()); + let ic2_ = u32(u32()); + let ic3_ = f32(f32()); + let ic4_ = vec2(vec2()); + let ic5_ = mat2x3(mat2x3()); + let ic6_ = bitcast>(vec2()); + let ic7_ = mat2x3(mat2x3()); +} diff --git a/tests/out/wgsl/operators.wgsl b/tests/out/wgsl/operators.wgsl index 41a9c821a4..9550bf8405 100644 --- a/tests/out/wgsl/operators.wgsl +++ b/tests/out/wgsl/operators.wgsl @@ -1,8 +1,3 @@ -struct Foo { - a: vec4, - b: i32, -} - const v_f32_one: vec4 = vec4(1.0, 1.0, 1.0, 1.0); const v_f32_zero: vec4 = vec4(0.0, 0.0, 0.0, 0.0); const v_f32_half: vec4 = vec4(0.5, 0.5, 0.5, 0.5); @@ -45,27 +40,6 @@ fn bool_cast(x: vec3) -> vec3 { return vec3(y); } -fn constructors() -> f32 { - var foo: Foo; - - foo = Foo(vec4(1.0), 1); - let m0_ = mat2x2(vec2(1.0, 0.0), vec2(0.0, 1.0)); - let m1_1 = mat4x4(vec4(1.0, 0.0, 0.0, 0.0), vec4(0.0, 1.0, 0.0, 0.0), vec4(0.0, 0.0, 1.0, 0.0), vec4(0.0, 0.0, 0.0, 1.0)); - let cit0_ = vec2(0u); - let cit1_ = mat2x2(vec2(0.0), vec2(0.0)); - let cit2_ = array(0, 1, 2, 3); - let ic0_ = bool(bool()); - let ic1_ = i32(i32()); - let ic2_ = u32(u32()); - let ic3_ = f32(f32()); - let ic4_ = vec2(vec2()); - let ic5_ = mat2x3(mat2x3()); - let ic6_ = bitcast>(vec2()); - let ic7_ = mat2x3(mat2x3()); - let _e71 = foo.a.x; - return _e71; -} - fn logical() { let neg0_ = !(true); let neg1_ = !(vec2(true)); @@ -271,7 +245,6 @@ fn main() { let _e0 = builtins(); let _e1 = splat(); let _e4 = bool_cast(v_f32_one.xyz); - let _e5 = constructors(); logical(); arithmetic(); bit(); diff --git a/tests/snapshots.rs b/tests/snapshots.rs index 658e5fe7f3..e1e1144139 100644 --- a/tests/snapshots.rs +++ b/tests/snapshots.rs @@ -607,6 +607,10 @@ fn convert_wgsl() { ("invariant", Targets::GLSL), ("ray-query", Targets::SPIRV | Targets::METAL), ("hlsl-keyword", Targets::HLSL), + ( + "constructors", + Targets::SPIRV | Targets::METAL | Targets::GLSL | Targets::HLSL | Targets::WGSL, + ), ]; for &(name, targets) in inputs.iter() {