xref: /aosp_15_r20/external/skia/tests/sksl/shared/TernaryOneZeroOptimization.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 %ok "ok"
13               OpName %TRUE "TRUE"
14               OpDecorate %sk_FragColor RelaxedPrecision
15               OpDecorate %sk_FragColor Location 0
16               OpDecorate %sk_FragColor Index 0
17               OpMemberDecorate %_UniformBuffer 0 Offset 0
18               OpMemberDecorate %_UniformBuffer 0 RelaxedPrecision
19               OpMemberDecorate %_UniformBuffer 1 Offset 16
20               OpMemberDecorate %_UniformBuffer 1 RelaxedPrecision
21               OpDecorate %_UniformBuffer Block
22               OpDecorate %7 Binding 0
23               OpDecorate %7 DescriptorSet 0
24               OpDecorate %32 RelaxedPrecision
25               OpDecorate %33 RelaxedPrecision
26               OpDecorate %92 RelaxedPrecision
27               OpDecorate %94 RelaxedPrecision
28               OpDecorate %95 RelaxedPrecision
29      %float = OpTypeFloat 32
30    %v4float = OpTypeVector %float 4
31%_ptr_Output_v4float = OpTypePointer Output %v4float
32%sk_FragColor = OpVariable %_ptr_Output_v4float Output
33%_UniformBuffer = OpTypeStruct %v4float %v4float
34%_ptr_Uniform__UniformBuffer = OpTypePointer Uniform %_UniformBuffer
35          %7 = OpVariable %_ptr_Uniform__UniformBuffer Uniform
36       %void = OpTypeVoid
37         %12 = OpTypeFunction %void
38    %float_0 = OpConstant %float 0
39    %v2float = OpTypeVector %float 2
40         %16 = OpConstantComposite %v2float %float_0 %float_0
41%_ptr_Function_v2float = OpTypePointer Function %v2float
42         %20 = OpTypeFunction %v4float %_ptr_Function_v2float
43       %bool = OpTypeBool
44%_ptr_Function_bool = OpTypePointer Function %bool
45       %true = OpConstantTrue %bool
46%_ptr_Uniform_v4float = OpTypePointer Uniform %v4float
47        %int = OpTypeInt 32 1
48      %int_0 = OpConstant %int 0
49      %false = OpConstantFalse %bool
50      %int_1 = OpConstant %int 1
51    %float_1 = OpConstant %float 1
52     %v2bool = OpTypeVector %bool 2
53         %64 = OpConstantComposite %v2bool %true %true
54      %v2int = OpTypeVector %int 2
55         %72 = OpConstantComposite %v2int %int_1 %int_1
56         %80 = OpConstantComposite %v2float %float_1 %float_1
57%_ptr_Function_v4float = OpTypePointer Function %v4float
58%_entrypoint_v = OpFunction %void None %12
59         %13 = OpLabel
60         %17 = OpVariable %_ptr_Function_v2float Function
61               OpStore %17 %16
62         %19 = OpFunctionCall %v4float %main %17
63               OpStore %sk_FragColor %19
64               OpReturn
65               OpFunctionEnd
66       %main = OpFunction %v4float None %20
67         %21 = OpFunctionParameter %_ptr_Function_v2float
68         %22 = OpLabel
69         %ok = OpVariable %_ptr_Function_bool Function
70       %TRUE = OpVariable %_ptr_Function_bool Function
71         %86 = OpVariable %_ptr_Function_v4float Function
72               OpStore %ok %true
73         %28 = OpAccessChain %_ptr_Uniform_v4float %7 %int_0
74         %32 = OpLoad %v4float %28
75         %33 = OpCompositeExtract %float %32 1
76         %34 = OpFUnordNotEqual %bool %33 %float_0
77               OpStore %TRUE %34
78               OpSelectionMerge %37 None
79               OpBranchConditional %true %36 %37
80         %36 = OpLabel
81         %39 = OpSelect %int %34 %int_1 %int_0
82         %40 = OpIEqual %bool %int_1 %39
83               OpBranch %37
84         %37 = OpLabel
85         %41 = OpPhi %bool %false %22 %40 %36
86               OpStore %ok %41
87               OpSelectionMerge %43 None
88               OpBranchConditional %41 %42 %43
89         %42 = OpLabel
90         %45 = OpSelect %float %34 %float_1 %float_0
91         %46 = OpFOrdEqual %bool %float_1 %45
92               OpBranch %43
93         %43 = OpLabel
94         %47 = OpPhi %bool %false %37 %46 %42
95               OpStore %ok %47
96               OpSelectionMerge %49 None
97               OpBranchConditional %47 %48 %49
98         %48 = OpLabel
99               OpBranch %49
100         %49 = OpLabel
101         %50 = OpPhi %bool %false %43 %34 %48
102               OpStore %ok %50
103               OpSelectionMerge %52 None
104               OpBranchConditional %50 %51 %52
105         %51 = OpLabel
106         %53 = OpSelect %int %34 %int_1 %int_0
107         %54 = OpIEqual %bool %int_1 %53
108               OpBranch %52
109         %52 = OpLabel
110         %55 = OpPhi %bool %false %49 %54 %51
111               OpStore %ok %55
112               OpSelectionMerge %57 None
113               OpBranchConditional %55 %56 %57
114         %56 = OpLabel
115         %58 = OpSelect %float %34 %float_1 %float_0
116         %59 = OpFOrdEqual %bool %float_1 %58
117               OpBranch %57
118         %57 = OpLabel
119         %60 = OpPhi %bool %false %52 %59 %56
120               OpStore %ok %60
121               OpSelectionMerge %62 None
122               OpBranchConditional %60 %61 %62
123         %61 = OpLabel
124         %65 = OpCompositeConstruct %v2bool %34 %34
125         %66 = OpLogicalEqual %v2bool %64 %65
126         %67 = OpAll %bool %66
127               OpBranch %62
128         %62 = OpLabel
129         %68 = OpPhi %bool %false %57 %67 %61
130               OpStore %ok %68
131               OpSelectionMerge %70 None
132               OpBranchConditional %68 %69 %70
133         %69 = OpLabel
134         %73 = OpSelect %int %34 %int_1 %int_0
135         %74 = OpCompositeConstruct %v2int %73 %73
136         %75 = OpIEqual %v2bool %72 %74
137         %76 = OpAll %bool %75
138               OpBranch %70
139         %70 = OpLabel
140         %77 = OpPhi %bool %false %62 %76 %69
141               OpStore %ok %77
142               OpSelectionMerge %79 None
143               OpBranchConditional %77 %78 %79
144         %78 = OpLabel
145         %81 = OpSelect %float %34 %float_1 %float_0
146         %82 = OpCompositeConstruct %v2float %81 %81
147         %83 = OpFOrdEqual %v2bool %80 %82
148         %84 = OpAll %bool %83
149               OpBranch %79
150         %79 = OpLabel
151         %85 = OpPhi %bool %false %70 %84 %78
152               OpStore %ok %85
153               OpSelectionMerge %90 None
154               OpBranchConditional %85 %88 %89
155         %88 = OpLabel
156         %91 = OpAccessChain %_ptr_Uniform_v4float %7 %int_0
157         %92 = OpLoad %v4float %91
158               OpStore %86 %92
159               OpBranch %90
160         %89 = OpLabel
161         %93 = OpAccessChain %_ptr_Uniform_v4float %7 %int_1
162         %94 = OpLoad %v4float %93
163               OpStore %86 %94
164               OpBranch %90
165         %90 = OpLabel
166         %95 = OpLoad %v4float %86
167               OpReturnValue %95
168               OpFunctionEnd
169