| author | |
| committer | |
| log | e81b505960b106a042e4cb890971ba365a5ef180 |
| tree | 751dc190a6b9c95a9cfd33057657e2a55b94b691 |
| parent | 4e4ba6c3e1273fda8137f9f7e26325051f92bfa4 |
38 files changed, 194 insertions(+), 156 deletions(-)
lib/std/fmt.zig-24| ... | ... | @@ -1292,10 +1292,6 @@ test "cstr" { |
| 1292 | 1292 | } |
| 1293 | 1293 | |
| 1294 | 1294 | test "filesize" { |
| 1295 | if (builtin.os == .linux and builtin.arch == .arm and builtin.abi == .musleabihf) { | |
| 1296 | // TODO https://github.com/ziglang/zig/issues/3289 | |
| 1297 | return error.SkipZigTest; | |
| 1298 | } | |
| 1299 | 1295 | try testFmt("file size: 63MiB\n", "file size: {Bi}\n", .{@as(usize, 63 * 1024 * 1024)}); |
| 1300 | 1296 | try testFmt("file size: 66.06MB\n", "file size: {B:.2}\n", .{@as(usize, 63 * 1024 * 1024)}); |
| 1301 | 1297 | } |
| ... | ... | @@ -1330,10 +1326,6 @@ test "enum" { |
| 1330 | 1326 | } |
| 1331 | 1327 | |
| 1332 | 1328 | test "float.scientific" { |
| 1333 | if (builtin.os == .linux and builtin.arch == .arm and builtin.abi == .musleabihf) { | |
| 1334 | // TODO https://github.com/ziglang/zig/issues/3289 | |
| 1335 | return error.SkipZigTest; | |
| 1336 | } | |
| 1337 | 1329 | try testFmt("f32: 1.34000003e+00", "f32: {e}", .{@as(f32, 1.34)}); |
| 1338 | 1330 | try testFmt("f32: 1.23400001e+01", "f32: {e}", .{@as(f32, 12.34)}); |
| 1339 | 1331 | try testFmt("f64: -1.234e+11", "f64: {e}", .{@as(f64, -12.34e10)}); |
| ... | ... | @@ -1341,10 +1333,6 @@ test "float.scientific" { |
| 1341 | 1333 | } |
| 1342 | 1334 | |
| 1343 | 1335 | test "float.scientific.precision" { |
| 1344 | if (builtin.os == .linux and builtin.arch == .arm and builtin.abi == .musleabihf) { | |
| 1345 | // TODO https://github.com/ziglang/zig/issues/3289 | |
| 1346 | return error.SkipZigTest; | |
| 1347 | } | |
| 1348 | 1336 | try testFmt("f64: 1.40971e-42", "f64: {e:.5}", .{@as(f64, 1.409706e-42)}); |
| 1349 | 1337 | try testFmt("f64: 1.00000e-09", "f64: {e:.5}", .{@as(f64, @bitCast(f32, @as(u32, 814313563)))}); |
| 1350 | 1338 | try testFmt("f64: 7.81250e-03", "f64: {e:.5}", .{@as(f64, @bitCast(f32, @as(u32, 1006632960)))}); |
| ... | ... | @@ -1354,10 +1342,6 @@ test "float.scientific.precision" { |
| 1354 | 1342 | } |
| 1355 | 1343 | |
| 1356 | 1344 | test "float.special" { |
| 1357 | if (builtin.os == .linux and builtin.arch == .arm and builtin.abi == .musleabihf) { | |
| 1358 | // TODO https://github.com/ziglang/zig/issues/3289 | |
| 1359 | return error.SkipZigTest; | |
| 1360 | } | |
| 1361 | 1345 | try testFmt("f64: nan", "f64: {}", .{math.nan_f64}); |
| 1362 | 1346 | // negative nan is not defined by IEE 754, |
| 1363 | 1347 | // and ARM thus normalizes it to positive nan |
| ... | ... | @@ -1369,10 +1353,6 @@ test "float.special" { |
| 1369 | 1353 | } |
| 1370 | 1354 | |
| 1371 | 1355 | test "float.decimal" { |
| 1372 | if (builtin.os == .linux and builtin.arch == .arm and builtin.abi == .musleabihf) { | |
| 1373 | // TODO https://github.com/ziglang/zig/issues/3289 | |
| 1374 | return error.SkipZigTest; | |
| 1375 | } | |
| 1376 | 1356 | try testFmt("f64: 152314000000000000000000000000", "f64: {d}", .{@as(f64, 1.52314e+29)}); |
| 1377 | 1357 | try testFmt("f32: 1.1", "f32: {d:.1}", .{@as(f32, 1.1234)}); |
| 1378 | 1358 | try testFmt("f32: 1234.57", "f32: {d:.2}", .{@as(f32, 1234.567)}); |
| ... | ... | @@ -1391,10 +1371,6 @@ test "float.decimal" { |
| 1391 | 1371 | } |
| 1392 | 1372 | |
| 1393 | 1373 | test "float.libc.sanity" { |
| 1394 | if (builtin.os == .linux and builtin.arch == .arm and builtin.abi == .musleabihf) { | |
| 1395 | // TODO https://github.com/ziglang/zig/issues/3289 | |
| 1396 | return error.SkipZigTest; | |
| 1397 | } | |
| 1398 | 1374 | try testFmt("f64: 0.00001", "f64: {d:.5}", .{@as(f64, @bitCast(f32, @as(u32, 916964781)))}); |
| 1399 | 1375 | try testFmt("f64: 0.00001", "f64: {d:.5}", .{@as(f64, @bitCast(f32, @as(u32, 925353389)))}); |
| 1400 | 1376 | try testFmt("f64: 0.10000", "f64: {d:.5}", .{@as(f64, @bitCast(f32, @as(u32, 1036831278)))}); |
lib/std/fmt/parse_float.zig-4| ... | ... | @@ -382,10 +382,6 @@ pub fn parseFloat(comptime T: type, s: []const u8) !T { |
| 382 | 382 | } |
| 383 | 383 | |
| 384 | 384 | test "fmt.parseFloat" { |
| 385 | if (@import("builtin").arch == .arm) { | |
| 386 | // TODO https://github.com/ziglang/zig/issues/3289 | |
| 387 | return error.SkipZigTest; | |
| 388 | } | |
| 389 | 385 | const testing = std.testing; |
| 390 | 386 | const expect = testing.expect; |
| 391 | 387 | const expectEqual = testing.expectEqual; |
lib/std/math/big/rational.zig-8| ... | ... | @@ -742,10 +742,6 @@ test "big.rational setFloatString" { |
| 742 | 742 | } |
| 743 | 743 | |
| 744 | 744 | test "big.rational toFloat" { |
| 745 | if (builtin.os == .linux and builtin.arch == .arm and builtin.abi == .musleabihf) { | |
| 746 | // TODO https://github.com/ziglang/zig/issues/3289 | |
| 747 | return error.SkipZigTest; | |
| 748 | } | |
| 749 | 745 | var a = try Rational.init(al); |
| 750 | 746 | |
| 751 | 747 | // = 3.14159297943115234375 |
| ... | ... | @@ -758,10 +754,6 @@ test "big.rational toFloat" { |
| 758 | 754 | } |
| 759 | 755 | |
| 760 | 756 | test "big.rational set/to Float round-trip" { |
| 761 | if (builtin.os == .linux and builtin.arch == .arm and builtin.abi == .musleabihf) { | |
| 762 | // TODO https://github.com/ziglang/zig/issues/3289 | |
| 763 | return error.SkipZigTest; | |
| 764 | } | |
| 765 | 757 | var a = try Rational.init(al); |
| 766 | 758 | var prng = std.rand.DefaultPrng.init(0x5EED); |
| 767 | 759 | var i: usize = 0; |
lib/std/math/complex/atan.zig-4| ... | ... | @@ -130,10 +130,6 @@ test "complex.catan32" { |
| 130 | 130 | } |
| 131 | 131 | |
| 132 | 132 | test "complex.catan64" { |
| 133 | if (builtin.os == .linux and builtin.arch == .arm and builtin.abi == .musleabihf) { | |
| 134 | // TODO https://github.com/ziglang/zig/issues/3289 | |
| 135 | return error.SkipZigTest; | |
| 136 | } | |
| 137 | 133 | const a = Complex(f64).new(5, 3); |
| 138 | 134 | const c = atan(a); |
| 139 | 135 |
lib/std/math/complex/cosh.zig-4| ... | ... | @@ -165,10 +165,6 @@ test "complex.ccosh32" { |
| 165 | 165 | } |
| 166 | 166 | |
| 167 | 167 | test "complex.ccosh64" { |
| 168 | if (builtin.os == .linux and builtin.arch == .arm and builtin.abi == .musleabihf) { | |
| 169 | // TODO https://github.com/ziglang/zig/issues/3289 | |
| 170 | return error.SkipZigTest; | |
| 171 | } | |
| 172 | 168 | const a = Complex(f64).new(5, 3); |
| 173 | 169 | const c = cosh(a); |
| 174 | 170 |
lib/std/math/complex/exp.zig-4| ... | ... | @@ -131,10 +131,6 @@ test "complex.cexp32" { |
| 131 | 131 | } |
| 132 | 132 | |
| 133 | 133 | test "complex.cexp64" { |
| 134 | if (builtin.os == .linux and builtin.arch == .arm and builtin.abi == .musleabihf) { | |
| 135 | // TODO https://github.com/ziglang/zig/issues/3289 | |
| 136 | return error.SkipZigTest; | |
| 137 | } | |
| 138 | 134 | const a = Complex(f64).new(5, 3); |
| 139 | 135 | const c = exp(a); |
| 140 | 136 |
lib/std/math/complex/sinh.zig-4| ... | ... | @@ -164,10 +164,6 @@ test "complex.csinh32" { |
| 164 | 164 | } |
| 165 | 165 | |
| 166 | 166 | test "complex.csinh64" { |
| 167 | if (builtin.os == .linux and builtin.arch == .arm and builtin.abi == .musleabihf) { | |
| 168 | // TODO https://github.com/ziglang/zig/issues/3289 | |
| 169 | return error.SkipZigTest; | |
| 170 | } | |
| 171 | 167 | const a = Complex(f64).new(5, 3); |
| 172 | 168 | const c = sinh(a); |
| 173 | 169 |
lib/std/math/complex/tanh.zig-4| ... | ... | @@ -113,10 +113,6 @@ test "complex.ctanh32" { |
| 113 | 113 | } |
| 114 | 114 | |
| 115 | 115 | test "complex.ctanh64" { |
| 116 | if (builtin.os == .linux and builtin.arch == .arm and builtin.abi == .musleabihf) { | |
| 117 | // TODO https://github.com/ziglang/zig/issues/3289 | |
| 118 | return error.SkipZigTest; | |
| 119 | } | |
| 120 | 116 | const a = Complex(f64).new(5, 3); |
| 121 | 117 | const c = tanh(a); |
| 122 | 118 |
lib/std/math/cos.zig-4| ... | ... | @@ -100,10 +100,6 @@ test "math.cos32" { |
| 100 | 100 | } |
| 101 | 101 | |
| 102 | 102 | test "math.cos64" { |
| 103 | if (builtin.os == .linux and builtin.arch == .arm and builtin.abi == .musleabihf) { | |
| 104 | // TODO https://github.com/ziglang/zig/issues/3289 | |
| 105 | return error.SkipZigTest; | |
| 106 | } | |
| 107 | 103 | const epsilon = 0.000001; |
| 108 | 104 | |
| 109 | 105 | expect(math.approxEq(f64, cos_(f64, 0.0), 1.0, epsilon)); |
lib/std/math/pow.zig-12| ... | ... | @@ -184,10 +184,6 @@ fn isOddInteger(x: f64) bool { |
| 184 | 184 | } |
| 185 | 185 | |
| 186 | 186 | test "math.pow" { |
| 187 | if (builtin.os == .linux and builtin.arch == .arm and builtin.abi == .musleabihf) { | |
| 188 | // TODO https://github.com/ziglang/zig/issues/3289 | |
| 189 | return error.SkipZigTest; | |
| 190 | } | |
| 191 | 187 | const epsilon = 0.000001; |
| 192 | 188 | |
| 193 | 189 | expect(math.approxEq(f32, pow(f32, 0.0, 3.3), 0.0, epsilon)); |
| ... | ... | @@ -206,10 +202,6 @@ test "math.pow" { |
| 206 | 202 | } |
| 207 | 203 | |
| 208 | 204 | test "math.pow.special" { |
| 209 | if (builtin.os == .linux and builtin.arch == .arm and builtin.abi == .musleabihf) { | |
| 210 | // TODO https://github.com/ziglang/zig/issues/3289 | |
| 211 | return error.SkipZigTest; | |
| 212 | } | |
| 213 | 205 | const epsilon = 0.000001; |
| 214 | 206 | |
| 215 | 207 | expect(pow(f32, 4, 0.0) == 1.0); |
| ... | ... | @@ -252,10 +244,6 @@ test "math.pow.special" { |
| 252 | 244 | } |
| 253 | 245 | |
| 254 | 246 | test "math.pow.overflow" { |
| 255 | if (builtin.os == .linux and builtin.arch == .arm and builtin.abi == .musleabihf) { | |
| 256 | // TODO https://github.com/ziglang/zig/issues/3289 | |
| 257 | return error.SkipZigTest; | |
| 258 | } | |
| 259 | 247 | expect(math.isPositiveInf(pow(f64, 2, 1 << 32))); |
| 260 | 248 | expect(pow(f64, 2, -(1 << 32)) == 0); |
| 261 | 249 | expect(math.isNegativeInf(pow(f64, -2, (1 << 32) + 1))); |
lib/std/math/sin.zig-20| ... | ... | @@ -84,20 +84,12 @@ fn sin_(comptime T: type, x_: T) T { |
| 84 | 84 | } |
| 85 | 85 | |
| 86 | 86 | test "math.sin" { |
| 87 | if (builtin.os == .linux and builtin.arch == .arm and builtin.abi == .musleabihf) { | |
| 88 | // TODO https://github.com/ziglang/zig/issues/3289 | |
| 89 | return error.SkipZigTest; | |
| 90 | } | |
| 91 | 87 | expect(sin(@as(f32, 0.0)) == sin_(f32, 0.0)); |
| 92 | 88 | expect(sin(@as(f64, 0.0)) == sin_(f64, 0.0)); |
| 93 | 89 | expect(comptime (math.sin(@as(f64, 2))) == math.sin(@as(f64, 2))); |
| 94 | 90 | } |
| 95 | 91 | |
| 96 | 92 | test "math.sin32" { |
| 97 | if (builtin.os == .linux and builtin.arch == .arm and builtin.abi == .musleabihf) { | |
| 98 | // TODO https://github.com/ziglang/zig/issues/3289 | |
| 99 | return error.SkipZigTest; | |
| 100 | } | |
| 101 | 93 | const epsilon = 0.000001; |
| 102 | 94 | |
| 103 | 95 | expect(math.approxEq(f32, sin_(f32, 0.0), 0.0, epsilon)); |
| ... | ... | @@ -110,10 +102,6 @@ test "math.sin32" { |
| 110 | 102 | } |
| 111 | 103 | |
| 112 | 104 | test "math.sin64" { |
| 113 | if (builtin.os == .linux and builtin.arch == .arm and builtin.abi == .musleabihf) { | |
| 114 | // TODO https://github.com/ziglang/zig/issues/3289 | |
| 115 | return error.SkipZigTest; | |
| 116 | } | |
| 117 | 105 | const epsilon = 0.000001; |
| 118 | 106 | |
| 119 | 107 | expect(math.approxEq(f64, sin_(f64, 0.0), 0.0, epsilon)); |
| ... | ... | @@ -126,10 +114,6 @@ test "math.sin64" { |
| 126 | 114 | } |
| 127 | 115 | |
| 128 | 116 | test "math.sin32.special" { |
| 129 | if (builtin.os == .linux and builtin.arch == .arm and builtin.abi == .musleabihf) { | |
| 130 | // TODO https://github.com/ziglang/zig/issues/3289 | |
| 131 | return error.SkipZigTest; | |
| 132 | } | |
| 133 | 117 | expect(sin_(f32, 0.0) == 0.0); |
| 134 | 118 | expect(sin_(f32, -0.0) == -0.0); |
| 135 | 119 | expect(math.isNan(sin_(f32, math.inf(f32)))); |
| ... | ... | @@ -138,10 +122,6 @@ test "math.sin32.special" { |
| 138 | 122 | } |
| 139 | 123 | |
| 140 | 124 | test "math.sin64.special" { |
| 141 | if (builtin.os == .linux and builtin.arch == .arm and builtin.abi == .musleabihf) { | |
| 142 | // TODO https://github.com/ziglang/zig/issues/3289 | |
| 143 | return error.SkipZigTest; | |
| 144 | } | |
| 145 | 125 | expect(sin_(f64, 0.0) == 0.0); |
| 146 | 126 | expect(sin_(f64, -0.0) == -0.0); |
| 147 | 127 | expect(math.isNan(sin_(f64, math.inf(f64)))); |
lib/std/math/tan.zig-4| ... | ... | @@ -91,10 +91,6 @@ test "math.tan32" { |
| 91 | 91 | } |
| 92 | 92 | |
| 93 | 93 | test "math.tan64" { |
| 94 | if (builtin.os == .linux and builtin.arch == .arm and builtin.abi == .musleabihf) { | |
| 95 | // TODO https://github.com/ziglang/zig/issues/3289 | |
| 96 | return error.SkipZigTest; | |
| 97 | } | |
| 98 | 94 | const epsilon = 0.000001; |
| 99 | 95 | |
| 100 | 96 | expect(math.approxEq(f64, tan_(f64, 0.0), 0.0, epsilon)); |
lib/std/special/compiler_rt.zig+32-32| ... | ... | @@ -181,62 +181,62 @@ comptime { |
| 181 | 181 | @export("__aeabi_memcmp4", __aeabi_memcmp, linkage); |
| 182 | 182 | @export("__aeabi_memcmp8", __aeabi_memcmp, linkage); |
| 183 | 183 | |
| 184 | @export("__aeabi_f2d", @import("compiler_rt/extendXfYf2.zig").__extendsfdf2, linkage); | |
| 185 | @export("__aeabi_i2d", @import("compiler_rt/floatsiXf.zig").__floatsidf, linkage); | |
| 186 | @export("__aeabi_l2d", @import("compiler_rt/floatdidf.zig").__floatdidf, linkage); | |
| 187 | @export("__aeabi_ui2d", @import("compiler_rt/floatunsidf.zig").__floatunsidf, linkage); | |
| 188 | @export("__aeabi_ul2d", @import("compiler_rt/floatundidf.zig").__floatundidf, linkage); | |
| 189 | @export("__aeabi_ui2f", @import("compiler_rt/floatunsisf.zig").__floatunsisf, linkage); | |
| 190 | @export("__aeabi_ul2f", @import("compiler_rt/floatundisf.zig").__floatundisf, linkage); | |
| 184 | @export("__aeabi_f2d", @import("compiler_rt/extendXfYf2.zig").__aeabi_f2d, linkage); | |
| 185 | @export("__aeabi_i2d", @import("compiler_rt/floatsiXf.zig").__aeabi_i2d, linkage); | |
| 186 | @export("__aeabi_l2d", @import("compiler_rt/floatdidf.zig").__aeabi_l2d, linkage); | |
| 187 | @export("__aeabi_ui2d", @import("compiler_rt/floatunsidf.zig").__aeabi_ui2d, linkage); | |
| 188 | @export("__aeabi_ul2d", @import("compiler_rt/floatundidf.zig").__aeabi_ul2d, linkage); | |
| 189 | @export("__aeabi_ui2f", @import("compiler_rt/floatunsisf.zig").__aeabi_ui2f, linkage); | |
| 190 | @export("__aeabi_ul2f", @import("compiler_rt/floatundisf.zig").__aeabi_ul2f, linkage); | |
| 191 | 191 | |
| 192 | @export("__aeabi_fneg", @import("compiler_rt/negXf2.zig").__negsf2, linkage); | |
| 193 | @export("__aeabi_dneg", @import("compiler_rt/negXf2.zig").__negdf2, linkage); | |
| 192 | @export("__aeabi_fneg", @import("compiler_rt/negXf2.zig").__aeabi_fneg, linkage); | |
| 193 | @export("__aeabi_dneg", @import("compiler_rt/negXf2.zig").__aeabi_dneg, linkage); | |
| 194 | 194 | |
| 195 | @export("__aeabi_fmul", @import("compiler_rt/mulXf3.zig").__mulsf3, linkage); | |
| 196 | @export("__aeabi_dmul", @import("compiler_rt/mulXf3.zig").__muldf3, linkage); | |
| 195 | @export("__aeabi_fmul", @import("compiler_rt/mulXf3.zig").__aeabi_fmul, linkage); | |
| 196 | @export("__aeabi_dmul", @import("compiler_rt/mulXf3.zig").__aeabi_dmul, linkage); | |
| 197 | 197 | |
| 198 | @export("__aeabi_d2h", @import("compiler_rt/truncXfYf2.zig").__truncdfhf2, linkage); | |
| 198 | @export("__aeabi_d2h", @import("compiler_rt/truncXfYf2.zig").__aeabi_d2h, linkage); | |
| 199 | 199 | |
| 200 | @export("__aeabi_f2ulz", @import("compiler_rt/fixunssfdi.zig").__fixunssfdi, linkage); | |
| 201 | @export("__aeabi_d2ulz", @import("compiler_rt/fixunsdfdi.zig").__fixunsdfdi, linkage); | |
| 200 | @export("__aeabi_f2ulz", @import("compiler_rt/fixunssfdi.zig").__aeabi_f2ulz, linkage); | |
| 201 | @export("__aeabi_d2ulz", @import("compiler_rt/fixunsdfdi.zig").__aeabi_d2ulz, linkage); | |
| 202 | 202 | |
| 203 | @export("__aeabi_f2lz", @import("compiler_rt/fixsfdi.zig").__fixsfdi, linkage); | |
| 204 | @export("__aeabi_d2lz", @import("compiler_rt/fixdfdi.zig").__fixdfdi, linkage); | |
| 203 | @export("__aeabi_f2lz", @import("compiler_rt/fixsfdi.zig").__aeabi_f2lz, linkage); | |
| 204 | @export("__aeabi_d2lz", @import("compiler_rt/fixdfdi.zig").__aeabi_d2lz, linkage); | |
| 205 | 205 | |
| 206 | @export("__aeabi_d2uiz", @import("compiler_rt/fixunsdfsi.zig").__fixunsdfsi, linkage); | |
| 206 | @export("__aeabi_d2uiz", @import("compiler_rt/fixunsdfsi.zig").__aeabi_d2uiz, linkage); | |
| 207 | 207 | |
| 208 | @export("__aeabi_h2f", @import("compiler_rt/extendXfYf2.zig").__extendhfsf2, linkage); | |
| 209 | @export("__aeabi_f2h", @import("compiler_rt/truncXfYf2.zig").__truncsfhf2, linkage); | |
| 208 | @export("__aeabi_h2f", @import("compiler_rt/extendXfYf2.zig").__aeabi_h2f, linkage); | |
| 209 | @export("__aeabi_f2h", @import("compiler_rt/truncXfYf2.zig").__aeabi_f2h, linkage); | |
| 210 | 210 | |
| 211 | @export("__aeabi_i2f", @import("compiler_rt/floatsiXf.zig").__floatsisf, linkage); | |
| 212 | @export("__aeabi_d2f", @import("compiler_rt/truncXfYf2.zig").__truncdfsf2, linkage); | |
| 211 | @export("__aeabi_i2f", @import("compiler_rt/floatsiXf.zig").__aeabi_i2f, linkage); | |
| 212 | @export("__aeabi_d2f", @import("compiler_rt/truncXfYf2.zig").__aeabi_d2f, linkage); | |
| 213 | 213 | |
| 214 | @export("__aeabi_fadd", @import("compiler_rt/addXf3.zig").__addsf3, linkage); | |
| 215 | @export("__aeabi_dadd", @import("compiler_rt/addXf3.zig").__adddf3, linkage); | |
| 216 | @export("__aeabi_fsub", @import("compiler_rt/addXf3.zig").__subsf3, linkage); | |
| 217 | @export("__aeabi_dsub", @import("compiler_rt/addXf3.zig").__subdf3, linkage); | |
| 214 | @export("__aeabi_fadd", @import("compiler_rt/addXf3.zig").__aeabi_fadd, linkage); | |
| 215 | @export("__aeabi_dadd", @import("compiler_rt/addXf3.zig").__aeabi_dadd, linkage); | |
| 216 | @export("__aeabi_fsub", @import("compiler_rt/addXf3.zig").__aeabi_fsub, linkage); | |
| 217 | @export("__aeabi_dsub", @import("compiler_rt/addXf3.zig").__aeabi_dsub, linkage); | |
| 218 | 218 | |
| 219 | @export("__aeabi_f2uiz", @import("compiler_rt/fixunssfsi.zig").__fixunssfsi, linkage); | |
| 219 | @export("__aeabi_f2uiz", @import("compiler_rt/fixunssfsi.zig").__aeabi_f2uiz, linkage); | |
| 220 | 220 | |
| 221 | @export("__aeabi_f2iz", @import("compiler_rt/fixsfsi.zig").__fixsfsi, linkage); | |
| 222 | @export("__aeabi_d2iz", @import("compiler_rt/fixdfsi.zig").__fixdfsi, linkage); | |
| 221 | @export("__aeabi_f2iz", @import("compiler_rt/fixsfsi.zig").__aeabi_f2iz, linkage); | |
| 222 | @export("__aeabi_d2iz", @import("compiler_rt/fixdfsi.zig").__aeabi_d2iz, linkage); | |
| 223 | 223 | |
| 224 | @export("__aeabi_fdiv", @import("compiler_rt/divsf3.zig").__divsf3, linkage); | |
| 225 | @export("__aeabi_ddiv", @import("compiler_rt/divdf3.zig").__divdf3, linkage); | |
| 224 | @export("__aeabi_fdiv", @import("compiler_rt/divsf3.zig").__aeabi_fdiv, linkage); | |
| 225 | @export("__aeabi_ddiv", @import("compiler_rt/divdf3.zig").__aeabi_ddiv, linkage); | |
| 226 | 226 | |
| 227 | 227 | @export("__aeabi_fcmpeq", @import("compiler_rt/arm/aeabi_fcmp.zig").__aeabi_fcmpeq, linkage); |
| 228 | 228 | @export("__aeabi_fcmplt", @import("compiler_rt/arm/aeabi_fcmp.zig").__aeabi_fcmplt, linkage); |
| 229 | 229 | @export("__aeabi_fcmple", @import("compiler_rt/arm/aeabi_fcmp.zig").__aeabi_fcmple, linkage); |
| 230 | 230 | @export("__aeabi_fcmpge", @import("compiler_rt/arm/aeabi_fcmp.zig").__aeabi_fcmpge, linkage); |
| 231 | 231 | @export("__aeabi_fcmpgt", @import("compiler_rt/arm/aeabi_fcmp.zig").__aeabi_fcmpgt, linkage); |
| 232 | @export("__aeabi_fcmpun", @import("compiler_rt/comparesf2.zig").__unordsf2, linkage); | |
| 232 | @export("__aeabi_fcmpun", @import("compiler_rt/comparesf2.zig").__aeabi_fcmpun, linkage); | |
| 233 | 233 | |
| 234 | 234 | @export("__aeabi_dcmpeq", @import("compiler_rt/arm/aeabi_dcmp.zig").__aeabi_dcmpeq, linkage); |
| 235 | 235 | @export("__aeabi_dcmplt", @import("compiler_rt/arm/aeabi_dcmp.zig").__aeabi_dcmplt, linkage); |
| 236 | 236 | @export("__aeabi_dcmple", @import("compiler_rt/arm/aeabi_dcmp.zig").__aeabi_dcmple, linkage); |
| 237 | 237 | @export("__aeabi_dcmpge", @import("compiler_rt/arm/aeabi_dcmp.zig").__aeabi_dcmpge, linkage); |
| 238 | 238 | @export("__aeabi_dcmpgt", @import("compiler_rt/arm/aeabi_dcmp.zig").__aeabi_dcmpgt, linkage); |
| 239 | @export("__aeabi_dcmpun", @import("compiler_rt/comparedf2.zig").__unorddf2, linkage); | |
| 239 | @export("__aeabi_dcmpun", @import("compiler_rt/comparedf2.zig").__aeabi_dcmpun, linkage); | |
| 240 | 240 | } |
| 241 | 241 | if (builtin.os == .windows) { |
| 242 | 242 | // Default stack-probe functions emitted by LLVM |
lib/std/special/compiler_rt/addXf3.zig+20| ... | ... | @@ -33,6 +33,26 @@ pub fn __subtf3(a: f128, b: f128) callconv(.C) f128 { |
| 33 | 33 | return addXf3(f128, a, neg_b); |
| 34 | 34 | } |
| 35 | 35 | |
| 36 | pub fn __aeabi_fadd(a: f32, b: f32) callconv(.AAPCS) f32 { | |
| 37 | @setRuntimeSafety(false); | |
| 38 | return @call(.{ .modifier = .always_inline }, __addsf3, .{ a, b }); | |
| 39 | } | |
| 40 | ||
| 41 | pub fn __aeabi_dadd(a: f64, b: f64) callconv(.AAPCS) f64 { | |
| 42 | @setRuntimeSafety(false); | |
| 43 | return @call(.{ .modifier = .always_inline }, __adddf3, .{ a, b }); | |
| 44 | } | |
| 45 | ||
| 46 | pub fn __aeabi_fsub(a: f32, b: f32) callconv(.AAPCS) f32 { | |
| 47 | @setRuntimeSafety(false); | |
| 48 | return @call(.{ .modifier = .always_inline }, __subsf3, .{ a, b }); | |
| 49 | } | |
| 50 | ||
| 51 | pub fn __aeabi_dsub(a: f64, b: f64) callconv(.AAPCS) f64 { | |
| 52 | @setRuntimeSafety(false); | |
| 53 | return @call(.{ .modifier = .always_inline }, __subdf3, .{ a, b }); | |
| 54 | } | |
| 55 | ||
| 36 | 56 | // TODO: restore inline keyword, see: https://github.com/ziglang/zig/issues/2154 |
| 37 | 57 | fn normalize(comptime T: type, significand: *@IntType(false, T.bit_count)) i32 { |
| 38 | 58 | const Z = @IntType(false, T.bit_count); |
lib/std/special/compiler_rt/arm/aeabi_dcmp.zig-13| ... | ... | @@ -2,8 +2,6 @@ |
| 2 | 2 | // |
| 3 | 3 | // https://github.com/llvm/llvm-project/commit/d674d96bc56c0f377879d01c9d8dfdaaa7859cdb/compiler-rt/lib/builtins/arm/aeabi_dcmp.S |
| 4 | 4 | |
| 5 | const compiler_rt_armhf_target = false; // TODO | |
| 6 | ||
| 7 | 5 | const ConditionalOperator = enum { |
| 8 | 6 | Eq, |
| 9 | 7 | Lt, |
| ... | ... | @@ -42,23 +40,12 @@ pub fn __aeabi_dcmpgt() callconv(.Naked) noreturn { |
| 42 | 40 | unreachable; |
| 43 | 41 | } |
| 44 | 42 | |
| 45 | inline fn convert_dcmp_args_to_df2_args() void { | |
| 46 | asm volatile ( | |
| 47 | \\ vmov d0, r0, r1 | |
| 48 | \\ vmov d1, r2, r3 | |
| 49 | ); | |
| 50 | } | |
| 51 | ||
| 52 | 43 | fn aeabi_dcmp(comptime cond: ConditionalOperator) void { |
| 53 | 44 | @setRuntimeSafety(false); |
| 54 | 45 | asm volatile ( |
| 55 | 46 | \\ push { r4, lr } |
| 56 | 47 | ); |
| 57 | 48 | |
| 58 | if (compiler_rt_armhf_target) { | |
| 59 | convert_dcmp_args_to_df2_args(); | |
| 60 | } | |
| 61 | ||
| 62 | 49 | switch (cond) { |
| 63 | 50 | .Eq => asm volatile ( |
| 64 | 51 | \\ bl __eqdf2 |
lib/std/special/compiler_rt/arm/aeabi_fcmp.zig-13| ... | ... | @@ -2,8 +2,6 @@ |
| 2 | 2 | // |
| 3 | 3 | // https://github.com/llvm/llvm-project/commit/d674d96bc56c0f377879d01c9d8dfdaaa7859cdb/compiler-rt/lib/builtins/arm/aeabi_fcmp.S |
| 4 | 4 | |
| 5 | const compiler_rt_armhf_target = false; // TODO | |
| 6 | ||
| 7 | 5 | const ConditionalOperator = enum { |
| 8 | 6 | Eq, |
| 9 | 7 | Lt, |
| ... | ... | @@ -42,23 +40,12 @@ pub fn __aeabi_fcmpgt() callconv(.Naked) noreturn { |
| 42 | 40 | unreachable; |
| 43 | 41 | } |
| 44 | 42 | |
| 45 | inline fn convert_fcmp_args_to_sf2_args() void { | |
| 46 | asm volatile ( | |
| 47 | \\ vmov s0, r0 | |
| 48 | \\ vmov s1, r1 | |
| 49 | ); | |
| 50 | } | |
| 51 | ||
| 52 | 43 | fn aeabi_fcmp(comptime cond: ConditionalOperator) void { |
| 53 | 44 | @setRuntimeSafety(false); |
| 54 | 45 | asm volatile ( |
| 55 | 46 | \\ push { r4, lr } |
| 56 | 47 | ); |
| 57 | 48 | |
| 58 | if (compiler_rt_armhf_target) { | |
| 59 | convert_fcmp_args_to_sf2_args(); | |
| 60 | } | |
| 61 | ||
| 62 | 49 | switch (cond) { |
| 63 | 50 | .Eq => asm volatile ( |
| 64 | 51 | \\ bl __eqsf2 |
lib/std/special/compiler_rt/comparedf2.zig+5| ... | ... | @@ -117,6 +117,11 @@ pub fn __gtdf2(a: fp_t, b: fp_t) callconv(.C) c_int { |
| 117 | 117 | return __gedf2(a, b); |
| 118 | 118 | } |
| 119 | 119 | |
| 120 | pub fn __aeabi_dcmpun(a: fp_t, b: fp_t) callconv(.AAPCS) c_int { | |
| 121 | @setRuntimeSafety(false); | |
| 122 | return @call(.{ .modifier = .always_inline }, __unorddf2, .{ a, b }); | |
| 123 | } | |
| 124 | ||
| 120 | 125 | test "import comparedf2" { |
| 121 | 126 | _ = @import("comparedf2_test.zig"); |
| 122 | 127 | } |
lib/std/special/compiler_rt/comparesf2.zig+5| ... | ... | @@ -117,6 +117,11 @@ pub fn __gtsf2(a: fp_t, b: fp_t) callconv(.C) c_int { |
| 117 | 117 | return __gesf2(a, b); |
| 118 | 118 | } |
| 119 | 119 | |
| 120 | pub fn __aeabi_fcmpun(a: fp_t, b: fp_t) callconv(.AAPCS) c_int { | |
| 121 | @setRuntimeSafety(false); | |
| 122 | return @call(.{ .modifier = .always_inline }, __unordsf2, .{ a, b }); | |
| 123 | } | |
| 124 | ||
| 120 | 125 | test "import comparesf2" { |
| 121 | 126 | _ = @import("comparesf2_test.zig"); |
| 122 | 127 | } |
lib/std/special/compiler_rt/divdf3.zig+5| ... | ... | @@ -323,6 +323,11 @@ fn normalize(comptime T: type, significand: *@IntType(false, T.bit_count)) i32 { |
| 323 | 323 | return 1 - shift; |
| 324 | 324 | } |
| 325 | 325 | |
| 326 | pub fn __aeabi_ddiv(a: f64, b: f64) callconv(.AAPCS) f64 { | |
| 327 | @setRuntimeSafety(false); | |
| 328 | return @call(.{ .modifier = .always_inline }, __divdf3, .{ a, b }); | |
| 329 | } | |
| 330 | ||
| 326 | 331 | test "import divdf3" { |
| 327 | 332 | _ = @import("divdf3_test.zig"); |
| 328 | 333 | } |
lib/std/special/compiler_rt/divsf3.zig+5| ... | ... | @@ -196,6 +196,11 @@ fn normalize(comptime T: type, significand: *@IntType(false, T.bit_count)) i32 { |
| 196 | 196 | return 1 - shift; |
| 197 | 197 | } |
| 198 | 198 | |
| 199 | pub fn __aeabi_fdiv(a: f32, b: f32) callconv(.AAPCS) f32 { | |
| 200 | @setRuntimeSafety(false); | |
| 201 | return @call(.{ .modifier = .always_inline }, __divsf3, .{ a, b }); | |
| 202 | } | |
| 203 | ||
| 199 | 204 | test "import divsf3" { |
| 200 | 205 | _ = @import("divsf3_test.zig"); |
| 201 | 206 | } |
lib/std/special/compiler_rt/extendXfYf2.zig+10| ... | ... | @@ -18,6 +18,16 @@ pub fn __extendhfsf2(a: u16) callconv(.C) f32 { |
| 18 | 18 | return @call(.{ .modifier = .always_inline }, extendXfYf2, .{ f32, f16, a }); |
| 19 | 19 | } |
| 20 | 20 | |
| 21 | pub fn __aeabi_h2f(arg: u16) callconv(.AAPCS) f32 { | |
| 22 | @setRuntimeSafety(false); | |
| 23 | return @call(.{ .modifier = .always_inline }, __extendhfsf2, .{arg}); | |
| 24 | } | |
| 25 | ||
| 26 | pub fn __aeabi_f2d(arg: f32) callconv(.AAPCS) f64 { | |
| 27 | @setRuntimeSafety(false); | |
| 28 | return @call(.{ .modifier = .always_inline }, __extendsfdf2, .{arg}); | |
| 29 | } | |
| 30 | ||
| 21 | 31 | const CHAR_BIT = 8; |
| 22 | 32 | |
| 23 | 33 | fn extendXfYf2(comptime dst_t: type, comptime src_t: type, a: @IntType(false, @typeInfo(src_t).Float.bits)) dst_t { |
lib/std/special/compiler_rt/fixdfdi.zig+5| ... | ... | @@ -6,6 +6,11 @@ pub fn __fixdfdi(a: f64) callconv(.C) i64 { |
| 6 | 6 | return fixint(f64, i64, a); |
| 7 | 7 | } |
| 8 | 8 | |
| 9 | pub fn __aeabi_d2lz(arg: f64) callconv(.AAPCS) i64 { | |
| 10 | @setRuntimeSafety(false); | |
| 11 | return @call(.{ .modifier = .always_inline }, __fixdfdi, .{arg}); | |
| 12 | } | |
| 13 | ||
| 9 | 14 | test "import fixdfdi" { |
| 10 | 15 | _ = @import("fixdfdi_test.zig"); |
| 11 | 16 | } |
lib/std/special/compiler_rt/fixdfsi.zig+5| ... | ... | @@ -6,6 +6,11 @@ pub fn __fixdfsi(a: f64) callconv(.C) i32 { |
| 6 | 6 | return fixint(f64, i32, a); |
| 7 | 7 | } |
| 8 | 8 | |
| 9 | pub fn __aeabi_d2iz(a: f64) callconv(.AAPCS) i32 { | |
| 10 | @setRuntimeSafety(false); | |
| 11 | return @call(.{ .modifier = .always_inline }, __fixdfsi, .{a}); | |
| 12 | } | |
| 13 | ||
| 9 | 14 | test "import fixdfsi" { |
| 10 | 15 | _ = @import("fixdfsi_test.zig"); |
| 11 | 16 | } |
lib/std/special/compiler_rt/fixsfdi.zig+5| ... | ... | @@ -6,6 +6,11 @@ pub fn __fixsfdi(a: f32) callconv(.C) i64 { |
| 6 | 6 | return fixint(f32, i64, a); |
| 7 | 7 | } |
| 8 | 8 | |
| 9 | pub fn __aeabi_f2lz(arg: f32) callconv(.AAPCS) i64 { | |
| 10 | @setRuntimeSafety(false); | |
| 11 | return @call(.{ .modifier = .always_inline }, __fixsfdi, .{arg}); | |
| 12 | } | |
| 13 | ||
| 9 | 14 | test "import fixsfdi" { |
| 10 | 15 | _ = @import("fixsfdi_test.zig"); |
| 11 | 16 | } |
lib/std/special/compiler_rt/fixsfsi.zig+5| ... | ... | @@ -6,6 +6,11 @@ pub fn __fixsfsi(a: f32) callconv(.C) i32 { |
| 6 | 6 | return fixint(f32, i32, a); |
| 7 | 7 | } |
| 8 | 8 | |
| 9 | pub fn __aeabi_f2iz(a: f32) callconv(.AAPCS) i32 { | |
| 10 | @setRuntimeSafety(false); | |
| 11 | return @call(.{ .modifier = .always_inline }, __fixsfsi, .{a}); | |
| 12 | } | |
| 13 | ||
| 9 | 14 | test "import fixsfsi" { |
| 10 | 15 | _ = @import("fixsfsi_test.zig"); |
| 11 | 16 | } |
lib/std/special/compiler_rt/fixunsdfdi.zig+5| ... | ... | @@ -6,6 +6,11 @@ pub fn __fixunsdfdi(a: f64) callconv(.C) u64 { |
| 6 | 6 | return fixuint(f64, u64, a); |
| 7 | 7 | } |
| 8 | 8 | |
| 9 | pub fn __aeabi_d2ulz(a: f64) callconv(.AAPCS) u64 { | |
| 10 | @setRuntimeSafety(false); | |
| 11 | return @call(.{ .modifier = .always_inline }, __fixunsdfdi, .{a}); | |
| 12 | } | |
| 13 | ||
| 9 | 14 | test "import fixunsdfdi" { |
| 10 | 15 | _ = @import("fixunsdfdi_test.zig"); |
| 11 | 16 | } |
lib/std/special/compiler_rt/fixunsdfsi.zig+5| ... | ... | @@ -6,6 +6,11 @@ pub fn __fixunsdfsi(a: f64) callconv(.C) u32 { |
| 6 | 6 | return fixuint(f64, u32, a); |
| 7 | 7 | } |
| 8 | 8 | |
| 9 | pub fn __aeabi_d2uiz(arg: f64) callconv(.AAPCS) u32 { | |
| 10 | @setRuntimeSafety(false); | |
| 11 | return @call(.{ .modifier = .always_inline }, __fixunsdfsi, .{arg}); | |
| 12 | } | |
| 13 | ||
| 9 | 14 | test "import fixunsdfsi" { |
| 10 | 15 | _ = @import("fixunsdfsi_test.zig"); |
| 11 | 16 | } |
lib/std/special/compiler_rt/fixunssfdi.zig+5| ... | ... | @@ -6,6 +6,11 @@ pub fn __fixunssfdi(a: f32) callconv(.C) u64 { |
| 6 | 6 | return fixuint(f32, u64, a); |
| 7 | 7 | } |
| 8 | 8 | |
| 9 | pub fn __aeabi_f2ulz(a: f32) callconv(.AAPCS) u64 { | |
| 10 | @setRuntimeSafety(false); | |
| 11 | return @call(.{ .modifier = .always_inline }, __fixunssfdi, .{a}); | |
| 12 | } | |
| 13 | ||
| 9 | 14 | test "import fixunssfdi" { |
| 10 | 15 | _ = @import("fixunssfdi_test.zig"); |
| 11 | 16 | } |
lib/std/special/compiler_rt/fixunssfsi.zig+5| ... | ... | @@ -6,6 +6,11 @@ pub fn __fixunssfsi(a: f32) callconv(.C) u32 { |
| 6 | 6 | return fixuint(f32, u32, a); |
| 7 | 7 | } |
| 8 | 8 | |
| 9 | pub fn __aeabi_f2uiz(a: f32) callconv(.AAPCS) u32 { | |
| 10 | @setRuntimeSafety(false); | |
| 11 | return @call(.{ .modifier = .always_inline }, __fixunssfsi, .{a}); | |
| 12 | } | |
| 13 | ||
| 9 | 14 | test "import fixunssfsi" { |
| 10 | 15 | _ = @import("fixunssfsi_test.zig"); |
| 11 | 16 | } |
lib/std/special/compiler_rt/floatdidf.zig+5| ... | ... | @@ -17,6 +17,11 @@ pub fn __floatdidf(a: i64) callconv(.C) f64 { |
| 17 | 17 | return (high - twop52) + @bitCast(f64, low); |
| 18 | 18 | } |
| 19 | 19 | |
| 20 | pub fn __aeabi_l2d(arg: i64) callconv(.AAPCS) f64 { | |
| 21 | @setRuntimeSafety(false); | |
| 22 | return @call(.{ .modifier = .always_inline }, __floatdidf, .{arg}); | |
| 23 | } | |
| 24 | ||
| 20 | 25 | test "import floatdidf" { |
| 21 | 26 | _ = @import("floatdidf_test.zig"); |
| 22 | 27 | } |
lib/std/special/compiler_rt/floatsiXf.zig+10| ... | ... | @@ -68,6 +68,16 @@ pub fn __floatsitf(arg: i32) callconv(.C) f128 { |
| 68 | 68 | return @call(.{ .modifier = .always_inline }, floatsiXf, .{ f128, arg }); |
| 69 | 69 | } |
| 70 | 70 | |
| 71 | pub fn __aeabi_i2d(arg: i32) callconv(.AAPCS) f64 { | |
| 72 | @setRuntimeSafety(false); | |
| 73 | return @call(.{ .modifier = .always_inline }, __floatsidf, .{arg}); | |
| 74 | } | |
| 75 | ||
| 76 | pub fn __aeabi_i2f(arg: i32) callconv(.AAPCS) f32 { | |
| 77 | @setRuntimeSafety(false); | |
| 78 | return @call(.{ .modifier = .always_inline }, __floatsisf, .{arg}); | |
| 79 | } | |
| 80 | ||
| 71 | 81 | fn test_one_floatsitf(a: i32, expected: u128) void { |
| 72 | 82 | const r = __floatsitf(a); |
| 73 | 83 | std.testing.expect(@bitCast(u128, r) == expected); |
lib/std/special/compiler_rt/floatundidf.zig+5| ... | ... | @@ -19,6 +19,11 @@ pub fn __floatundidf(a: u64) callconv(.C) f64 { |
| 19 | 19 | return (@bitCast(f64, high) - twop84_plus_twop52) + @bitCast(f64, low); |
| 20 | 20 | } |
| 21 | 21 | |
| 22 | pub fn __aeabi_ul2d(arg: u64) callconv(.AAPCS) f64 { | |
| 23 | @setRuntimeSafety(false); | |
| 24 | return @call(.{ .modifier = .always_inline }, __floatundidf, .{arg}); | |
| 25 | } | |
| 26 | ||
| 22 | 27 | test "import floatundidf" { |
| 23 | 28 | _ = @import("floatundidf_test.zig"); |
| 24 | 29 | } |
lib/std/special/compiler_rt/floatundisf.zig+6-1| ... | ... | @@ -4,7 +4,7 @@ const maxInt = std.math.maxInt; |
| 4 | 4 | |
| 5 | 5 | const FLT_MANT_DIG = 24; |
| 6 | 6 | |
| 7 | pub extern fn __floatundisf(arg: u64) f32 { | |
| 7 | pub fn __floatundisf(arg: u64) callconv(.C) f32 { | |
| 8 | 8 | @setRuntimeSafety(builtin.is_test); |
| 9 | 9 | |
| 10 | 10 | if (arg == 0) return 0; |
| ... | ... | @@ -56,6 +56,11 @@ pub extern fn __floatundisf(arg: u64) f32 { |
| 56 | 56 | return @bitCast(f32, result); |
| 57 | 57 | } |
| 58 | 58 | |
| 59 | pub fn __aeabi_ul2f(arg: u64) callconv(.AAPCS) f32 { | |
| 60 | @setRuntimeSafety(false); | |
| 61 | return @call(.{ .modifier = .always_inline }, __floatundisf, .{arg}); | |
| 62 | } | |
| 63 | ||
| 59 | 64 | fn test__floatundisf(a: u64, expected: f32) void { |
| 60 | 65 | std.testing.expectEqual(expected, __floatundisf(a)); |
| 61 | 66 | } |
lib/std/special/compiler_rt/floatunsidf.zig+5| ... | ... | @@ -18,6 +18,11 @@ pub fn __floatunsidf(arg: u32) callconv(.C) f64 { |
| 18 | 18 | return @bitCast(f64, mant | (exp + 1023) << 52); |
| 19 | 19 | } |
| 20 | 20 | |
| 21 | pub fn __aeabi_ui2d(arg: u32) callconv(.AAPCS) f64 { | |
| 22 | @setRuntimeSafety(false); | |
| 23 | return @call(.{ .modifier = .always_inline }, __floatunsidf, .{arg}); | |
| 24 | } | |
| 25 | ||
| 21 | 26 | fn test_one_floatunsidf(a: u32, expected: u64) void { |
| 22 | 27 | const r = __floatunsidf(a); |
| 23 | 28 | std.testing.expect(@bitCast(u64, r) == expected); |
lib/std/special/compiler_rt/floatunsisf.zig+6-1| ... | ... | @@ -6,7 +6,7 @@ const significandBits = 23; |
| 6 | 6 | const exponentBias = 127; |
| 7 | 7 | const implicitBit = @as(u32, 1) << significandBits; |
| 8 | 8 | |
| 9 | pub extern fn __floatunsisf(arg: u32) f32 { | |
| 9 | pub fn __floatunsisf(arg: u32) callconv(.C) f32 { | |
| 10 | 10 | @setRuntimeSafety(builtin.is_test); |
| 11 | 11 | |
| 12 | 12 | if (arg == 0) return 0.0; |
| ... | ... | @@ -38,6 +38,11 @@ pub extern fn __floatunsisf(arg: u32) f32 { |
| 38 | 38 | return @bitCast(f32, result); |
| 39 | 39 | } |
| 40 | 40 | |
| 41 | pub fn __aeabi_ui2f(arg: u32) callconv(.AAPCS) f32 { | |
| 42 | @setRuntimeSafety(false); | |
| 43 | return @call(.{ .modifier = .always_inline }, __floatunsisf, .{arg}); | |
| 44 | } | |
| 45 | ||
| 41 | 46 | fn test_one_floatunsisf(a: u32, expected: u32) void { |
| 42 | 47 | const r = __floatunsisf(a); |
| 43 | 48 | std.testing.expect(@bitCast(u32, r) == expected); |
lib/std/special/compiler_rt/mulXf3.zig+10| ... | ... | @@ -16,6 +16,16 @@ pub fn __mulsf3(a: f32, b: f32) callconv(.C) f32 { |
| 16 | 16 | return mulXf3(f32, a, b); |
| 17 | 17 | } |
| 18 | 18 | |
| 19 | pub fn __aeabi_fmul(a: f32, b: f32) callconv(.C) f32 { | |
| 20 | @setRuntimeSafety(false); | |
| 21 | return @call(.{ .modifier = .always_inline }, __mulsf3, .{ a, b }); | |
| 22 | } | |
| 23 | ||
| 24 | pub fn __aeabi_dmul(a: f64, b: f64) callconv(.C) f64 { | |
| 25 | @setRuntimeSafety(false); | |
| 26 | return @call(.{ .modifier = .always_inline }, __muldf3, .{ a, b }); | |
| 27 | } | |
| 28 | ||
| 19 | 29 | fn mulXf3(comptime T: type, a: T, b: T) T { |
| 20 | 30 | @setRuntimeSafety(builtin.is_test); |
| 21 | 31 | const Z = @IntType(false, T.bit_count); |
lib/std/special/compiler_rt/negXf2.zig+10| ... | ... | @@ -8,6 +8,16 @@ pub fn __negdf2(a: f64) callconv(.C) f64 { |
| 8 | 8 | return negXf2(f64, a); |
| 9 | 9 | } |
| 10 | 10 | |
| 11 | pub fn __aeabi_fneg(arg: f32) callconv(.AAPCS) f32 { | |
| 12 | @setRuntimeSafety(false); | |
| 13 | return @call(.{ .modifier = .always_inline }, __negsf2, .{arg}); | |
| 14 | } | |
| 15 | ||
| 16 | pub fn __aeabi_dneg(arg: f64) callconv(.AAPCS) f64 { | |
| 17 | @setRuntimeSafety(false); | |
| 18 | return @call(.{ .modifier = .always_inline }, __negdf2, .{arg}); | |
| 19 | } | |
| 20 | ||
| 11 | 21 | fn negXf2(comptime T: type, a: T) T { |
| 12 | 22 | const Z = @IntType(false, T.bit_count); |
| 13 | 23 |
lib/std/special/compiler_rt/truncXfYf2.zig+15| ... | ... | @@ -20,6 +20,21 @@ pub fn __truncdfsf2(a: f64) callconv(.C) f32 { |
| 20 | 20 | return truncXfYf2(f32, f64, a); |
| 21 | 21 | } |
| 22 | 22 | |
| 23 | pub fn __aeabi_d2f(a: f64) callconv(.AAPCS) f32 { | |
| 24 | @setRuntimeSafety(false); | |
| 25 | return @call(.{ .modifier = .always_inline }, __truncdfsf2, .{a}); | |
| 26 | } | |
| 27 | ||
| 28 | pub fn __aeabi_d2h(a: f64) callconv(.AAPCS) u16 { | |
| 29 | @setRuntimeSafety(false); | |
| 30 | return @call(.{ .modifier = .always_inline }, __truncdfhf2, .{a}); | |
| 31 | } | |
| 32 | ||
| 33 | pub fn __aeabi_f2h(a: f32) callconv(.AAPCS) u16 { | |
| 34 | @setRuntimeSafety(false); | |
| 35 | return @call(.{ .modifier = .always_inline }, __truncsfhf2, .{a}); | |
| 36 | } | |
| 37 | ||
| 23 | 38 | inline fn truncXfYf2(comptime dst_t: type, comptime src_t: type, a: src_t) dst_t { |
| 24 | 39 | const src_rep_t = @IntType(false, @typeInfo(src_t).Float.bits); |
| 25 | 40 | const dst_rep_t = @IntType(false, @typeInfo(dst_t).Float.bits); |