authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2023-05-11 17:39:38-07:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2023-05-11 17:40:50-07:00
log8de2f77f3be72b7c89f4691ddd1e70196ebe5d6c
treef1cf34b4f287f6df1bd6a7a195bab15bed1fe142
parent3c2841c2020e2a0630b0a0b1b97f07c75c770368

remove the compiler-rt README file

What's the point of this file? It has way too much information and it attracts contribution churn. Somebody else should maintain this somewhere else.

1 files changed, 0 insertions(+), 804 deletions(-)

lib/compiler_rt/README.md deleted-804
......@@ -1,804 +0,0 @@
1If hardware lacks basic or specialized functionality, compiler-rt adds such functionality
2for basic arithmetic(s).
3One such example is 64-bit integer multiplication on 32-bit x86.
4
5Goals:
61. zig as linker for object files produced by other compilers
7 => `function compatibility` to compiler-rt and libgcc for same-named functions
8 * compatibility conflict between compiler-rt and libgcc: prefer compiler-rt
92. `symbol-level compatibility` low-priority compared to emitted calls by llvm
10 * symbol-level compatibility: libgcc even lower priority
113. add zig-specific language runtime features, see #7265
12 * example: arbitrary bit width integer arithmetic
13 * lower to call those functions for e.g. multiplying two i12345 numbers together
14 * proper naming + documention for standardizing (allow languages to follow our exmaple)
15
16Current status (tracking libgcc documentation):
17- Integer library routines => almost implemented
18- Soft float library routines => finished
19- Decimal float library routines => unimplemented (~120 functions)
20- Fixed-point fractional library routines => unimplemented (~300 functions)
21- Exception handling routines => unclear, if supported (~32+x undocumented functions)
22- Miscellaneous routines => unclear, if supported (cache control and stack function)
23- No zig-specific language runtime features in compiler-rt yet
24
25This library is automatically built as-needed for the compilation target and
26then statically linked and therefore is a transparent dependency for the
27programmer.
28For details see `../compiler_rt.zig`.
29
30Bugs should be solved by trying to duplicate the bug upstream, if possible.
31 * If the bug exists upstream, get it fixed upstream and port the fix downstream to Zig.
32 * If the bug only exists in Zig, use the corresponding C code and debug
33 both implementations side by side to figure out what is wrong.
34
35Routines with status are given below. Sources were besides
36"The Art of Computer Programming" by Donald E. Knuth, "HackersDelight" by Henry S. Warren,
37"Bit Twiddling Hacks" collected by Sean Eron Anderson, "Berkeley SoftFloat" by John R. Hauser,
38LLVM "compiler-rt" as it was MIT-licensed, "musl libc" and thoughts + work of contributors.
39
40The compiler-rt routines have not yet been audited.
41See https://github.com/ziglang/zig/issues/1504.
42
43From left to right the columns mean 1. if the routine is implemented (✗ or ✓),
442. the name, 3. input (`a`), 4. input (`b`), 5. return value,
456. an explanation of the functionality, .. to repeat the comment from the
46column a row above and/or additional return values.
47Some routines have more extensive comments supplemented with a reference text.
48
49Integer and Float Operations
50
51| Done | Name | a | b | Out | Comment |
52| ------ | ------------- | ---- | ---- | ---- | ------------------------------ |
53| | | | | | **Integer Bit Operations** |
54| ✓ | __clzsi2 | u32 | ∅ | i32 | count leading zeros |
55| ✓ | __clzdi2 | u64 | ∅ | i32 | count leading zeros |
56| ✓ | __clzti2 | u128 | ∅ | i32 | count leading zeros |
57| ✓ | __ctzsi2 | u32 | ∅ | i32 | count trailing zeros |
58| ✓ | __ctzdi2 | u64 | ∅ | i32 | count trailing zeros |
59| ✓ | __ctzti2 | u128 | ∅ | i32 | count trailing zeros |
60| ✓ | __ffssi2 | u32 | ∅ | i32 | find least significant 1 bit |
61| ✓ | __ffsdi2 | u64 | ∅ | i32 | find least significant 1 bit |
62| ✓ | __ffsti2 | u128 | ∅ | i32 | find least significant 1 bit |
63| ✓ | __paritysi2 | u32 | ∅ | i32 | bit parity |
64| ✓ | __paritydi2 | u64 | ∅ | i32 | bit parity |
65| ✓ | __parityti2 | u128 | ∅ | i32 | bit parity |
66| ✓ | __popcountsi2 | u32 | ∅ | i32 | bit population |
67| ✓ | __popcountdi2 | u64 | ∅ | i32 | bit population |
68| ✓ | __popcountti2 | u128 | ∅ | i32 | bit population |
69| ✓ | __bswapsi2 | u32 | ∅ | i32 | byte swap |
70| ✓ | __bswapdi2 | u64 | ∅ | i32 | byte swap |
71| ✓ | __bswapti2 | u128 | ∅ | i32 | byte swap |
72| | | | | | **Integer Comparison** |
73| ✓ | __cmpsi2 | i32 | i32 | i32 | `(a<b) -> 0, (a==b) -> 1, (a>b) -> 2` |
74| ✓ | __cmpdi2 | i64 | i64 | i32 | .. |
75| ✗ | __aeabi_lcmp | i64 | i64 | i32 | .. ARM |
76| ✓ | __cmpti2 | i128 | i128 | i32 | .. |
77| ✓ | __ucmpsi2 | u32 | u32 | i32 | `(a<b) -> 0, (a==b) -> 1, (a>b) -> 2` |
78| ✓ | __ucmpdi2 | u64 | u64 | i32 | .. |
79| ✗ | __aeabi_ulcmp | u64 | u64 | i32 | .. ARM |
80| ✓ | __ucmpti2 | u128 | u128 | i32 | .. |
81| | | | | | **Integer Arithmetic** |
82| ✓ | __ashlsi3 | i32 | i32 | i32 | `a << b` [^unused_rl78] |
83| ✓ | __ashldi3 | i64 | i32 | i64 | .. |
84| ✓ | __ashlti3 | i128 | i32 | i128 | .. |
85| ✓ | __aeabi_llsl | i32 | i32 | i32 | .. ARM |
86| ✓ | __ashrsi3 | i32 | i32 | i32 | `a >> b` arithmetic (sign fill) [^unused_rl78] |
87| ✓ | __ashrdi3 | i64 | i32 | i64 | .. |
88| ✓ | __ashrti3 | i128 | i32 | i128 | .. |
89| ✓ | __aeabi_lasr | i64 | i32 | i64 | .. ARM |
90| ✓ | __lshrsi3 | i32 | i32 | i32 | `a >> b` logical (zero fill) [^unused_rl78] |
91| ✓ | __lshrdi3 | i64 | i32 | i64 | .. |
92| ✓ | __lshrti3 | i128 | i32 | i128 | .. |
93| ✓ | __aeabi_llsr | i64 | i32 | i64 | .. ARM |
94| ✓ | __negsi2 | i32 | i32 | i32 | `-a` [^libgcc_compat] |
95| ✓ | __negdi2 | i64 | i64 | i64 | .. |
96| ✓ | __negti2 | i128 | i128 | i128 | .. |
97| ✓ | __mulsi3 | i32 | i32 | i32 | `a * b` |
98| ✓ | __muldi3 | i64 | i64 | i64 | .. |
99| ✓ | __aeabi_lmul | i64 | i64 | i64 | .. ARM |
100| ✓ | __multi3 | i128 | i128 | i128 | .. |
101| ✓ | __divsi3 | i32 | i32 | i32 | `a / b` |
102| ✓ | __divdi3 | i64 | i64 | i64 | .. |
103| ✓ | __divti3 | i128 | i128 | i128 | .. |
104| ✓ | __aeabi_idiv | i32 | i32 | i32 | .. ARM |
105| ✓ | __udivsi3 | u32 | u32 | u32 | `a / b` |
106| ✓ | __udivdi3 | u64 | u64 | u64 | .. |
107| ✓ | __udivti3 | u128 | u128 | u128 | .. |
108| ✓ | __aeabi_uidiv | i32 | i32 | i32 | .. ARM |
109| ✓ | __modsi3 | i32 | i32 | i32 | `a % b` |
110| ✓ | __moddi3 | i64 | i64 | i64 | .. |
111| ✓ | __modti3 | i128 | i128 | i128 | .. |
112| ✓ | __umodsi3 | u32 | u32 | u32 | `a % b` |
113| ✓ | __umoddi3 | u64 | u64 | u64 | .. |
114| ✓ | __umodti3 | u128 | u128 | u128 | .. |
115| ✓ | __udivmodsi4 | u32 | u32 | u32 | `a / b, rem.* = a % b` |
116| ✓ | __aeabi_uidivmod | u32 | u32 | u32 | .. ARM |
117| ✓ | __udivmoddi4 | u64 | u64 | u64 | .. |
118| ✓ | __aeabi_uldivmod | u64 | u64 | u64 | .. ARM |
119| ✓ | __udivmodti4 | u128 | u128 | u128 | .. |
120| ✓ | __divmodsi4 | i32 | i32 | i32 | `a / b, rem.* = a % b` |
121| ✓ | __aeabi_idivmod | i32 | i32 | i32 | .. ARM |
122| ✓ | __divmoddi4 | i64 | i64 | i64 | .. |
123| ✓ | __aeabi_ldivmod | i64 | i64 | i64 | .. ARM |
124| ✓ | __divmodti4 | i128 | i128 | i128 | .. [^libgcc_compat] |
125| | | | | | **Integer Arithmetic with Trapping Overflow**|
126| ✓ | __absvsi2 | i32 | i32 | i32 | abs(a) |
127| ✓ | __absvdi2 | i64 | i64 | i64 | .. |
128| ✓ | __absvti2 | i128 | i128 | i128 | .. |
129| ✓ | __negvsi2 | i32 | i32 | i32 | `-a` [^libgcc_compat] |
130| ✓ | __negvdi2 | i64 | i64 | i64 | .. |
131| ✓ | __negvti2 | i128 | i128 | i128 | .. |
132| ✗ | __addvsi3 | i32 | i32 | i32 | `a + b` |
133| ✗ | __addvdi3 | i64 | i64 | i64 | .. |
134| ✗ | __addvti3 | i128 | i128 | i128 | .. |
135| ✗ | __subvsi3 | i32 | i32 | i32 | `a - b` |
136| ✗ | __subvdi3 | i64 | i64 | i64 | .. |
137| ✗ | __subvti3 | i128 | i128 | i128 | .. |
138| ✗ | __mulvsi3 | i32 | i32 | i32 | `a * b` |
139| ✗ | __mulvdi3 | i64 | i64 | i64 | .. |
140| ✗ | __mulvti3 | i128 | i128 | i128 | .. |
141| | | | | | **Integer Arithmetic which Return on Overflow** [^noptr_faster] |
142| ✓ | __addosi4 | i32 | i32 | i32 | `a + b`, overflow->ov.*=1 else 0 [^perf_addition] |
143| ✓ | __addodi4 | i64 | i64 | i64 | .. |
144| ✓ | __addoti4 | i128 | i128 | i128 | .. |
145| ✓ | __subosi4 | i32 | i32 | i32 | `a - b`, overflow->ov.*=1 else 0 [^perf_addition] |
146| ✓ | __subodi4 | i64 | i64 | i64 | .. |
147| ✓ | __suboti4 | i128 | i128 | i128 | .. |
148| ✓ | __mulosi4 | i32 | i32 | i32 | `a * b`, overflow->ov.*=1 else 0 |
149| ✓ | __mulodi4 | i64 | i64 | i64 | .. |
150| ✓ | __muloti4 | i128 | i128 | i128 | .. |
151| | | | | | **Float Conversion** |
152| ✓ | __extendhfdf2 | f16 | ∅ | f32 | .. |
153| ✓ | __extendsfdf2 | f32 | ∅ | f64 | .. |
154| ✓ | __aeabi_f2d | f32 | ∅ | f64 | .. |
155| ✓ | __extendsftf2 | f32 | ∅ | f128 | .. |
156| ✓ | __extendsfxf2 | f32 | ∅ | f80 | .. |
157| ✓ | __extenddftf2 | f64 | ∅ | f128 | .. |
158| ✓ | __extenddfxf2 | f64 | ∅ | f80 | .. |
159| ✗ | __aeabi_h2f | f16 | ∅ | f32 | .. ARM |
160| ✗ | __aeabi_h2f_alt | f16 | ∅ | f32 | .. ARM alternate [^VFPv3alt] |
161| ✓ | __gnu_h2f_ieee | f16 | ∅ | f32 | .. GNU naming convention |
162| ✓ | __truncsfhf2 | f32 | ∅ | f16 | rounding towards zero |
163| ✓ | __truncdfhf2 | f64 | ∅ | f16 | .. |
164| ✓ | __truncdfsf2 | f64 | ∅ | f32 | .. |
165| ✓ | __trunctfhf2 | f128 | ∅ | f16 | .. |
166| ✓ | __trunctfsf2 | f128 | ∅ | f32 | .. |
167| ✓ | __trunctfdf2 | f128 | ∅ | f64 | .. |
168| ✓ | __trunctfxf2 | f128 | ∅ | f80 | .. |
169| ✓ | __truncxfhf2 | f80 | ∅ | f16 | .. |
170| ✓ | __truncxfsf2 | f80 | ∅ | f32 | .. |
171| ✓ | __truncxfdf2 | f80 | ∅ | f64 | .. |
172| ✗ | __aeabi_f2h | f32 | ∅ | f16 | .. ARM |
173| ✗ | __aeabi_f2h_alt | f32 | ∅ | f16 | .. ARM alternate [^VFPv3alt] |
174| ✓ | __gnu_f2h_ieee | f32 | ∅ | f16 | .. GNU naming convention |
175| ✓ | __aeabi_d2h | f64 | ∅ | f16 | .. ARM |
176| ✗ | __aeabi_d2h_alt | f64 | ∅ | f16 | .. ARM alternate [^VFPv3alt] |
177| ✓ | __aeabi_d2f | f64 | ∅ | f32 | .. ARM |
178| ✓ | __trunckfsf2 | f128 | ∅ | f32 | .. PPC |
179| ✓ | _Qp_qtos |*f128 | ∅ | f32 | .. SPARC |
180| ✓ | __trunckfdf2 | f128 | ∅ | f64 | .. PPC |
181| ✓ | _Qp_qtod |*f128 | ∅ | f64 | .. SPARC |
182| ✓ | __fixhfsi | f16 | ∅ | i32 | float to int, rounding towards zero |
183| ✓ | __fixsfsi | f32 | ∅ | i32 | .. |
184| ✓ | __aeabi_f2iz | f32 | ∅ | i32 | .. ARM |
185| ✓ | __fixdfsi | f64 | ∅ | i32 | .. |
186| ✓ | __aeabi_d2iz | f64 | ∅ | i32 | .. ARM |
187| ✓ | __fixtfsi | f128 | ∅ | i32 | .. |
188| ✓ | __fixxfsi | f80 | ∅ | i32 | .. |
189| ✓ | __fixhfdi | f16 | ∅ | i64 | .. |
190| ✓ | __fixsfdi | f32 | ∅ | i64 | .. |
191| ✓ | __aeabi_f2lz | f32 | ∅ | i64 | .. ARM |
192| ✓ | __fixdfdi | f64 | ∅ | i64 | .. |
193| ✓ | __aeabi_d2lz | f64 | ∅ | i64 | .. ARM |
194| ✓ | __fixtfdi | f128 | ∅ | i64 | .. |
195| ✓ | __fixxfdi | f80 | ∅ | i64 | .. |
196| ✓ | __fixhfti | f16 | ∅ | i128 | .. |
197| ✓ | __fixsfti | f32 | ∅ | i128 | .. |
198| ✓ | __fixdfti | f64 | ∅ | i128 | .. |
199| ✓ | __fixtfti | f128 | ∅ | i128 | .. |
200| ✓ | __fixxfti | f80 | ∅ | i128 | .. |
201| ✓ | __fixunshfsi | f16 | ∅ | u32 | float to uint, rounding towards zero. negative values become 0. |
202| ✓ | __fixunssfsi | f32 | ∅ | u32 | .. |
203| ✓ | __aeabi_f2uiz | f32 | ∅ | u32 | .. ARM |
204| ✓ | __fixunsdfsi | f64 | ∅ | u32 | .. |
205| ✓ | __aeabi_d2uiz | f64 | ∅ | u32 | .. ARM |
206| ✓ | __fixunstfsi | f128 | ∅ | u32 | .. |
207| ✓ | __fixunsxfsi | f80 | ∅ | u32 | .. |
208| ✓ | __fixunshfdi | f16 | ∅ | u64 | .. |
209| ✓ | __fixunssfdi | f32 | ∅ | u64 | .. |
210| ✓ | __aeabi_f2ulz | f32 | ∅ | u64 | .. ARM |
211| ✓ | __fixunsdfdi | f64 | ∅ | u64 | .. |
212| ✓ | __aeabi_d2ulz | f64 | ∅ | u64 | .. ARM |
213| ✓ | __fixunstfdi | f128 | ∅ | u64 | .. |
214| ✓ | __fixunsxfdi | f80 | ∅ | u64 | .. |
215| ✓ | __fixunshfti | f16 | ∅ | u128 | .. |
216| ✓ | __fixunssfti | f32 | ∅ | u128 | .. |
217| ✓ | __fixunsdfti | f64 | ∅ | u128 | .. |
218| ✓ | __fixunstfti | f128 | ∅ | u128 | .. |
219| ✓ | __fixunsxfti | f80 | ∅ | u128 | .. |
220| ✓ | __floatsihf | i32 | ∅ | f16 | int to float |
221| ✓ | __floatsisf | i32 | ∅ | f32 | .. |
222| ✓ | __aeabi_i2f | i32 | ∅ | f32 | .. ARM |
223| ✓ | __floatsidf | i32 | ∅ | f64 | .. |
224| ✓ | __aeabi_i2d | i32 | ∅ | f64 | .. ARM |
225| ✓ | __floatsitf | i32 | ∅ | f128 | .. |
226| ✓ | __floatsixf | i32 | ∅ | f80 | .. |
227| ✓ | __floatdisf | i64 | ∅ | f32 | .. |
228| ✓ | __aeabi_l2f | i64 | ∅ | f32 | .. ARM |
229| ✓ | __floatdidf | i64 | ∅ | f64 | .. |
230| ✓ | __aeabi_l2d | i64 | ∅ | f64 | .. ARM |
231| ✓ | __floatditf | i64 | ∅ | f128 | .. |
232| ✓ | __floatdixf | i64 | ∅ | f80 | .. |
233| ✓ | __floattihf | i128 | ∅ | f16 | .. |
234| ✓ | __floattisf | i128 | ∅ | f32 | .. |
235| ✓ | __floattidf | i128 | ∅ | f64 | .. |
236| ✓ | __floattitf | i128 | ∅ | f128 | .. |
237| ✓ | __floattixf | i128 | ∅ | f80 | .. |
238| ✓ | __floatunsihf | u32 | ∅ | f16 | uint to float |
239| ✓ | __floatunsisf | u32 | ∅ | f32 | .. |
240| ✓ | __aeabi_ui2f | u32 | ∅ | f32 | .. ARM |
241| ✓ | __floatunsidf | u32 | ∅ | f64 | .. |
242| ✓ | __aeabi_ui2d | u32 | ∅ | f64 | .. ARM |
243| ✓ | __floatunsitf | u32 | ∅ | f128 | .. |
244| ✓ | __floatunsixf | u32 | ∅ | f80 | .. |
245| ✓ | __floatundihf | u64 | ∅ | f16 | .. |
246| ✓ | __floatundisf | u64 | ∅ | f32 | .. |
247| ✓ | __aeabi_ul2f | u64 | ∅ | f32 | .. ARM |
248| ✓ | __floatundidf | u64 | ∅ | f64 | .. |
249| ✓ | __aeabi_ul2d | u64 | ∅ | f64 | .. ARM |
250| ✓ | __floatunditf | u64 | ∅ | f128 | .. |
251| ✓ | __floatundixf | u64 | ∅ | f80 | .. |
252| ✓ | __floatuntihf | u128 | ∅ | f16 | .. |
253| ✓ | __floatuntisf | u128 | ∅ | f32 | .. |
254| ✓ | __floatuntidf | u128 | ∅ | f64 | .. |
255| ✓ | __floatuntitf | u128 | ∅ | f128 | .. |
256| ✓ | __floatuntixf | u128 | ∅ | f80 | .. |
257| | | | | | **Float Comparison** |
258| ✓ | __cmphf2 | f16 | f16 | i32 | `(a<b)->-1, (a==b)->0, (a>b)->1, Nan->1` |
259| ✓ | __cmpsf2 | f32 | f32 | i32 | exported from __lesf2, __ledf2, __letf2 (below) |
260| ✓ | __cmpdf2 | f64 | f64 | i32 | But: if NaN is a possibility, use another routine. |
261| ✓ | __cmptf2 | f128 | f128 | i32 | .. |
262| ✓ | __cmpxf2 | f80 | f80 | i32 | .. |
263| ✓ | _Qp_cmp |*f128 |*f128 | i32 | .. SPARC |
264| ✓ | __unordhf2 | f16 | f16 | i32 | `(a==+-NaN or b==+-NaN) -> !=0, else -> 0` |
265| ✓ | __unordsf2 | f32 | f32 | i32 | .. |
266| ✓ | __unorddf2 | f64 | f64 | i32 | Note: only reliable for (input!=NaN) |
267| ✓ | __unordtf2 | f128 | f128 | i32 | .. |
268| ✓ | __unordxf2 | f80 | f80 | i32 | .. |
269| ✓ | __aeabi_fcmpun | f32 | f32 | i32 | .. ARM |
270| ✓ | __aeabi_dcmpun | f32 | f32 | i32 | .. ARM |
271| ✓ | __unordkf2 | f128 | f128 | i32 | .. PPC |
272| ✓ | __eqhf2 | f16 | f16 | i32 | `(a!=NaN) and (b!=Nan) and (a==b) -> output=0` |
273| ✓ | __eqsf2 | f32 | f32 | i32 | .. |
274| ✓ | __eqdf2 | f64 | f64 | i32 | .. |
275| ✓ | __eqtf2 | f128 | f128 | i32 | .. |
276| ✓ | __eqxf2 | f80 | f80 | i32 | .. |
277| ✓ | __aeabi_fcmpeq | f32 | f32 | i32 | .. ARM |
278| ✓ | __aeabi_dcmpeq | f32 | f32 | i32 | .. ARM |
279| ✓ | __eqkf2 | f128 | f128 | i32 | .. PPC |
280| ✓ | _Qp_feq |*f128 |*f128 | bool | .. SPARC |
281| ✓ | __nehf2 | f16 | f16 | i32 | `(a==NaN) or (b==Nan) or (a!=b) -> output!=0` |
282| ✓ | __nesf2 | f32 | f32 | i32 | Note: __eqXf2 and __neXf2 have same return value |
283| ✓ | __nedf2 | f64 | f64 | i32 | .. |
284| ✓ | __netf2 | f128 | f128 | i32 | .. |
285| ✓ | __nexf2 | f80 | f80 | i32 | .. |
286| ✓ | __nekf2 | f128 | f128 | i32 | .. PPC |
287| ✓ | _Qp_fne |*f128 |*f128 | bool | .. SPARC |
288| ✓ | __gehf2 | f16 | f16 | i32 | `(a!=Nan) and (b!=Nan) and (a>=b) -> output>=0` |
289| ✓ | __gesf2 | f32 | f32 | i32 | .. |
290| ✓ | __gedf2 | f64 | f64 | i32 | .. |
291| ✓ | __getf2 | f128 | f128 | i32 | .. |
292| ✓ | __gexf2 | f80 | f80 | i32 | .. |
293| ✓ | __aeabi_fcmpge | f32 | f32 | i32 | .. ARM |
294| ✓ | __aeabi_dcmpge | f64 | f64 | i32 | .. ARM |
295| ✓ | __gekf2 | f128 | f128 | i32 | .. PPC |
296| ✓ | _Qp_fge |*f128 |*f128 | bool | .. SPARC |
297| ✓ | __lthf2 | f16 | f16 | i32 | `(a!=Nan) and (b!=Nan) and (a<b) -> output<0` |
298| ✓ | __ltsf2 | f32 | f32 | i32 | .. |
299| ✓ | __ltdf2 | f64 | f64 | i32 | .. |
300| ✓ | __lttf2 | f128 | f128 | i32 | .. |
301| ✓ | __ltxf2 | f80 | f80 | i32 | .. |
302| ✓ | __ltkf2 | f128 | f128 | i32 | .. PPC |
303| ✓ | __aeabi_fcmplt | f32 | f32 | i32 | .. ARM |
304| ✓ | __aeabi_dcmplt | f32 | f32 | i32 | .. ARM |
305| ✓ | _Qp_flt |*f128 |*f128 | bool | .. SPARC |
306| ✓ | __lehf2 | f16 | f16 | i32 | `(a!=Nan) and (b!=Nan) and (a<=b) -> output<=0` |
307| ✓ | __lesf2 | f32 | f32 | i32 | .. |
308| ✓ | __ledf2 | f64 | f64 | i32 | .. |
309| ✓ | __letf2 | f128 | f128 | i32 | .. |
310| ✓ | __lexf2 | f80 | f80 | i32 | .. |
311| ✓ | __aeabi_fcmple | f32 | f32 | i32 | .. ARM |
312| ✓ | __aeabi_dcmple | f32 | f32 | i32 | .. ARM |
313| ✓ | __lekf2 | f128 | f128 | i32 | .. PPC |
314| ✓ | _Qp_fle |*f128 |*f128 | bool | .. SPARC |
315| ✓ | __gthf2 | f16 | f16 | i32 | `(a!=Nan) and (b!=Nan) and (a>b) -> output>0` |
316| ✓ | __gtsf2 | f32 | f32 | i32 | .. |
317| ✓ | __gtdf2 | f64 | f64 | i32 | .. |
318| ✓ | __gttf2 | f128 | f128 | i32 | .. |
319| ✓ | __gtxf2 | f80 | f80 | i32 | .. |
320| ✓ | __aeabi_fcmpgt | f32 | f32 | i32 | .. ARM |
321| ✓ | __aeabi_dcmpgt | f64 | f64 | i32 | .. ARM |
322| ✓ | __gtkf2 | f128 | f128 | i32 | .. PPC |
323| ✓ | _Qp_fgt |*f128 |*f128 | bool | .. SPARC |
324| | | | | | **Float Arithmetic** |
325| ✓ | __addhf3 | f32 | f32 | f32 | `a + b` |
326| ✓ | __addsf3 | f32 | f32 | f32 | .. |
327| ✓ | __adddf3 | f64 | f64 | f64 | .. |
328| ✓ | __addtf3 | f128 | f128 | f128 | .. |
329| ✓ | __addxf3 | f80 | f80 | f80 | .. |
330| ✓ | __aeabi_fadd | f32 | f32 | f32 | .. ARM |
331| ✓ | __aeabi_dadd | f64 | f64 | f64 | .. ARM |
332| ✓ | __addkf3 | f128 | f128 | f128 | .. PPC |
333| ✓ | _Qp_add |*f128 |*f128 | void | .. SPARC args *c,*a,*b c=a+b |
334| ✓ | __subhf3 | f32 | f32 | f32 | `a - b` |
335| ✓ | __subsf3 | f32 | f32 | f32 | .. |
336| ✓ | __subdf3 | f64 | f64 | f64 | .. |
337| ✓ | __subtf3 | f128 | f128 | f128 | .. |
338| ✓ | __subxf3 | f80 | f80 | f80 | .. |
339| ✓ | __aeabi_fsub | f32 | f32 | f32 | .. ARM |
340| ✓ | __aeabi_dsub | f64 | f64 | f64 | .. ARM |
341| ✓ | __subkf3 | f128 | f128 | f128 | .. PPC |
342| ✓ | _Qp_sub |*f128 |*f128 | void | .. SPARC args *c,*a,*b c=a-b |
343| ✓ | __mulhf3 | f32 | f32 | f32 | `a * b` |
344| ✓ | __mulsf3 | f32 | f32 | f32 | .. |
345| ✓ | __muldf3 | f64 | f64 | f64 | .. |
346| ✓ | __multf3 | f128 | f128 | f128 | .. |
347| ✓ | __mulxf3 | f80 | f80 | f80 | .. |
348| ✓ | __aeabi_fmul | f32 | f32 | f32 | .. ARM |
349| ✓ | __aeabi_dmul | f64 | f64 | f64 | .. ARM |
350| ✓ | __mulkf3 | f128 | f128 | f128 | .. PPC |
351| ✓ | _Qp_mul |*f128 |*f128 | void | .. SPARC args *c,*a,*b c=a*b |
352| ✓ | __divsf3 | f32 | f32 | f32 | `a / b` |
353| ✓ | __divdf3 | f64 | f64 | f64 | .. |
354| ✓ | __divtf3 | f128 | f128 | f128 | .. |
355| ✓ | __divxf3 | f80 | f80 | f80 | .. |
356| ✓ | __aeabi_fdiv | f32 | f32 | f32 | .. ARM |
357| ✓ | __aeabi_ddiv | f64 | f64 | f64 | .. ARM |
358| ✓ | __divkf3 | f128 | f128 | f128 | .. PPC |
359| ✓ | _Qp_div |*f128 |*f128 | void | .. SPARC args *c,*a,*b c=a*b |
360| ✓ | __negsf2 | f32 | ∅ | f32[^unused_rl78] | -a (can be lowered directly to a xor) |
361| ✓ | __negdf2 | f64 | ∅ | f64 | .. |
362| ✓ | __negtf2 | f128 | ∅ | f128 | .. |
363| ✓ | __negxf2 | f80 | ∅ | f80 | .. |
364| | | | | | **Other** |
365| ✓ | __powihf2 | f16 | i32 | f16 | `a ^ b` |
366| ✓ | __powisf2 | f32 | i32 | f32 | .. |
367| ✓ | __powidf2 | f64 | i32 | f64 | .. |
368| ✓ | __powitf2 | f128 | i32 | f128 | .. |
369| ✓ | __powixf2 | f80 | i32 | f80 | .. |
370| ✓ | __mulhc3 | all4 | f16 | f16 | `(a+ib) * (c+id)` |
371| ✓ | __mulsc3 | all4 | f32 | f32 | .. |
372| ✓ | __muldc3 | all4 | f64 | f64 | .. |
373| ✓ | __multc3 | all4 | f128 | f128 | .. |
374| ✓ | __mulxc3 | all4 | f80 | f80 | .. |
375| ✓ | __divhc3 | all4 | f16 | f16 | `(a+ib) / (c+id)` |
376| ✓ | __divsc3 | all4 | f32 | f32 | .. |
377| ✓ | __divdc3 | all4 | f64 | f64 | .. |
378| ✓ | __divtc3 | all4 | f128 | f128 | .. |
379| ✓ | __divxc3 | all4 | f80 | f80 | .. |
380
381[^unused_rl78]: Unused in LLVM, but used for example by rl78.
382[^libgcc_compat]: Unused in backends and for symbol-level compatibility with libgcc.
383[^noptr_faster]: Operations without pointer and without C struct semantics lead to better optimizations.
384[^perf_addition]: Has better performance than standard method due to 2s complement semantics.
385Not provided by LLVM and libgcc.
386[^VFPv3alt]: Converts IEEE-format to VFPv3 alternative-format.
387
388Decimal float library routines
389
390BID means Binary Integer Decimal encoding, DPD means Densely Packed Decimal encoding.
391BID should be only chosen for binary data, DPD for decimal data (ASCII, Unicode etc).
392For example the number 0.2 is not accurately representable in binary data.
393
394| Done | Name | a | b | Out | Comment |
395| ------ | ------------- | --------- | --------- | --------- | ---------------------------- |
396| | | | | | **Decimal Float Conversion** |
397| ✗ | __dpd_extendsddd2 | dec32 | ∅ | dec64 | conversion |
398| ✗ | __bid_extendsddd2 | dec32 | ∅ | dec64 | .. |
399| ✗ | __dpd_extendsdtd2 | dec32 | ∅ | dec128| .. |
400| ✗ | __bid_extendsdtd2 | dec32 | ∅ | dec128| .. |
401| ✗ | __dpd_extendddtd2 | dec64 | ∅ | dec128| .. |
402| ✗ | __bid_extendddtd2 | dec64 | ∅ | dec128| .. |
403| ✗ | __dpd_truncddsd2 | dec64 | ∅ | dec32 | .. |
404| ✗ | __bid_truncddsd2 | dec64 | ∅ | dec32 | .. |
405| ✗ | __dpd_trunctdsd2 | dec128 | ∅ | dec32 | .. |
406| ✗ | __bid_trunctdsd2 | dec128 | ∅ | dec32 | .. |
407| ✗ | __dpd_trunctddd2 | dec128 | ∅ | dec64 | .. |
408| ✗ | __bid_trunctddd2 | dec128 | ∅ | dec64 | .. |
409| ✗ | __dpd_extendsfdd | float | ∅ | dec64 | .. |
410| ✗ | __bid_extendsfdd | float | ∅ | dec64 | .. |
411| ✗ | __dpd_extendsftd | float | ∅ | dec128| .. |
412| ✗ | __bid_extendsftd | float | ∅ | dec128| .. |
413| ✗ | __dpd_extenddftd | double | ∅ | dec128| .. |
414| ✗ | __bid_extenddftd | double | ∅ | dec128| .. |
415| ✗ | __dpd_extendxftd |long double | ∅ | dec128| .. |
416| ✗ | __bid_extendxftd |long double | ∅ | dec128| .. |
417| ✗ | __dpd_truncdfsd | double | ∅ | dec32 | .. |
418| ✗ | __bid_truncdfsd | double | ∅ | dec32 | .. |
419| ✗ | __dpd_truncxfsd |long double | ∅ | dec32 | .. |
420| ✗ | __bid_truncxfsd |long double | ∅ | dec32 | .. |
421| ✗ | __dpd_trunctfsd |long double | ∅ | dec32 | .. |
422| ✗ | __bid_trunctfsd |long double | ∅ | dec32 | .. |
423| ✗ | __dpd_truncxfdd |long double | ∅ | dec64 | .. |
424| ✗ | __bid_truncxfdd |long double | ∅ | dec64 | .. |
425| ✗ | __dpd_trunctfdd |long double | ∅ | dec64 | .. |
426| ✗ | __bid_trunctfdd |long double | ∅ | dec64 | .. |
427| ✗ | __dpd_truncddsf | dec64 | ∅ | float | .. |
428| ✗ | __bid_truncddsf | dec64 | ∅ | float | .. |
429| ✗ | __dpd_trunctdsf | dec128 | ∅ | float | .. |
430| ✗ | __bid_trunctdsf | dec128 | ∅ | float | .. |
431| ✗ | __dpd_extendsddf | dec32 | ∅ | double| .. |
432| ✗ | __bid_extendsddf | dec32 | ∅ | double| .. |
433| ✗ | __dpd_trunctddf | dec128 | ∅ | double| .. |
434| ✗ | __bid_trunctddf | dec128 | ∅ | double| .. |
435| ✗ | __dpd_extendsdxf | dec32 | ∅ |long double| .. |
436| ✗ | __bid_extendsdxf | dec32 | ∅ |long double| .. |
437| ✗ | __dpd_extendddxf | dec64 | ∅ |long double| .. |
438| ✗ | __bid_extendddxf | dec64 | ∅ |long double| .. |
439| ✗ | __dpd_trunctdxf | dec128 | ∅ |long double| .. |
440| ✗ | __bid_trunctdxf | dec128 | ∅ |long double| .. |
441| ✗ | __dpd_extendsdtf | dec32 | ∅ |long double| .. |
442| ✗ | __bid_extendsdtf | dec32 | ∅ |long double| .. |
443| ✗ | __dpd_extendddtf | dec64 | ∅ |long double| .. |
444| ✗ | __bid_extendddtf | dec64 | ∅ |long double| .. |
445| ✗ | __dpd_extendsfsd | float | ∅ | dec32 | same size conversions |
446| ✗ | __bid_extendsfsd | float | ∅ | dec32 | .. |
447| ✗ | __dpd_extenddfdd | double | ∅ | dec64 | .. |
448| ✗ | __bid_extenddfdd | double | ∅ | dec64 | .. |
449| ✗ | __dpd_extendtftd |long double | ∅ | dec128| .. |
450| ✗ | __bid_extendtftd |long double | ∅ | dec128| .. |
451| ✗ | __dpd_truncsdsf | dec32 | ∅ | float | .. |
452| ✗ | __bid_truncsdsf | dec32 | ∅ | float | .. |
453| ✗ | __dpd_truncdddf | dec64 | ∅ | float | conversion |
454| ✗ | __bid_truncdddf | dec64 | ∅ | float | .. |
455| ✗ | __dpd_trunctdtf | dec128 | ∅ |long double| .. |
456| ✗ | __bid_trunctdtf | dec128 | ∅ |long double| .. |
457| ✗ | __dpd_fixsdsi | dec32 | ∅ | int | .. |
458| ✗ | __bid_fixsdsi | dec32 | ∅ | int | .. |
459| ✗ | __dpd_fixddsi | dec64 | ∅ | int | .. |
460| ✗ | __bid_fixddsi | dec64 | ∅ | int | .. |
461| ✗ | __dpd_fixtdsi | dec128 | ∅ | int | .. |
462| ✗ | __bid_fixtdsi | dec128 | ∅ | int | .. |
463| ✗ | __dpd_fixsddi | dec32 | ∅ | long | .. |
464| ✗ | __bid_fixsddi | dec32 | ∅ | long | .. |
465| ✗ | __dpd_fixdddi | dec64 | ∅ | long | .. |
466| ✗ | __bid_fixdddi | dec64 | ∅ | long | .. |
467| ✗ | __dpd_fixtddi | dec128 | ∅ | long | .. |
468| ✗ | __bid_fixtddi | dec128 | ∅ | long | .. |
469| ✗ | __dpd_fixunssdsi | dec32 | ∅ |unsigned int | .. All negative values become zero. |
470| ✗ | __bid_fixunssdsi | dec32 | ∅ |unsigned int | .. |
471| ✗ | __dpd_fixunsddsi | dec64 | ∅ |unsigned int | .. |
472| ✗ | __bid_fixunsddsi | dec64 | ∅ |unsigned int | .. |
473| ✗ | __dpd_fixunstdsi | dec128 | ∅ |unsigned int | .. |
474| ✗ | __bid_fixunstdsi | dec128 | ∅ |unsigned int | .. |
475| ✗ | __dpd_fixunssddi | dec32 | ∅ |unsigned long| .. |
476| ✗ | __bid_fixunssddi | dec32 | ∅ |unsigned long| .. |
477| ✗ | __dpd_fixunsdddi | dec64 | ∅ |unsigned long| .. |
478| ✗ | __bid_fixunsdddi | dec64 | ∅ |unsigned long| .. |
479| ✗ | __dpd_fixunstddi | dec128 | ∅ |unsigned long| .. |
480| ✗ | __bid_fixunstddi | dec128 | ∅ |unsigned long| .. |
481| ✗ | __dpd_floatsisd | int | ∅ | dec32 | .. |
482| ✗ | __bid_floatsisd | int | ∅ | dec32 | .. |
483| ✗ | __dpd_floatsidd | int | ∅ | dec64 | .. |
484| ✗ | __bid_floatsidd | int | ∅ | dec64 | .. |
485| ✗ | __dpd_floatsitd | int | ∅ | dec128 | .. |
486| ✗ | __bid_floatsitd | int | ∅ | dec128 | .. |
487| ✗ | __dpd_floatdisd | long | ∅ | dec32 | .. |
488| ✗ | __bid_floatdisd | long | ∅ | dec32 | .. |
489| ✗ | __dpd_floatdidd | long | ∅ | dec64 | .. |
490| ✗ | __bid_floatdidd | long | ∅ | dec64 | .. |
491| ✗ | __dpd_floatditd | long | ∅ | dec128 | .. |
492| ✗ | __bid_floatditd | long | ∅ | dec128 | .. |
493| ✗ | __dpd_floatunssisd | unsigned int| ∅ | dec32 | .. |
494| ✗ | __bid_floatunssisd | unsigned int| ∅ | dec32 | .. |
495| ✗ | __dpd_floatunssidd | unsigned int| ∅ | dec64 | .. |
496| ✗ | __bid_floatunssidd | unsigned int| ∅ | dec64 | .. |
497| ✗ | __dpd_floatunssitd | unsigned int| ∅ | dec128 | .. |
498| ✗ | __bid_floatunssitd | unsigned int| ∅ | dec128 | .. |
499| ✗ | __dpd_floatunsdisd |unsigned long| ∅ | dec32 | .. |
500| ✗ | __bid_floatunsdisd |unsigned long| ∅ | dec32 | .. |
501| ✗ | __dpd_floatunsdidd |unsigned long| ∅ | dec64 | .. |
502| ✗ | __bid_floatunsdidd |unsigned long| ∅ | dec64 | .. |
503| ✗ | __dpd_floatunsditd |unsigned long| ∅ | dec128 | .. |
504| ✗ | __bid_floatunsditd |unsigned long| ∅ | dec128 | .. |
505| | | | | | **Decimal Float Comparison** |
506| ✗ | __dpd_unordsd2 | dec32 | dec32 | c_int | `a +-NaN or a +-NaN -> 1(nonzero), else -> 0` |
507| ✗ | __bid_unordsd2 | dec32 | dec32 | c_int | .. |
508| ✗ | __dpd_unorddd2 | dec64 | dec64 | c_int | .. |
509| ✗ | __bid_unorddd2 | dec64 | dec64 | c_int | .. |
510| ✗ | __dpd_unordtd2 | dec128 | dec128 | c_int | .. |
511| ✗ | __bid_unordtd2 | dec128 | dec128 | c_int | .. |
512| ✗ | __dpd_eqsd2 | dec32 | dec32 | c_int |`a!=+-NaN and b!=+-Nan and a==b -> 0, else -> 1(nonzero)`|
513| ✗ | __bid_eqsd2 | dec32 | dec32 | c_int | .. |
514| ✗ | __dpd_eqdd2 | dec64 | dec64 | c_int | .. |
515| ✗ | __bid_eqdd2 | dec64 | dec64 | c_int | .. |
516| ✗ | __dpd_eqtd2 | dec128 | dec128 | c_int | .. |
517| ✗ | __bid_eqtd2 | dec128 | dec128 | c_int | .. |
518| ✗ | __dpd_nesd2 | dec32 | dec32 | c_int | `a==+-NaN or b==+-NaN or a!=b -> 1(nonzero), else -> 0` |
519| ✗ | __bid_nesd2 | dec32 | dec32 | c_int | .. |
520| ✗ | __dpd_nedd2 | dec64 | dec64 | c_int | .. |
521| ✗ | __bid_nedd2 | dec64 | dec64 | c_int | .. |
522| ✗ | __dpd_netd2 | dec128 | dec128 | c_int | .. |
523| ✗ | __bid_netd2 | dec128 | dec128 | c_int | .. |
524| ✗ | __dpd_gesd2 | dec32 | dec32 | c_int | `a!=+-NaN and b!=+-NaN and a>=b -> >=0, else -> <0` |
525| ✗ | __bid_gesd2 | dec32 | dec32 | c_int | .. |
526| ✗ | __dpd_gedd2 | dec64 | dec64 | c_int | .. |
527| ✗ | __bid_gedd2 | dec64 | dec64 | c_int | .. |
528| ✗ | __dpd_getd2 | dec128 | dec128 | c_int | .. |
529| ✗ | __bid_getd2 | dec128 | dec128 | c_int | .. |
530| ✗ | __dpd_ltsd2 | dec32 | dec32 | c_int | `a!=+-NaN and b!=+-NaN and a<b -> <0, else -> >=0` |
531| ✗ | __bid_ltsd2 | dec32 | dec32 | c_int | .. |
532| ✗ | __dpd_ltdd2 | dec64 | dec64 | c_int | .. |
533| ✗ | __bid_ltdd2 | dec64 | dec64 | c_int | .. |
534| ✗ | __dpd_lttd2 | dec128 | dec128 | c_int | .. |
535| ✗ | __bid_lttd2 | dec128 | dec128 | c_int | .. |
536| ✗ | __dpd_lesd2 | dec32 | dec32 | c_int | `a!=+-NaN and b!=+-NaN and a<=b -> <=0, else -> >=0` |
537| ✗ | __bid_lesd2 | dec32 | dec32 | c_int | .. |
538| ✗ | __dpd_ledd2 | dec64 | dec64 | c_int | .. |
539| ✗ | __bid_ledd2 | dec64 | dec64 | c_int | .. |
540| ✗ | __dpd_letd2 | dec128 | dec128 | c_int | .. |
541| ✗ | __bid_letd2 | dec128 | dec128 | c_int | .. |
542| ✗ | __dpd_gtsd2 | dec32 | dec32 | c_int | `a!=+-NaN and b!=+-NaN and a>b -> >0, else -> <=0` |
543| ✗ | __bid_gtsd2 | dec32 | dec32 | c_int | .. |
544| ✗ | __dpd_gtdd2 | dec64 | dec64 | c_int | .. |
545| ✗ | __bid_gtdd2 | dec64 | dec64 | c_int | .. |
546| ✗ | __dpd_gttd2 | dec128 | dec128 | c_int | .. |
547| ✗ | __bid_gttd2 | dec128 | dec128 | c_int | .. |
548| | | | | | **Decimal Float Arithmetic**[^options] |
549| ✗ | __dpd_addsd3 | dec32 | dec32 | dec32 |`a + b`|
550| ✗ | __bid_addsd3 | dec32 | dec32 | dec32 | .. |
551| ✗ | __dpd_adddd3 | dec64 | dec64 | dec64 | .. |
552| ✗ | __bid_adddd3 | dec64 | dec64 | dec64 | .. |
553| ✗ | __dpd_addtd3 | dec128 | dec128 | dec128 | .. |
554| ✗ | __bid_addtd3 | dec128 | dec128 | dec128 | .. |
555| ✗ | __dpd_subsd3 | dec32 | dec32 | dec32 |`a - b`|
556| ✗ | __bid_subsd3 | dec32 | dec32 | dec32 | .. |
557| ✗ | __dpd_subdd3 | dec64 | dec64 | dec64 | .. |
558| ✗ | __bid_subdd3 | dec64 | dec64 | dec64 | .. |
559| ✗ | __dpd_subtd3 | dec128 | dec128 | dec128 | .. |
560| ✗ | __bid_subtd3 | dec128 | dec128 | dec128 | .. |
561| ✗ | __dpd_mulsd3 | dec32 | dec32 | dec32 |`a * b`|
562| ✗ | __bid_mulsd3 | dec32 | dec32 | dec32 | .. |
563| ✗ | __dpd_muldd3 | dec64 | dec64 | dec64 | .. |
564| ✗ | __bid_muldd3 | dec64 | dec64 | dec64 | .. |
565| ✗ | __dpd_multd3 | dec128 | dec128 | dec128 | .. |
566| ✗ | __bid_multd3 | dec128 | dec128 | dec128 | .. |
567| ✗ | __dpd_divsd3 | dec32 | dec32 | dec32 |`a / b`|
568| ✗ | __bid_divsd3 | dec32 | dec32 | dec32 | .. |
569| ✗ | __dpd_divdd3 | dec64 | dec64 | dec64 | .. |
570| ✗ | __bid_divdd3 | dec64 | dec64 | dec64 | .. |
571| ✗ | __dpd_divtd3 | dec128 | dec128 | dec128 | .. |
572| ✗ | __bid_divtd3 | dec128 | dec128 | dec128 | .. |
573| ✗ | __dpd_negsd2 | dec32 | dec32 | dec32 | `-a` |
574| ✗ | __bid_negsd2 | dec32 | dec32 | dec32 | .. |
575| ✗ | __dpd_negdd2 | dec64 | dec64 | dec64 | .. |
576| ✗ | __bid_negdd2 | dec64 | dec64 | dec64 | .. |
577| ✗ | __dpd_negtd2 | dec128 | dec128 | dec128 | .. |
578| ✗ | __bid_negtd2 | dec128 | dec128 | dec128 | .. |
579
580[^options]: These numbers include options with routines for +-0 and +-Nan.
581
582Fixed-point fractional library routines
583
584TODO brief explanation + implementation
585
586| Done | Name | a | b | Out | Comment |
587| ------ | ------------- | --------- | --------- | --------- | -------------------------- |
588| | | | | | **Fixed-Point Fractional** |
589
590Math functions according to C99 with gnu extension sincos. f16, f80 and f128 functions
591are additionally supported by Zig, but not part of C standard. Alphabetically sorted.
592
593| Done | Name | a | b | Out | Comment |
594| ---- | ------- | --------- | --------- | --------- | -------------------------- |
595| ✓ | __ceilh | f16 | ∅ | f16 |smallest integer value not less than a|
596| ✓ | ceilf | f32 | ∅ | f32 |If a is integer, +-0, +-NaN, or +-infinite, a itself is returned.|
597| ✓ | ceil | f64 | ∅ | f64 | .. |
598| ✓ | __ceilx | f80 | ∅ | f80 | |
599| ✓ | ceilf128 | f128 | ∅ | f128 | .. PPC |
600| ✓ | ceilq | f128 | ∅ | f128 | .. |
601| ✓ | ceill |long double| ∅ |long double| .. |
602| ✓ | __cosh | f16 | ∅ | f16 | `cos(a)=(e^(ia)+e^(-ia))/2`|
603| ✓ | cosf | f32 | ∅ | f32 | .. |
604| ✓ | cos | f64 | ∅ | f64 | .. |
605| ✓ | __cosx | f80 | ∅ | f80 | .. |
606| ✓ | cosf128 | f128 | ∅ | f128 | .. |
607| ✓ | cosq | f128 | ∅ | f128 | .. PPC |
608| ✓ | cosl |long double| ∅ |long double| .. |
609| ✓ | __exph | f16 | ∅ | f16 | `e^a` with e base of natural logarithms|
610| ✓ | expf | f32 | ∅ | f32 | .. |
611| ✓ | exp | f64 | ∅ | f64 | .. |
612| ✓ | __expx | f80 | ∅ | f80 | .. |
613| ✓ | expf128 | f128 | ∅ | f128 | .. |
614| ✓ | expq | f128 | ∅ | f128 | .. PPC |
615| ✓ | expl |long double| ∅ |long double| .. |
616| ✓ | __exp2h | f16 | ∅ | f16 | `2^a` |
617| ✓ | exp2f | f32 | ∅ | f32 | .. |
618| ✓ | exp2 | f64 | ∅ | f64 | .. |
619| ✓ | __exp2x | f80 | ∅ | f80 | .. |
620| ✓ | exp2f128 | f128 | ∅ | f128 | .. |
621| ✓ | exp2q | f128 | ∅ | f128 | .. PPC |
622| ✓ | exp2l |long double| ∅ |long double| .. |
623| ✓ | __fabsh | f16 | ∅ | f16 | absolute value of a |
624| ✓ | fabsf | f32 | ∅ | f32 | .. |
625| ✓ | fabs | f64 | ∅ | f64 | .. |
626| ✓ | __fabsx | f80 | ∅ | f80 | .. |
627| ✓ | fabsf128 | f128 | ∅ | f128 | .. |
628| ✓ | fabsq | f128 | ∅ | f128 | .. PPC |
629| ✓ | fabsl |long double| ∅ |long double| .. |
630| ✓ | __floorh | f16 | ∅ | f16 |largest integer value not greater than a|
631| ✓ | floorf | f32 | ∅ | f32 |If a is integer, +-0, +-NaN, or +-infinite, a itself is returned.|
632| ✓ | floor | f64 | ∅ | f64 | .. |
633| ✓ | __floorx | f80 | ∅ | f80 | .. |
634| ✓ | floorf128 | f128 | ∅ | f128 | .. |
635| ✓ | floorq | f128 | ∅ | f128 | .. PPC |
636| ✓ | floorl |long double| ∅ |long double| .. |
637| ✓ | __fmah | f16 | 2xf16 | f16 | args a,b,c result `(a*b)+c`|
638| ✓ | fmaf | f32 | 2xf32 | f32 |Fused multiply-add for hardware acceleration|
639| ✓ | fma | f64 | 2xf64 | f64 | .. |
640| ✓ | __fmax | f80 | 2xf80 | f80 | .. |
641| ✓ | fmaf128 | f128 | 2xf128 | f128 | .. |
642| ✓ | fmaq | f128 | 2xf128 | f128 | .. PPC |
643| ✓ | fmal |long double|2xlong double|long double| .. |
644| ✓ | __fmaxh | f16 | f16 | f16 | larger value of a,b |
645| ✓ | fmaxf | f32 | f32 | f32 | .. |
646| ✓ | fmax | f64 | f64 | f64 | .. |
647| ✓ | __fmaxx | f80 | f80 | f80 | .. |
648| ✓ | fmaxf128 | f128 | f128 | f128 | .. |
649| ✓ | fmaxq | f128 | f128 | f128 | .. PPC |
650| ✓ | fmaxl |long double|long double|long double| .. |
651| ✓ | __fminh | f16 | f16 | f16 | smaller value of a,b |
652| ✓ | fminf | f32 | f32 | f32 | .. |
653| ✓ | fmin | f64 | f64 | f64 | .. |
654| ✓ | __fminx | f80 | f80 | f80 | .. |
655| ✓ | fminf128 | f128 | f128 | f128 | .. |
656| ✓ | fminq | f128 | f128 | f128 | .. PPC |
657| ✓ | fminl |long double|long double|long double| .. |
658| ✓ | __fmodh | f16 | f16 | f16 |floating-point remainder of division a/b|
659| ✓ | fmodf | f32 | f32 | f32 | .. |
660| ✓ | fmod | f64 | f64 | f64 | .. |
661| ✓ | __fmodx | f80 | f80 | f80 | .. |
662| ✓ | fmodf128 | f128 | f128 | f128 | .. |
663| ✓ | fmodq | f128 | f128 | f128 | .. PPC |
664| ✓ | fmodl |long double|long double|long double| .. |
665| ✓ | __logh | f16 | ∅ | f16 |natural (base-e) logarithm of a|
666| ✓ | logf | f32 | ∅ | f32 | .. |
667| ✓ | log | f64 | ∅ | f64 | .. |
668| ✓ | __logx | f80 | ∅ | f80 | .. |
669| ✓ | logf128 | f128 | ∅ | f128 | .. |
670| ✓ | logq | f128 | ∅ | f128 | .. PPC |
671| ✓ | logl |long double| ∅ |long double| .. |
672| ✓ | __log10h | f16 | ∅ | f16 |common (base-10) logarithm of a|
673| ✓ | log10f | f32 | ∅ | f32 | .. |
674| ✓ | log10 | f64 | ∅ | f64 | .. |
675| ✓ | __log10x | f80 | ∅ | f80 | .. |
676| ✓ | log10f128 | f128 | ∅ | f128 | .. |
677| ✓ | log10q | f128 | ∅ | f128 | .. PPC |
678| ✓ | log10l |long double| ∅ |long double| .. |
679| ✓ | __log2h | f16 | ∅ | f16 | base-2 logarithm of a |
680| ✓ | log2f | f32 | ∅ | f32 | .. |
681| ✓ | log2 | f64 | ∅ | f64 | .. |
682| ✓ | __log2x | f80 | ∅ | f80 | .. |
683| ✓ | log2f128 | f128 | ∅ | f128 | .. |
684| ✓ | log2q | f128 | ∅ | f128 | .. PPC |
685| ✓ | log2l |long double| ∅ |long double| .. |
686| ✓ | __roundh | f16 | ∅ | f16 | a rounded to next int away from zero|
687| ✓ | roundf | f32 | ∅ | f32 | .. |
688| ✓ | round | f64 | ∅ | f64 | .. |
689| ✓ | __roundx | f80 | ∅ | f80 | .. |
690| ✓ | roundf128 | f128 | ∅ | f128 | .. |
691| ✓ | roundq | f128 | ∅ | f128 | .. PPC |
692| ✓ | roundl |long double| ∅ |long double| .. |
693| ✓ | __sinh | f16 | ∅ | f16 | `sin(a)=(e^(ia)-e^(-ia))/2`|
694| ✓ | sinf | f32 | ∅ | f32 | .. |
695| ✓ | sin | f64 | ∅ | f64 | .. |
696| ✓ | __sinx | f80 | ∅ | f80 | .. |
697| ✓ | sinf128 | f128 | ∅ | f128 | .. |
698| ✓ | sinq | f128 | ∅ | f128 | .. PPC |
699| ✓ | sinl |long double| ∅ |long double| .. |
700| ✓ | __sincosh | f16 | 2x *f16 | ∅ |sin and cos of the same angle a|
701| ✓ | sincosf | f32 | 2x *f32 | ∅ |args a,*b,*c, `b.*=sin(x),c.*=cos(x)`|
702| ✓ | sincos | f64 | 2x *f64 | ∅ | .. |
703| ✓ | __sincosx | f80 | 2x *f80 | ∅ | .. |
704| ✓ | sincosf128 | f128 | 2x *f128 | ∅ | .. |
705| ✓ | sincosq | f128 | 2x *f128 | ∅ | .. PPC |
706| ✓ | sincosl |long double| 2x *long double|∅ | .. |
707| ✓ | __sqrth | f16 | ∅ | f16 | square root of a (find `r st. a=r^2`)|
708| ✓ | sqrtf | f32 | ∅ | f32 | .. |
709| ✓ | sqrt | f64 | ∅ | f64 | .. |
710| ✓ | __sqrtx | f80 | ∅ | f80 | .. |
711| ✓ | sqrtf128 | f128 | ∅ | f128 | .. |
712| ✓ | sqrtq | f128 | ∅ | f128 | .. PPC |
713| ✓ | sqrtl |long double| ∅ |long double| .. |
714| ✓ | __tanh | f16 | ∅ | f16 | `tan(x)=sin(x)/cos(x) |
715| ✓ | tanf | f32 | ∅ | f32 | .. |
716| ✓ | tan | f64 | ∅ | f64 | .. |
717| ✓ | __tanx | f80 | ∅ | f80 | .. |
718| ✓ | tanf128 | f128 | ∅ | f128 | .. |
719| ✓ | tanq | f128 | ∅ | f128 | .. PPC |
720| ✓ | tanl |long double| ∅ |long double| .. |
721| ✓ | __trunch | f16 | ∅ | f16 | a rounded to next int towards zero|
722| ✓ | truncf | f32 | ∅ | f32 | .. |
723| ✓ | trunc | f64 | ∅ | f64 | .. |
724| ✓ | __truncx | f80 | ∅ | f80 | .. |
725| ✓ | truncf128 | f128 | ∅ | f128 | .. |
726| ✓ | truncq | f128 | ∅ | f128 | .. PPC |
727| ✓ | truncl |long double| ∅ |long double| .. |
728
729Arbitrary Precision Big Integer (BigInt) library routines
730
731TODO brief description
732
733| Done | Name | result| a | b | size| ret | Comment |
734| ---- | ------- | ----- | ----- | ----- | --- | ----- |---------------------- |
735| | | | | | | |**BigInt Bit Operation**|
736| | | | | | | |**BigInt Comparison** |
737| | | | | | | |**BigInt Arithmetic** |
738|✓|__udivei4 |[*c]u32|[*c]u32|[*c]u32|usize|void | `a / b` |
739|✓|__umodei4 |[*c]u32|[*c]u32|[*c]u32|usize|void | `a % b` |
740|✗|__divei4 |[*c]u32|[*c]u32|[*c]u32|usize|void | `a / b` |
741|✗|__modei4 |[*c]u32|[*c]u32|[*c]u32|usize|void | `a % b` |
742| | | | | | | |**BigInt Arithmetic with Trapping Overflow**|
743| | | | | | | |**BigInt Arithmetic which Return on Overflow**[^noptr_faster]|
744
745Further content (conditionally) exported with C abi:
746
747ARM-only routines
748
749| Done | Name | a | b | Out | Comment |
750| ---- | -------- | --- | --- | -----| ----------------------|
751| | | | | | **Float Comparison** |
752|✗|__aeabi_cfcmpeq | f32 | f32 | void | `a == b` result in PSR ZC flags[^PSRZC] |
753|✗|__aeabi_cfcmple | f32 | f32 | void | `a <= b` result .. |
754|✗|__aeabi_cfrcmple| f32 | f32 | void | `b <= a` .. |
755|✗|__aeabi_cdcmpeq | f64 | f64 | void | `a == b` .. |
756|✗|__aeabi_cdcmple | f64 | f64 | void | `a <= b` .. |
757|✗|__aeabi_cdrcmple| f64 | f64 | void | `b <= a` .. |
758| | | | | | **Float Arithmetic** |
759|✗|__aeabi_frsub | f64 | f64 | f64 | `b - a` |
760|✗|__aeabi_drsub | f64 | f64 | f64 | .. |
761| | | | | | **Special** |
762|✓|__aeabi_read_tp | ∅ | ∅ | *u8 | ret tls pointer |
763|✗|__aeabi_idiv0 | i32 | ∅ | i32 | div by 0 modifier |
764|✗|__aeabi_ldiv0 | i64 | ∅ | i64 | div by 0 modifier |
765| | | | | | **Unaligned memory access** |
766|✗|__aeabi_uread4 |[*]u8| ∅ | i32 | ret value read |
767|✗|__aeabi_uwrite4 | i32 |[*]u8| i32 | ret value written |
768|✗|__aeabi_uread8 |[*]u8| ∅ | i64 | .. |
769|✗|__aeabi_uwrite8 | i64 |[*]u8| i64 | .. |
770
771
772| Done | Name | a | b | c | Comment |
773| ---- | -------- | --- | --- | -----| ----------------------|
774| | | | | | **Memory copy, move and set** |
775|✓|__aeabi_memcpy8 |[*]u8|[*]u8| usize| *dest, *src, size |
776|✓|__aeabi_memcpy4 |[*]u8|[*]u8| usize| .. |
777|✓|__aeabi_memcpy |[*]u8|[*]u8| usize| .. |
778|✓|__aeabi_memmove8|[*]u8|[*]u8| usize| *dest, *src, size |
779|✓|__aeabi_memmove4|[*]u8|[*]u8| usize| .. |
780|✓|__aeabi_memmove |[*]u8|[*]u8| usize| .. |
781|✓|__aeabi_memset8 |[*]u8|usize| i32 | *dest, size, char |
782|✓|__aeabi_memset4 |[*]u8|usize| i32 | .. |
783|✓|__aeabi_memset |[*]u8|usize| i32 | .. |
784|✓|__aeabi_memclr8 |[*]u8| u32 | usize| *dest, size |
785|✓|__aeabi_memclr4 |[*]u8| u32 | usize| .. |
786|✓|__aeabi_memclr |[*]u8| u32 | usize| .. |
787|✓|__aeabi_uwrite8 | i64 |[*]u8| i64 | .. |
788
789- __aeabi_read_tp
790
791[^PSRZC]: return result in the CPSR Z and C flag. C is clear only if the
792operands are ordered and the first operand is less than the second.
793Z is set only when the operands are ordered and equal.
794Preserves all core registers except ip, lr, and the CPSR.
795
796- aarch64 outline atomics
797- atomics
798- bcmp
799- clear cache
800- memory routines (memcmp, memcpy, memset, memmove)
801- msvc things like _alldiv, _aulldiv, _allrem
802- objective-c __isPlatformVersionAtLeast check
803- stack probe routines
804- tls emulation