From e81b505960b106a042e4cb890971ba365a5ef180 Mon Sep 17 00:00:00 2001 From: LemonBoy Date: Tue, 7 Jan 2020 17:44:20 +0100 Subject: [PATCH] Use the correct calling convention for AEABI intrinsics --- lib/std/fmt.zig | 24 ------- lib/std/fmt/parse_float.zig | 4 -- lib/std/math/big/rational.zig | 8 --- lib/std/math/complex/atan.zig | 4 -- lib/std/math/complex/cosh.zig | 4 -- lib/std/math/complex/exp.zig | 4 -- lib/std/math/complex/sinh.zig | 4 -- lib/std/math/complex/tanh.zig | 4 -- lib/std/math/cos.zig | 4 -- lib/std/math/pow.zig | 12 ---- lib/std/math/sin.zig | 20 ------ lib/std/math/tan.zig | 4 -- lib/std/special/compiler_rt.zig | 64 +++++++++---------- lib/std/special/compiler_rt/addXf3.zig | 20 ++++++ .../special/compiler_rt/arm/aeabi_dcmp.zig | 13 ---- .../special/compiler_rt/arm/aeabi_fcmp.zig | 13 ---- lib/std/special/compiler_rt/comparedf2.zig | 5 ++ lib/std/special/compiler_rt/comparesf2.zig | 5 ++ lib/std/special/compiler_rt/divdf3.zig | 5 ++ lib/std/special/compiler_rt/divsf3.zig | 5 ++ lib/std/special/compiler_rt/extendXfYf2.zig | 10 +++ lib/std/special/compiler_rt/fixdfdi.zig | 5 ++ lib/std/special/compiler_rt/fixdfsi.zig | 5 ++ lib/std/special/compiler_rt/fixsfdi.zig | 5 ++ lib/std/special/compiler_rt/fixsfsi.zig | 5 ++ lib/std/special/compiler_rt/fixunsdfdi.zig | 5 ++ lib/std/special/compiler_rt/fixunsdfsi.zig | 5 ++ lib/std/special/compiler_rt/fixunssfdi.zig | 5 ++ lib/std/special/compiler_rt/fixunssfsi.zig | 5 ++ lib/std/special/compiler_rt/floatdidf.zig | 5 ++ lib/std/special/compiler_rt/floatsiXf.zig | 10 +++ lib/std/special/compiler_rt/floatundidf.zig | 5 ++ lib/std/special/compiler_rt/floatundisf.zig | 7 +- lib/std/special/compiler_rt/floatunsidf.zig | 5 ++ lib/std/special/compiler_rt/floatunsisf.zig | 7 +- lib/std/special/compiler_rt/mulXf3.zig | 10 +++ lib/std/special/compiler_rt/negXf2.zig | 10 +++ lib/std/special/compiler_rt/truncXfYf2.zig | 15 +++++ 38 files changed, 194 insertions(+), 156 deletions(-) diff --git a/lib/std/fmt.zig b/lib/std/fmt.zig index 1d64468eb847ee8b1b87b01da2e0357bc3c0bd8c..57fb3a4074108a2ec29f20cf4f4abd3b1945d414 100644 --- a/lib/std/fmt.zig +++ b/lib/std/fmt.zig @@ -1292,10 +1292,6 @@ test "cstr" { } test "filesize" { - if (builtin.os == .linux and builtin.arch == .arm and builtin.abi == .musleabihf) { - // TODO https://github.com/ziglang/zig/issues/3289 - return error.SkipZigTest; - } try testFmt("file size: 63MiB\n", "file size: {Bi}\n", .{@as(usize, 63 * 1024 * 1024)}); try testFmt("file size: 66.06MB\n", "file size: {B:.2}\n", .{@as(usize, 63 * 1024 * 1024)}); } @@ -1330,10 +1326,6 @@ test "enum" { } test "float.scientific" { - if (builtin.os == .linux and builtin.arch == .arm and builtin.abi == .musleabihf) { - // TODO https://github.com/ziglang/zig/issues/3289 - return error.SkipZigTest; - } try testFmt("f32: 1.34000003e+00", "f32: {e}", .{@as(f32, 1.34)}); try testFmt("f32: 1.23400001e+01", "f32: {e}", .{@as(f32, 12.34)}); try testFmt("f64: -1.234e+11", "f64: {e}", .{@as(f64, -12.34e10)}); @@ -1341,10 +1333,6 @@ test "float.scientific" { } test "float.scientific.precision" { - if (builtin.os == .linux and builtin.arch == .arm and builtin.abi == .musleabihf) { - // TODO https://github.com/ziglang/zig/issues/3289 - return error.SkipZigTest; - } try testFmt("f64: 1.40971e-42", "f64: {e:.5}", .{@as(f64, 1.409706e-42)}); try testFmt("f64: 1.00000e-09", "f64: {e:.5}", .{@as(f64, @bitCast(f32, @as(u32, 814313563)))}); try testFmt("f64: 7.81250e-03", "f64: {e:.5}", .{@as(f64, @bitCast(f32, @as(u32, 1006632960)))}); @@ -1354,10 +1342,6 @@ test "float.scientific.precision" { } test "float.special" { - if (builtin.os == .linux and builtin.arch == .arm and builtin.abi == .musleabihf) { - // TODO https://github.com/ziglang/zig/issues/3289 - return error.SkipZigTest; - } try testFmt("f64: nan", "f64: {}", .{math.nan_f64}); // negative nan is not defined by IEE 754, // and ARM thus normalizes it to positive nan @@ -1369,10 +1353,6 @@ test "float.special" { } test "float.decimal" { - if (builtin.os == .linux and builtin.arch == .arm and builtin.abi == .musleabihf) { - // TODO https://github.com/ziglang/zig/issues/3289 - return error.SkipZigTest; - } try testFmt("f64: 152314000000000000000000000000", "f64: {d}", .{@as(f64, 1.52314e+29)}); try testFmt("f32: 1.1", "f32: {d:.1}", .{@as(f32, 1.1234)}); try testFmt("f32: 1234.57", "f32: {d:.2}", .{@as(f32, 1234.567)}); @@ -1391,10 +1371,6 @@ test "float.decimal" { } test "float.libc.sanity" { - if (builtin.os == .linux and builtin.arch == .arm and builtin.abi == .musleabihf) { - // TODO https://github.com/ziglang/zig/issues/3289 - return error.SkipZigTest; - } try testFmt("f64: 0.00001", "f64: {d:.5}", .{@as(f64, @bitCast(f32, @as(u32, 916964781)))}); try testFmt("f64: 0.00001", "f64: {d:.5}", .{@as(f64, @bitCast(f32, @as(u32, 925353389)))}); try testFmt("f64: 0.10000", "f64: {d:.5}", .{@as(f64, @bitCast(f32, @as(u32, 1036831278)))}); diff --git a/lib/std/fmt/parse_float.zig b/lib/std/fmt/parse_float.zig index 78ce0b7d0abbf63b290195dfc9157fd0adae2cf9..2c480852ac5d79f369f61a7bc85000856b20c887 100644 --- a/lib/std/fmt/parse_float.zig +++ b/lib/std/fmt/parse_float.zig @@ -382,10 +382,6 @@ pub fn parseFloat(comptime T: type, s: []const u8) !T { } test "fmt.parseFloat" { - if (@import("builtin").arch == .arm) { - // TODO https://github.com/ziglang/zig/issues/3289 - return error.SkipZigTest; - } const testing = std.testing; const expect = testing.expect; const expectEqual = testing.expectEqual; diff --git a/lib/std/math/big/rational.zig b/lib/std/math/big/rational.zig index 6a51931e3c98fbefa97e34d6ffa55c3cc7a8fd1b..27a3b7300fa055e5ca3f6fe0e22491db67c60478 100644 --- a/lib/std/math/big/rational.zig +++ b/lib/std/math/big/rational.zig @@ -742,10 +742,6 @@ test "big.rational setFloatString" { } test "big.rational toFloat" { - if (builtin.os == .linux and builtin.arch == .arm and builtin.abi == .musleabihf) { - // TODO https://github.com/ziglang/zig/issues/3289 - return error.SkipZigTest; - } var a = try Rational.init(al); // = 3.14159297943115234375 @@ -758,10 +754,6 @@ test "big.rational toFloat" { } test "big.rational set/to Float round-trip" { - if (builtin.os == .linux and builtin.arch == .arm and builtin.abi == .musleabihf) { - // TODO https://github.com/ziglang/zig/issues/3289 - return error.SkipZigTest; - } var a = try Rational.init(al); var prng = std.rand.DefaultPrng.init(0x5EED); var i: usize = 0; diff --git a/lib/std/math/complex/atan.zig b/lib/std/math/complex/atan.zig index d5e3dcac73938fd253855890ec61d52050e0c2d2..5ba6f7b0d2c2a4be3e632da65202af44c12d2479 100644 --- a/lib/std/math/complex/atan.zig +++ b/lib/std/math/complex/atan.zig @@ -130,10 +130,6 @@ test "complex.catan32" { } test "complex.catan64" { - if (builtin.os == .linux and builtin.arch == .arm and builtin.abi == .musleabihf) { - // TODO https://github.com/ziglang/zig/issues/3289 - return error.SkipZigTest; - } const a = Complex(f64).new(5, 3); const c = atan(a); diff --git a/lib/std/math/complex/cosh.zig b/lib/std/math/complex/cosh.zig index ce2c78b455a8470a56ad68fb476f747684505eb9..a9ac8936024c0b55fd3bee0ae746804dd0395202 100644 --- a/lib/std/math/complex/cosh.zig +++ b/lib/std/math/complex/cosh.zig @@ -165,10 +165,6 @@ test "complex.ccosh32" { } test "complex.ccosh64" { - if (builtin.os == .linux and builtin.arch == .arm and builtin.abi == .musleabihf) { - // TODO https://github.com/ziglang/zig/issues/3289 - return error.SkipZigTest; - } const a = Complex(f64).new(5, 3); const c = cosh(a); diff --git a/lib/std/math/complex/exp.zig b/lib/std/math/complex/exp.zig index b39875c770865c5bfccb09eb63a3bd61e9976bea..9f9e3db80762e5260381946c9794573ebe04963c 100644 --- a/lib/std/math/complex/exp.zig +++ b/lib/std/math/complex/exp.zig @@ -131,10 +131,6 @@ test "complex.cexp32" { } test "complex.cexp64" { - if (builtin.os == .linux and builtin.arch == .arm and builtin.abi == .musleabihf) { - // TODO https://github.com/ziglang/zig/issues/3289 - return error.SkipZigTest; - } const a = Complex(f64).new(5, 3); const c = exp(a); diff --git a/lib/std/math/complex/sinh.zig b/lib/std/math/complex/sinh.zig index d633bcc37e8e34fc34928011fa9228032a1242c6..7dd880c71c583e4ec12be3f2dfde70560c2ec810 100644 --- a/lib/std/math/complex/sinh.zig +++ b/lib/std/math/complex/sinh.zig @@ -164,10 +164,6 @@ test "complex.csinh32" { } test "complex.csinh64" { - if (builtin.os == .linux and builtin.arch == .arm and builtin.abi == .musleabihf) { - // TODO https://github.com/ziglang/zig/issues/3289 - return error.SkipZigTest; - } const a = Complex(f64).new(5, 3); const c = sinh(a); diff --git a/lib/std/math/complex/tanh.zig b/lib/std/math/complex/tanh.zig index 3249a4309d51f2063526ec112952ed2b7bb12c60..afd2e6aee44640edbd16dd2c7feba56bbd347e95 100644 --- a/lib/std/math/complex/tanh.zig +++ b/lib/std/math/complex/tanh.zig @@ -113,10 +113,6 @@ test "complex.ctanh32" { } test "complex.ctanh64" { - if (builtin.os == .linux and builtin.arch == .arm and builtin.abi == .musleabihf) { - // TODO https://github.com/ziglang/zig/issues/3289 - return error.SkipZigTest; - } const a = Complex(f64).new(5, 3); const c = tanh(a); diff --git a/lib/std/math/cos.zig b/lib/std/math/cos.zig index 66a1cc8509ff9186b3c7a6969147e16bb95a69c2..248243e28867a13d233054b657cdf8f8bb9174d7 100644 --- a/lib/std/math/cos.zig +++ b/lib/std/math/cos.zig @@ -100,10 +100,6 @@ test "math.cos32" { } test "math.cos64" { - if (builtin.os == .linux and builtin.arch == .arm and builtin.abi == .musleabihf) { - // TODO https://github.com/ziglang/zig/issues/3289 - return error.SkipZigTest; - } const epsilon = 0.000001; expect(math.approxEq(f64, cos_(f64, 0.0), 1.0, epsilon)); diff --git a/lib/std/math/pow.zig b/lib/std/math/pow.zig index c3a77921376789f3f5fec24546c54f550cdd9714..18c9f80634eff38e7c7ae284c3e17e5c36314614 100644 --- a/lib/std/math/pow.zig +++ b/lib/std/math/pow.zig @@ -184,10 +184,6 @@ fn isOddInteger(x: f64) bool { } test "math.pow" { - if (builtin.os == .linux and builtin.arch == .arm and builtin.abi == .musleabihf) { - // TODO https://github.com/ziglang/zig/issues/3289 - return error.SkipZigTest; - } const epsilon = 0.000001; expect(math.approxEq(f32, pow(f32, 0.0, 3.3), 0.0, epsilon)); @@ -206,10 +202,6 @@ test "math.pow" { } test "math.pow.special" { - if (builtin.os == .linux and builtin.arch == .arm and builtin.abi == .musleabihf) { - // TODO https://github.com/ziglang/zig/issues/3289 - return error.SkipZigTest; - } const epsilon = 0.000001; expect(pow(f32, 4, 0.0) == 1.0); @@ -252,10 +244,6 @@ test "math.pow.special" { } test "math.pow.overflow" { - if (builtin.os == .linux and builtin.arch == .arm and builtin.abi == .musleabihf) { - // TODO https://github.com/ziglang/zig/issues/3289 - return error.SkipZigTest; - } expect(math.isPositiveInf(pow(f64, 2, 1 << 32))); expect(pow(f64, 2, -(1 << 32)) == 0); expect(math.isNegativeInf(pow(f64, -2, (1 << 32) + 1))); diff --git a/lib/std/math/sin.zig b/lib/std/math/sin.zig index 5b92fd454ba298f85a1a8ade8d6315eb8e03ab9b..00225449bb22ac7e9b717f91b6ff94ea1edae8b2 100644 --- a/lib/std/math/sin.zig +++ b/lib/std/math/sin.zig @@ -84,20 +84,12 @@ fn sin_(comptime T: type, x_: T) T { } test "math.sin" { - if (builtin.os == .linux and builtin.arch == .arm and builtin.abi == .musleabihf) { - // TODO https://github.com/ziglang/zig/issues/3289 - return error.SkipZigTest; - } expect(sin(@as(f32, 0.0)) == sin_(f32, 0.0)); expect(sin(@as(f64, 0.0)) == sin_(f64, 0.0)); expect(comptime (math.sin(@as(f64, 2))) == math.sin(@as(f64, 2))); } test "math.sin32" { - if (builtin.os == .linux and builtin.arch == .arm and builtin.abi == .musleabihf) { - // TODO https://github.com/ziglang/zig/issues/3289 - return error.SkipZigTest; - } const epsilon = 0.000001; expect(math.approxEq(f32, sin_(f32, 0.0), 0.0, epsilon)); @@ -110,10 +102,6 @@ test "math.sin32" { } test "math.sin64" { - if (builtin.os == .linux and builtin.arch == .arm and builtin.abi == .musleabihf) { - // TODO https://github.com/ziglang/zig/issues/3289 - return error.SkipZigTest; - } const epsilon = 0.000001; expect(math.approxEq(f64, sin_(f64, 0.0), 0.0, epsilon)); @@ -126,10 +114,6 @@ test "math.sin64" { } test "math.sin32.special" { - if (builtin.os == .linux and builtin.arch == .arm and builtin.abi == .musleabihf) { - // TODO https://github.com/ziglang/zig/issues/3289 - return error.SkipZigTest; - } expect(sin_(f32, 0.0) == 0.0); expect(sin_(f32, -0.0) == -0.0); expect(math.isNan(sin_(f32, math.inf(f32)))); @@ -138,10 +122,6 @@ test "math.sin32.special" { } test "math.sin64.special" { - if (builtin.os == .linux and builtin.arch == .arm and builtin.abi == .musleabihf) { - // TODO https://github.com/ziglang/zig/issues/3289 - return error.SkipZigTest; - } expect(sin_(f64, 0.0) == 0.0); expect(sin_(f64, -0.0) == -0.0); expect(math.isNan(sin_(f64, math.inf(f64)))); diff --git a/lib/std/math/tan.zig b/lib/std/math/tan.zig index 14272a48e298c06ac4908fad6231947d48fff285..01a0314d740339b85ed93a63cdba81db221f86d2 100644 --- a/lib/std/math/tan.zig +++ b/lib/std/math/tan.zig @@ -91,10 +91,6 @@ test "math.tan32" { } test "math.tan64" { - if (builtin.os == .linux and builtin.arch == .arm and builtin.abi == .musleabihf) { - // TODO https://github.com/ziglang/zig/issues/3289 - return error.SkipZigTest; - } const epsilon = 0.000001; expect(math.approxEq(f64, tan_(f64, 0.0), 0.0, epsilon)); diff --git a/lib/std/special/compiler_rt.zig b/lib/std/special/compiler_rt.zig index 7a55300583c0ce96887a4b548abbb616e04b8b82..efa21d6cd751dcbedc9a4b897ec0640a78de247e 100644 --- a/lib/std/special/compiler_rt.zig +++ b/lib/std/special/compiler_rt.zig @@ -181,62 +181,62 @@ comptime { @export("__aeabi_memcmp4", __aeabi_memcmp, linkage); @export("__aeabi_memcmp8", __aeabi_memcmp, linkage); - @export("__aeabi_f2d", @import("compiler_rt/extendXfYf2.zig").__extendsfdf2, linkage); - @export("__aeabi_i2d", @import("compiler_rt/floatsiXf.zig").__floatsidf, linkage); - @export("__aeabi_l2d", @import("compiler_rt/floatdidf.zig").__floatdidf, linkage); - @export("__aeabi_ui2d", @import("compiler_rt/floatunsidf.zig").__floatunsidf, linkage); - @export("__aeabi_ul2d", @import("compiler_rt/floatundidf.zig").__floatundidf, linkage); - @export("__aeabi_ui2f", @import("compiler_rt/floatunsisf.zig").__floatunsisf, linkage); - @export("__aeabi_ul2f", @import("compiler_rt/floatundisf.zig").__floatundisf, linkage); + @export("__aeabi_f2d", @import("compiler_rt/extendXfYf2.zig").__aeabi_f2d, linkage); + @export("__aeabi_i2d", @import("compiler_rt/floatsiXf.zig").__aeabi_i2d, linkage); + @export("__aeabi_l2d", @import("compiler_rt/floatdidf.zig").__aeabi_l2d, linkage); + @export("__aeabi_ui2d", @import("compiler_rt/floatunsidf.zig").__aeabi_ui2d, linkage); + @export("__aeabi_ul2d", @import("compiler_rt/floatundidf.zig").__aeabi_ul2d, linkage); + @export("__aeabi_ui2f", @import("compiler_rt/floatunsisf.zig").__aeabi_ui2f, linkage); + @export("__aeabi_ul2f", @import("compiler_rt/floatundisf.zig").__aeabi_ul2f, linkage); - @export("__aeabi_fneg", @import("compiler_rt/negXf2.zig").__negsf2, linkage); - @export("__aeabi_dneg", @import("compiler_rt/negXf2.zig").__negdf2, linkage); + @export("__aeabi_fneg", @import("compiler_rt/negXf2.zig").__aeabi_fneg, linkage); + @export("__aeabi_dneg", @import("compiler_rt/negXf2.zig").__aeabi_dneg, linkage); - @export("__aeabi_fmul", @import("compiler_rt/mulXf3.zig").__mulsf3, linkage); - @export("__aeabi_dmul", @import("compiler_rt/mulXf3.zig").__muldf3, linkage); + @export("__aeabi_fmul", @import("compiler_rt/mulXf3.zig").__aeabi_fmul, linkage); + @export("__aeabi_dmul", @import("compiler_rt/mulXf3.zig").__aeabi_dmul, linkage); - @export("__aeabi_d2h", @import("compiler_rt/truncXfYf2.zig").__truncdfhf2, linkage); + @export("__aeabi_d2h", @import("compiler_rt/truncXfYf2.zig").__aeabi_d2h, linkage); - @export("__aeabi_f2ulz", @import("compiler_rt/fixunssfdi.zig").__fixunssfdi, linkage); - @export("__aeabi_d2ulz", @import("compiler_rt/fixunsdfdi.zig").__fixunsdfdi, linkage); + @export("__aeabi_f2ulz", @import("compiler_rt/fixunssfdi.zig").__aeabi_f2ulz, linkage); + @export("__aeabi_d2ulz", @import("compiler_rt/fixunsdfdi.zig").__aeabi_d2ulz, linkage); - @export("__aeabi_f2lz", @import("compiler_rt/fixsfdi.zig").__fixsfdi, linkage); - @export("__aeabi_d2lz", @import("compiler_rt/fixdfdi.zig").__fixdfdi, linkage); + @export("__aeabi_f2lz", @import("compiler_rt/fixsfdi.zig").__aeabi_f2lz, linkage); + @export("__aeabi_d2lz", @import("compiler_rt/fixdfdi.zig").__aeabi_d2lz, linkage); - @export("__aeabi_d2uiz", @import("compiler_rt/fixunsdfsi.zig").__fixunsdfsi, linkage); + @export("__aeabi_d2uiz", @import("compiler_rt/fixunsdfsi.zig").__aeabi_d2uiz, linkage); - @export("__aeabi_h2f", @import("compiler_rt/extendXfYf2.zig").__extendhfsf2, linkage); - @export("__aeabi_f2h", @import("compiler_rt/truncXfYf2.zig").__truncsfhf2, linkage); + @export("__aeabi_h2f", @import("compiler_rt/extendXfYf2.zig").__aeabi_h2f, linkage); + @export("__aeabi_f2h", @import("compiler_rt/truncXfYf2.zig").__aeabi_f2h, linkage); - @export("__aeabi_i2f", @import("compiler_rt/floatsiXf.zig").__floatsisf, linkage); - @export("__aeabi_d2f", @import("compiler_rt/truncXfYf2.zig").__truncdfsf2, linkage); + @export("__aeabi_i2f", @import("compiler_rt/floatsiXf.zig").__aeabi_i2f, linkage); + @export("__aeabi_d2f", @import("compiler_rt/truncXfYf2.zig").__aeabi_d2f, linkage); - @export("__aeabi_fadd", @import("compiler_rt/addXf3.zig").__addsf3, linkage); - @export("__aeabi_dadd", @import("compiler_rt/addXf3.zig").__adddf3, linkage); - @export("__aeabi_fsub", @import("compiler_rt/addXf3.zig").__subsf3, linkage); - @export("__aeabi_dsub", @import("compiler_rt/addXf3.zig").__subdf3, linkage); + @export("__aeabi_fadd", @import("compiler_rt/addXf3.zig").__aeabi_fadd, linkage); + @export("__aeabi_dadd", @import("compiler_rt/addXf3.zig").__aeabi_dadd, linkage); + @export("__aeabi_fsub", @import("compiler_rt/addXf3.zig").__aeabi_fsub, linkage); + @export("__aeabi_dsub", @import("compiler_rt/addXf3.zig").__aeabi_dsub, linkage); - @export("__aeabi_f2uiz", @import("compiler_rt/fixunssfsi.zig").__fixunssfsi, linkage); + @export("__aeabi_f2uiz", @import("compiler_rt/fixunssfsi.zig").__aeabi_f2uiz, linkage); - @export("__aeabi_f2iz", @import("compiler_rt/fixsfsi.zig").__fixsfsi, linkage); - @export("__aeabi_d2iz", @import("compiler_rt/fixdfsi.zig").__fixdfsi, linkage); + @export("__aeabi_f2iz", @import("compiler_rt/fixsfsi.zig").__aeabi_f2iz, linkage); + @export("__aeabi_d2iz", @import("compiler_rt/fixdfsi.zig").__aeabi_d2iz, linkage); - @export("__aeabi_fdiv", @import("compiler_rt/divsf3.zig").__divsf3, linkage); - @export("__aeabi_ddiv", @import("compiler_rt/divdf3.zig").__divdf3, linkage); + @export("__aeabi_fdiv", @import("compiler_rt/divsf3.zig").__aeabi_fdiv, linkage); + @export("__aeabi_ddiv", @import("compiler_rt/divdf3.zig").__aeabi_ddiv, linkage); @export("__aeabi_fcmpeq", @import("compiler_rt/arm/aeabi_fcmp.zig").__aeabi_fcmpeq, linkage); @export("__aeabi_fcmplt", @import("compiler_rt/arm/aeabi_fcmp.zig").__aeabi_fcmplt, linkage); @export("__aeabi_fcmple", @import("compiler_rt/arm/aeabi_fcmp.zig").__aeabi_fcmple, linkage); @export("__aeabi_fcmpge", @import("compiler_rt/arm/aeabi_fcmp.zig").__aeabi_fcmpge, linkage); @export("__aeabi_fcmpgt", @import("compiler_rt/arm/aeabi_fcmp.zig").__aeabi_fcmpgt, linkage); - @export("__aeabi_fcmpun", @import("compiler_rt/comparesf2.zig").__unordsf2, linkage); + @export("__aeabi_fcmpun", @import("compiler_rt/comparesf2.zig").__aeabi_fcmpun, linkage); @export("__aeabi_dcmpeq", @import("compiler_rt/arm/aeabi_dcmp.zig").__aeabi_dcmpeq, linkage); @export("__aeabi_dcmplt", @import("compiler_rt/arm/aeabi_dcmp.zig").__aeabi_dcmplt, linkage); @export("__aeabi_dcmple", @import("compiler_rt/arm/aeabi_dcmp.zig").__aeabi_dcmple, linkage); @export("__aeabi_dcmpge", @import("compiler_rt/arm/aeabi_dcmp.zig").__aeabi_dcmpge, linkage); @export("__aeabi_dcmpgt", @import("compiler_rt/arm/aeabi_dcmp.zig").__aeabi_dcmpgt, linkage); - @export("__aeabi_dcmpun", @import("compiler_rt/comparedf2.zig").__unorddf2, linkage); + @export("__aeabi_dcmpun", @import("compiler_rt/comparedf2.zig").__aeabi_dcmpun, linkage); } if (builtin.os == .windows) { // Default stack-probe functions emitted by LLVM diff --git a/lib/std/special/compiler_rt/addXf3.zig b/lib/std/special/compiler_rt/addXf3.zig index ac38e1c8cd50c8c3c0e0f39a61687937061a63d0..4294752baaebfbe9b9629cb607b62e425584530a 100644 --- a/lib/std/special/compiler_rt/addXf3.zig +++ b/lib/std/special/compiler_rt/addXf3.zig @@ -33,6 +33,26 @@ pub fn __subtf3(a: f128, b: f128) callconv(.C) f128 { return addXf3(f128, a, neg_b); } +pub fn __aeabi_fadd(a: f32, b: f32) callconv(.AAPCS) f32 { + @setRuntimeSafety(false); + return @call(.{ .modifier = .always_inline }, __addsf3, .{ a, b }); +} + +pub fn __aeabi_dadd(a: f64, b: f64) callconv(.AAPCS) f64 { + @setRuntimeSafety(false); + return @call(.{ .modifier = .always_inline }, __adddf3, .{ a, b }); +} + +pub fn __aeabi_fsub(a: f32, b: f32) callconv(.AAPCS) f32 { + @setRuntimeSafety(false); + return @call(.{ .modifier = .always_inline }, __subsf3, .{ a, b }); +} + +pub fn __aeabi_dsub(a: f64, b: f64) callconv(.AAPCS) f64 { + @setRuntimeSafety(false); + return @call(.{ .modifier = .always_inline }, __subdf3, .{ a, b }); +} + // TODO: restore inline keyword, see: https://github.com/ziglang/zig/issues/2154 fn normalize(comptime T: type, significand: *@IntType(false, T.bit_count)) i32 { const Z = @IntType(false, T.bit_count); diff --git a/lib/std/special/compiler_rt/arm/aeabi_dcmp.zig b/lib/std/special/compiler_rt/arm/aeabi_dcmp.zig index d75c343fbbf08fe1a27b129bb18757b44861d892..a8ed182901573641d73c87c83478c7d7e934411b 100644 --- a/lib/std/special/compiler_rt/arm/aeabi_dcmp.zig +++ b/lib/std/special/compiler_rt/arm/aeabi_dcmp.zig @@ -2,8 +2,6 @@ // // https://github.com/llvm/llvm-project/commit/d674d96bc56c0f377879d01c9d8dfdaaa7859cdb/compiler-rt/lib/builtins/arm/aeabi_dcmp.S -const compiler_rt_armhf_target = false; // TODO - const ConditionalOperator = enum { Eq, Lt, @@ -42,23 +40,12 @@ pub fn __aeabi_dcmpgt() callconv(.Naked) noreturn { unreachable; } -inline fn convert_dcmp_args_to_df2_args() void { - asm volatile ( - \\ vmov d0, r0, r1 - \\ vmov d1, r2, r3 - ); -} - fn aeabi_dcmp(comptime cond: ConditionalOperator) void { @setRuntimeSafety(false); asm volatile ( \\ push { r4, lr } ); - if (compiler_rt_armhf_target) { - convert_dcmp_args_to_df2_args(); - } - switch (cond) { .Eq => asm volatile ( \\ bl __eqdf2 diff --git a/lib/std/special/compiler_rt/arm/aeabi_fcmp.zig b/lib/std/special/compiler_rt/arm/aeabi_fcmp.zig index bf36e78ad2151b49502188d08de503453a05cfc2..0b4c0f0d41e904fd29efe9cc0af05294f1cdcc56 100644 --- a/lib/std/special/compiler_rt/arm/aeabi_fcmp.zig +++ b/lib/std/special/compiler_rt/arm/aeabi_fcmp.zig @@ -2,8 +2,6 @@ // // https://github.com/llvm/llvm-project/commit/d674d96bc56c0f377879d01c9d8dfdaaa7859cdb/compiler-rt/lib/builtins/arm/aeabi_fcmp.S -const compiler_rt_armhf_target = false; // TODO - const ConditionalOperator = enum { Eq, Lt, @@ -42,23 +40,12 @@ pub fn __aeabi_fcmpgt() callconv(.Naked) noreturn { unreachable; } -inline fn convert_fcmp_args_to_sf2_args() void { - asm volatile ( - \\ vmov s0, r0 - \\ vmov s1, r1 - ); -} - fn aeabi_fcmp(comptime cond: ConditionalOperator) void { @setRuntimeSafety(false); asm volatile ( \\ push { r4, lr } ); - if (compiler_rt_armhf_target) { - convert_fcmp_args_to_sf2_args(); - } - switch (cond) { .Eq => asm volatile ( \\ bl __eqsf2 diff --git a/lib/std/special/compiler_rt/comparedf2.zig b/lib/std/special/compiler_rt/comparedf2.zig index b6e08c49f4059da3bf4d5cffecf2351aa53802c5..98cca106f7d23880b204d2ff775115a4459fc33c 100644 --- a/lib/std/special/compiler_rt/comparedf2.zig +++ b/lib/std/special/compiler_rt/comparedf2.zig @@ -117,6 +117,11 @@ pub fn __gtdf2(a: fp_t, b: fp_t) callconv(.C) c_int { return __gedf2(a, b); } +pub fn __aeabi_dcmpun(a: fp_t, b: fp_t) callconv(.AAPCS) c_int { + @setRuntimeSafety(false); + return @call(.{ .modifier = .always_inline }, __unorddf2, .{ a, b }); +} + test "import comparedf2" { _ = @import("comparedf2_test.zig"); } diff --git a/lib/std/special/compiler_rt/comparesf2.zig b/lib/std/special/compiler_rt/comparesf2.zig index fdb5737ad376384ee07bff4c9187b147b49de5cb..bd881af2a1ea2ea05c211020ca5f9c3da93ccafb 100644 --- a/lib/std/special/compiler_rt/comparesf2.zig +++ b/lib/std/special/compiler_rt/comparesf2.zig @@ -117,6 +117,11 @@ pub fn __gtsf2(a: fp_t, b: fp_t) callconv(.C) c_int { return __gesf2(a, b); } +pub fn __aeabi_fcmpun(a: fp_t, b: fp_t) callconv(.AAPCS) c_int { + @setRuntimeSafety(false); + return @call(.{ .modifier = .always_inline }, __unordsf2, .{ a, b }); +} + test "import comparesf2" { _ = @import("comparesf2_test.zig"); } diff --git a/lib/std/special/compiler_rt/divdf3.zig b/lib/std/special/compiler_rt/divdf3.zig index a8afd4a3a69c214c462986f9c929879cbf54d46d..f0c0d1247c8aa98a27a33ed82cad67b57ead6f64 100644 --- a/lib/std/special/compiler_rt/divdf3.zig +++ b/lib/std/special/compiler_rt/divdf3.zig @@ -323,6 +323,11 @@ fn normalize(comptime T: type, significand: *@IntType(false, T.bit_count)) i32 { return 1 - shift; } +pub fn __aeabi_ddiv(a: f64, b: f64) callconv(.AAPCS) f64 { + @setRuntimeSafety(false); + return @call(.{ .modifier = .always_inline }, __divdf3, .{ a, b }); +} + test "import divdf3" { _ = @import("divdf3_test.zig"); } diff --git a/lib/std/special/compiler_rt/divsf3.zig b/lib/std/special/compiler_rt/divsf3.zig index ea882b4927b9f912f5f0b61273dfce02de7d8137..e51f94e19df91256ac0b22710e25a67c3f2ed468 100644 --- a/lib/std/special/compiler_rt/divsf3.zig +++ b/lib/std/special/compiler_rt/divsf3.zig @@ -196,6 +196,11 @@ fn normalize(comptime T: type, significand: *@IntType(false, T.bit_count)) i32 { return 1 - shift; } +pub fn __aeabi_fdiv(a: f32, b: f32) callconv(.AAPCS) f32 { + @setRuntimeSafety(false); + return @call(.{ .modifier = .always_inline }, __divsf3, .{ a, b }); +} + test "import divsf3" { _ = @import("divsf3_test.zig"); } diff --git a/lib/std/special/compiler_rt/extendXfYf2.zig b/lib/std/special/compiler_rt/extendXfYf2.zig index 10227043aa2e5f7bd6c4d8e4afff79998002cb0b..4e63d93ac5ee1b95de7ea5b43e4dc4993de4ca8c 100644 --- a/lib/std/special/compiler_rt/extendXfYf2.zig +++ b/lib/std/special/compiler_rt/extendXfYf2.zig @@ -18,6 +18,16 @@ pub fn __extendhfsf2(a: u16) callconv(.C) f32 { return @call(.{ .modifier = .always_inline }, extendXfYf2, .{ f32, f16, a }); } +pub fn __aeabi_h2f(arg: u16) callconv(.AAPCS) f32 { + @setRuntimeSafety(false); + return @call(.{ .modifier = .always_inline }, __extendhfsf2, .{arg}); +} + +pub fn __aeabi_f2d(arg: f32) callconv(.AAPCS) f64 { + @setRuntimeSafety(false); + return @call(.{ .modifier = .always_inline }, __extendsfdf2, .{arg}); +} + const CHAR_BIT = 8; fn extendXfYf2(comptime dst_t: type, comptime src_t: type, a: @IntType(false, @typeInfo(src_t).Float.bits)) dst_t { diff --git a/lib/std/special/compiler_rt/fixdfdi.zig b/lib/std/special/compiler_rt/fixdfdi.zig index fb3b31d6e8305de809eceefc186fb022a8ad046e..11b50091294ed250563d21e1856efc02a8eee8b3 100644 --- a/lib/std/special/compiler_rt/fixdfdi.zig +++ b/lib/std/special/compiler_rt/fixdfdi.zig @@ -6,6 +6,11 @@ pub fn __fixdfdi(a: f64) callconv(.C) i64 { return fixint(f64, i64, a); } +pub fn __aeabi_d2lz(arg: f64) callconv(.AAPCS) i64 { + @setRuntimeSafety(false); + return @call(.{ .modifier = .always_inline }, __fixdfdi, .{arg}); +} + test "import fixdfdi" { _ = @import("fixdfdi_test.zig"); } diff --git a/lib/std/special/compiler_rt/fixdfsi.zig b/lib/std/special/compiler_rt/fixdfsi.zig index de21c86e43f42300939a5233a626a9e24141c297..8a6d8da34203bdd102de75614a46610d2ed5efc6 100644 --- a/lib/std/special/compiler_rt/fixdfsi.zig +++ b/lib/std/special/compiler_rt/fixdfsi.zig @@ -6,6 +6,11 @@ pub fn __fixdfsi(a: f64) callconv(.C) i32 { return fixint(f64, i32, a); } +pub fn __aeabi_d2iz(a: f64) callconv(.AAPCS) i32 { + @setRuntimeSafety(false); + return @call(.{ .modifier = .always_inline }, __fixdfsi, .{a}); +} + test "import fixdfsi" { _ = @import("fixdfsi_test.zig"); } diff --git a/lib/std/special/compiler_rt/fixsfdi.zig b/lib/std/special/compiler_rt/fixsfdi.zig index d3aaf9d470f217deb20e469fe2eacfd5ff8785e2..d0d958cdd6b310c295307c0644ae56981b79c4aa 100644 --- a/lib/std/special/compiler_rt/fixsfdi.zig +++ b/lib/std/special/compiler_rt/fixsfdi.zig @@ -6,6 +6,11 @@ pub fn __fixsfdi(a: f32) callconv(.C) i64 { return fixint(f32, i64, a); } +pub fn __aeabi_f2lz(arg: f32) callconv(.AAPCS) i64 { + @setRuntimeSafety(false); + return @call(.{ .modifier = .always_inline }, __fixsfdi, .{arg}); +} + test "import fixsfdi" { _ = @import("fixsfdi_test.zig"); } diff --git a/lib/std/special/compiler_rt/fixsfsi.zig b/lib/std/special/compiler_rt/fixsfsi.zig index 81aa01dfa1b5a63f6b5cd7176da42e4d493112bc..84395d0fa67a8689a3e12f1ed1602d16774eb115 100644 --- a/lib/std/special/compiler_rt/fixsfsi.zig +++ b/lib/std/special/compiler_rt/fixsfsi.zig @@ -6,6 +6,11 @@ pub fn __fixsfsi(a: f32) callconv(.C) i32 { return fixint(f32, i32, a); } +pub fn __aeabi_f2iz(a: f32) callconv(.AAPCS) i32 { + @setRuntimeSafety(false); + return @call(.{ .modifier = .always_inline }, __fixsfsi, .{a}); +} + test "import fixsfsi" { _ = @import("fixsfsi_test.zig"); } diff --git a/lib/std/special/compiler_rt/fixunsdfdi.zig b/lib/std/special/compiler_rt/fixunsdfdi.zig index 9d41d4b740934d4783cb2c0cea4d3bde7849d858..800c9b1148ad4d3074dc7b1e9f48cee630e2fd17 100644 --- a/lib/std/special/compiler_rt/fixunsdfdi.zig +++ b/lib/std/special/compiler_rt/fixunsdfdi.zig @@ -6,6 +6,11 @@ pub fn __fixunsdfdi(a: f64) callconv(.C) u64 { return fixuint(f64, u64, a); } +pub fn __aeabi_d2ulz(a: f64) callconv(.AAPCS) u64 { + @setRuntimeSafety(false); + return @call(.{ .modifier = .always_inline }, __fixunsdfdi, .{a}); +} + test "import fixunsdfdi" { _ = @import("fixunsdfdi_test.zig"); } diff --git a/lib/std/special/compiler_rt/fixunsdfsi.zig b/lib/std/special/compiler_rt/fixunsdfsi.zig index 044523512c80466c334b18b251fcbc8a2f0aca55..156c21a887b10dea35836310d96435541b22317b 100644 --- a/lib/std/special/compiler_rt/fixunsdfsi.zig +++ b/lib/std/special/compiler_rt/fixunsdfsi.zig @@ -6,6 +6,11 @@ pub fn __fixunsdfsi(a: f64) callconv(.C) u32 { return fixuint(f64, u32, a); } +pub fn __aeabi_d2uiz(arg: f64) callconv(.AAPCS) u32 { + @setRuntimeSafety(false); + return @call(.{ .modifier = .always_inline }, __fixunsdfsi, .{arg}); +} + test "import fixunsdfsi" { _ = @import("fixunsdfsi_test.zig"); } diff --git a/lib/std/special/compiler_rt/fixunssfdi.zig b/lib/std/special/compiler_rt/fixunssfdi.zig index a42121aeec963332e1d935ef9084b483e1ec32b6..ec00a7ee35c50814414320465012b127eed644b8 100644 --- a/lib/std/special/compiler_rt/fixunssfdi.zig +++ b/lib/std/special/compiler_rt/fixunssfdi.zig @@ -6,6 +6,11 @@ pub fn __fixunssfdi(a: f32) callconv(.C) u64 { return fixuint(f32, u64, a); } +pub fn __aeabi_f2ulz(a: f32) callconv(.AAPCS) u64 { + @setRuntimeSafety(false); + return @call(.{ .modifier = .always_inline }, __fixunssfdi, .{a}); +} + test "import fixunssfdi" { _ = @import("fixunssfdi_test.zig"); } diff --git a/lib/std/special/compiler_rt/fixunssfsi.zig b/lib/std/special/compiler_rt/fixunssfsi.zig index 00f7c8ad22586a00b79b9fb11fc2bd285a0e473d..a4e5a323f5927e856d9f33e34c1df024145fbad3 100644 --- a/lib/std/special/compiler_rt/fixunssfsi.zig +++ b/lib/std/special/compiler_rt/fixunssfsi.zig @@ -6,6 +6,11 @@ pub fn __fixunssfsi(a: f32) callconv(.C) u32 { return fixuint(f32, u32, a); } +pub fn __aeabi_f2uiz(a: f32) callconv(.AAPCS) u32 { + @setRuntimeSafety(false); + return @call(.{ .modifier = .always_inline }, __fixunssfsi, .{a}); +} + test "import fixunssfsi" { _ = @import("fixunssfsi_test.zig"); } diff --git a/lib/std/special/compiler_rt/floatdidf.zig b/lib/std/special/compiler_rt/floatdidf.zig index 93bd0c8a3e5b0851d28baa8f908f38eab38ddc75..afe9e906fd81533a71072ec193bad214bfb85802 100644 --- a/lib/std/special/compiler_rt/floatdidf.zig +++ b/lib/std/special/compiler_rt/floatdidf.zig @@ -17,6 +17,11 @@ pub fn __floatdidf(a: i64) callconv(.C) f64 { return (high - twop52) + @bitCast(f64, low); } +pub fn __aeabi_l2d(arg: i64) callconv(.AAPCS) f64 { + @setRuntimeSafety(false); + return @call(.{ .modifier = .always_inline }, __floatdidf, .{arg}); +} + test "import floatdidf" { _ = @import("floatdidf_test.zig"); } diff --git a/lib/std/special/compiler_rt/floatsiXf.zig b/lib/std/special/compiler_rt/floatsiXf.zig index 30a09de90c340bbd619c1993fa822cae87f7d4b0..ef3aba34d4de61566658acf7e4cb4c86065c2e65 100644 --- a/lib/std/special/compiler_rt/floatsiXf.zig +++ b/lib/std/special/compiler_rt/floatsiXf.zig @@ -68,6 +68,16 @@ pub fn __floatsitf(arg: i32) callconv(.C) f128 { return @call(.{ .modifier = .always_inline }, floatsiXf, .{ f128, arg }); } +pub fn __aeabi_i2d(arg: i32) callconv(.AAPCS) f64 { + @setRuntimeSafety(false); + return @call(.{ .modifier = .always_inline }, __floatsidf, .{arg}); +} + +pub fn __aeabi_i2f(arg: i32) callconv(.AAPCS) f32 { + @setRuntimeSafety(false); + return @call(.{ .modifier = .always_inline }, __floatsisf, .{arg}); +} + fn test_one_floatsitf(a: i32, expected: u128) void { const r = __floatsitf(a); std.testing.expect(@bitCast(u128, r) == expected); diff --git a/lib/std/special/compiler_rt/floatundidf.zig b/lib/std/special/compiler_rt/floatundidf.zig index c8803b4c6cc2ce55b476f5a74407aca439ab4029..1efe55da4062babf326dfcddc78b84b0137b7d61 100644 --- a/lib/std/special/compiler_rt/floatundidf.zig +++ b/lib/std/special/compiler_rt/floatundidf.zig @@ -19,6 +19,11 @@ pub fn __floatundidf(a: u64) callconv(.C) f64 { return (@bitCast(f64, high) - twop84_plus_twop52) + @bitCast(f64, low); } +pub fn __aeabi_ul2d(arg: u64) callconv(.AAPCS) f64 { + @setRuntimeSafety(false); + return @call(.{ .modifier = .always_inline }, __floatundidf, .{arg}); +} + test "import floatundidf" { _ = @import("floatundidf_test.zig"); } diff --git a/lib/std/special/compiler_rt/floatundisf.zig b/lib/std/special/compiler_rt/floatundisf.zig index b311438fa26cb6801e9e398da21e79df8a08cb47..41ff02daee686ec0f0b2c0c838e13590881287fa 100644 --- a/lib/std/special/compiler_rt/floatundisf.zig +++ b/lib/std/special/compiler_rt/floatundisf.zig @@ -4,7 +4,7 @@ const maxInt = std.math.maxInt; const FLT_MANT_DIG = 24; -pub extern fn __floatundisf(arg: u64) f32 { +pub fn __floatundisf(arg: u64) callconv(.C) f32 { @setRuntimeSafety(builtin.is_test); if (arg == 0) return 0; @@ -56,6 +56,11 @@ pub extern fn __floatundisf(arg: u64) f32 { return @bitCast(f32, result); } +pub fn __aeabi_ul2f(arg: u64) callconv(.AAPCS) f32 { + @setRuntimeSafety(false); + return @call(.{ .modifier = .always_inline }, __floatundisf, .{arg}); +} + fn test__floatundisf(a: u64, expected: f32) void { std.testing.expectEqual(expected, __floatundisf(a)); } diff --git a/lib/std/special/compiler_rt/floatunsidf.zig b/lib/std/special/compiler_rt/floatunsidf.zig index 92a78708064b14d059a2fe1f781ffab7ca681156..771b4938e1cca19354408ff31cb040cdf588b9bb 100644 --- a/lib/std/special/compiler_rt/floatunsidf.zig +++ b/lib/std/special/compiler_rt/floatunsidf.zig @@ -18,6 +18,11 @@ pub fn __floatunsidf(arg: u32) callconv(.C) f64 { return @bitCast(f64, mant | (exp + 1023) << 52); } +pub fn __aeabi_ui2d(arg: u32) callconv(.AAPCS) f64 { + @setRuntimeSafety(false); + return @call(.{ .modifier = .always_inline }, __floatunsidf, .{arg}); +} + fn test_one_floatunsidf(a: u32, expected: u64) void { const r = __floatunsidf(a); std.testing.expect(@bitCast(u64, r) == expected); diff --git a/lib/std/special/compiler_rt/floatunsisf.zig b/lib/std/special/compiler_rt/floatunsisf.zig index 777252c575a0d924b005aa32964333739dda6061..c11243e6e43e6628e0563e1448b472b5ef3462e9 100644 --- a/lib/std/special/compiler_rt/floatunsisf.zig +++ b/lib/std/special/compiler_rt/floatunsisf.zig @@ -6,7 +6,7 @@ const significandBits = 23; const exponentBias = 127; const implicitBit = @as(u32, 1) << significandBits; -pub extern fn __floatunsisf(arg: u32) f32 { +pub fn __floatunsisf(arg: u32) callconv(.C) f32 { @setRuntimeSafety(builtin.is_test); if (arg == 0) return 0.0; @@ -38,6 +38,11 @@ pub extern fn __floatunsisf(arg: u32) f32 { return @bitCast(f32, result); } +pub fn __aeabi_ui2f(arg: u32) callconv(.AAPCS) f32 { + @setRuntimeSafety(false); + return @call(.{ .modifier = .always_inline }, __floatunsisf, .{arg}); +} + fn test_one_floatunsisf(a: u32, expected: u32) void { const r = __floatunsisf(a); std.testing.expect(@bitCast(u32, r) == expected); diff --git a/lib/std/special/compiler_rt/mulXf3.zig b/lib/std/special/compiler_rt/mulXf3.zig index 9457bfb86e4f0e1060f343d10c5e8f3131d6c20c..103692f610c45d9effa9547a8ee8029cd9b82fd1 100644 --- a/lib/std/special/compiler_rt/mulXf3.zig +++ b/lib/std/special/compiler_rt/mulXf3.zig @@ -16,6 +16,16 @@ pub fn __mulsf3(a: f32, b: f32) callconv(.C) f32 { return mulXf3(f32, a, b); } +pub fn __aeabi_fmul(a: f32, b: f32) callconv(.C) f32 { + @setRuntimeSafety(false); + return @call(.{ .modifier = .always_inline }, __mulsf3, .{ a, b }); +} + +pub fn __aeabi_dmul(a: f64, b: f64) callconv(.C) f64 { + @setRuntimeSafety(false); + return @call(.{ .modifier = .always_inline }, __muldf3, .{ a, b }); +} + fn mulXf3(comptime T: type, a: T, b: T) T { @setRuntimeSafety(builtin.is_test); const Z = @IntType(false, T.bit_count); diff --git a/lib/std/special/compiler_rt/negXf2.zig b/lib/std/special/compiler_rt/negXf2.zig index e21e36b9552be7ec465a651fa63397a3b7fc1781..c41b1b48d75ecbf59bcd06550bd646abadcb2965 100644 --- a/lib/std/special/compiler_rt/negXf2.zig +++ b/lib/std/special/compiler_rt/negXf2.zig @@ -8,6 +8,16 @@ pub fn __negdf2(a: f64) callconv(.C) f64 { return negXf2(f64, a); } +pub fn __aeabi_fneg(arg: f32) callconv(.AAPCS) f32 { + @setRuntimeSafety(false); + return @call(.{ .modifier = .always_inline }, __negsf2, .{arg}); +} + +pub fn __aeabi_dneg(arg: f64) callconv(.AAPCS) f64 { + @setRuntimeSafety(false); + return @call(.{ .modifier = .always_inline }, __negdf2, .{arg}); +} + fn negXf2(comptime T: type, a: T) T { const Z = @IntType(false, T.bit_count); diff --git a/lib/std/special/compiler_rt/truncXfYf2.zig b/lib/std/special/compiler_rt/truncXfYf2.zig index 10b097e777c3daa6e1b193a4d83210efb77b7d9c..0a09dea84c4923dac8de0b2ed1e176c41702a454 100644 --- a/lib/std/special/compiler_rt/truncXfYf2.zig +++ b/lib/std/special/compiler_rt/truncXfYf2.zig @@ -20,6 +20,21 @@ pub fn __truncdfsf2(a: f64) callconv(.C) f32 { return truncXfYf2(f32, f64, a); } +pub fn __aeabi_d2f(a: f64) callconv(.AAPCS) f32 { + @setRuntimeSafety(false); + return @call(.{ .modifier = .always_inline }, __truncdfsf2, .{a}); +} + +pub fn __aeabi_d2h(a: f64) callconv(.AAPCS) u16 { + @setRuntimeSafety(false); + return @call(.{ .modifier = .always_inline }, __truncdfhf2, .{a}); +} + +pub fn __aeabi_f2h(a: f32) callconv(.AAPCS) u16 { + @setRuntimeSafety(false); + return @call(.{ .modifier = .always_inline }, __truncsfhf2, .{a}); +} + inline fn truncXfYf2(comptime dst_t: type, comptime src_t: type, a: src_t) dst_t { const src_rep_t = @IntType(false, @typeInfo(src_t).Float.bits); const dst_rep_t = @IntType(false, @typeInfo(dst_t).Float.bits); -- 2.54.0