xref: /aosp_15_r20/external/skia/tests/sksl/intrinsics/Length.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 "testMatrix2x2"
9               OpMemberName %_UniformBuffer 1 "colorGreen"
10               OpMemberName %_UniformBuffer 2 "colorRed"
11               OpName %_entrypoint_v "_entrypoint_v"
12               OpName %main "main"
13               OpName %inputVal "inputVal"
14               OpName %expected "expected"
15               OpDecorate %sk_FragColor RelaxedPrecision
16               OpDecorate %sk_FragColor Location 0
17               OpDecorate %sk_FragColor Index 0
18               OpMemberDecorate %_UniformBuffer 0 Offset 0
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 %103 RelaxedPrecision
27               OpDecorate %106 RelaxedPrecision
28               OpDecorate %107 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 %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%_ptr_Function_v4float = OpTypePointer Function %v4float
44%_ptr_Uniform_v4float = OpTypePointer Uniform %v4float
45        %int = OpTypeInt 32 1
46      %int_0 = OpConstant %int 0
47    %float_2 = OpConstant %float 2
48   %float_n2 = OpConstant %float -2
49    %float_1 = OpConstant %float 1
50    %float_8 = OpConstant %float 8
51         %34 = OpConstantComposite %v4float %float_2 %float_n2 %float_1 %float_8
52    %float_3 = OpConstant %float 3
53    %float_5 = OpConstant %float 5
54   %float_13 = OpConstant %float 13
55         %40 = OpConstantComposite %v4float %float_3 %float_3 %float_5 %float_13
56       %bool = OpTypeBool
57      %false = OpConstantFalse %bool
58%float_0_0500000007 = OpConstant %float 0.0500000007
59    %v3float = OpTypeVector %float 3
60      %int_1 = OpConstant %int 1
61      %int_2 = OpConstant %int 2
62%_entrypoint_v = OpFunction %void None %12
63         %13 = OpLabel
64         %17 = OpVariable %_ptr_Function_v2float Function
65               OpStore %17 %16
66         %19 = OpFunctionCall %v4float %main %17
67               OpStore %sk_FragColor %19
68               OpReturn
69               OpFunctionEnd
70       %main = OpFunction %v4float None %20
71         %21 = OpFunctionParameter %_ptr_Function_v2float
72         %22 = OpLabel
73   %inputVal = OpVariable %_ptr_Function_v4float Function
74   %expected = OpVariable %_ptr_Function_v4float Function
75         %97 = OpVariable %_ptr_Function_v4float Function
76         %25 = OpAccessChain %_ptr_Uniform_v4float %7 %int_0
77         %29 = OpLoad %v4float %25
78         %35 = OpFAdd %v4float %29 %34
79               OpStore %inputVal %35
80               OpStore %expected %40
81         %45 = OpCompositeExtract %float %35 0
82         %44 = OpExtInst %float %1 Length %45
83         %46 = OpFSub %float %44 %float_3
84         %43 = OpExtInst %float %1 FAbs %46
85         %48 = OpFOrdLessThan %bool %43 %float_0_0500000007
86               OpSelectionMerge %50 None
87               OpBranchConditional %48 %49 %50
88         %49 = OpLabel
89         %53 = OpVectorShuffle %v2float %35 %35 0 1
90         %52 = OpExtInst %float %1 Length %53
91         %54 = OpFSub %float %52 %float_3
92         %51 = OpExtInst %float %1 FAbs %54
93         %55 = OpFOrdLessThan %bool %51 %float_0_0500000007
94               OpBranch %50
95         %50 = OpLabel
96         %56 = OpPhi %bool %false %22 %55 %49
97               OpSelectionMerge %58 None
98               OpBranchConditional %56 %57 %58
99         %57 = OpLabel
100         %61 = OpVectorShuffle %v3float %35 %35 0 1 2
101         %60 = OpExtInst %float %1 Length %61
102         %63 = OpFSub %float %60 %float_5
103         %59 = OpExtInst %float %1 FAbs %63
104         %64 = OpFOrdLessThan %bool %59 %float_0_0500000007
105               OpBranch %58
106         %58 = OpLabel
107         %65 = OpPhi %bool %false %50 %64 %57
108               OpSelectionMerge %67 None
109               OpBranchConditional %65 %66 %67
110         %66 = OpLabel
111         %69 = OpExtInst %float %1 Length %35
112         %70 = OpFSub %float %69 %float_13
113         %68 = OpExtInst %float %1 FAbs %70
114         %71 = OpFOrdLessThan %bool %68 %float_0_0500000007
115               OpBranch %67
116         %67 = OpLabel
117         %72 = OpPhi %bool %false %58 %71 %66
118               OpSelectionMerge %74 None
119               OpBranchConditional %72 %73 %74
120         %73 = OpLabel
121         %76 = OpFSub %float %float_3 %float_3
122         %75 = OpExtInst %float %1 FAbs %76
123         %77 = OpFOrdLessThan %bool %75 %float_0_0500000007
124               OpBranch %74
125         %74 = OpLabel
126         %78 = OpPhi %bool %false %67 %77 %73
127               OpSelectionMerge %80 None
128               OpBranchConditional %78 %79 %80
129         %79 = OpLabel
130         %82 = OpFSub %float %float_3 %float_3
131         %81 = OpExtInst %float %1 FAbs %82
132         %83 = OpFOrdLessThan %bool %81 %float_0_0500000007
133               OpBranch %80
134         %80 = OpLabel
135         %84 = OpPhi %bool %false %74 %83 %79
136               OpSelectionMerge %86 None
137               OpBranchConditional %84 %85 %86
138         %85 = OpLabel
139         %88 = OpFSub %float %float_5 %float_5
140         %87 = OpExtInst %float %1 FAbs %88
141         %89 = OpFOrdLessThan %bool %87 %float_0_0500000007
142               OpBranch %86
143         %86 = OpLabel
144         %90 = OpPhi %bool %false %80 %89 %85
145               OpSelectionMerge %92 None
146               OpBranchConditional %90 %91 %92
147         %91 = OpLabel
148         %94 = OpFSub %float %float_13 %float_13
149         %93 = OpExtInst %float %1 FAbs %94
150         %95 = OpFOrdLessThan %bool %93 %float_0_0500000007
151               OpBranch %92
152         %92 = OpLabel
153         %96 = OpPhi %bool %false %86 %95 %91
154               OpSelectionMerge %100 None
155               OpBranchConditional %96 %98 %99
156         %98 = OpLabel
157        %101 = OpAccessChain %_ptr_Uniform_v4float %7 %int_1
158        %103 = OpLoad %v4float %101
159               OpStore %97 %103
160               OpBranch %100
161         %99 = OpLabel
162        %104 = OpAccessChain %_ptr_Uniform_v4float %7 %int_2
163        %106 = OpLoad %v4float %104
164               OpStore %97 %106
165               OpBranch %100
166        %100 = OpLabel
167        %107 = OpLoad %v4float %97
168               OpReturnValue %107
169               OpFunctionEnd
170