0
Fork 0
mirror of https://codeberg.org/ziglang/zig synced 2026-11-18 07:05:05 +00:00
zig/lib/std/special
Cody Tapscott b5d5685a4e compiler_rt: Implement floatXiYf/fixXfYi, incl f80
This change:
 - Adds  generic implementation of the float -> integer conversion
   functions floatXiYf, including support for f80
 - Updates the existing implementation of integer -> float conversion
   fixXiYf to support f16 and f80
 - Fixes the handling of the explicit integer bit in `__trunctfxf2`
 - Combines the test cases for fixXfYi/floatXiYf into a single file
 - Renames `fmodl` to `fmodq`, since it operates on 128-bit floats

The new implementation for floatXiYf has been benchmarked, and generally
provides equal or better performance versus the current implementations:

Throughput (MiB/s) - Before
     |    u32   |    i32   |    u64   |    i64   |   u128   |   i128   |
-----|----------|----------|----------|----------|----------|----------|
 f16 |     none |     none |     none |     none |     none |     none |
 f32 |  2231.67 |  2001.19 |  1745.66 |  1405.77 |  2173.99 |  1874.63 |
 f64 |  1407.17 |  1055.83 |  2911.68 |  2437.21 |  1676.05 |  1476.67 |
 f80 |     none |     none |     none |     none |     none |     none |
f128 |   327.56 |   321.25 |   645.92 |   654.52 |  1153.56 |  1096.27 |

Throughput (MiB/s) - After
     |    u32   |    i32   |    u64   |    i64   |   u128   |   i128   |
-----|----------|----------|----------|----------|----------|----------|
 f16 |  1407.61 |  1637.25 |  3555.03 |  2594.56 |  3680.60 |  3063.34 |
 f32 |  2101.36 |  2122.62 |  3225.46 |  3123.86 |  2860.05 |  1985.21 |
 f64 |  1395.57 |  1314.87 |  2409.24 |  2196.30 |  2384.95 |  1908.15 |
 f80 |   475.53 |   457.92 |   884.50 |   812.12 |  1475.27 |  1382.16 |
f128 |   359.60 |   350.91 |   723.08 |   706.80 |  1296.42 |  1198.87 |
History 2022-04-12 10:25:26 -07:00
..
compiler_rt compiler_rt: Implement floatXiYf/fixXfYi, incl f80 2022-04-12 10:25:26 -07:00
docs std docs: @This() in generic types 2021-04-12 09:31:45 +02:00
init-exe init-exe template: build.zig: setTarget on the tests 2021-12-18 17:29:46 -07:00
init-lib Make pointer variables in ( init-lib | init-exe )/build.zig const. (#10057) 2021-10-29 13:37:17 -04:00
build_runner.zig CLI: remove remainders of --verbose-ast and --verbose-tokenize 2022-02-06 01:57:04 -05:00
c.zig freestanding libc: remove ceil functions 2022-03-20 13:29:48 -07:00
compiler_rt.zig compiler_rt: Implement floatXiYf/fixXfYi, incl f80 2022-04-12 10:25:26 -07:00
ssp.zig migrate from std.Target.current to @import("builtin").target 2021-10-04 23:48:55 -07:00
test_runner.zig stage2: improve @typeName 2022-03-18 00:12:22 -07:00