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