xref: /aosp_15_r20/external/skia/tests/sksl/shared/NumberConversions.asm.frag (revision c8dee2aa9b3f27cf6c858bd81872bdeb2c07ed17)
1               OpCapability Shader
2          %1 = OpExtInstImport "GLSL.std.450"
3               OpMemoryModel Logical GLSL450
4               OpEntryPoint Fragment %main "main" %sk_FragColor
5               OpExecutionMode %main OriginUpperLeft
6               OpName %sk_FragColor "sk_FragColor"
7               OpName %_UniformBuffer "_UniformBuffer"
8               OpMemberName %_UniformBuffer 0 "unknownInput"
9               OpName %main "main"
10               OpName %b "b"
11               OpName %s "s"
12               OpName %i "i"
13               OpName %us "us"
14               OpName %ui "ui"
15               OpName %h "h"
16               OpName %f "f"
17               OpName %s2s "s2s"
18               OpName %i2s "i2s"
19               OpName %us2s "us2s"
20               OpName %ui2s "ui2s"
21               OpName %h2s "h2s"
22               OpName %f2s "f2s"
23               OpName %b2s "b2s"
24               OpName %s2i "s2i"
25               OpName %i2i "i2i"
26               OpName %us2i "us2i"
27               OpName %ui2i "ui2i"
28               OpName %h2i "h2i"
29               OpName %f2i "f2i"
30               OpName %b2i "b2i"
31               OpName %s2us "s2us"
32               OpName %i2us "i2us"
33               OpName %us2us "us2us"
34               OpName %ui2us "ui2us"
35               OpName %h2us "h2us"
36               OpName %f2us "f2us"
37               OpName %b2us "b2us"
38               OpName %s2ui "s2ui"
39               OpName %i2ui "i2ui"
40               OpName %us2ui "us2ui"
41               OpName %ui2ui "ui2ui"
42               OpName %h2ui "h2ui"
43               OpName %f2ui "f2ui"
44               OpName %b2ui "b2ui"
45               OpName %s2f "s2f"
46               OpName %i2f "i2f"
47               OpName %us2f "us2f"
48               OpName %ui2f "ui2f"
49               OpName %h2f "h2f"
50               OpName %f2f "f2f"
51               OpName %b2f "b2f"
52               OpDecorate %sk_FragColor RelaxedPrecision
53               OpDecorate %sk_FragColor Location 0
54               OpDecorate %sk_FragColor Index 0
55               OpMemberDecorate %_UniformBuffer 0 Offset 0
56               OpDecorate %_UniformBuffer Block
57               OpDecorate %7 Binding 0
58               OpDecorate %7 DescriptorSet 0
59               OpDecorate %s RelaxedPrecision
60               OpDecorate %24 RelaxedPrecision
61               OpDecorate %us RelaxedPrecision
62               OpDecorate %34 RelaxedPrecision
63               OpDecorate %h RelaxedPrecision
64               OpDecorate %s2s RelaxedPrecision
65               OpDecorate %i2s RelaxedPrecision
66               OpDecorate %us2s RelaxedPrecision
67               OpDecorate %49 RelaxedPrecision
68               OpDecorate %ui2s RelaxedPrecision
69               OpDecorate %51 RelaxedPrecision
70               OpDecorate %h2s RelaxedPrecision
71               OpDecorate %53 RelaxedPrecision
72               OpDecorate %f2s RelaxedPrecision
73               OpDecorate %55 RelaxedPrecision
74               OpDecorate %b2s RelaxedPrecision
75               OpDecorate %57 RelaxedPrecision
76               OpDecorate %s2us RelaxedPrecision
77               OpDecorate %72 RelaxedPrecision
78               OpDecorate %i2us RelaxedPrecision
79               OpDecorate %74 RelaxedPrecision
80               OpDecorate %us2us RelaxedPrecision
81               OpDecorate %ui2us RelaxedPrecision
82               OpDecorate %h2us RelaxedPrecision
83               OpDecorate %78 RelaxedPrecision
84               OpDecorate %f2us RelaxedPrecision
85               OpDecorate %80 RelaxedPrecision
86               OpDecorate %b2us RelaxedPrecision
87               OpDecorate %82 RelaxedPrecision
88               OpDecorate %111 RelaxedPrecision
89               OpDecorate %112 RelaxedPrecision
90               OpDecorate %113 RelaxedPrecision
91               OpDecorate %114 RelaxedPrecision
92               OpDecorate %115 RelaxedPrecision
93               OpDecorate %116 RelaxedPrecision
94               OpDecorate %117 RelaxedPrecision
95               OpDecorate %118 RelaxedPrecision
96               OpDecorate %119 RelaxedPrecision
97               OpDecorate %120 RelaxedPrecision
98               OpDecorate %121 RelaxedPrecision
99               OpDecorate %122 RelaxedPrecision
100               OpDecorate %123 RelaxedPrecision
101               OpDecorate %124 RelaxedPrecision
102               OpDecorate %125 RelaxedPrecision
103               OpDecorate %126 RelaxedPrecision
104               OpDecorate %127 RelaxedPrecision
105               OpDecorate %128 RelaxedPrecision
106               OpDecorate %129 RelaxedPrecision
107               OpDecorate %130 RelaxedPrecision
108               OpDecorate %131 RelaxedPrecision
109               OpDecorate %132 RelaxedPrecision
110               OpDecorate %133 RelaxedPrecision
111               OpDecorate %134 RelaxedPrecision
112               OpDecorate %135 RelaxedPrecision
113               OpDecorate %136 RelaxedPrecision
114               OpDecorate %137 RelaxedPrecision
115               OpDecorate %138 RelaxedPrecision
116               OpDecorate %139 RelaxedPrecision
117               OpDecorate %140 RelaxedPrecision
118               OpDecorate %141 RelaxedPrecision
119               OpDecorate %142 RelaxedPrecision
120               OpDecorate %143 RelaxedPrecision
121               OpDecorate %144 RelaxedPrecision
122               OpDecorate %145 RelaxedPrecision
123               OpDecorate %146 RelaxedPrecision
124               OpDecorate %147 RelaxedPrecision
125               OpDecorate %148 RelaxedPrecision
126               OpDecorate %149 RelaxedPrecision
127               OpDecorate %150 RelaxedPrecision
128               OpDecorate %151 RelaxedPrecision
129               OpDecorate %152 RelaxedPrecision
130               OpDecorate %153 RelaxedPrecision
131               OpDecorate %157 RelaxedPrecision
132               OpDecorate %158 RelaxedPrecision
133               OpDecorate %159 RelaxedPrecision
134               OpDecorate %160 RelaxedPrecision
135               OpDecorate %161 RelaxedPrecision
136               OpDecorate %162 RelaxedPrecision
137               OpDecorate %163 RelaxedPrecision
138               OpDecorate %164 RelaxedPrecision
139               OpDecorate %165 RelaxedPrecision
140               OpDecorate %166 RelaxedPrecision
141               OpDecorate %167 RelaxedPrecision
142               OpDecorate %168 RelaxedPrecision
143               OpDecorate %170 RelaxedPrecision
144               OpDecorate %171 RelaxedPrecision
145               OpDecorate %173 RelaxedPrecision
146               OpDecorate %174 RelaxedPrecision
147               OpDecorate %176 RelaxedPrecision
148               OpDecorate %177 RelaxedPrecision
149               OpDecorate %179 RelaxedPrecision
150               OpDecorate %180 RelaxedPrecision
151               OpDecorate %182 RelaxedPrecision
152               OpDecorate %183 RelaxedPrecision
153               OpDecorate %185 RelaxedPrecision
154               OpDecorate %186 RelaxedPrecision
155               OpDecorate %188 RelaxedPrecision
156               OpDecorate %189 RelaxedPrecision
157               OpDecorate %191 RelaxedPrecision
158               OpDecorate %193 RelaxedPrecision
159               OpDecorate %195 RelaxedPrecision
160               OpDecorate %197 RelaxedPrecision
161               OpDecorate %199 RelaxedPrecision
162               OpDecorate %201 RelaxedPrecision
163               OpDecorate %203 RelaxedPrecision
164               OpDecorate %204 RelaxedPrecision
165      %float = OpTypeFloat 32
166    %v4float = OpTypeVector %float 4
167%_ptr_Output_v4float = OpTypePointer Output %v4float
168%sk_FragColor = OpVariable %_ptr_Output_v4float Output
169%_UniformBuffer = OpTypeStruct %float
170%_ptr_Uniform__UniformBuffer = OpTypePointer Uniform %_UniformBuffer
171          %7 = OpVariable %_ptr_Uniform__UniformBuffer Uniform
172       %void = OpTypeVoid
173         %11 = OpTypeFunction %void
174       %bool = OpTypeBool
175%_ptr_Function_bool = OpTypePointer Function %bool
176       %true = OpConstantTrue %bool
177        %int = OpTypeInt 32 1
178%_ptr_Function_int = OpTypePointer Function %int
179%_ptr_Uniform_float = OpTypePointer Uniform %float
180      %int_0 = OpConstant %int 0
181       %uint = OpTypeInt 32 0
182%_ptr_Function_uint = OpTypePointer Function %uint
183%_ptr_Function_float = OpTypePointer Function %float
184      %int_1 = OpConstant %int 1
185     %uint_1 = OpConstant %uint 1
186     %uint_0 = OpConstant %uint 0
187    %float_1 = OpConstant %float 1
188    %float_0 = OpConstant %float 0
189%_ptr_Output_float = OpTypePointer Output %float
190       %main = OpFunction %void None %11
191         %12 = OpLabel
192          %b = OpVariable %_ptr_Function_bool Function
193          %s = OpVariable %_ptr_Function_int Function
194          %i = OpVariable %_ptr_Function_int Function
195         %us = OpVariable %_ptr_Function_uint Function
196         %ui = OpVariable %_ptr_Function_uint Function
197          %h = OpVariable %_ptr_Function_float Function
198          %f = OpVariable %_ptr_Function_float Function
199        %s2s = OpVariable %_ptr_Function_int Function
200        %i2s = OpVariable %_ptr_Function_int Function
201       %us2s = OpVariable %_ptr_Function_int Function
202       %ui2s = OpVariable %_ptr_Function_int Function
203        %h2s = OpVariable %_ptr_Function_int Function
204        %f2s = OpVariable %_ptr_Function_int Function
205        %b2s = OpVariable %_ptr_Function_int Function
206        %s2i = OpVariable %_ptr_Function_int Function
207        %i2i = OpVariable %_ptr_Function_int Function
208       %us2i = OpVariable %_ptr_Function_int Function
209       %ui2i = OpVariable %_ptr_Function_int Function
210        %h2i = OpVariable %_ptr_Function_int Function
211        %f2i = OpVariable %_ptr_Function_int Function
212        %b2i = OpVariable %_ptr_Function_int Function
213       %s2us = OpVariable %_ptr_Function_uint Function
214       %i2us = OpVariable %_ptr_Function_uint Function
215      %us2us = OpVariable %_ptr_Function_uint Function
216      %ui2us = OpVariable %_ptr_Function_uint Function
217       %h2us = OpVariable %_ptr_Function_uint Function
218       %f2us = OpVariable %_ptr_Function_uint Function
219       %b2us = OpVariable %_ptr_Function_uint Function
220       %s2ui = OpVariable %_ptr_Function_uint Function
221       %i2ui = OpVariable %_ptr_Function_uint Function
222      %us2ui = OpVariable %_ptr_Function_uint Function
223      %ui2ui = OpVariable %_ptr_Function_uint Function
224       %h2ui = OpVariable %_ptr_Function_uint Function
225       %f2ui = OpVariable %_ptr_Function_uint Function
226       %b2ui = OpVariable %_ptr_Function_uint Function
227        %s2f = OpVariable %_ptr_Function_float Function
228        %i2f = OpVariable %_ptr_Function_float Function
229       %us2f = OpVariable %_ptr_Function_float Function
230       %ui2f = OpVariable %_ptr_Function_float Function
231        %h2f = OpVariable %_ptr_Function_float Function
232        %f2f = OpVariable %_ptr_Function_float Function
233        %b2f = OpVariable %_ptr_Function_float Function
234               OpStore %b %true
235         %20 = OpAccessChain %_ptr_Uniform_float %7 %int_0
236         %23 = OpLoad %float %20
237         %24 = OpConvertFToS %int %23
238               OpStore %s %24
239         %26 = OpAccessChain %_ptr_Uniform_float %7 %int_0
240         %27 = OpLoad %float %26
241         %28 = OpConvertFToS %int %27
242               OpStore %i %28
243         %32 = OpAccessChain %_ptr_Uniform_float %7 %int_0
244         %33 = OpLoad %float %32
245         %34 = OpConvertFToU %uint %33
246               OpStore %us %34
247         %36 = OpAccessChain %_ptr_Uniform_float %7 %int_0
248         %37 = OpLoad %float %36
249         %38 = OpConvertFToU %uint %37
250               OpStore %ui %38
251         %41 = OpAccessChain %_ptr_Uniform_float %7 %int_0
252         %42 = OpLoad %float %41
253               OpStore %h %42
254         %44 = OpAccessChain %_ptr_Uniform_float %7 %int_0
255         %45 = OpLoad %float %44
256               OpStore %f %45
257               OpStore %s2s %24
258               OpStore %i2s %28
259         %49 = OpBitcast %int %34
260               OpStore %us2s %49
261         %51 = OpBitcast %int %38
262               OpStore %ui2s %51
263         %53 = OpConvertFToS %int %42
264               OpStore %h2s %53
265         %55 = OpConvertFToS %int %45
266               OpStore %f2s %55
267         %57 = OpSelect %int %true %int_1 %int_0
268               OpStore %b2s %57
269               OpStore %s2i %24
270               OpStore %i2i %28
271         %62 = OpBitcast %int %34
272               OpStore %us2i %62
273         %64 = OpBitcast %int %38
274               OpStore %ui2i %64
275         %66 = OpConvertFToS %int %42
276               OpStore %h2i %66
277         %68 = OpConvertFToS %int %45
278               OpStore %f2i %68
279         %70 = OpSelect %int %true %int_1 %int_0
280               OpStore %b2i %70
281         %72 = OpBitcast %uint %24
282               OpStore %s2us %72
283         %74 = OpBitcast %uint %28
284               OpStore %i2us %74
285               OpStore %us2us %34
286               OpStore %ui2us %38
287         %78 = OpConvertFToU %uint %42
288               OpStore %h2us %78
289         %80 = OpConvertFToU %uint %45
290               OpStore %f2us %80
291         %82 = OpSelect %uint %true %uint_1 %uint_0
292               OpStore %b2us %82
293         %86 = OpBitcast %uint %24
294               OpStore %s2ui %86
295         %88 = OpBitcast %uint %28
296               OpStore %i2ui %88
297               OpStore %us2ui %34
298               OpStore %ui2ui %38
299         %92 = OpConvertFToU %uint %42
300               OpStore %h2ui %92
301         %94 = OpConvertFToU %uint %45
302               OpStore %f2ui %94
303         %96 = OpSelect %uint %true %uint_1 %uint_0
304               OpStore %b2ui %96
305         %98 = OpConvertSToF %float %24
306               OpStore %s2f %98
307        %100 = OpConvertSToF %float %28
308               OpStore %i2f %100
309        %102 = OpConvertUToF %float %34
310               OpStore %us2f %102
311        %104 = OpConvertUToF %float %38
312               OpStore %ui2f %104
313               OpStore %h2f %42
314               OpStore %f2f %45
315        %108 = OpSelect %float %true %float_1 %float_0
316               OpStore %b2f %108
317        %111 = OpConvertSToF %float %24
318        %112 = OpConvertSToF %float %28
319        %113 = OpFAdd %float %111 %112
320        %114 = OpConvertUToF %float %34
321        %115 = OpFAdd %float %113 %114
322        %116 = OpConvertUToF %float %38
323        %117 = OpFAdd %float %115 %116
324        %118 = OpFAdd %float %117 %42
325        %119 = OpFAdd %float %118 %45
326        %120 = OpConvertSToF %float %24
327        %121 = OpFAdd %float %119 %120
328        %122 = OpConvertSToF %float %28
329        %123 = OpFAdd %float %121 %122
330        %124 = OpConvertSToF %float %49
331        %125 = OpFAdd %float %123 %124
332        %126 = OpConvertSToF %float %51
333        %127 = OpFAdd %float %125 %126
334        %128 = OpConvertSToF %float %53
335        %129 = OpFAdd %float %127 %128
336        %130 = OpConvertSToF %float %55
337        %131 = OpFAdd %float %129 %130
338        %132 = OpConvertSToF %float %57
339        %133 = OpFAdd %float %131 %132
340        %134 = OpConvertSToF %float %24
341        %135 = OpFAdd %float %133 %134
342        %136 = OpConvertSToF %float %28
343        %137 = OpFAdd %float %135 %136
344        %138 = OpConvertSToF %float %62
345        %139 = OpFAdd %float %137 %138
346        %140 = OpConvertSToF %float %64
347        %141 = OpFAdd %float %139 %140
348        %142 = OpConvertSToF %float %66
349        %143 = OpFAdd %float %141 %142
350        %144 = OpConvertSToF %float %68
351        %145 = OpFAdd %float %143 %144
352        %146 = OpConvertSToF %float %70
353        %147 = OpFAdd %float %145 %146
354        %148 = OpConvertUToF %float %72
355        %149 = OpFAdd %float %147 %148
356        %150 = OpConvertUToF %float %74
357        %151 = OpFAdd %float %149 %150
358        %152 = OpConvertUToF %float %34
359        %153 = OpFAdd %float %151 %152
360        %154 = OpAccessChain %_ptr_Output_float %sk_FragColor %int_0
361               OpStore %154 %153
362        %156 = OpAccessChain %_ptr_Output_float %sk_FragColor %int_0
363        %157 = OpLoad %float %156
364        %158 = OpLoad %uint %ui2us
365        %159 = OpConvertUToF %float %158
366        %160 = OpLoad %uint %h2us
367        %161 = OpConvertUToF %float %160
368        %162 = OpFAdd %float %159 %161
369        %163 = OpLoad %uint %f2us
370        %164 = OpConvertUToF %float %163
371        %165 = OpFAdd %float %162 %164
372        %166 = OpLoad %uint %b2us
373        %167 = OpConvertUToF %float %166
374        %168 = OpFAdd %float %165 %167
375        %169 = OpLoad %uint %s2ui
376        %170 = OpConvertUToF %float %169
377        %171 = OpFAdd %float %168 %170
378        %172 = OpLoad %uint %i2ui
379        %173 = OpConvertUToF %float %172
380        %174 = OpFAdd %float %171 %173
381        %175 = OpLoad %uint %us2ui
382        %176 = OpConvertUToF %float %175
383        %177 = OpFAdd %float %174 %176
384        %178 = OpLoad %uint %ui2ui
385        %179 = OpConvertUToF %float %178
386        %180 = OpFAdd %float %177 %179
387        %181 = OpLoad %uint %h2ui
388        %182 = OpConvertUToF %float %181
389        %183 = OpFAdd %float %180 %182
390        %184 = OpLoad %uint %f2ui
391        %185 = OpConvertUToF %float %184
392        %186 = OpFAdd %float %183 %185
393        %187 = OpLoad %uint %b2ui
394        %188 = OpConvertUToF %float %187
395        %189 = OpFAdd %float %186 %188
396        %190 = OpLoad %float %s2f
397        %191 = OpFAdd %float %189 %190
398        %192 = OpLoad %float %i2f
399        %193 = OpFAdd %float %191 %192
400        %194 = OpLoad %float %us2f
401        %195 = OpFAdd %float %193 %194
402        %196 = OpLoad %float %ui2f
403        %197 = OpFAdd %float %195 %196
404        %198 = OpLoad %float %h2f
405        %199 = OpFAdd %float %197 %198
406        %200 = OpLoad %float %f2f
407        %201 = OpFAdd %float %199 %200
408        %202 = OpLoad %float %b2f
409        %203 = OpFAdd %float %201 %202
410        %204 = OpFAdd %float %157 %203
411               OpStore %156 %204
412               OpReturn
413               OpFunctionEnd
414