xref: /aosp_15_r20/external/skia/tests/sksl/intrinsics/Inverse.asm.frag (revision c8dee2aa9b3f27cf6c858bd81872bdeb2c07ed17)
1               OpCapability Shader
2          %1 = OpExtInstImport "GLSL.std.450"
3               OpMemoryModel Logical GLSL450
4               OpEntryPoint Fragment %_entrypoint_v "_entrypoint" %sk_FragColor
5               OpExecutionMode %_entrypoint_v OriginUpperLeft
6               OpName %sk_FragColor "sk_FragColor"
7               OpName %_UniformBuffer "_UniformBuffer"
8               OpMemberName %_UniformBuffer 0 "colorGreen"
9               OpMemberName %_UniformBuffer 1 "colorRed"
10               OpName %_entrypoint_v "_entrypoint_v"
11               OpName %main "main"
12               OpName %matrix2x2 "matrix2x2"
13               OpName %inv2x2 "inv2x2"
14               OpName %inv3x3 "inv3x3"
15               OpName %inv4x4 "inv4x4"
16               OpName %Zero "Zero"
17               OpDecorate %sk_FragColor RelaxedPrecision
18               OpDecorate %sk_FragColor Location 0
19               OpDecorate %sk_FragColor Index 0
20               OpMemberDecorate %_UniformBuffer 0 Offset 0
21               OpMemberDecorate %_UniformBuffer 0 RelaxedPrecision
22               OpMemberDecorate %_UniformBuffer 1 Offset 16
23               OpMemberDecorate %_UniformBuffer 1 RelaxedPrecision
24               OpDecorate %_UniformBuffer Block
25               OpDecorate %7 Binding 0
26               OpDecorate %7 DescriptorSet 0
27               OpDecorate %72 RelaxedPrecision
28               OpDecorate %73 RelaxedPrecision
29               OpDecorate %209 RelaxedPrecision
30               OpDecorate %212 RelaxedPrecision
31               OpDecorate %213 RelaxedPrecision
32      %float = OpTypeFloat 32
33    %v4float = OpTypeVector %float 4
34%_ptr_Output_v4float = OpTypePointer Output %v4float
35%sk_FragColor = OpVariable %_ptr_Output_v4float Output
36%_UniformBuffer = OpTypeStruct %v4float %v4float
37%_ptr_Uniform__UniformBuffer = OpTypePointer Uniform %_UniformBuffer
38          %7 = OpVariable %_ptr_Uniform__UniformBuffer Uniform
39       %void = OpTypeVoid
40         %12 = OpTypeFunction %void
41    %float_0 = OpConstant %float 0
42    %v2float = OpTypeVector %float 2
43         %16 = OpConstantComposite %v2float %float_0 %float_0
44%_ptr_Function_v2float = OpTypePointer Function %v2float
45         %20 = OpTypeFunction %v4float %_ptr_Function_v2float
46%mat2v2float = OpTypeMatrix %v2float 2
47%_ptr_Function_mat2v2float = OpTypePointer Function %mat2v2float
48    %float_1 = OpConstant %float 1
49    %float_2 = OpConstant %float 2
50    %float_3 = OpConstant %float 3
51    %float_4 = OpConstant %float 4
52         %30 = OpConstantComposite %v2float %float_1 %float_2
53         %31 = OpConstantComposite %v2float %float_3 %float_4
54         %32 = OpConstantComposite %mat2v2float %30 %31
55   %float_n2 = OpConstant %float -2
56  %float_1_5 = OpConstant %float 1.5
57 %float_n0_5 = OpConstant %float -0.5
58         %37 = OpConstantComposite %v2float %float_n2 %float_1
59         %38 = OpConstantComposite %v2float %float_1_5 %float_n0_5
60         %39 = OpConstantComposite %mat2v2float %37 %38
61    %v3float = OpTypeVector %float 3
62%mat3v3float = OpTypeMatrix %v3float 3
63%_ptr_Function_mat3v3float = OpTypePointer Function %mat3v3float
64  %float_n24 = OpConstant %float -24
65   %float_18 = OpConstant %float 18
66    %float_5 = OpConstant %float 5
67   %float_20 = OpConstant %float 20
68  %float_n15 = OpConstant %float -15
69   %float_n4 = OpConstant %float -4
70   %float_n5 = OpConstant %float -5
71         %51 = OpConstantComposite %v3float %float_n24 %float_18 %float_5
72         %52 = OpConstantComposite %v3float %float_20 %float_n15 %float_n4
73         %53 = OpConstantComposite %v3float %float_n5 %float_4 %float_1
74         %54 = OpConstantComposite %mat3v3float %51 %52 %53
75%mat4v4float = OpTypeMatrix %v4float 4
76%_ptr_Function_mat4v4float = OpTypePointer Function %mat4v4float
77  %float_0_5 = OpConstant %float 0.5
78   %float_n8 = OpConstant %float -8
79   %float_n1 = OpConstant %float -1
80         %61 = OpConstantComposite %v4float %float_n2 %float_n0_5 %float_1 %float_0_5
81         %62 = OpConstantComposite %v4float %float_1 %float_0_5 %float_0 %float_n0_5
82         %63 = OpConstantComposite %v4float %float_n8 %float_n1 %float_2 %float_2
83         %64 = OpConstantComposite %v4float %float_3 %float_0_5 %float_n1 %float_n0_5
84         %65 = OpConstantComposite %mat4v4float %61 %62 %63 %64
85%_ptr_Function_float = OpTypePointer Function %float
86%_ptr_Uniform_v4float = OpTypePointer Uniform %v4float
87        %int = OpTypeInt 32 1
88      %int_0 = OpConstant %int 0
89       %bool = OpTypeBool
90      %false = OpConstantFalse %bool
91     %v2bool = OpTypeVector %bool 2
92     %v3bool = OpTypeVector %bool 3
93     %v4bool = OpTypeVector %bool 4
94    %float_6 = OpConstant %float 6
95    %float_7 = OpConstant %float 7
96    %float_8 = OpConstant %float 8
97    %float_9 = OpConstant %float 9
98        %116 = OpConstantComposite %v3float %float_1 %float_2 %float_3
99        %117 = OpConstantComposite %v3float %float_4 %float_5 %float_6
100        %118 = OpConstantComposite %v3float %float_7 %float_8 %float_9
101        %119 = OpConstantComposite %mat3v3float %116 %117 %118
102        %151 = OpConstantComposite %v3float %float_0 %float_1 %float_4
103        %152 = OpConstantComposite %v3float %float_5 %float_6 %float_0
104        %153 = OpConstantComposite %mat3v3float %116 %151 %152
105        %175 = OpConstantComposite %v4float %float_1 %float_0 %float_0 %float_1
106        %176 = OpConstantComposite %v4float %float_0 %float_2 %float_1 %float_2
107        %177 = OpConstantComposite %v4float %float_2 %float_1 %float_0 %float_1
108        %178 = OpConstantComposite %v4float %float_2 %float_0 %float_1 %float_4
109        %179 = OpConstantComposite %mat4v4float %175 %176 %177 %178
110%_ptr_Function_v4float = OpTypePointer Function %v4float
111      %int_1 = OpConstant %int 1
112%_entrypoint_v = OpFunction %void None %12
113         %13 = OpLabel
114         %17 = OpVariable %_ptr_Function_v2float Function
115               OpStore %17 %16
116         %19 = OpFunctionCall %v4float %main %17
117               OpStore %sk_FragColor %19
118               OpReturn
119               OpFunctionEnd
120       %main = OpFunction %v4float None %20
121         %21 = OpFunctionParameter %_ptr_Function_v2float
122         %22 = OpLabel
123  %matrix2x2 = OpVariable %_ptr_Function_mat2v2float Function
124     %inv2x2 = OpVariable %_ptr_Function_mat2v2float Function
125     %inv3x3 = OpVariable %_ptr_Function_mat3v3float Function
126     %inv4x4 = OpVariable %_ptr_Function_mat4v4float Function
127       %Zero = OpVariable %_ptr_Function_float Function
128        %203 = OpVariable %_ptr_Function_v4float Function
129               OpStore %matrix2x2 %32
130               OpStore %inv2x2 %39
131               OpStore %inv3x3 %54
132               OpStore %inv4x4 %65
133         %68 = OpAccessChain %_ptr_Uniform_v4float %7 %int_0
134         %72 = OpLoad %v4float %68
135         %73 = OpCompositeExtract %float %72 2
136               OpStore %Zero %73
137         %77 = OpFOrdEqual %v2bool %37 %37
138         %78 = OpAll %bool %77
139         %79 = OpFOrdEqual %v2bool %38 %38
140         %80 = OpAll %bool %79
141         %81 = OpLogicalAnd %bool %78 %80
142               OpSelectionMerge %83 None
143               OpBranchConditional %81 %82 %83
144         %82 = OpLabel
145         %85 = OpFOrdEqual %v3bool %51 %51
146         %86 = OpAll %bool %85
147         %87 = OpFOrdEqual %v3bool %52 %52
148         %88 = OpAll %bool %87
149         %89 = OpLogicalAnd %bool %86 %88
150         %90 = OpFOrdEqual %v3bool %53 %53
151         %91 = OpAll %bool %90
152         %92 = OpLogicalAnd %bool %89 %91
153               OpBranch %83
154         %83 = OpLabel
155         %93 = OpPhi %bool %false %22 %92 %82
156               OpSelectionMerge %95 None
157               OpBranchConditional %93 %94 %95
158         %94 = OpLabel
159         %97 = OpFOrdEqual %v4bool %61 %61
160         %98 = OpAll %bool %97
161         %99 = OpFOrdEqual %v4bool %62 %62
162        %100 = OpAll %bool %99
163        %101 = OpLogicalAnd %bool %98 %100
164        %102 = OpFOrdEqual %v4bool %63 %63
165        %103 = OpAll %bool %102
166        %104 = OpLogicalAnd %bool %101 %103
167        %105 = OpFOrdEqual %v4bool %64 %64
168        %106 = OpAll %bool %105
169        %107 = OpLogicalAnd %bool %104 %106
170               OpBranch %95
171         %95 = OpLabel
172        %108 = OpPhi %bool %false %83 %107 %94
173               OpSelectionMerge %110 None
174               OpBranchConditional %108 %109 %110
175        %109 = OpLabel
176        %111 = OpExtInst %mat3v3float %1 MatrixInverse %119
177        %120 = OpCompositeExtract %v3float %111 0
178        %121 = OpFUnordNotEqual %v3bool %120 %51
179        %122 = OpAny %bool %121
180        %123 = OpCompositeExtract %v3float %111 1
181        %124 = OpFUnordNotEqual %v3bool %123 %52
182        %125 = OpAny %bool %124
183        %126 = OpLogicalOr %bool %122 %125
184        %127 = OpCompositeExtract %v3float %111 2
185        %128 = OpFUnordNotEqual %v3bool %127 %53
186        %129 = OpAny %bool %128
187        %130 = OpLogicalOr %bool %126 %129
188               OpBranch %110
189        %110 = OpLabel
190        %131 = OpPhi %bool %false %95 %130 %109
191               OpSelectionMerge %133 None
192               OpBranchConditional %131 %132 %133
193        %132 = OpLabel
194        %135 = OpCompositeConstruct %v2float %73 %73
195        %136 = OpCompositeConstruct %mat2v2float %135 %135
196        %137 = OpFAdd %v2float %30 %135
197        %138 = OpFAdd %v2float %31 %135
198        %139 = OpCompositeConstruct %mat2v2float %137 %138
199        %134 = OpExtInst %mat2v2float %1 MatrixInverse %139
200        %140 = OpCompositeExtract %v2float %134 0
201        %141 = OpFOrdEqual %v2bool %140 %37
202        %142 = OpAll %bool %141
203        %143 = OpCompositeExtract %v2float %134 1
204        %144 = OpFOrdEqual %v2bool %143 %38
205        %145 = OpAll %bool %144
206        %146 = OpLogicalAnd %bool %142 %145
207               OpBranch %133
208        %133 = OpLabel
209        %147 = OpPhi %bool %false %110 %146 %132
210               OpSelectionMerge %149 None
211               OpBranchConditional %147 %148 %149
212        %148 = OpLabel
213        %154 = OpCompositeConstruct %v3float %73 %73 %73
214        %155 = OpCompositeConstruct %mat3v3float %154 %154 %154
215        %156 = OpFAdd %v3float %116 %154
216        %157 = OpFAdd %v3float %151 %154
217        %158 = OpFAdd %v3float %152 %154
218        %159 = OpCompositeConstruct %mat3v3float %156 %157 %158
219        %150 = OpExtInst %mat3v3float %1 MatrixInverse %159
220        %160 = OpCompositeExtract %v3float %150 0
221        %161 = OpFOrdEqual %v3bool %160 %51
222        %162 = OpAll %bool %161
223        %163 = OpCompositeExtract %v3float %150 1
224        %164 = OpFOrdEqual %v3bool %163 %52
225        %165 = OpAll %bool %164
226        %166 = OpLogicalAnd %bool %162 %165
227        %167 = OpCompositeExtract %v3float %150 2
228        %168 = OpFOrdEqual %v3bool %167 %53
229        %169 = OpAll %bool %168
230        %170 = OpLogicalAnd %bool %166 %169
231               OpBranch %149
232        %149 = OpLabel
233        %171 = OpPhi %bool %false %133 %170 %148
234               OpSelectionMerge %173 None
235               OpBranchConditional %171 %172 %173
236        %172 = OpLabel
237        %180 = OpCompositeConstruct %v4float %73 %73 %73 %73
238        %181 = OpCompositeConstruct %mat4v4float %180 %180 %180 %180
239        %182 = OpFAdd %v4float %175 %180
240        %183 = OpFAdd %v4float %176 %180
241        %184 = OpFAdd %v4float %177 %180
242        %185 = OpFAdd %v4float %178 %180
243        %186 = OpCompositeConstruct %mat4v4float %182 %183 %184 %185
244        %174 = OpExtInst %mat4v4float %1 MatrixInverse %186
245        %187 = OpCompositeExtract %v4float %174 0
246        %188 = OpFOrdEqual %v4bool %187 %61
247        %189 = OpAll %bool %188
248        %190 = OpCompositeExtract %v4float %174 1
249        %191 = OpFOrdEqual %v4bool %190 %62
250        %192 = OpAll %bool %191
251        %193 = OpLogicalAnd %bool %189 %192
252        %194 = OpCompositeExtract %v4float %174 2
253        %195 = OpFOrdEqual %v4bool %194 %63
254        %196 = OpAll %bool %195
255        %197 = OpLogicalAnd %bool %193 %196
256        %198 = OpCompositeExtract %v4float %174 3
257        %199 = OpFOrdEqual %v4bool %198 %64
258        %200 = OpAll %bool %199
259        %201 = OpLogicalAnd %bool %197 %200
260               OpBranch %173
261        %173 = OpLabel
262        %202 = OpPhi %bool %false %149 %201 %172
263               OpSelectionMerge %207 None
264               OpBranchConditional %202 %205 %206
265        %205 = OpLabel
266        %208 = OpAccessChain %_ptr_Uniform_v4float %7 %int_0
267        %209 = OpLoad %v4float %208
268               OpStore %203 %209
269               OpBranch %207
270        %206 = OpLabel
271        %210 = OpAccessChain %_ptr_Uniform_v4float %7 %int_1
272        %212 = OpLoad %v4float %210
273               OpStore %203 %212
274               OpBranch %207
275        %207 = OpLabel
276        %213 = OpLoad %v4float %203
277               OpReturnValue %213
278               OpFunctionEnd
279