authorgravatar for jan.hafer@rwth-aachen.deJan Philipp Hafer <jan.hafer@rwth-aachen.de> 2023-02-11 15:16:44+01:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2023-02-19 14:00:55-05:00
log476bdc8b0b02cbd09f6a856aa7dc548dea565109
treed1fb06b8dbde71f379bcf9ac9aed53a06436dc9b
parentadfc019d6070cf322048bdb36d991354711c4636

compiler_rt: restructure compiler_rt.zig according to README.md

Justifications - compiler_rt base routines are almost finished, so make 1:1 mapping of code and documentation. - Make adjustments to code + documentation simpler to prevent technical or documentation debt.

2 files changed, 144 insertions(+), 134 deletions(-)

lib/compiler_rt.zig+143-133
......@@ -3,64 +3,35 @@ const builtin = @import("builtin");
33pub const panic = @import("compiler_rt/common.zig").panic;
44
55comptime {
6 _ = @import("compiler_rt/addf3.zig");
7 _ = @import("compiler_rt/addhf3.zig");
8 _ = @import("compiler_rt/addsf3.zig");
9 _ = @import("compiler_rt/adddf3.zig");
10 _ = @import("compiler_rt/addtf3.zig");
11 _ = @import("compiler_rt/addxf3.zig");
12
13 _ = @import("compiler_rt/subhf3.zig");
14 _ = @import("compiler_rt/subsf3.zig");
15 _ = @import("compiler_rt/subdf3.zig");
16 _ = @import("compiler_rt/subtf3.zig");
17 _ = @import("compiler_rt/subxf3.zig");
18
19 _ = @import("compiler_rt/mulf3.zig");
20 _ = @import("compiler_rt/mulhf3.zig");
21 _ = @import("compiler_rt/mulsf3.zig");
22 _ = @import("compiler_rt/muldf3.zig");
23 _ = @import("compiler_rt/multf3.zig");
24 _ = @import("compiler_rt/mulxf3.zig");
25
26 _ = @import("compiler_rt/powiXf2.zig");
27 _ = @import("compiler_rt/mulc3.zig");
28 _ = @import("compiler_rt/mulhc3.zig");
29 _ = @import("compiler_rt/mulsc3.zig");
30 _ = @import("compiler_rt/muldc3.zig");
31 _ = @import("compiler_rt/mulxc3.zig");
32 _ = @import("compiler_rt/multc3.zig");
6 // Integer routines
7 _ = @import("compiler_rt/count0bits.zig");
8 _ = @import("compiler_rt/parity.zig");
9 _ = @import("compiler_rt/popcount.zig");
10 _ = @import("compiler_rt/bswap.zig");
11 _ = @import("compiler_rt/cmp.zig");
3312
34 _ = @import("compiler_rt/divc3.zig");
35 _ = @import("compiler_rt/divhc3.zig");
36 _ = @import("compiler_rt/divsc3.zig");
37 _ = @import("compiler_rt/divdc3.zig");
38 _ = @import("compiler_rt/divxc3.zig");
39 _ = @import("compiler_rt/divtc3.zig");
13 _ = @import("compiler_rt/shift.zig");
14 _ = @import("compiler_rt/negXi2.zig");
15 _ = @import("compiler_rt/int.zig");
16 _ = @import("compiler_rt/muldi3.zig");
17 _ = @import("compiler_rt/multi3.zig");
18 _ = @import("compiler_rt/divti3.zig");
19 _ = @import("compiler_rt/udivti3.zig");
20 _ = @import("compiler_rt/modti3.zig");
21 _ = @import("compiler_rt/umodti3.zig");
4022
41 _ = @import("compiler_rt/neghf2.zig");
42 _ = @import("compiler_rt/negsf2.zig");
43 _ = @import("compiler_rt/negdf2.zig");
44 _ = @import("compiler_rt/negtf2.zig");
45 _ = @import("compiler_rt/negxf2.zig");
23 _ = @import("compiler_rt/absv.zig");
24 _ = @import("compiler_rt/absvsi2.zig");
25 _ = @import("compiler_rt/absvdi2.zig");
26 _ = @import("compiler_rt/absvti2.zig");
27 _ = @import("compiler_rt/negv.zig");
4628
47 _ = @import("compiler_rt/comparef.zig");
48 _ = @import("compiler_rt/cmphf2.zig");
49 _ = @import("compiler_rt/cmpsf2.zig");
50 _ = @import("compiler_rt/cmpdf2.zig");
51 _ = @import("compiler_rt/cmptf2.zig");
52 _ = @import("compiler_rt/cmpxf2.zig");
53 _ = @import("compiler_rt/gehf2.zig");
54 _ = @import("compiler_rt/gesf2.zig");
55 _ = @import("compiler_rt/gedf2.zig");
56 _ = @import("compiler_rt/gexf2.zig");
57 _ = @import("compiler_rt/getf2.zig");
58 _ = @import("compiler_rt/unordhf2.zig");
59 _ = @import("compiler_rt/unordsf2.zig");
60 _ = @import("compiler_rt/unorddf2.zig");
61 _ = @import("compiler_rt/unordxf2.zig");
62 _ = @import("compiler_rt/unordtf2.zig");
29 _ = @import("compiler_rt/addo.zig");
30 _ = @import("compiler_rt/subo.zig");
31 _ = @import("compiler_rt/mulo.zig");
6332
33 // Float routines
34 // conversion
6435 _ = @import("compiler_rt/extendf.zig");
6536 _ = @import("compiler_rt/extendhfsf2.zig");
6637 _ = @import("compiler_rt/extendhfdf2.zig");
......@@ -85,37 +56,37 @@ comptime {
8556 _ = @import("compiler_rt/trunctfdf2.zig");
8657 _ = @import("compiler_rt/trunctfxf2.zig");
8758
88 _ = @import("compiler_rt/divhf3.zig");
89 _ = @import("compiler_rt/divsf3.zig");
90 _ = @import("compiler_rt/divdf3.zig");
91 _ = @import("compiler_rt/divxf3.zig");
92 _ = @import("compiler_rt/divtf3.zig");
93 _ = @import("compiler_rt/sin.zig");
94 _ = @import("compiler_rt/cos.zig");
95 _ = @import("compiler_rt/sincos.zig");
96 _ = @import("compiler_rt/ceil.zig");
97 _ = @import("compiler_rt/exp.zig");
98 _ = @import("compiler_rt/exp2.zig");
99 _ = @import("compiler_rt/fabs.zig");
100 _ = @import("compiler_rt/floor.zig");
101 _ = @import("compiler_rt/fma.zig");
102 _ = @import("compiler_rt/fmax.zig");
103 _ = @import("compiler_rt/fmin.zig");
104 _ = @import("compiler_rt/fmod.zig");
105 _ = @import("compiler_rt/log.zig");
106 _ = @import("compiler_rt/log10.zig");
107 _ = @import("compiler_rt/log2.zig");
108 _ = @import("compiler_rt/round.zig");
109 _ = @import("compiler_rt/sqrt.zig");
110 _ = @import("compiler_rt/tan.zig");
111 _ = @import("compiler_rt/trunc.zig");
112 _ = @import("compiler_rt/divti3.zig");
113 _ = @import("compiler_rt/modti3.zig");
114 _ = @import("compiler_rt/multi3.zig");
115 _ = @import("compiler_rt/udivti3.zig");
116 _ = @import("compiler_rt/udivmodei4.zig");
117 _ = @import("compiler_rt/udivmodti4.zig");
118 _ = @import("compiler_rt/umodti3.zig");
59 _ = @import("compiler_rt/float_to_int.zig");
60 _ = @import("compiler_rt/fixhfsi.zig");
61 _ = @import("compiler_rt/fixhfdi.zig");
62 _ = @import("compiler_rt/fixhfti.zig");
63 _ = @import("compiler_rt/fixsfsi.zig");
64 _ = @import("compiler_rt/fixsfdi.zig");
65 _ = @import("compiler_rt/fixsfti.zig");
66 _ = @import("compiler_rt/fixdfsi.zig");
67 _ = @import("compiler_rt/fixdfdi.zig");
68 _ = @import("compiler_rt/fixdfti.zig");
69 _ = @import("compiler_rt/fixtfsi.zig");
70 _ = @import("compiler_rt/fixtfdi.zig");
71 _ = @import("compiler_rt/fixtfti.zig");
72 _ = @import("compiler_rt/fixxfsi.zig");
73 _ = @import("compiler_rt/fixxfdi.zig");
74 _ = @import("compiler_rt/fixxfti.zig");
75 _ = @import("compiler_rt/fixunshfsi.zig");
76 _ = @import("compiler_rt/fixunshfdi.zig");
77 _ = @import("compiler_rt/fixunshfti.zig");
78 _ = @import("compiler_rt/fixunssfsi.zig");
79 _ = @import("compiler_rt/fixunssfdi.zig");
80 _ = @import("compiler_rt/fixunssfti.zig");
81 _ = @import("compiler_rt/fixunsdfsi.zig");
82 _ = @import("compiler_rt/fixunsdfdi.zig");
83 _ = @import("compiler_rt/fixunsdfti.zig");
84 _ = @import("compiler_rt/fixunstfsi.zig");
85 _ = @import("compiler_rt/fixunstfdi.zig");
86 _ = @import("compiler_rt/fixunstfti.zig");
87 _ = @import("compiler_rt/fixunsxfsi.zig");
88 _ = @import("compiler_rt/fixunsxfdi.zig");
89 _ = @import("compiler_rt/fixunsxfti.zig");
11990
12091 _ = @import("compiler_rt/int_to_float.zig");
12192 _ = @import("compiler_rt/floatsihf.zig");
......@@ -149,60 +120,99 @@ comptime {
149120 _ = @import("compiler_rt/floatuntitf.zig");
150121 _ = @import("compiler_rt/floatuntixf.zig");
151122
152 _ = @import("compiler_rt/float_to_int.zig");
153 _ = @import("compiler_rt/fixhfsi.zig");
154 _ = @import("compiler_rt/fixhfdi.zig");
155 _ = @import("compiler_rt/fixhfti.zig");
156 _ = @import("compiler_rt/fixsfsi.zig");
157 _ = @import("compiler_rt/fixsfdi.zig");
158 _ = @import("compiler_rt/fixsfti.zig");
159 _ = @import("compiler_rt/fixdfsi.zig");
160 _ = @import("compiler_rt/fixdfdi.zig");
161 _ = @import("compiler_rt/fixdfti.zig");
162 _ = @import("compiler_rt/fixtfsi.zig");
163 _ = @import("compiler_rt/fixtfdi.zig");
164 _ = @import("compiler_rt/fixtfti.zig");
165 _ = @import("compiler_rt/fixxfsi.zig");
166 _ = @import("compiler_rt/fixxfdi.zig");
167 _ = @import("compiler_rt/fixxfti.zig");
168 _ = @import("compiler_rt/fixunshfsi.zig");
169 _ = @import("compiler_rt/fixunshfdi.zig");
170 _ = @import("compiler_rt/fixunshfti.zig");
171 _ = @import("compiler_rt/fixunssfsi.zig");
172 _ = @import("compiler_rt/fixunssfdi.zig");
173 _ = @import("compiler_rt/fixunssfti.zig");
174 _ = @import("compiler_rt/fixunsdfsi.zig");
175 _ = @import("compiler_rt/fixunsdfdi.zig");
176 _ = @import("compiler_rt/fixunsdfti.zig");
177 _ = @import("compiler_rt/fixunstfsi.zig");
178 _ = @import("compiler_rt/fixunstfdi.zig");
179 _ = @import("compiler_rt/fixunstfti.zig");
180 _ = @import("compiler_rt/fixunsxfsi.zig");
181 _ = @import("compiler_rt/fixunsxfdi.zig");
182 _ = @import("compiler_rt/fixunsxfti.zig");
123 // comparison
124 _ = @import("compiler_rt/comparef.zig");
125 _ = @import("compiler_rt/cmphf2.zig");
126 _ = @import("compiler_rt/cmpsf2.zig");
127 _ = @import("compiler_rt/cmpdf2.zig");
128 _ = @import("compiler_rt/cmptf2.zig");
129 _ = @import("compiler_rt/cmpxf2.zig");
130 _ = @import("compiler_rt/unordhf2.zig");
131 _ = @import("compiler_rt/unordsf2.zig");
132 _ = @import("compiler_rt/unorddf2.zig");
133 _ = @import("compiler_rt/unordxf2.zig");
134 _ = @import("compiler_rt/unordtf2.zig");
135 _ = @import("compiler_rt/gehf2.zig");
136 _ = @import("compiler_rt/gesf2.zig");
137 _ = @import("compiler_rt/gedf2.zig");
138 _ = @import("compiler_rt/gexf2.zig");
139 _ = @import("compiler_rt/getf2.zig");
183140
184 _ = @import("compiler_rt/count0bits.zig");
185 _ = @import("compiler_rt/parity.zig");
186 _ = @import("compiler_rt/popcount.zig");
187 _ = @import("compiler_rt/bswap.zig");
188 _ = @import("compiler_rt/int.zig");
189 _ = @import("compiler_rt/shift.zig");
141 // arithmetic
142 _ = @import("compiler_rt/addf3.zig");
143 _ = @import("compiler_rt/addhf3.zig");
144 _ = @import("compiler_rt/addsf3.zig");
145 _ = @import("compiler_rt/adddf3.zig");
146 _ = @import("compiler_rt/addtf3.zig");
147 _ = @import("compiler_rt/addxf3.zig");
190148
191 _ = @import("compiler_rt/negXi2.zig");
149 _ = @import("compiler_rt/subhf3.zig");
150 _ = @import("compiler_rt/subsf3.zig");
151 _ = @import("compiler_rt/subdf3.zig");
152 _ = @import("compiler_rt/subtf3.zig");
153 _ = @import("compiler_rt/subxf3.zig");
192154
193 _ = @import("compiler_rt/muldi3.zig");
155 _ = @import("compiler_rt/mulf3.zig");
156 _ = @import("compiler_rt/mulhf3.zig");
157 _ = @import("compiler_rt/mulsf3.zig");
158 _ = @import("compiler_rt/muldf3.zig");
159 _ = @import("compiler_rt/multf3.zig");
160 _ = @import("compiler_rt/mulxf3.zig");
194161
195 _ = @import("compiler_rt/absv.zig");
196 _ = @import("compiler_rt/absvsi2.zig");
197 _ = @import("compiler_rt/absvdi2.zig");
198 _ = @import("compiler_rt/absvti2.zig");
162 _ = @import("compiler_rt/divhf3.zig");
163 _ = @import("compiler_rt/divsf3.zig");
164 _ = @import("compiler_rt/divdf3.zig");
165 _ = @import("compiler_rt/divxf3.zig");
166 _ = @import("compiler_rt/divtf3.zig");
199167
200 _ = @import("compiler_rt/negv.zig");
201 _ = @import("compiler_rt/addo.zig");
202 _ = @import("compiler_rt/subo.zig");
203 _ = @import("compiler_rt/mulo.zig");
204 _ = @import("compiler_rt/cmp.zig");
168 _ = @import("compiler_rt/neghf2.zig");
169 _ = @import("compiler_rt/negsf2.zig");
170 _ = @import("compiler_rt/negdf2.zig");
171 _ = @import("compiler_rt/negtf2.zig");
172 _ = @import("compiler_rt/negxf2.zig");
173
174 // other
175 _ = @import("compiler_rt/powiXf2.zig");
176 _ = @import("compiler_rt/mulc3.zig");
177 _ = @import("compiler_rt/mulhc3.zig");
178 _ = @import("compiler_rt/mulsc3.zig");
179 _ = @import("compiler_rt/muldc3.zig");
180 _ = @import("compiler_rt/mulxc3.zig");
181 _ = @import("compiler_rt/multc3.zig");
182
183 _ = @import("compiler_rt/divc3.zig");
184 _ = @import("compiler_rt/divhc3.zig");
185 _ = @import("compiler_rt/divsc3.zig");
186 _ = @import("compiler_rt/divdc3.zig");
187 _ = @import("compiler_rt/divxc3.zig");
188 _ = @import("compiler_rt/divtc3.zig");
189
190 // Math routines. Alphabetically sorted.
191 _ = @import("compiler_rt/ceil.zig");
192 _ = @import("compiler_rt/cos.zig");
193 _ = @import("compiler_rt/exp.zig");
194 _ = @import("compiler_rt/exp2.zig");
195 _ = @import("compiler_rt/fabs.zig");
196 _ = @import("compiler_rt/floor.zig");
197 _ = @import("compiler_rt/fma.zig");
198 _ = @import("compiler_rt/fmax.zig");
199 _ = @import("compiler_rt/fmin.zig");
200 _ = @import("compiler_rt/fmod.zig");
201 _ = @import("compiler_rt/log.zig");
202 _ = @import("compiler_rt/log10.zig");
203 _ = @import("compiler_rt/log2.zig");
204 _ = @import("compiler_rt/round.zig");
205 _ = @import("compiler_rt/sin.zig");
206 _ = @import("compiler_rt/sincos.zig");
207 _ = @import("compiler_rt/sqrt.zig");
208 _ = @import("compiler_rt/tan.zig");
209 _ = @import("compiler_rt/trunc.zig");
210
211 // BigInt. Alphabetically sorted.
212 _ = @import("compiler_rt/udivmodei4.zig");
213 _ = @import("compiler_rt/udivmodti4.zig");
205214
215 // extra
206216 _ = @import("compiler_rt/os_version_check.zig");
207217 _ = @import("compiler_rt/emutls.zig");
208218 _ = @import("compiler_rt/arm.zig");
lib/compiler_rt/README.md+1-1
......@@ -331,7 +331,7 @@ Integer and Float Operations
331331| ✓ | __negdf2 | f64 | ∅ | f64 | .. |
332332| ✓ | __negtf2 | f128 | ∅ | f128 | .. |
333333| ✓ | __negxf2 | f80 | ∅ | f80 | .. |
334| | | | | | **Floating point raised to integer power** |
334| | | | | | **Other** |
335335| ✓ | __powihf2 | f16 | i32 | f16 | `a ^ b` |
336336| ✓ | __powisf2 | f32 | i32 | f32 | .. |
337337| ✓ | __powidf2 | f64 | i32 | f64 | .. |