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");...@@ -3,64 +3,35 @@ const builtin = @import("builtin");
3pub const panic = @import("compiler_rt/common.zig").panic;3pub const panic = @import("compiler_rt/common.zig").panic;
44
5comptime {5comptime {
6 _ = @import("compiler_rt/addf3.zig");6 // Integer routines
7 _ = @import("compiler_rt/addhf3.zig");7 _ = @import("compiler_rt/count0bits.zig");
8 _ = @import("compiler_rt/addsf3.zig");8 _ = @import("compiler_rt/parity.zig");
9 _ = @import("compiler_rt/adddf3.zig");9 _ = @import("compiler_rt/popcount.zig");
10 _ = @import("compiler_rt/addtf3.zig");10 _ = @import("compiler_rt/bswap.zig");
11 _ = @import("compiler_rt/addxf3.zig");11 _ = @import("compiler_rt/cmp.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");
3312
34 _ = @import("compiler_rt/divc3.zig");13 _ = @import("compiler_rt/shift.zig");
35 _ = @import("compiler_rt/divhc3.zig");14 _ = @import("compiler_rt/negXi2.zig");
36 _ = @import("compiler_rt/divsc3.zig");15 _ = @import("compiler_rt/int.zig");
37 _ = @import("compiler_rt/divdc3.zig");16 _ = @import("compiler_rt/muldi3.zig");
38 _ = @import("compiler_rt/divxc3.zig");17 _ = @import("compiler_rt/multi3.zig");
39 _ = @import("compiler_rt/divtc3.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");23 _ = @import("compiler_rt/absv.zig");
42 _ = @import("compiler_rt/negsf2.zig");24 _ = @import("compiler_rt/absvsi2.zig");
43 _ = @import("compiler_rt/negdf2.zig");25 _ = @import("compiler_rt/absvdi2.zig");
44 _ = @import("compiler_rt/negtf2.zig");26 _ = @import("compiler_rt/absvti2.zig");
45 _ = @import("compiler_rt/negxf2.zig");27 _ = @import("compiler_rt/negv.zig");
4628
47 _ = @import("compiler_rt/comparef.zig");29 _ = @import("compiler_rt/addo.zig");
48 _ = @import("compiler_rt/cmphf2.zig");30 _ = @import("compiler_rt/subo.zig");
49 _ = @import("compiler_rt/cmpsf2.zig");31 _ = @import("compiler_rt/mulo.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");
6332
33 // Float routines
34 // conversion
64 _ = @import("compiler_rt/extendf.zig");35 _ = @import("compiler_rt/extendf.zig");
65 _ = @import("compiler_rt/extendhfsf2.zig");36 _ = @import("compiler_rt/extendhfsf2.zig");
66 _ = @import("compiler_rt/extendhfdf2.zig");37 _ = @import("compiler_rt/extendhfdf2.zig");
...@@ -85,37 +56,37 @@ comptime {...@@ -85,37 +56,37 @@ comptime {
85 _ = @import("compiler_rt/trunctfdf2.zig");56 _ = @import("compiler_rt/trunctfdf2.zig");
86 _ = @import("compiler_rt/trunctfxf2.zig");57 _ = @import("compiler_rt/trunctfxf2.zig");
8758
88 _ = @import("compiler_rt/divhf3.zig");59 _ = @import("compiler_rt/float_to_int.zig");
89 _ = @import("compiler_rt/divsf3.zig");60 _ = @import("compiler_rt/fixhfsi.zig");
90 _ = @import("compiler_rt/divdf3.zig");61 _ = @import("compiler_rt/fixhfdi.zig");
91 _ = @import("compiler_rt/divxf3.zig");62 _ = @import("compiler_rt/fixhfti.zig");
92 _ = @import("compiler_rt/divtf3.zig");63 _ = @import("compiler_rt/fixsfsi.zig");
93 _ = @import("compiler_rt/sin.zig");64 _ = @import("compiler_rt/fixsfdi.zig");
94 _ = @import("compiler_rt/cos.zig");65 _ = @import("compiler_rt/fixsfti.zig");
95 _ = @import("compiler_rt/sincos.zig");66 _ = @import("compiler_rt/fixdfsi.zig");
96 _ = @import("compiler_rt/ceil.zig");67 _ = @import("compiler_rt/fixdfdi.zig");
97 _ = @import("compiler_rt/exp.zig");68 _ = @import("compiler_rt/fixdfti.zig");
98 _ = @import("compiler_rt/exp2.zig");69 _ = @import("compiler_rt/fixtfsi.zig");
99 _ = @import("compiler_rt/fabs.zig");70 _ = @import("compiler_rt/fixtfdi.zig");
100 _ = @import("compiler_rt/floor.zig");71 _ = @import("compiler_rt/fixtfti.zig");
101 _ = @import("compiler_rt/fma.zig");72 _ = @import("compiler_rt/fixxfsi.zig");
102 _ = @import("compiler_rt/fmax.zig");73 _ = @import("compiler_rt/fixxfdi.zig");
103 _ = @import("compiler_rt/fmin.zig");74 _ = @import("compiler_rt/fixxfti.zig");
104 _ = @import("compiler_rt/fmod.zig");75 _ = @import("compiler_rt/fixunshfsi.zig");
105 _ = @import("compiler_rt/log.zig");76 _ = @import("compiler_rt/fixunshfdi.zig");
106 _ = @import("compiler_rt/log10.zig");77 _ = @import("compiler_rt/fixunshfti.zig");
107 _ = @import("compiler_rt/log2.zig");78 _ = @import("compiler_rt/fixunssfsi.zig");
108 _ = @import("compiler_rt/round.zig");79 _ = @import("compiler_rt/fixunssfdi.zig");
109 _ = @import("compiler_rt/sqrt.zig");80 _ = @import("compiler_rt/fixunssfti.zig");
110 _ = @import("compiler_rt/tan.zig");81 _ = @import("compiler_rt/fixunsdfsi.zig");
111 _ = @import("compiler_rt/trunc.zig");82 _ = @import("compiler_rt/fixunsdfdi.zig");
112 _ = @import("compiler_rt/divti3.zig");83 _ = @import("compiler_rt/fixunsdfti.zig");
113 _ = @import("compiler_rt/modti3.zig");84 _ = @import("compiler_rt/fixunstfsi.zig");
114 _ = @import("compiler_rt/multi3.zig");85 _ = @import("compiler_rt/fixunstfdi.zig");
115 _ = @import("compiler_rt/udivti3.zig");86 _ = @import("compiler_rt/fixunstfti.zig");
116 _ = @import("compiler_rt/udivmodei4.zig");87 _ = @import("compiler_rt/fixunsxfsi.zig");
117 _ = @import("compiler_rt/udivmodti4.zig");88 _ = @import("compiler_rt/fixunsxfdi.zig");
118 _ = @import("compiler_rt/umodti3.zig");89 _ = @import("compiler_rt/fixunsxfti.zig");
11990
120 _ = @import("compiler_rt/int_to_float.zig");91 _ = @import("compiler_rt/int_to_float.zig");
121 _ = @import("compiler_rt/floatsihf.zig");92 _ = @import("compiler_rt/floatsihf.zig");
...@@ -149,60 +120,99 @@ comptime {...@@ -149,60 +120,99 @@ comptime {
149 _ = @import("compiler_rt/floatuntitf.zig");120 _ = @import("compiler_rt/floatuntitf.zig");
150 _ = @import("compiler_rt/floatuntixf.zig");121 _ = @import("compiler_rt/floatuntixf.zig");
151122
152 _ = @import("compiler_rt/float_to_int.zig");123 // comparison
153 _ = @import("compiler_rt/fixhfsi.zig");124 _ = @import("compiler_rt/comparef.zig");
154 _ = @import("compiler_rt/fixhfdi.zig");125 _ = @import("compiler_rt/cmphf2.zig");
155 _ = @import("compiler_rt/fixhfti.zig");126 _ = @import("compiler_rt/cmpsf2.zig");
156 _ = @import("compiler_rt/fixsfsi.zig");127 _ = @import("compiler_rt/cmpdf2.zig");
157 _ = @import("compiler_rt/fixsfdi.zig");128 _ = @import("compiler_rt/cmptf2.zig");
158 _ = @import("compiler_rt/fixsfti.zig");129 _ = @import("compiler_rt/cmpxf2.zig");
159 _ = @import("compiler_rt/fixdfsi.zig");130 _ = @import("compiler_rt/unordhf2.zig");
160 _ = @import("compiler_rt/fixdfdi.zig");131 _ = @import("compiler_rt/unordsf2.zig");
161 _ = @import("compiler_rt/fixdfti.zig");132 _ = @import("compiler_rt/unorddf2.zig");
162 _ = @import("compiler_rt/fixtfsi.zig");133 _ = @import("compiler_rt/unordxf2.zig");
163 _ = @import("compiler_rt/fixtfdi.zig");134 _ = @import("compiler_rt/unordtf2.zig");
164 _ = @import("compiler_rt/fixtfti.zig");135 _ = @import("compiler_rt/gehf2.zig");
165 _ = @import("compiler_rt/fixxfsi.zig");136 _ = @import("compiler_rt/gesf2.zig");
166 _ = @import("compiler_rt/fixxfdi.zig");137 _ = @import("compiler_rt/gedf2.zig");
167 _ = @import("compiler_rt/fixxfti.zig");138 _ = @import("compiler_rt/gexf2.zig");
168 _ = @import("compiler_rt/fixunshfsi.zig");139 _ = @import("compiler_rt/getf2.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");
183140
184 _ = @import("compiler_rt/count0bits.zig");141 // arithmetic
185 _ = @import("compiler_rt/parity.zig");142 _ = @import("compiler_rt/addf3.zig");
186 _ = @import("compiler_rt/popcount.zig");143 _ = @import("compiler_rt/addhf3.zig");
187 _ = @import("compiler_rt/bswap.zig");144 _ = @import("compiler_rt/addsf3.zig");
188 _ = @import("compiler_rt/int.zig");145 _ = @import("compiler_rt/adddf3.zig");
189 _ = @import("compiler_rt/shift.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");162 _ = @import("compiler_rt/divhf3.zig");
196 _ = @import("compiler_rt/absvsi2.zig");163 _ = @import("compiler_rt/divsf3.zig");
197 _ = @import("compiler_rt/absvdi2.zig");164 _ = @import("compiler_rt/divdf3.zig");
198 _ = @import("compiler_rt/absvti2.zig");165 _ = @import("compiler_rt/divxf3.zig");
166 _ = @import("compiler_rt/divtf3.zig");
199167
200 _ = @import("compiler_rt/negv.zig");168 _ = @import("compiler_rt/neghf2.zig");
201 _ = @import("compiler_rt/addo.zig");169 _ = @import("compiler_rt/negsf2.zig");
202 _ = @import("compiler_rt/subo.zig");170 _ = @import("compiler_rt/negdf2.zig");
203 _ = @import("compiler_rt/mulo.zig");171 _ = @import("compiler_rt/negtf2.zig");
204 _ = @import("compiler_rt/cmp.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
206 _ = @import("compiler_rt/os_version_check.zig");216 _ = @import("compiler_rt/os_version_check.zig");
207 _ = @import("compiler_rt/emutls.zig");217 _ = @import("compiler_rt/emutls.zig");
208 _ = @import("compiler_rt/arm.zig");218 _ = @import("compiler_rt/arm.zig");
lib/compiler_rt/README.md+1-1
...@@ -331,7 +331,7 @@ Integer and Float Operations...@@ -331,7 +331,7 @@ Integer and Float Operations
331| ✓ | __negdf2 | f64 | ∅ | f64 | .. |331| ✓ | __negdf2 | f64 | ∅ | f64 | .. |
332| ✓ | __negtf2 | f128 | ∅ | f128 | .. |332| ✓ | __negtf2 | f128 | ∅ | f128 | .. |
333| ✓ | __negxf2 | f80 | ∅ | f80 | .. |333| ✓ | __negxf2 | f80 | ∅ | f80 | .. |
334| | | | | | **Floating point raised to integer power** |334| | | | | | **Other** |
335| ✓ | __powihf2 | f16 | i32 | f16 | `a ^ b` |335| ✓ | __powihf2 | f16 | i32 | f16 | `a ^ b` |
336| ✓ | __powisf2 | f32 | i32 | f32 | .. |336| ✓ | __powisf2 | f32 | i32 | f32 | .. |
337| ✓ | __powidf2 | f64 | i32 | f64 | .. |337| ✓ | __powidf2 | f64 | i32 | f64 | .. |