xref: /aosp_15_r20/external/skia/tests/sksl/intrinsics/MaxInt.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 "testInputs"
9               OpMemberName %_UniformBuffer 1 "colorGreen"
10               OpMemberName %_UniformBuffer 2 "colorRed"
11               OpName %_entrypoint_v "_entrypoint_v"
12               OpName %main "main"
13               OpName %intValues "intValues"
14               OpName %intGreen "intGreen"
15               OpName %expectedA "expectedA"
16               OpName %expectedB "expectedB"
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               OpMemberDecorate %_UniformBuffer 2 Offset 32
25               OpMemberDecorate %_UniformBuffer 2 RelaxedPrecision
26               OpDecorate %_UniformBuffer Block
27               OpDecorate %7 Binding 0
28               OpDecorate %7 DescriptorSet 0
29               OpDecorate %30 RelaxedPrecision
30               OpDecorate %32 RelaxedPrecision
31               OpDecorate %33 RelaxedPrecision
32               OpDecorate %35 RelaxedPrecision
33               OpDecorate %37 RelaxedPrecision
34               OpDecorate %39 RelaxedPrecision
35               OpDecorate %45 RelaxedPrecision
36               OpDecorate %46 RelaxedPrecision
37               OpDecorate %47 RelaxedPrecision
38               OpDecorate %49 RelaxedPrecision
39               OpDecorate %51 RelaxedPrecision
40               OpDecorate %53 RelaxedPrecision
41               OpDecorate %175 RelaxedPrecision
42               OpDecorate %178 RelaxedPrecision
43               OpDecorate %179 RelaxedPrecision
44      %float = OpTypeFloat 32
45    %v4float = OpTypeVector %float 4
46%_ptr_Output_v4float = OpTypePointer Output %v4float
47%sk_FragColor = OpVariable %_ptr_Output_v4float Output
48%_UniformBuffer = OpTypeStruct %v4float %v4float %v4float
49%_ptr_Uniform__UniformBuffer = OpTypePointer Uniform %_UniformBuffer
50          %7 = OpVariable %_ptr_Uniform__UniformBuffer Uniform
51       %void = OpTypeVoid
52         %12 = OpTypeFunction %void
53    %float_0 = OpConstant %float 0
54    %v2float = OpTypeVector %float 2
55         %16 = OpConstantComposite %v2float %float_0 %float_0
56%_ptr_Function_v2float = OpTypePointer Function %v2float
57         %20 = OpTypeFunction %v4float %_ptr_Function_v2float
58        %int = OpTypeInt 32 1
59      %v4int = OpTypeVector %int 4
60%_ptr_Function_v4int = OpTypePointer Function %v4int
61%_ptr_Uniform_v4float = OpTypePointer Uniform %v4float
62      %int_0 = OpConstant %int 0
63  %float_100 = OpConstant %float 100
64      %int_1 = OpConstant %int 1
65     %int_50 = OpConstant %int 50
66     %int_75 = OpConstant %int 75
67    %int_225 = OpConstant %int 225
68         %60 = OpConstantComposite %v4int %int_50 %int_50 %int_75 %int_225
69    %int_100 = OpConstant %int 100
70         %63 = OpConstantComposite %v4int %int_0 %int_100 %int_75 %int_225
71       %bool = OpTypeBool
72      %false = OpConstantFalse %bool
73      %v2int = OpTypeVector %int 2
74         %74 = OpConstantComposite %v2int %int_50 %int_50
75     %v2bool = OpTypeVector %bool 2
76      %v3int = OpTypeVector %int 3
77         %85 = OpConstantComposite %v3int %int_50 %int_50 %int_50
78     %v3bool = OpTypeVector %bool 3
79         %94 = OpConstantComposite %v4int %int_50 %int_50 %int_50 %int_50
80     %v4bool = OpTypeVector %bool 4
81       %true = OpConstantTrue %bool
82        %111 = OpConstantComposite %v3int %int_50 %int_50 %int_75
83        %154 = OpConstantComposite %v2int %int_0 %int_100
84        %161 = OpConstantComposite %v3int %int_0 %int_100 %int_75
85%_ptr_Function_v4float = OpTypePointer Function %v4float
86      %int_2 = OpConstant %int 2
87%_entrypoint_v = OpFunction %void None %12
88         %13 = OpLabel
89         %17 = OpVariable %_ptr_Function_v2float Function
90               OpStore %17 %16
91         %19 = OpFunctionCall %v4float %main %17
92               OpStore %sk_FragColor %19
93               OpReturn
94               OpFunctionEnd
95       %main = OpFunction %v4float None %20
96         %21 = OpFunctionParameter %_ptr_Function_v2float
97         %22 = OpLabel
98  %intValues = OpVariable %_ptr_Function_v4int Function
99   %intGreen = OpVariable %_ptr_Function_v4int Function
100  %expectedA = OpVariable %_ptr_Function_v4int Function
101  %expectedB = OpVariable %_ptr_Function_v4int Function
102        %169 = OpVariable %_ptr_Function_v4float Function
103         %27 = OpAccessChain %_ptr_Uniform_v4float %7 %int_0
104         %30 = OpLoad %v4float %27
105         %32 = OpVectorTimesScalar %v4float %30 %float_100
106         %33 = OpCompositeExtract %float %32 0
107         %34 = OpConvertFToS %int %33
108         %35 = OpCompositeExtract %float %32 1
109         %36 = OpConvertFToS %int %35
110         %37 = OpCompositeExtract %float %32 2
111         %38 = OpConvertFToS %int %37
112         %39 = OpCompositeExtract %float %32 3
113         %40 = OpConvertFToS %int %39
114         %41 = OpCompositeConstruct %v4int %34 %36 %38 %40
115               OpStore %intValues %41
116         %43 = OpAccessChain %_ptr_Uniform_v4float %7 %int_1
117         %45 = OpLoad %v4float %43
118         %46 = OpVectorTimesScalar %v4float %45 %float_100
119         %47 = OpCompositeExtract %float %46 0
120         %48 = OpConvertFToS %int %47
121         %49 = OpCompositeExtract %float %46 1
122         %50 = OpConvertFToS %int %49
123         %51 = OpCompositeExtract %float %46 2
124         %52 = OpConvertFToS %int %51
125         %53 = OpCompositeExtract %float %46 3
126         %54 = OpConvertFToS %int %53
127         %55 = OpCompositeConstruct %v4int %48 %50 %52 %54
128               OpStore %intGreen %55
129               OpStore %expectedA %60
130               OpStore %expectedB %63
131         %67 = OpCompositeExtract %int %41 0
132         %66 = OpExtInst %int %1 SMax %67 %int_50
133         %68 = OpIEqual %bool %66 %int_50
134               OpSelectionMerge %70 None
135               OpBranchConditional %68 %69 %70
136         %69 = OpLabel
137         %72 = OpVectorShuffle %v2int %41 %41 0 1
138         %71 = OpExtInst %v2int %1 SMax %72 %74
139         %75 = OpVectorShuffle %v2int %60 %60 0 1
140         %76 = OpIEqual %v2bool %71 %75
141         %78 = OpAll %bool %76
142               OpBranch %70
143         %70 = OpLabel
144         %79 = OpPhi %bool %false %22 %78 %69
145               OpSelectionMerge %81 None
146               OpBranchConditional %79 %80 %81
147         %80 = OpLabel
148         %83 = OpVectorShuffle %v3int %41 %41 0 1 2
149         %82 = OpExtInst %v3int %1 SMax %83 %85
150         %86 = OpVectorShuffle %v3int %60 %60 0 1 2
151         %87 = OpIEqual %v3bool %82 %86
152         %89 = OpAll %bool %87
153               OpBranch %81
154         %81 = OpLabel
155         %90 = OpPhi %bool %false %70 %89 %80
156               OpSelectionMerge %92 None
157               OpBranchConditional %90 %91 %92
158         %91 = OpLabel
159         %93 = OpExtInst %v4int %1 SMax %41 %94
160         %95 = OpIEqual %v4bool %93 %60
161         %97 = OpAll %bool %95
162               OpBranch %92
163         %92 = OpLabel
164         %98 = OpPhi %bool %false %81 %97 %91
165               OpSelectionMerge %100 None
166               OpBranchConditional %98 %99 %100
167         %99 = OpLabel
168               OpBranch %100
169        %100 = OpLabel
170        %102 = OpPhi %bool %false %92 %true %99
171               OpSelectionMerge %104 None
172               OpBranchConditional %102 %103 %104
173        %103 = OpLabel
174        %105 = OpVectorShuffle %v2int %60 %60 0 1
175        %106 = OpIEqual %v2bool %74 %105
176        %107 = OpAll %bool %106
177               OpBranch %104
178        %104 = OpLabel
179        %108 = OpPhi %bool %false %100 %107 %103
180               OpSelectionMerge %110 None
181               OpBranchConditional %108 %109 %110
182        %109 = OpLabel
183        %112 = OpVectorShuffle %v3int %60 %60 0 1 2
184        %113 = OpIEqual %v3bool %111 %112
185        %114 = OpAll %bool %113
186               OpBranch %110
187        %110 = OpLabel
188        %115 = OpPhi %bool %false %104 %114 %109
189               OpSelectionMerge %117 None
190               OpBranchConditional %115 %116 %117
191        %116 = OpLabel
192               OpBranch %117
193        %117 = OpLabel
194        %118 = OpPhi %bool %false %110 %true %116
195               OpSelectionMerge %120 None
196               OpBranchConditional %118 %119 %120
197        %119 = OpLabel
198        %122 = OpCompositeExtract %int %55 0
199        %121 = OpExtInst %int %1 SMax %67 %122
200        %123 = OpIEqual %bool %121 %int_0
201               OpBranch %120
202        %120 = OpLabel
203        %124 = OpPhi %bool %false %117 %123 %119
204               OpSelectionMerge %126 None
205               OpBranchConditional %124 %125 %126
206        %125 = OpLabel
207        %128 = OpVectorShuffle %v2int %41 %41 0 1
208        %129 = OpVectorShuffle %v2int %55 %55 0 1
209        %127 = OpExtInst %v2int %1 SMax %128 %129
210        %130 = OpVectorShuffle %v2int %63 %63 0 1
211        %131 = OpIEqual %v2bool %127 %130
212        %132 = OpAll %bool %131
213               OpBranch %126
214        %126 = OpLabel
215        %133 = OpPhi %bool %false %120 %132 %125
216               OpSelectionMerge %135 None
217               OpBranchConditional %133 %134 %135
218        %134 = OpLabel
219        %137 = OpVectorShuffle %v3int %41 %41 0 1 2
220        %138 = OpVectorShuffle %v3int %55 %55 0 1 2
221        %136 = OpExtInst %v3int %1 SMax %137 %138
222        %139 = OpVectorShuffle %v3int %63 %63 0 1 2
223        %140 = OpIEqual %v3bool %136 %139
224        %141 = OpAll %bool %140
225               OpBranch %135
226        %135 = OpLabel
227        %142 = OpPhi %bool %false %126 %141 %134
228               OpSelectionMerge %144 None
229               OpBranchConditional %142 %143 %144
230        %143 = OpLabel
231        %145 = OpExtInst %v4int %1 SMax %41 %55
232        %146 = OpIEqual %v4bool %145 %63
233        %147 = OpAll %bool %146
234               OpBranch %144
235        %144 = OpLabel
236        %148 = OpPhi %bool %false %135 %147 %143
237               OpSelectionMerge %150 None
238               OpBranchConditional %148 %149 %150
239        %149 = OpLabel
240               OpBranch %150
241        %150 = OpLabel
242        %151 = OpPhi %bool %false %144 %true %149
243               OpSelectionMerge %153 None
244               OpBranchConditional %151 %152 %153
245        %152 = OpLabel
246        %155 = OpVectorShuffle %v2int %63 %63 0 1
247        %156 = OpIEqual %v2bool %154 %155
248        %157 = OpAll %bool %156
249               OpBranch %153
250        %153 = OpLabel
251        %158 = OpPhi %bool %false %150 %157 %152
252               OpSelectionMerge %160 None
253               OpBranchConditional %158 %159 %160
254        %159 = OpLabel
255        %162 = OpVectorShuffle %v3int %63 %63 0 1 2
256        %163 = OpIEqual %v3bool %161 %162
257        %164 = OpAll %bool %163
258               OpBranch %160
259        %160 = OpLabel
260        %165 = OpPhi %bool %false %153 %164 %159
261               OpSelectionMerge %167 None
262               OpBranchConditional %165 %166 %167
263        %166 = OpLabel
264               OpBranch %167
265        %167 = OpLabel
266        %168 = OpPhi %bool %false %160 %true %166
267               OpSelectionMerge %173 None
268               OpBranchConditional %168 %171 %172
269        %171 = OpLabel
270        %174 = OpAccessChain %_ptr_Uniform_v4float %7 %int_1
271        %175 = OpLoad %v4float %174
272               OpStore %169 %175
273               OpBranch %173
274        %172 = OpLabel
275        %176 = OpAccessChain %_ptr_Uniform_v4float %7 %int_2
276        %178 = OpLoad %v4float %176
277               OpStore %169 %178
278               OpBranch %173
279        %173 = OpLabel
280        %179 = OpLoad %v4float %169
281               OpReturnValue %179
282               OpFunctionEnd
283