authorgravatar for jan.hafer@rwth-aachen.deJan Philipp Hafer <jan.hafer@rwth-aachen.de> 2022-10-22 17:33:01+02:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2022-10-22 09:23:50-07:00
log776f7de9673087597e1a549d3567c18c43c800ab
treecc8ae01aeb1b99473cf22cf1c24c430a860926c3
parent10b8c4d8f02c085090b07f3709de2d70d3b85cf0

update compiler_rt README and prettify it

This documents status of routines and adds the next work item "Decimal float library routines", which are only recommended for binary data. Complete absence of tests is also documented. This does not document the various aliases, e.g. those for ARM. Missing Integer library routines: - __addvsi3 - __addvdi3 - __addvti3 - __addvdi3 - __addvti3 - __subvsi3 - __subvdi3 - __subvti3 - __subvdi3 - __subvti3 - __mulvsi3 - __mulvdi3 - __mulvti3 - __mulvdi3 - __mulvti3 Missing floating library routines: - __powisf2 - __powidf2 - __powitf2 - __powixf2 Missing routines for symbol-level compatibility to gcc: - __ashlsi3 - __ashrsi3 - __lshrsi3

1 files changed, 425 insertions(+), 184 deletions(-)

lib/compiler_rt/README.md+425-184
...@@ -15,7 +15,7 @@ Goals:...@@ -15,7 +15,7 @@ Goals:
1515
16Current status (tracking libgcc documentation):16Current status (tracking libgcc documentation):
17- Integer library routines => almost implemented17- Integer library routines => almost implemented
18- Soft float library routines => only f80 routines missing18- Soft float library routines => finished
19- Decimal float library routines => unimplemented (~120 functions)19- Decimal float library routines => unimplemented (~120 functions)
20- Fixed-point fractional library routines => unimplemented (~300 functions)20- Fixed-point fractional library routines => unimplemented (~300 functions)
21- Exception handling routines => unclear, if supported (~32+x undocumented functions)21- Exception handling routines => unclear, if supported (~32+x undocumented functions)
...@@ -48,66 +48,71 @@ Bugs should be solved by trying to duplicate the bug upstream, if possible....@@ -48,66 +48,71 @@ Bugs should be solved by trying to duplicate the bug upstream, if possible.
48## Integer library routines48## Integer library routines
4949
50#### Integer Bit operations50#### Integer Bit operations
51- dev HackersDelight __clzsi2 // count leading zeros51
52- dev HackersDelight __clzdi2 // count leading zeros52- dev HackersDelight __clzsi2 // count leading zeros
53- dev HackersDelight __clzti2 // count leading zeros53- dev HackersDelight __clzdi2 // count leading zeros
54- dev HackersDelight __ctzsi2 // count trailing zeros54- dev HackersDelight __clzti2 // count leading zeros
55- dev HackersDelight __ctzdi2 // count trailing zeros55- dev HackersDelight __ctzsi2 // count trailing zeros
56- dev HackersDelight __ctzti2 // count trailing zeros56- dev HackersDelight __ctzdi2 // count trailing zeros
57- dev __ctzsi2 __ffssi2 // find least significant 1 bit57- dev HackersDelight __ctzti2 // count trailing zeros
58- dev __ctzsi2 __ffsdi2 // find least significant 1 bit58- dev __ctzsi2 __ffssi2 // find least significant 1 bit
59- dev __ctzsi2 __ffsti2 // find least significant 1 bit59- dev __ctzsi2 __ffsdi2 // find least significant 1 bit
60- dev BitTwiddlingHacks __paritysi2 // bit parity60- dev __ctzsi2 __ffsti2 // find least significant 1 bit
61- dev BitTwiddlingHacks __paritydi2 // bit parity61- dev BitTwiddlingHacks __paritysi2 // bit parity
62- dev BitTwiddlingHacks __parityti2 // bit parity62- dev BitTwiddlingHacks __paritydi2 // bit parity
63- dev TAOCP __popcountsi2 // bit population63- dev BitTwiddlingHacks __parityti2 // bit parity
64- dev TAOCP __popcountdi2 // bit population64- dev TAOCP __popcountsi2 // bit population
65- dev TAOCP __popcountti2 // bit population65- dev TAOCP __popcountdi2 // bit population
66- dev other __bswapsi2 // a byteswapped66- dev TAOCP __popcountti2 // bit population
67- dev other __bswapdi2 // a byteswapped67- dev other __bswapsi2 // a byteswapped
68- dev other __bswapti2 // a byteswapped68- dev other __bswapdi2 // a byteswapped
69- dev other __bswapti2 // a byteswapped
6970
70#### Integer Comparison71#### Integer Comparison
71- port llvm __cmpsi2 // (a<b)=>output=0, (a==b)=>output=1, (a>b)=>output=272
72- port llvm __cmpdi273- port llvm __cmpsi2 // a,b: i32, (a<b)-> 0, (a==b) -> 1, (a>b) -> 2
73- port llvm __cmpti274- port llvm __cmpdi2 // a,b: i64
74- port llvm __ucmpsi2 // (a<b)=>output=0, (a==b)=>output=1, (a>b)=>output=275- port llvm __cmpti2 // a,b: i128
75- port llvm __ucmpdi276- port llvm __ucmpsi2 // a,b: u32, (a<b)-> 0, (a==b) -> 1, (a>b) -> 2
76- port llvm __ucmpti277- port llvm __ucmpdi2 // a,b: u64
78- port llvm __ucmpti2 // a,b: u128
7779
78#### Integer Arithmetic80#### Integer Arithmetic
79- none none __ashlsi3 // a << b unused in llvm, missing (e.g. used by rl78)81
80- port llvm __ashldi3 // a << b82- none none __ashlsi3 // a,b: i32, a << b unused in llvm, TODO (e.g. used by rl78)
81- port llvm __ashlti3 // a << b83- port llvm __ashldi3 // a,b: u64
82- none none __ashrsi3 // a >> b arithmetic (sign fill) missing (e.g. used by rl78)84- port llvm __ashlti3 // a,b: u128
83- port llvm __ashrdi3 // a >> b arithmetic (sign fill)85- none none __ashrsi3 // a,b: i32, a >> b arithmetic (sign fill) TODO (e.g. used by rl78)
84- port llvm __ashrti3 // a >> b arithmetic (sign fill)86- port llvm __ashrdi3 // ..
85- none none __lshrsi3 // a >> b logical (zero fill) missing (e.g. used by rl78)87- port llvm __ashrti3 //
86- port llvm __lshrdi3 // a >> b logical (zero fill)88- none none __lshrsi3 // a,b: i32, a >> b logical (zero fill) TODO (e.g. used by rl78)
87- port llvm __lshrti3 // a >> b logical (zero fill)89- port llvm __lshrdi3 //
88- port llvm __negdi2 // -a symbol-level compatibility: libgcc90- port llvm __lshrti3 //
89- port llvm __negti2 // -a unnecessary: unused in backends91- port llvm __negdi2 // a: i32, -a, symbol-level compatibility with libgcc
90- port llvm __mulsi3 // a * b signed92- port llvm __negti2 // unnecessary: unused in backends
91- port llvm __muldi3 // a * b signed93- port llvm __mulsi3 // a,b: i32, a * b
92- port llvm __multi3 // a * b signed94- port llvm __muldi3 //
93- port llvm __divsi3 // a / b signed95- port llvm __multi3 //
94- port llvm __divdi3 // a / b signed96- port llvm __divsi3 // a,b: i32, a / b
95- port llvm __divti3 // a / b signed97- port llvm __divdi3 //
96- port llvm __udivsi3 // a / b unsigned98- port llvm __divti3 //
97- port llvm __udivdi3 // a / b unsigned99- port llvm __udivsi3 // a,b: u32, a / b
98- port llvm __udivti3 // a / b unsigned100- port llvm __udivdi3 //
99- port llvm __modsi3 // a % b signed101- port llvm __udivti3 //
100- port llvm __moddi3 // a % b signed102- port llvm __modsi3 // a,b: i32, a % b
101- port llvm __modti3 // a % b signed103- port llvm __moddi3 //
102- port llvm __umodsi3 // a % b unsigned104- port llvm __modti3 //
103- port llvm __umoddi3 // a % b unsigned105- port llvm __umodsi3 // a,b: u32, a % b
104- port llvm __umodti3 // a % b unsigned106- port llvm __umoddi3 //
105- port llvm __udivmoddi4 // a / b, rem.* = a % b unsigned107- port llvm __umodti3 //
106- port llvm __udivmodti4 // a / b, rem.* = a % b unsigned108- port llvm __udivmoddi4 // a,b: u32, a / b, rem.* = a % b unsigned
107- port llvm __udivmodsi4 // a / b, rem.* = a % b unsigned109- port llvm __udivmodti4 //
108- port llvm __divmodsi4 // a / b, rem.* = a % b signed, ARM110- port llvm __udivmodsi4 //
111- port llvm __divmodsi4 // a,b: i32, a / b, rem.* = a % b signed, ARM
112- port llvm __divmoddi4 //
109113
110#### Integer Arithmetic with trapping overflow114#### Integer Arithmetic with trapping overflow
115
111- dev BitTwiddlingHacks __absvsi2 // abs(a)116- dev BitTwiddlingHacks __absvsi2 // abs(a)
112- dev BitTwiddlingHacks __absvdi2 // abs(a)117- dev BitTwiddlingHacks __absvdi2 // abs(a)
113- dev BitTwiddlingHacks __absvti2 // abs(a)118- dev BitTwiddlingHacks __absvti2 // abs(a)
...@@ -116,152 +121,388 @@ Bugs should be solved by trying to duplicate the bug upstream, if possible....@@ -116,152 +121,388 @@ Bugs should be solved by trying to duplicate the bug upstream, if possible.
116- port llvm __negvti2 // -a121- port llvm __negvti2 // -a
117- TODO upstreaming __addvsi3..__mulvti3 after testing panics works122- TODO upstreaming __addvsi3..__mulvti3 after testing panics works
118- dev HackersDelight __addvsi3 // a + b123- dev HackersDelight __addvsi3 // a + b
119- dev HackersDelight __addvdi3 // a + b124- dev HackersDelight __addvdi3 //
120- dev HackersDelight __addvti3 // a + b125- dev HackersDelight __addvti3 //
121- dev HackersDelight __subvsi3 // a - b126- dev HackersDelight __subvsi3 // a - b
122- dev HackersDelight __subvdi3 // a - b127- dev HackersDelight __subvdi3 //
123- dev HackersDelight __subvti3 // a - b128- dev HackersDelight __subvti3 //
124- dev HackersDelight __mulvsi3 // a * b129- dev HackersDelight __mulvsi3 // a * b
125- dev HackersDelight __mulvdi3 // a * b130- dev HackersDelight __mulvdi3 //
126- dev HackersDelight __mulvti3 // a * b131- dev HackersDelight __mulvti3 //
127132
128#### Integer Arithmetic which returns if overflow (would be faster without pointer)133#### Integer Arithmetic which returns if overflow (would be faster without pointer)
129- dev HackersDelight __addosi4 // a + b, overflow=>ov.*=1 else 0134
135- dev HackersDelight __addosi4 // a + b, overflow->ov.*=1 else 0
130- dev HackersDelight __addodi4 // (completeness + performance, llvm does not use them)136- dev HackersDelight __addodi4 // (completeness + performance, llvm does not use them)
131- dev HackersDelight __addoti4 //137- dev HackersDelight __addoti4 //
132- dev HackersDelight __subosi4 // a - b, overflow=>ov.*=1 else 0138- dev HackersDelight __subosi4 // a - b, overflow->ov.*=1 else 0
133- dev HackersDelight __subodi4 // (completeness + performance, llvm does not use them)139- dev HackersDelight __subodi4 // (completeness + performance, llvm does not use them)
134- dev HackersDelight __suboti4 //140- dev HackersDelight __suboti4 //
135- dev HackersDelight __mulosi4 // a * b, overflow=>ov.*=1 else 0141- dev HackersDelight __mulosi4 // a * b, overflow->ov.*=1 else 0
136- dev HackersDelight __mulodi4 // (required by llvm)142- dev HackersDelight __mulodi4 // (required by llvm)
137- dev HackersDelight __muloti4 //143- dev HackersDelight __muloti4 //
138144
139## Float library routines145## Float library routines
140146
147TODO: review source of implementation
148
141#### Float Conversion149#### Float Conversion
142- todo todo __extendsfdf2 // extend a f32 => f64150
143- todo todo __extendsftf2 // extend a f32 => f128151- dev other __extendsfdf2 // a: f32 -> f64, TODO: missing tests
144- dev llvm __extendsfxf2 // extend a f32 => f80152- dev other __extendsftf2 // a: f32 -> f128
145- todo todo __extenddftf2 // extend a f64 => f128153- dev llvm __extendsfxf2 // a: f32 -> f80, TODO: missing tests
146- dev llvm __extenddfxf2 // extend a f64 => f80154- dev other __extenddftf2 // a: f64 -> f128
147- todo todo __truncdfsf2 // truncate a to narrower mode of return type, rounding towards zero155- dev llvm __extenddfxf2 // a: f64 -> f80
148- todo todo __trunctfdf2 //156- dev other __truncdfsf2 // a: f64 -> f32, rounding towards zero
149- todo todo __trunctfsf2 //157- dev other __trunctfdf2 // a: f128-> f64
150- dev llvm __truncxfsf2 //158- dev other __trunctfsf2 // a: f128-> f32
151- dev llvm __truncxfdf2 //159- dev llvm __truncxfsf2 // a: f80 -> f32, TODO: missing tests
152- todo todo __fixsfsi // convert a to i32, rounding towards zero160- dev llvm __truncxfdf2 // a: f80 -> f64, TODO: missing tests
153- todo todo __fixdfsi //161
154- todo todo __fixtfsi //162- dev unclear __fixsfsi // a: f32 -> i32, rounding towards zero
155- todo todo __fixxfsi //163- dev unclear __fixdfsi // a: f64 -> i32
156- todo todo __fixsfdi // convert a to i64, rounding towards zero164- dev unclear __fixtfsi // a: f128-> i32
157- todo todo __fixdfdi //165- dev unclear __fixxfsi // a: f80 -> i32, TODO: missing tests
158- todo todo __fixtfdi //166- dev unclear __fixsfdi // a: f32 -> i64, rounding towards zero
159- todo todo __fixxfdi //167- dev unclear __fixdfdi // ..
160- todo todo __fixsfti // convert a to i128, rounding towards zero168- dev unclear __fixtfdi //
161- todo todo __fixdfti //169- dev unclear __fixxfdi // TODO: missing tests
162- todo todo __fixtfdi //170- dev unclear __fixsfti // a: f32 -> i128, rounding towards zero
163- todo todo __fixxfti //171- dev unclear __fixdfti // ..
164172- dev unclear __fixtfdi //
165- __fixunssfsi // convert to u32, rounding towards zero. negative values become 0.173- dev unclear __fixxfti // TODO: missing tests
166- __fixunsdfsi //174
167- __fixunstfsi //175- dev unclear __fixunssfsi // a: f32 -> u32, rounding towards zero. negative values become 0.
168- __fixunsxfsi //176- dev unclear __fixunsdfsi // ..
169- __fixunssfdi // convert to u64, rounding towards zero. negative values become 0.177- dev unclear __fixunstfsi //
170- __fixunsdfdi //178- dev unclear __fixunsxfsi // TODO: missing tests
171- __fixunstfdi //179- dev unclear __fixunssfdi // a: f32 -> u64, rounding towards zero. negative values become 0.
172- __fixunsxfdi //180- dev unclear __fixunsdfdi //
173- __fixunssfti // convert to u128, rounding towards zero. negative values become 0.181- dev unclear __fixunstfdi //
174- __fixunsdfti //182- dev unclear __fixunsxfdi // TODO: missing tests
175- __fixunstfdi //183- dev unclear __fixunssfti // a: f32 -> u128, rounding towards zero. negative values become 0.
176- __fixunsxfti //184- dev unclear __fixunsdfti //
177185- dev unclear __fixunstfdi //
178- __floatsisf // convert i32 to floating point186- dev unclear __fixunsxfti // TODO: some more tests needed for base coverage
179- __floatsidf //187
180- __floatsitf //188- dev unclear __floatsisf // a: i32 -> f32
181- __floatsixf //189- dev unclear __floatsidf // a: i32 -> f64, TODO: missing tests
182- __floatdisf // convert i64 to floating point190- dev unclear __floatsitf // ..
183- __floatdidf //191- dev unclear __floatsixf // TODO: missing tests
184- __floatditf //192- dev unclear __floatdisf // a: i64 -> f32
185- __floatdixf //193- dev unclear __floatdidf //
186- __floattisf // convert i128 to floating point194- dev unclear __floatditf //
187- __floattidf //195- dev unclear __floatdixf // TODO: missing tests
188- __floattixf //196- dev unclear __floattisf // a: i128-> f32
189197- dev unclear __floattidf //
190- __floatunsisf // convert u32 to floating point198- dev unclear __floattitf //
191- __floatunsidf //199- dev unclear __floattixf // TODO: missing tests
192- __floatunsitf //200
193- __floatunsixf //201- dev unclear __floatunsisf // a: u32 -> f32
194- __floatundisf // convert u64 to floating point202- dev unclear __floatunsidf // TODO: missing tests
195- __floatundidf //203- dev unclear __floatunsitf //
196- __floatunditf //204- dev unclear __floatunsixf // TODO: missing tests
197- __floatundixf //205- dev unclear __floatundisf // a: u64 -> f32
198- __floatuntisf // convert u128 to floating point206- dev unclear __floatundidf //
199- __floatuntidf //207- dev unclear __floatunditf //
200- __floatuntitf //208- dev unclear __floatundixf // TODO: missing tests
201- __floatuntixf //209- dev unclear __floatuntisf // a: u128-> f32
210- dev unclear __floatuntidf //
211- dev unclear __floatuntitf //
212- dev unclear __floatuntixf // TODO: missing tests
202213
203#### Float Comparison214#### Float Comparison
204- __cmpsf2 // return (a<b)=>-1,(a==b)=>0,(a>b)=>1,Nan=>1 dont rely on this215
205- __cmpdf2 // exported from __lesf2, __ledf2, __letf2 (below)216- dev other __cmpsf2 // a,b:f32, (a<b)->-1,(a==b)->0,(a>b)->1,Nan->1
206- __cmptf2 //217- dev other __cmpdf2 // exported from __lesf2, __ledf2, __letf2 (below)
207- __unordsf2 // (input==NaN) => out!=0 else out=0,218- dev other __cmptf2 // But: if NaN is a possibility, use another routine.
208- __unorddf2 // __only reliable for (input!=Nan)__219- dev other __unordsf2 // a,b:f32, (a==+-NaN or b==+-NaN) -> !=0, else -> 0
209- __unordtf2 //220- dev other __unorddf2 // __only reliable for (input!=NaN)__
210- __eqsf2 // (a!=NaN) and (b!=Nan) and (a==b) => output=0221- dev other __unordtf2 // TODO: missing tests
211- __eqdf2 //222- dev other __eqsf2 // (a!=NaN) and (b!=Nan) and (a==b) -> output=0
212- __eqtf2 //223- dev other __eqdf2 //
213- __nesf2 // (a==NaN) or (b==Nan) or (a!=b) => output!=0224- dev other __eqtf2 //
214- __nedf2 //225- dev other __nesf2 // (a==NaN) or (b==Nan) or (a!=b) -> output!=0
215- __netf2 //226- dev other __nedf2 //
216- __gesf2 // (a!=Nan) and (b!=Nan) and (a>=b) => output>=0227- dev other __netf2 // __eqtf2 and __netf2 have same return value -> tested with __eqsf2
217- __gedf2 //228- dev other __gesf2 // (a!=Nan) and (b!=Nan) and (a>=b) -> output>=0
218- __getf2 //229- dev other __gedf2 //
219- __ltsf2 // (a!=Nan) and (b!=Nan) and (a<b) => output<0230- dev other __getf2 // TODO: missing tests
220- __ltdf2 //231- dev other __ltsf2 // (a!=Nan) and (b!=Nan) and (a<b) -> output<0
221- __lttf2 //232- dev other __ltdf2 //
222- __lesf2 // (a!=Nan) and (b!=Nan) and (a<=b) => output<=0233- dev other __lttf2 // TODO: missing tests
223- __ledf2 //234- dev other __lesf2 // (a!=Nan) and (b!=Nan) and (a<=b) -> output<=0
224- __letf2 //235- dev other __ledf2 //
225- __gtsf2 // (a!=Nan) and (b!=Nan) and (a>b) => output>0236- dev other __letf2 // TODO: missing tests
226- __gtdf2 //237- dev other __gtsf2 // (a!=Nan) and (b!=Nan) and (a>b) -> output>0
227- __gttf2 //238- dev other __gtdf2 //
239- dev other __gttf2 // TODO: missing tests
228240
229#### Float Arithmetic241#### Float Arithmetic
230- __addsf3 // a + b f32242
231- __adddf3 // a + b f64243- dev unclear __addsf3 // a + b f32, TODO: missing tests
232- __addtf3 // a + b f128244- dev unclear __adddf3 // a + b f64, TODO: missing tests
233- __addxf3 // a + b f80245- dev unclear __addtf3 // a + b f128
234- __aeabi_fadd // a + b f64 ARM: AAPCS246- dev unclear __addxf3 // a + b f80
235- __aeabi_dadd // a + b f64 ARM: AAPCS247- dev unclear __aeabi_fadd // a + b f64 ARM: AAPCS
236- __subsf3 // a - b248- dev unclear __aeabi_dadd // a + b f64 ARM: AAPCS
237- __subdf3 // a - b249- dev unclear __subsf3 // a - b, TODO: missing tests
238- __subtf3 // a - b250- dev unclear __subdf3 // a - b, TODO: missing tests
239- __subxf3 // a - b f80251- dev unclear __subtf3 // a - b
240- __aeabi_fsub // a - b f64 ARM: AAPCS252- dev unclear __subxf3 // a - b f80, TODO: missing tests
241- __aeabi_dsub // a - b f64 ARM: AAPCS253- dev unclear __aeabi_fsub // a - b f64 ARM: AAPCS
242- __mulsf3 // a * b254- dev unclear __aeabi_dsub // a - b f64 ARM: AAPCS
243- __muldf3 // a * b255- dev unclear __mulsf3 // a * b, TODO: missing tests
244- __multf3 // a * b256- dev unclear __muldf3 // a * b, TODO: missing tests
245- __mulxf3 // a * b257- dev unclear __multf3 // a * b
246- __divsf3 // a / b258- dev unclear __mulxf3 // a * b
247- __divdf3 // a / b259- dev unclear __divsf3 // a / b, TODO: review tests
248- __divtf3 // a / b260- dev unclear __divdf3 // a / b, TODO: review tests
249- __divxf3 // a / b261- dev unclear __divtf3 // a / b
250- __negsf2 // -a symbol-level compatibility: libgcc uses this for the rl78262- dev unclear __divxf3 // a / b
251- __negdf2 // -a unnecessary: can be lowered directly to a xor263- dev unclear __negsf2 // -a symbol-level compatibility: libgcc uses this for the rl78
252- __negtf2 // -a264- dev unclear __negdf2 // -a unnecessary: can be lowered directly to a xor
253- __negxf2 // -a265- dev unclear __negtf2 // -a, TODO: missing tests
266- dev unclear __negxf2 // -a, TODO: missing tests
254267
255#### Floating point raised to integer power268#### Floating point raised to integer power
256- __powisf2 // unclear, if supported a ^ b269- dev unclear __powisf2 // a ^ b, TODO
257- __powidf2 //270- dev unclear __powidf2 //
258- __powitf2 //271- dev unclear __powitf2 //
259- __powixf2 //272- dev unclear __powixf2 //
260- __mulsc3 // unsupported (a+ib) * (c+id)273- dev unclear __mulsc3 // (a+ib) * (c+id)
261- __muldc3 //274- dev unclear __muldc3 //
262- __multc3 //275- dev unclear __multc3 //
263- __mulxc3 //276- dev unclear __mulxc3 //
264- __divsc3 // unsupported (a+ib) * / (c+id)277- dev unclear __divsc3 // (a+ib) * / (c+id)
265- __divdc3 //278- dev unclear __divdc3 //
266- __divtc3 //279- dev unclear __divtc3 //
267- __divxc3 //280- dev unclear __divxc3 //
281
282## Decimal float library routines
283
284BID means Binary Integer Decimal encoding, DPD means Densely Packed Decimal encoding.
285BID should be only chosen for binary data, DPD for decimal data (ASCII, Unicode etc).
286If possible, use BCD instead of DPD to represent numbers not accurately representable
287in binary like the number 0.2.
288
289All routines are TODO.
290
291#### Decimal float Conversion
292
293- __dpd_extendsddd2 // dec32->dec64
294- __bid_extendsddd2 // dec32->dec64
295- __dpd_extendsdtd2 // dec32->dec128
296- __bid_extendsdtd2 // dec32->dec128
297- __dpd_extendddtd2 // dec64->dec128
298- __bid_extendddtd2 // dec64->dec128
299- __dpd_truncddsd2 // dec64->dec32
300- __bid_truncddsd2 // dec64->dec32
301- __dpd_trunctdsd2 // dec128->dec32
302- __bid_trunctdsd2 // dec128->dec32
303- __dpd_trunctddd2 // dec128->dec64
304- __bid_trunctddd2 // dec128->dec64
305
306- __dpd_extendsfdd // float->dec64
307- __bid_extendsfdd // float->dec64
308- __dpd_extendsftd // float->dec128
309- __bid_extendsftd // float->dec128
310- __dpd_extenddftd // double->dec128
311- __bid_extenddftd // double->dec128
312- __dpd_extendxftd // long double->dec128
313- __bid_extendxftd // long double->dec128
314- __dpd_truncdfsd // double->dec32
315- __bid_truncdfsd // double->dec32
316- __dpd_truncxfsd // long double->dec32
317- __bid_truncxfsd // long double->dec32
318- __dpd_trunctfsd // long double->dec32
319- __bid_trunctfsd // long double->dec32
320- __dpd_truncxfdd // long double->dec64
321- __bid_truncxfdd // long double->dec64
322- __dpd_trunctfdd // long double->dec64
323- __bid_trunctfdd // long double->dec64
324
325- __dpd_truncddsf // dec64->float
326- __bid_truncddsf // dec64->float
327- __dpd_trunctdsf // dec128->float
328- __bid_trunctdsf // dec128->float
329- __dpd_extendsddf // dec32->double
330- __bid_extendsddf // dec32->double
331- __dpd_trunctddf // dec128->double
332- __bid_trunctddf // dec128->double
333- __dpd_extendsdxf // dec32->long double
334- __bid_extendsdxf // dec32->long double
335- __dpd_extendddxf // dec64->long double
336- __bid_extendddxf // dec64->long double
337- __dpd_trunctdxf // dec128->long double
338- __bid_trunctdxf // dec128->long double
339- __dpd_extendsdtf // dec32->long double
340- __bid_extendsdtf // dec32->long double
341- __dpd_extendddtf // dec64->long double
342- __bid_extendddtf // dec64->long double
343
344Same size conversion:
345- __dpd_extendsfsd // float->dec32
346- __bid_extendsfsd // float->dec32
347- __dpd_extenddfdd // double->dec64
348- __bid_extenddfdd // double->dec64
349- __dpd_extendtftd //long double->dec128
350- __bid_extendtftd //long double->dec128
351- __dpd_truncsdsf // dec32->float
352- __bid_truncsdsf // dec32->float
353- __dpd_truncdddf // dec64->float
354- __bid_truncdddf // dec64->float
355- __dpd_trunctdtf // dec128->long double
356- __bid_trunctdtf // dec128->long double
357
358- __dpd_fixsdsi // dec32->int
359- __bid_fixsdsi // dec32->int
360- __dpd_fixddsi // dec64->int
361- __bid_fixddsi // dec64->int
362- __dpd_fixtdsi // dec128->int
363- __bid_fixtdsi // dec128->int
364
365- __dpd_fixsddi // dec32->long
366- __bid_fixsddi // dec32->long
367- __dpd_fixdddi // dec64->long
368- __bid_fixdddi // dec64->long
369- __dpd_fixtddi // dec128->long
370- __bid_fixtddi // dec128->long
371
372- __dpd_fixunssdsi // dec32->unsigned int, All negative values become zero.
373- __bid_fixunssdsi // dec32->unsigned int
374- __dpd_fixunsddsi // dec64->unsigned int
375- __bid_fixunsddsi // dec64->unsigned int
376- __dpd_fixunstdsi // dec128->unsigned int
377- __bid_fixunstdsi // dec128->unsigned int
378
379- __dpd_fixunssddi // dec32->unsigned long, All negative values become zero.
380- __bid_fixunssddi // dec32->unsigned long
381- __dpd_fixunsdddi // dec64->unsigned long
382- __bid_fixunsdddi // dec64->unsigned long
383- __dpd_fixunstddi // dec128->unsigned long
384- __bid_fixunstddi // dec128->unsigned long
385
386- __dpd_floatsisd // int->dec32
387- __bid_floatsisd // int->dec32
388- __dpd_floatsidd // int->dec64
389- __bid_floatsidd // int->dec64
390- __dpd_floatsitd // int->dec128
391- __bid_floatsitd // int->dec128
392
393- __dpd_floatdisd // long->dec32
394- __bid_floatdisd // long->dec32
395- __dpd_floatdidd // long->dec64
396- __bid_floatdidd // long->dec64
397- __dpd_floatditd // long->dec128
398- __bid_floatditd // long->dec128
399
400- __dpd_floatunssisd // unsigned int->dec32
401- __bid_floatunssisd // unsigned int->dec32
402- __dpd_floatunssidd // unsigned int->dec64
403- __bid_floatunssidd // unsigned int->dec64
404- __dpd_floatunssitd // unsigned int->dec128
405- __bid_floatunssitd // unsigned int->dec128
406
407- __dpd_floatunsdisd // unsigned long->dec32
408- __bid_floatunsdisd // unsigned long->dec32
409- __dpd_floatunsdidd // unsigned long->dec64
410- __bid_floatunsdidd // unsigned long->dec64
411- __dpd_floatunsditd // unsigned long->dec128
412- __bid_floatunsditd // unsigned long->dec128
413
414#### Decimal float Comparison
415
416All decimal float comparison routines return c_int.
417
418- __dpd_unordsd2 // a,b: dec32, a +-NaN or a +-NaN -> 1(nonzero), else -> 0
419- __bid_unordsd2 // a,b: dec32
420- __dpd_unorddd2 // a,b: dec64
421- __bid_unorddd2 // a,b: dec64
422- __dpd_unordtd2 // a,b: dec128
423- __bid_unordtd2 // a,b: dec128
424
425- __dpd_eqsd2 // a,b: dec32, a!=+-NaN and b!=+-Nan and a==b -> 0, else -> 1(nonzero)
426- __bid_eqsd2 // a,b: dec32
427- __dpd_eqdd2 // a,b: dec64
428- __bid_eqdd2 // a,b: dec64
429- __dpd_eqtd2 // a,b: dec128
430- __bid_eqtd2 // a,b: dec128
431
432- __dpd_nesd2 // a,b: dec32, a==+-NaN or b==+-NaN or a!=b -> 1(nonzero), else -> 0
433- __bid_nesd2 // a,b: dec32
434- __dpd_nedd2 // a,b: dec64
435- __bid_nedd2 // a,b: dec64
436- __dpd_netd2 // a,b: dec128
437- __bid_netd2 // a,b: dec128
438
439- __dpd_gesd2 // a,b: dec32, a!=+-NaN and b!=+-NaN and a>=b -> >=0, else -> <0
440- __bid_gesd2 // a,b: dec32
441- __dpd_gedd2 // a,b: dec64
442- __bid_gedd2 // a,b: dec64
443- __dpd_getd2 // a,b: dec128
444- __bid_getd2 // a,b: dec128
445
446- __dpd_ltsd2 // a,b: dec32, a!=+-NaN and b!=+-NaN and a<b -> <0, else -> >=0
447- __bid_ltsd2 // a,b: dec32
448- __dpd_ltdd2 // a,b: dec64
449- __bid_ltdd2 // a,b: dec64
450- __dpd_lttd2 // a,b: dec128
451- __bid_lttd2 // a,b: dec128
452
453- __dpd_lesd2 // a,b: dec32, a!=+-NaN and b!=+-NaN and a<=b -> <=0, else -> >=0
454- __bid_lesd2 // a,b: dec32
455- __dpd_ledd2 // a,b: dec64
456- __bid_ledd2 // a,b: dec64
457- __dpd_letd2 // a,b: dec128
458- __bid_letd2 // a,b: dec128
459
460- __dpd_gtsd2 // a,b: dec32, a!=+-NaN and b!=+-NaN and a>b -> >0, else -> <=0
461- __bid_gtsd2 // a,b: dec32
462- __dpd_gtdd2 // a,b: dec64
463- __bid_gtdd2 // a,b: dec64
464- __dpd_gttd2 // a,b: dec128
465- __bid_gttd2 // a,b: dec128
466
467#### Decimal float Arithmetic
468
469These numbers include options with routines for +-0 and +-Nan.
470
471- __dpd_addsd3 // a,b: dec32 -> dec32, a + b
472- __bid_addsd3 // a,b: dec32 -> dec32
473- __dpd_adddd3 // a,b: dec64 -> dec64
474- __bid_adddd3 // a,b: dec64 -> dec64
475- __dpd_addtd3 // a,b: dec128-> dec128
476- __bid_addtd3 // a,b: dec128-> dec128
477- __dpd_subsd3 // a,b: dec32, a - b
478- __bid_subsd3 // a,b: dec32 -> dec32
479- __dpd_subdd3 // a,b: dec64 ..
480- __bid_subdd3 // a,b: dec64
481- __dpd_subtd3 // a,b: dec128
482- __bid_subtd3 // a,b: dec128
483- __dpd_mulsd3 // a,b: dec32, a * b
484- __bid_mulsd3 // a,b: dec32 -> dec32
485- __dpd_muldd3 // a,b: dec64 ..
486- __bid_muldd3 // a,b: dec64
487- __dpd_multd3 // a,b: dec128
488- __bid_multd3 // a,b: dec128
489- __dpd_divsd3 // a,b: dec32, a / b
490- __bid_divsd3 // a,b: dec32 -> dec32
491- __dpd_divdd3 // a,b: dec64 ..
492- __bid_divdd3 // a,b: dec64
493- __dpd_divtd3 // a,b: dec128
494- __bid_divtd3 // a,b: dec128
495- __dpd_negsd2 // a,b: dec32, -a
496- __bid_negsd2 // a,b: dec32 -> dec32
497- __dpd_negdd2 // a,b: dec64 ..
498- __bid_negdd2 // a,b: dec64
499- __dpd_negtd2 // a,b: dec128
500- __bid_negtd2 // a,b: dec128
501
502## Fixed-point fractional library routines
503
504TODO
505
506Too unclear for work items:
507- Miscellaneous routines => unclear, if supported (cache control and stack functions)
508- Zig-specific language runtime features, for example "Arbitrary length integer library routines"