| author | |
| committer | |
| log | 2dce137d926150d34ff7a3650da48c211e34771a |
| tree | c8a55f9e5b69bdd1cc9b94c640b456a8939406e2 |
| parent | 2be066d057946eae592307f8f16679626b85b31d |
Add AEABI builtin __aeabi_f2d2 files changed, 13 insertions(+), 4 deletions(-)
std/special/compiler_rt.zig+3| ... | ... | @@ -92,6 +92,8 @@ comptime { |
| 92 | 92 | |
| 93 | 93 | @export("__truncdfsf2", @import("compiler_rt/truncXfYf2.zig").__truncdfsf2, linkage); |
| 94 | 94 | |
| 95 | @export("__extendsfdf2", @import("compiler_rt/extendXfYf2.zig").__extendsfdf2, linkage); | |
| 96 | ||
| 95 | 97 | @export("__fixunssfsi", @import("compiler_rt/fixunssfsi.zig").__fixunssfsi, linkage); |
| 96 | 98 | @export("__fixunssfdi", @import("compiler_rt/fixunssfdi.zig").__fixunssfdi, linkage); |
| 97 | 99 | @export("__fixunssfti", @import("compiler_rt/fixunssfti.zig").__fixunssfti, linkage); |
| ... | ... | @@ -161,6 +163,7 @@ comptime { |
| 161 | 163 | @export("__aeabi_memcmp4", __aeabi_memcmp, linkage); |
| 162 | 164 | @export("__aeabi_memcmp8", __aeabi_memcmp, linkage); |
| 163 | 165 | |
| 166 | @export("__aeabi_f2d", @import("compiler_rt/extendXfYf2.zig").__extendsfdf2, linkage); | |
| 164 | 167 | @export("__aeabi_i2d", @import("compiler_rt/floatsiXf.zig").__floatsidf, linkage); |
| 165 | 168 | @export("__aeabi_l2d", @import("compiler_rt/floatdidf.zig").__floatdidf, linkage); |
| 166 | 169 | @export("__aeabi_ui2d", @import("compiler_rt/floatunsidf.zig").__floatunsidf, linkage); |
std/special/compiler_rt/extendXfYf2.zig+10-4| ... | ... | @@ -2,21 +2,27 @@ const std = @import("std"); |
| 2 | 2 | const builtin = @import("builtin"); |
| 3 | 3 | const is_test = builtin.is_test; |
| 4 | 4 | |
| 5 | pub extern fn __extendsfdf2(a: f32) f64 { | |
| 6 | return @inlineCall(extendXfYf2, f64, f32, @bitCast(u32, a)); | |
| 7 | } | |
| 8 | ||
| 5 | 9 | pub extern fn __extenddftf2(a: f64) f128 { |
| 6 | return extendXfYf2(f128, f64, @bitCast(u64, a)); | |
| 10 | return @inlineCall(extendXfYf2, f128, f64, @bitCast(u64, a)); | |
| 7 | 11 | } |
| 8 | 12 | |
| 9 | 13 | pub extern fn __extendsftf2(a: f32) f128 { |
| 10 | return extendXfYf2(f128, f32, @bitCast(u32, a)); | |
| 14 | return @inlineCall(extendXfYf2, f128, f32, @bitCast(u32, a)); | |
| 11 | 15 | } |
| 12 | 16 | |
| 13 | 17 | pub extern fn __extendhfsf2(a: u16) f32 { |
| 14 | return extendXfYf2(f32, f16, a); | |
| 18 | return @inlineCall(extendXfYf2, f32, f16, a); | |
| 15 | 19 | } |
| 16 | 20 | |
| 17 | 21 | const CHAR_BIT = 8; |
| 18 | 22 | |
| 19 | inline fn extendXfYf2(comptime dst_t: type, comptime src_t: type, a: @IntType(false, @typeInfo(src_t).Float.bits)) dst_t { | |
| 23 | fn extendXfYf2(comptime dst_t: type, comptime src_t: type, a: @IntType(false, @typeInfo(src_t).Float.bits)) dst_t { | |
| 24 | @setRuntimeSafety(builtin.is_test); | |
| 25 | ||
| 20 | 26 | const src_rep_t = @IntType(false, @typeInfo(src_t).Float.bits); |
| 21 | 27 | const dst_rep_t = @IntType(false, @typeInfo(dst_t).Float.bits); |
| 22 | 28 | const srcSigBits = std.math.floatMantissaBits(src_t); |