| author | |
| committer | |
| log | 01ad6c0b020193a6c5c82e13296a12e847f78d05 |
| tree | aaa1c6c428a0e0578efa1dce73c336cd682a4734 |
| parent | 5518a0aff2ab023e9021b74a0a14eb9fcfc094cc |
Previous commit made fmal depend on __extendxftf2 and __trunctfxf2 but
we don't have implementations of those yet.5 files changed, 32 insertions(+), 0 deletions(-)
lib/std/special/c_stage1.zig+4| ... | ... | @@ -5,6 +5,7 @@ const isNan = std.math.isNan; |
| 5 | 5 | const native_arch = builtin.cpu.arch; |
| 6 | 6 | const native_abi = builtin.abi; |
| 7 | 7 | const native_os = builtin.os.tag; |
| 8 | const long_double_is_f128 = builtin.target.longDoubleIsF128(); | |
| 8 | 9 | |
| 9 | 10 | const is_wasm = switch (native_arch) { |
| 10 | 11 | .wasm32, .wasm64 => true, |
| ... | ... | @@ -657,6 +658,9 @@ export fn ceil(x: f64) f64 { |
| 657 | 658 | } |
| 658 | 659 | |
| 659 | 660 | export fn fmal(a: c_longdouble, b: c_longdouble, c: c_longdouble) c_longdouble { |
| 661 | if (!long_double_is_f128) { | |
| 662 | @panic("TODO implement this"); | |
| 663 | } | |
| 660 | 664 | return math.fma(c_longdouble, a, b, c); |
| 661 | 665 | } |
| 662 | 666 |
lib/std/special/compiler_rt.zig+11| ... | ... | @@ -18,6 +18,8 @@ const strong_linkage = if (is_test) |
| 18 | 18 | else |
| 19 | 19 | std.builtin.GlobalLinkage.Strong; |
| 20 | 20 | |
| 21 | const long_double_is_f128 = builtin.target.longDoubleIsF128(); | |
| 22 | ||
| 21 | 23 | comptime { |
| 22 | 24 | const __extenddftf2 = @import("compiler_rt/extendXfYf2.zig").__extenddftf2; |
| 23 | 25 | @export(__extenddftf2, .{ .name = "__extenddftf2", .linkage = linkage }); |
| ... | ... | @@ -75,6 +77,15 @@ comptime { |
| 75 | 77 | } |
| 76 | 78 | |
| 77 | 79 | if (!builtin.zig_is_stage2) { |
| 80 | if (!long_double_is_f128) { | |
| 81 | // TODO implement these | |
| 82 | //const __extendxftf2 = @import("compiler_rt/extendXfYf2.zig").__extendxftf2; | |
| 83 | //@export(__extendxftf2, .{ .name = "__extendxftf2", .linkage = linkage }); | |
| 84 | ||
| 85 | //const __trunctfxf2 = @import("compiler_rt/truncXfYf2.zig").__trunctfxf2; | |
| 86 | //@export(__trunctfxf2, .{ .name = "__trunctfxf2", .linkage = linkage }); | |
| 87 | } | |
| 88 | ||
| 78 | 89 | switch (arch) { |
| 79 | 90 | .i386, |
| 80 | 91 | .x86_64, |
lib/std/special/compiler_rt/extendXfYf2.zig+5| ... | ... | @@ -22,6 +22,11 @@ pub fn __extendhftf2(a: u16) callconv(.C) f128 { |
| 22 | 22 | return extendXfYf2(f128, f16, a); |
| 23 | 23 | } |
| 24 | 24 | |
| 25 | pub fn __extendxftf2(a: c_longdouble) callconv(.C) f128 { | |
| 26 | _ = a; | |
| 27 | @panic("TODO implement"); | |
| 28 | } | |
| 29 | ||
| 25 | 30 | pub fn __aeabi_h2f(arg: u16) callconv(.AAPCS) f32 { |
| 26 | 31 | @setRuntimeSafety(false); |
| 27 | 32 | return @call(.{ .modifier = .always_inline }, __extendhfsf2, .{arg}); |
lib/std/special/compiler_rt/truncXfYf2.zig+5| ... | ... | @@ -20,6 +20,11 @@ pub fn __trunctfdf2(a: f128) callconv(.C) f64 { |
| 20 | 20 | return @call(.{ .modifier = .always_inline }, truncXfYf2, .{ f64, f128, a }); |
| 21 | 21 | } |
| 22 | 22 | |
| 23 | pub fn __trunctfxf2(a: f128) callconv(.C) c_longdouble { | |
| 24 | _ = a; | |
| 25 | @panic("TODO implement"); | |
| 26 | } | |
| 27 | ||
| 23 | 28 | pub fn __truncdfsf2(a: f64) callconv(.C) f32 { |
| 24 | 29 | return @call(.{ .modifier = .always_inline }, truncXfYf2, .{ f32, f64, a }); |
| 25 | 30 | } |
lib/std/target.zig+7| ... | ... | @@ -1712,6 +1712,13 @@ pub const Target = struct { |
| 1712 | 1712 | else => ".X", |
| 1713 | 1713 | }; |
| 1714 | 1714 | } |
| 1715 | ||
| 1716 | pub inline fn longDoubleIsF128(target: Target) bool { | |
| 1717 | return switch (target.cpu.arch) { | |
| 1718 | .riscv64, .aarch64, .aarch64_be, .aarch64_32, .s390x, .mips64, .mips64el => true, | |
| 1719 | else => false, | |
| 1720 | }; | |
| 1721 | } | |
| 1715 | 1722 | }; |
| 1716 | 1723 | |
| 1717 | 1724 | test { |