xref: /aosp_15_r20/external/skia/tests/sksl/intrinsics/Modf.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 %value "value"
13               OpName %ok "ok"
14               OpName %whole "whole"
15               OpName %fraction "fraction"
16               OpDecorate %sk_FragColor RelaxedPrecision
17               OpDecorate %sk_FragColor Location 0
18               OpDecorate %sk_FragColor Index 0
19               OpMemberDecorate %_UniformBuffer 0 Offset 0
20               OpMemberDecorate %_UniformBuffer 0 RelaxedPrecision
21               OpMemberDecorate %_UniformBuffer 1 Offset 16
22               OpMemberDecorate %_UniformBuffer 1 RelaxedPrecision
23               OpDecorate %_UniformBuffer Block
24               OpDecorate %7 Binding 0
25               OpDecorate %7 DescriptorSet 0
26               OpDecorate %125 RelaxedPrecision
27               OpDecorate %132 RelaxedPrecision
28               OpDecorate %134 RelaxedPrecision
29               OpDecorate %135 RelaxedPrecision
30      %float = OpTypeFloat 32
31    %v4float = OpTypeVector %float 4
32%_ptr_Output_v4float = OpTypePointer Output %v4float
33%sk_FragColor = OpVariable %_ptr_Output_v4float Output
34%_UniformBuffer = OpTypeStruct %v4float %v4float
35%_ptr_Uniform__UniformBuffer = OpTypePointer Uniform %_UniformBuffer
36          %7 = OpVariable %_ptr_Uniform__UniformBuffer Uniform
37       %void = OpTypeVoid
38         %12 = OpTypeFunction %void
39    %float_0 = OpConstant %float 0
40    %v2float = OpTypeVector %float 2
41         %16 = OpConstantComposite %v2float %float_0 %float_0
42%_ptr_Function_v2float = OpTypePointer Function %v2float
43         %20 = OpTypeFunction %v4float %_ptr_Function_v2float
44%_ptr_Function_v4float = OpTypePointer Function %v4float
45  %float_2_5 = OpConstant %float 2.5
46 %float_n2_5 = OpConstant %float -2.5
47    %float_8 = OpConstant %float 8
48%float_n0_125 = OpConstant %float -0.125
49         %29 = OpConstantComposite %v4float %float_2_5 %float_n2_5 %float_8 %float_n0_125
50       %bool = OpTypeBool
51     %v4bool = OpTypeVector %bool 4
52%_ptr_Function_v4bool = OpTypePointer Function %v4bool
53      %false = OpConstantFalse %bool
54         %35 = OpConstantComposite %v4bool %false %false %false %false
55%_ptr_Function_float = OpTypePointer Function %float
56        %int = OpTypeInt 32 1
57      %int_0 = OpConstant %int 0
58    %float_2 = OpConstant %float 2
59  %float_0_5 = OpConstant %float 0.5
60%_ptr_Function_bool = OpTypePointer Function %bool
61   %float_n2 = OpConstant %float -2
62         %70 = OpConstantComposite %v2float %float_2 %float_n2
63     %v2bool = OpTypeVector %bool 2
64 %float_n0_5 = OpConstant %float -0.5
65         %78 = OpConstantComposite %v2float %float_0_5 %float_n0_5
66      %int_1 = OpConstant %int 1
67    %v3float = OpTypeVector %float 3
68%_ptr_Function_v3float = OpTypePointer Function %v3float
69         %96 = OpConstantComposite %v3float %float_2 %float_n2 %float_8
70     %v3bool = OpTypeVector %bool 3
71        %103 = OpConstantComposite %v3float %float_0_5 %float_n0_5 %float_0
72      %int_2 = OpConstant %int 2
73        %113 = OpConstantComposite %v4float %float_2 %float_n2 %float_8 %float_0
74        %118 = OpConstantComposite %v4float %float_0_5 %float_n0_5 %float_0 %float_n0_125
75      %int_3 = OpConstant %int 3
76%_ptr_Uniform_v4float = OpTypePointer Uniform %v4float
77%_entrypoint_v = OpFunction %void None %12
78         %13 = OpLabel
79         %17 = OpVariable %_ptr_Function_v2float Function
80               OpStore %17 %16
81         %19 = OpFunctionCall %v4float %main %17
82               OpStore %sk_FragColor %19
83               OpReturn
84               OpFunctionEnd
85       %main = OpFunction %v4float None %20
86         %21 = OpFunctionParameter %_ptr_Function_v2float
87         %22 = OpLabel
88      %value = OpVariable %_ptr_Function_v4float Function
89         %ok = OpVariable %_ptr_Function_v4bool Function
90      %whole = OpVariable %_ptr_Function_v4float Function
91   %fraction = OpVariable %_ptr_Function_v4float Function
92         %43 = OpVariable %_ptr_Function_float Function
93         %62 = OpVariable %_ptr_Function_v2float Function
94         %88 = OpVariable %_ptr_Function_v3float Function
95        %111 = OpVariable %_ptr_Function_v4float Function
96        %126 = OpVariable %_ptr_Function_v4float Function
97               OpStore %value %29
98               OpStore %ok %35
99         %39 = OpAccessChain %_ptr_Function_float %whole %int_0
100         %38 = OpExtInst %float %1 Modf %float_2_5 %43
101         %44 = OpLoad %float %43
102               OpStore %39 %44
103         %45 = OpAccessChain %_ptr_Function_float %fraction %int_0
104               OpStore %45 %38
105         %46 = OpLoad %v4float %whole
106         %47 = OpCompositeExtract %float %46 0
107         %49 = OpFOrdEqual %bool %47 %float_2
108               OpSelectionMerge %51 None
109               OpBranchConditional %49 %50 %51
110         %50 = OpLabel
111         %52 = OpLoad %v4float %fraction
112         %53 = OpCompositeExtract %float %52 0
113         %55 = OpFOrdEqual %bool %53 %float_0_5
114               OpBranch %51
115         %51 = OpLabel
116         %56 = OpPhi %bool %false %22 %55 %50
117         %57 = OpAccessChain %_ptr_Function_bool %ok %int_0
118               OpStore %57 %56
119         %60 = OpLoad %v4float %value
120         %61 = OpVectorShuffle %v2float %60 %60 0 1
121         %59 = OpExtInst %v2float %1 Modf %61 %62
122         %63 = OpLoad %v2float %62
123         %64 = OpLoad %v4float %whole
124         %65 = OpVectorShuffle %v4float %64 %63 4 5 2 3
125               OpStore %whole %65
126         %66 = OpLoad %v4float %fraction
127         %67 = OpVectorShuffle %v4float %66 %59 4 5 2 3
128               OpStore %fraction %67
129         %68 = OpVectorShuffle %v2float %65 %65 0 1
130         %71 = OpFOrdEqual %v2bool %68 %70
131         %73 = OpAll %bool %71
132               OpSelectionMerge %75 None
133               OpBranchConditional %73 %74 %75
134         %74 = OpLabel
135         %76 = OpVectorShuffle %v2float %67 %67 0 1
136         %79 = OpFOrdEqual %v2bool %76 %78
137         %80 = OpAll %bool %79
138               OpBranch %75
139         %75 = OpLabel
140         %81 = OpPhi %bool %false %51 %80 %74
141         %82 = OpAccessChain %_ptr_Function_bool %ok %int_1
142               OpStore %82 %81
143         %85 = OpLoad %v4float %value
144         %86 = OpVectorShuffle %v3float %85 %85 0 1 2
145         %84 = OpExtInst %v3float %1 Modf %86 %88
146         %90 = OpLoad %v3float %88
147         %91 = OpLoad %v4float %whole
148         %92 = OpVectorShuffle %v4float %91 %90 4 5 6 3
149               OpStore %whole %92
150         %93 = OpLoad %v4float %fraction
151         %94 = OpVectorShuffle %v4float %93 %84 4 5 6 3
152               OpStore %fraction %94
153         %95 = OpVectorShuffle %v3float %92 %92 0 1 2
154         %97 = OpFOrdEqual %v3bool %95 %96
155         %99 = OpAll %bool %97
156               OpSelectionMerge %101 None
157               OpBranchConditional %99 %100 %101
158        %100 = OpLabel
159        %102 = OpVectorShuffle %v3float %94 %94 0 1 2
160        %104 = OpFOrdEqual %v3bool %102 %103
161        %105 = OpAll %bool %104
162               OpBranch %101
163        %101 = OpLabel
164        %106 = OpPhi %bool %false %75 %105 %100
165        %107 = OpAccessChain %_ptr_Function_bool %ok %int_2
166               OpStore %107 %106
167        %110 = OpLoad %v4float %value
168        %109 = OpExtInst %v4float %1 Modf %110 %111
169        %112 = OpLoad %v4float %111
170               OpStore %whole %112
171               OpStore %fraction %109
172        %114 = OpFOrdEqual %v4bool %112 %113
173        %115 = OpAll %bool %114
174               OpSelectionMerge %117 None
175               OpBranchConditional %115 %116 %117
176        %116 = OpLabel
177        %119 = OpFOrdEqual %v4bool %109 %118
178        %120 = OpAll %bool %119
179               OpBranch %117
180        %117 = OpLabel
181        %121 = OpPhi %bool %false %101 %120 %116
182        %122 = OpAccessChain %_ptr_Function_bool %ok %int_3
183               OpStore %122 %121
184        %125 = OpLoad %v4bool %ok
185        %124 = OpAll %bool %125
186               OpSelectionMerge %129 None
187               OpBranchConditional %124 %127 %128
188        %127 = OpLabel
189        %130 = OpAccessChain %_ptr_Uniform_v4float %7 %int_0
190        %132 = OpLoad %v4float %130
191               OpStore %126 %132
192               OpBranch %129
193        %128 = OpLabel
194        %133 = OpAccessChain %_ptr_Uniform_v4float %7 %int_1
195        %134 = OpLoad %v4float %133
196               OpStore %126 %134
197               OpBranch %129
198        %129 = OpLabel
199        %135 = OpLoad %v4float %126
200               OpReturnValue %135
201               OpFunctionEnd
202