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