diff options
| author | Cody Tapscott <topolarity@tapscott.me> | 2022-04-08 18:54:53 -0700 |
|---|---|---|
| committer | Cody Tapscott <topolarity@tapscott.me> | 2022-04-12 10:25:26 -0700 |
| commit | b5d5685a4e3a536999d3e69ce92cc786f052d4ec (patch) | |
| tree | 22a2a956619df95d0165e62c7a53dbd466b2a841 /CMakeLists.txt | |
| parent | 17631cb2d30bf2d7b10401cf8f784a599bade5c5 (diff) | |
| download | zig-b5d5685a4e3a536999d3e69ce92cc786f052d4ec.tar.gz zig-b5d5685a4e3a536999d3e69ce92cc786f052d4ec.zip | |
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 |
Diffstat (limited to 'CMakeLists.txt')
| -rw-r--r-- | CMakeLists.txt | 37 |
1 files changed, 2 insertions, 35 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 22e17d84c6..81b96d67ab 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -493,41 +493,8 @@ set(ZIG_STAGE2_SOURCES "${CMAKE_SOURCE_DIR}/lib/std/special/compiler_rt/divtf3.zig" "${CMAKE_SOURCE_DIR}/lib/std/special/compiler_rt/divti3.zig" "${CMAKE_SOURCE_DIR}/lib/std/special/compiler_rt/extendXfYf2.zig" - "${CMAKE_SOURCE_DIR}/lib/std/special/compiler_rt/fixdfdi.zig" - "${CMAKE_SOURCE_DIR}/lib/std/special/compiler_rt/fixdfsi.zig" - "${CMAKE_SOURCE_DIR}/lib/std/special/compiler_rt/fixdfti.zig" - "${CMAKE_SOURCE_DIR}/lib/std/special/compiler_rt/fixint.zig" - "${CMAKE_SOURCE_DIR}/lib/std/special/compiler_rt/fixsfdi.zig" - "${CMAKE_SOURCE_DIR}/lib/std/special/compiler_rt/fixsfsi.zig" - "${CMAKE_SOURCE_DIR}/lib/std/special/compiler_rt/fixsfti.zig" - "${CMAKE_SOURCE_DIR}/lib/std/special/compiler_rt/fixtfdi.zig" - "${CMAKE_SOURCE_DIR}/lib/std/special/compiler_rt/fixtfsi.zig" - "${CMAKE_SOURCE_DIR}/lib/std/special/compiler_rt/fixtfti.zig" - "${CMAKE_SOURCE_DIR}/lib/std/special/compiler_rt/fixuint.zig" - "${CMAKE_SOURCE_DIR}/lib/std/special/compiler_rt/fixunsdfdi.zig" - "${CMAKE_SOURCE_DIR}/lib/std/special/compiler_rt/fixunsdfsi.zig" - "${CMAKE_SOURCE_DIR}/lib/std/special/compiler_rt/fixunsdfti.zig" - "${CMAKE_SOURCE_DIR}/lib/std/special/compiler_rt/fixunssfdi.zig" - "${CMAKE_SOURCE_DIR}/lib/std/special/compiler_rt/fixunssfsi.zig" - "${CMAKE_SOURCE_DIR}/lib/std/special/compiler_rt/fixunssfti.zig" - "${CMAKE_SOURCE_DIR}/lib/std/special/compiler_rt/fixunstfdi.zig" - "${CMAKE_SOURCE_DIR}/lib/std/special/compiler_rt/fixunstfsi.zig" - "${CMAKE_SOURCE_DIR}/lib/std/special/compiler_rt/fixunstfti.zig" - "${CMAKE_SOURCE_DIR}/lib/std/special/compiler_rt/floatXisf.zig" - "${CMAKE_SOURCE_DIR}/lib/std/special/compiler_rt/floatdidf.zig" - "${CMAKE_SOURCE_DIR}/lib/std/special/compiler_rt/floatditf.zig" - "${CMAKE_SOURCE_DIR}/lib/std/special/compiler_rt/floatsiXf.zig" - "${CMAKE_SOURCE_DIR}/lib/std/special/compiler_rt/floattidf.zig" - "${CMAKE_SOURCE_DIR}/lib/std/special/compiler_rt/floattitf.zig" - "${CMAKE_SOURCE_DIR}/lib/std/special/compiler_rt/floatundidf.zig" - "${CMAKE_SOURCE_DIR}/lib/std/special/compiler_rt/floatundisf.zig" - "${CMAKE_SOURCE_DIR}/lib/std/special/compiler_rt/floatunditf.zig" - "${CMAKE_SOURCE_DIR}/lib/std/special/compiler_rt/floatunsidf.zig" - "${CMAKE_SOURCE_DIR}/lib/std/special/compiler_rt/floatunsisf.zig" - "${CMAKE_SOURCE_DIR}/lib/std/special/compiler_rt/floatunsitf.zig" - "${CMAKE_SOURCE_DIR}/lib/std/special/compiler_rt/floatuntidf.zig" - "${CMAKE_SOURCE_DIR}/lib/std/special/compiler_rt/floatuntisf.zig" - "${CMAKE_SOURCE_DIR}/lib/std/special/compiler_rt/floatuntitf.zig" + "${CMAKE_SOURCE_DIR}/lib/std/special/compiler_rt/fixXfYi.zig" + "${CMAKE_SOURCE_DIR}/lib/std/special/compiler_rt/floatXiYf.zig" "${CMAKE_SOURCE_DIR}/lib/std/special/compiler_rt/int.zig" "${CMAKE_SOURCE_DIR}/lib/std/special/compiler_rt/modti3.zig" "${CMAKE_SOURCE_DIR}/lib/std/special/compiler_rt/mulXf3.zig" |
