authorgravatar for kj4tmp@gmail.comkj4tmp <kj4tmp@gmail.com> 2026-01-29 21:07:12-08:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2026-02-01 00:59:35+01:00
loge60ba21114bc4514acc535be7106ce6c16e9bf04
tree530816e88eab86aed30897121ddafda248a8a89a
parent2b19134c86223236b3fffc1360577a31d0251604

libzigc: roundl


6 files changed, 1 insertions(+), 46 deletions(-)

lib/libc/mingw/math/roundl.c deleted-26
......@@ -1,26 +0,0 @@
1/**
2 * This file has no copyright assigned and is placed in the Public Domain.
3 * This file is part of the mingw-w64 runtime package.
4 * No warranty is given; refer to the file DISCLAIMER.PD within this package.
5 */
6#include <math.h>
7
8long double
9roundl (long double x)
10{
11 long double res = 0.0L;
12 if (x >= 0.0L)
13 {
14 res = ceill (x);
15 if (res - x > 0.5L)
16 res -= 1.0L;
17 }
18 else
19 {
20 res = ceill (-x);
21 if (res + x > 0.5L)
22 res -= 1.0L;
23 res = -res;
24 }
25 return res;
26}
lib/libc/musl/src/math/s390x/roundl.c deleted-15
......@@ -1,15 +0,0 @@
1#include <math.h>
2
3#if defined(__HTM__) || __ARCH__ >= 9
4
5long double roundl(long double x)
6{
7 __asm__ ("fixbra %0, 1, %1, 4" : "=f"(x) : "f"(x));
8 return x;
9}
10
11#else
12
13#include "../roundl.c"
14
15#endif
src/libs/mingw.zig-1
......@@ -936,7 +936,6 @@ const mingw32_x86_src = [_][]const u8{
936936 "math" ++ path.sep_str ++ "lrintl.c",
937937 "math" ++ path.sep_str ++ "lroundl.c",
938938 "math" ++ path.sep_str ++ "rintl.c",
939 "math" ++ path.sep_str ++ "roundl.c",
940939 "math" ++ path.sep_str ++ "tgammal.c",
941940 "math" ++ path.sep_str ++ "x86" ++ path.sep_str ++ "_chgsignl.S",
942941 "math" ++ path.sep_str ++ "x86" ++ path.sep_str ++ "acoshl.c",
src/libs/musl.zig-2
......@@ -1023,7 +1023,6 @@ const src_files = [_][]const u8{
10231023 "musl/src/math/riscv64/fmaf.c",
10241024 "musl/src/math/round.c",
10251025 "musl/src/math/roundf.c",
1026 "musl/src/math/roundl.c",
10271026 "musl/src/math/s390x/fma.c",
10281027 "musl/src/math/s390x/fmaf.c",
10291028 "musl/src/math/s390x/nearbyint.c",
......@@ -1034,7 +1033,6 @@ const src_files = [_][]const u8{
10341033 "musl/src/math/s390x/rintl.c",
10351034 "musl/src/math/s390x/round.c",
10361035 "musl/src/math/s390x/roundf.c",
1037 "musl/src/math/s390x/roundl.c",
10381036 "musl/src/math/scalb.c",
10391037 "musl/src/math/scalbf.c",
10401038 "musl/src/math/scalbln.c",
src/libs/wasi_libc.zig-1
......@@ -810,7 +810,6 @@ const libc_top_half_src_files = [_][]const u8{
810810 "musl/src/math/rintl.c",
811811 "musl/src/math/round.c",
812812 "musl/src/math/roundf.c",
813 "musl/src/math/roundl.c",
814813 "musl/src/math/scalb.c",
815814 "musl/src/math/scalbf.c",
816815 "musl/src/math/scalbln.c",
test/libc.zig+1-1
......@@ -298,7 +298,7 @@ pub fn addCases(cases: *tests.LibcContext) void {
298298 // cases.addLibcTestCase("math/rintl.c", true, .{});
299299 // cases.addLibcTestCase("math/round.c", true, .{});
300300 // cases.addLibcTestCase("math/roundf.c", true, .{});
301 // cases.addLibcTestCase("math/roundl.c", true, .{});
301 cases.addLibcTestCase("math/roundl.c", true, .{});
302302 cases.addLibcTestCase("math/scalb.c", true, .{});
303303 cases.addLibcTestCase("math/scalbf.c", true, .{});
304304 cases.addLibcTestCase("math/scalbln.c", true, .{});