| author | |
| committer | |
| log | 69a95571ed6e0f2c4562b70dc222f427b3366858 |
| tree | 05e8e0ec5af7b9f3ef5ef0f3f79adadac99784f8 |
| parent | e60ba21114bc4514acc535be7106ce6c16e9bf04 |
7 files changed, 1 insertions(+), 78 deletions(-)
lib/libc/musl/src/math/aarch64/round.c deleted-7| ... | @@ -1,7 +0,0 @@ | ||
| 1 | #include <math.h> | ||
| 2 | |||
| 3 | double round(double x) | ||
| 4 | { | ||
| 5 | 	__asm__ ("frinta %d0, %d1" : "=w"(x) : "w"(x)); | ||
| 6 | 	return x; | ||
| 7 | } | ||
lib/libc/musl/src/math/powerpc64/round.c deleted-15| ... | @@ -1,15 +0,0 @@ | ||
| 1 | #include <math.h> | ||
| 2 | |||
| 3 | #ifdef _ARCH_PWR5X | ||
| 4 | |||
| 5 | double round(double x) | ||
| 6 | { | ||
| 7 | 	__asm__ ("frin %0, %1" : "=d"(x) : "d"(x)); | ||
| 8 | 	return x; | ||
| 9 | } | ||
| 10 | |||
| 11 | #else | ||
| 12 | |||
| 13 | #include "../round.c" | ||
| 14 | |||
| 15 | #endif | ||
lib/libc/musl/src/math/round.c deleted-35| ... | @@ -1,35 +0,0 @@ | ||
| 1 | #include "libm.h" | ||
| 2 | |||
| 3 | #if FLT_EVAL_METHOD==0 || FLT_EVAL_METHOD==1 | ||
| 4 | #define EPS DBL_EPSILON | ||
| 5 | #elif FLT_EVAL_METHOD==2 | ||
| 6 | #define EPS LDBL_EPSILON | ||
| 7 | #endif | ||
| 8 | static const double_t toint = 1/EPS; | ||
| 9 | |||
| 10 | double round(double x) | ||
| 11 | { | ||
| 12 | 	union {double f; uint64_t i;} u = {x}; | ||
| 13 | 	int e = u.i >> 52 & 0x7ff; | ||
| 14 | 	double_t y; | ||
| 15 | |||
| 16 | 	if (e >= 0x3ff+52) | ||
| 17 | 		return x; | ||
| 18 | 	if (u.i >> 63) | ||
| 19 | 		x = -x; | ||
| 20 | 	if (e < 0x3ff-1) { | ||
| 21 | 		/* raise inexact if x!=0 */ | ||
| 22 | 		FORCE_EVAL(x + toint); | ||
| 23 | 		return 0*u.f; | ||
| 24 | 	} | ||
| 25 | 	y = x + toint - toint - x; | ||
| 26 | 	if (y > 0.5) | ||
| 27 | 		y = y + x - 1; | ||
| 28 | 	else if (y <= -0.5) | ||
| 29 | 		y = y + x + 1; | ||
| 30 | 	else | ||
| 31 | 		y = y + x; | ||
| 32 | 	if (u.i >> 63) | ||
| 33 | 		y = -y; | ||
| 34 | 	return y; | ||
| 35 | } | ||
lib/libc/musl/src/math/s390x/round.c deleted-15| ... | @@ -1,15 +0,0 @@ | ||
| 1 | #include <math.h> | ||
| 2 | |||
| 3 | #if defined(__HTM__) || __ARCH__ >= 9 | ||
| 4 | |||
| 5 | double round(double x) | ||
| 6 | { | ||
| 7 | 	__asm__ ("fidbra %0, 1, %1, 4" : "=f"(x) : "f"(x)); | ||
| 8 | 	return x; | ||
| 9 | } | ||
| 10 | |||
| 11 | #else | ||
| 12 | |||
| 13 | #include "../round.c" | ||
| 14 | |||
| 15 | #endif | ||
src/libs/musl.zig-4| ... | @@ -818,7 +818,6 @@ const src_files = [_][]const u8{ | ... | @@ -818,7 +818,6 @@ const src_files = [_][]const u8{ |
| 818 | "musl/src/math/aarch64/nearbyintf.c", | 818 | "musl/src/math/aarch64/nearbyintf.c", |
| 819 | "musl/src/math/aarch64/rint.c", | 819 | "musl/src/math/aarch64/rint.c", |
| 820 | "musl/src/math/aarch64/rintf.c", | 820 | "musl/src/math/aarch64/rintf.c", |
| 821 | "musl/src/math/aarch64/round.c", | ||
| 822 | "musl/src/math/aarch64/roundf.c", | 821 | "musl/src/math/aarch64/roundf.c", |
| 823 | "musl/src/math/acosf.c", | 822 | "musl/src/math/acosf.c", |
| 824 | "musl/src/math/acosh.c", | 823 | "musl/src/math/acosh.c", |
| ... | @@ -997,7 +996,6 @@ const src_files = [_][]const u8{ | ... | @@ -997,7 +996,6 @@ const src_files = [_][]const u8{ |
| 997 | "musl/src/math/powerpc64/lrintf.c", | 996 | "musl/src/math/powerpc64/lrintf.c", |
| 998 | "musl/src/math/powerpc64/lround.c", | 997 | "musl/src/math/powerpc64/lround.c", |
| 999 | "musl/src/math/powerpc64/lroundf.c", | 998 | "musl/src/math/powerpc64/lroundf.c", |
| 1000 | "musl/src/math/powerpc64/round.c", | ||
| 1001 | "musl/src/math/powerpc64/roundf.c", | 999 | "musl/src/math/powerpc64/roundf.c", |
| 1002 | "musl/src/math/powerpc/fma.c", | 1000 | "musl/src/math/powerpc/fma.c", |
| 1003 | "musl/src/math/powerpc/fmaf.c", | 1001 | "musl/src/math/powerpc/fmaf.c", |
| ... | @@ -1021,7 +1019,6 @@ const src_files = [_][]const u8{ | ... | @@ -1021,7 +1019,6 @@ const src_files = [_][]const u8{ |
| 1021 | "musl/src/math/riscv32/fmaf.c", | 1019 | "musl/src/math/riscv32/fmaf.c", |
| 1022 | "musl/src/math/riscv64/fma.c", | 1020 | "musl/src/math/riscv64/fma.c", |
| 1023 | "musl/src/math/riscv64/fmaf.c", | 1021 | "musl/src/math/riscv64/fmaf.c", |
| 1024 | "musl/src/math/round.c", | ||
| 1025 | "musl/src/math/roundf.c", | 1022 | "musl/src/math/roundf.c", |
| 1026 | "musl/src/math/s390x/fma.c", | 1023 | "musl/src/math/s390x/fma.c", |
| 1027 | "musl/src/math/s390x/fmaf.c", | 1024 | "musl/src/math/s390x/fmaf.c", |
| ... | @@ -1031,7 +1028,6 @@ const src_files = [_][]const u8{ | ... | @@ -1031,7 +1028,6 @@ const src_files = [_][]const u8{ |
| 1031 | "musl/src/math/s390x/rint.c", | 1028 | "musl/src/math/s390x/rint.c", |
| 1032 | "musl/src/math/s390x/rintf.c", | 1029 | "musl/src/math/s390x/rintf.c", |
| 1033 | "musl/src/math/s390x/rintl.c", | 1030 | "musl/src/math/s390x/rintl.c", |
| 1034 | "musl/src/math/s390x/round.c", | ||
| 1035 | "musl/src/math/s390x/roundf.c", | 1031 | "musl/src/math/s390x/roundf.c", |
| 1036 | "musl/src/math/scalb.c", | 1032 | "musl/src/math/scalb.c", |
| 1037 | "musl/src/math/scalbf.c", | 1033 | "musl/src/math/scalbf.c", |
src/libs/wasi_libc.zig-1| ... | @@ -808,7 +808,6 @@ const libc_top_half_src_files = [_][]const u8{ | ... | @@ -808,7 +808,6 @@ const libc_top_half_src_files = [_][]const u8{ |
| 808 | "musl/src/math/remquof.c", | 808 | "musl/src/math/remquof.c", |
| 809 | "musl/src/math/remquol.c", | 809 | "musl/src/math/remquol.c", |
| 810 | "musl/src/math/rintl.c", | 810 | "musl/src/math/rintl.c", |
| 811 | "musl/src/math/round.c", | ||
| 812 | "musl/src/math/roundf.c", | 811 | "musl/src/math/roundf.c", |
| 813 | "musl/src/math/scalb.c", | 812 | "musl/src/math/scalb.c", |
| 814 | "musl/src/math/scalbf.c", | 813 | "musl/src/math/scalbf.c", |
test/libc.zig+1-1| ... | @@ -296,7 +296,7 @@ pub fn addCases(cases: *tests.LibcContext) void { | ... | @@ -296,7 +296,7 @@ pub fn addCases(cases: *tests.LibcContext) void { |
| 296 | // cases.addLibcTestCase("math/rint.c", true, .{}); | 296 | // cases.addLibcTestCase("math/rint.c", true, .{}); |
| 297 | cases.addLibcTestCase("math/rintf.c", true, .{}); | 297 | cases.addLibcTestCase("math/rintf.c", true, .{}); |
| 298 | // cases.addLibcTestCase("math/rintl.c", true, .{}); | 298 | // cases.addLibcTestCase("math/rintl.c", true, .{}); |
| 299 | // cases.addLibcTestCase("math/round.c", true, .{}); | 299 | cases.addLibcTestCase("math/round.c", true, .{}); |
| 300 | // cases.addLibcTestCase("math/roundf.c", true, .{}); | 300 | // cases.addLibcTestCase("math/roundf.c", true, .{}); |
| 301 | cases.addLibcTestCase("math/roundl.c", true, .{}); | 301 | cases.addLibcTestCase("math/roundl.c", true, .{}); |
| 302 | cases.addLibcTestCase("math/scalb.c", true, .{}); | 302 | cases.addLibcTestCase("math/scalb.c", true, .{}); |