authorgravatar for seda18@rolmail.netDavid Senoner <seda18@rolmail.net> 2025-07-04 12:54:31+02:00
committergravatar for seda18@rolmail.netDavid Senoner <seda18@rolmail.net> 2025-07-04 12:54:31+02:00
log3124f700c736383ca8c63e773b804ef78cc0bd19
tree82980a020ca49845dd208ae200f0c5d46b8e713b
parent9ef4bdf234ed6b58d46452f2286469925f062c39
signaturelock-open Commit is signed but in an unrecognized format.

delete superfluous libc floor implementations


12 files changed, 0 insertions(+), 192 deletions(-)

lib/libc/musl/src/math/aarch64/floor.c deleted-7
......@@ -1,7 +0,0 @@
1#include <math.h>
2
3double floor(double x)
4{
5 __asm__ ("frintm %d0, %d1" : "=w"(x) : "w"(x));
6 return x;
7}
lib/libc/musl/src/math/aarch64/floorf.c deleted-7
......@@ -1,7 +0,0 @@
1#include <math.h>
2
3float floorf(float x)
4{
5 __asm__ ("frintm %s0, %s1" : "=w"(x) : "w"(x));
6 return x;
7}
lib/libc/musl/src/math/floor.c deleted-31
......@@ -1,31 +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
8static const double_t toint = 1/EPS;
9
10double floor(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 || x == 0)
17 return x;
18 /* y = int(x) - x, where int(x) is an integer neighbor of x */
19 if (u.i >> 63)
20 y = x - toint + toint - x;
21 else
22 y = x + toint - toint - x;
23 /* special case because of non-nearest rounding modes */
24 if (e <= 0x3ff-1) {
25 FORCE_EVAL(y);
26 return u.i >> 63 ? -1 : 0;
27 }
28 if (y > 0)
29 return x + y - 1;
30 return x + y;
31}
lib/libc/musl/src/math/floorf.c deleted-27
......@@ -1,27 +0,0 @@
1#include "libm.h"
2
3float floorf(float x)
4{
5 union {float f; uint32_t i;} u = {x};
6 int e = (int)(u.i >> 23 & 0xff) - 0x7f;
7 uint32_t m;
8
9 if (e >= 23)
10 return x;
11 if (e >= 0) {
12 m = 0x007fffff >> e;
13 if ((u.i & m) == 0)
14 return x;
15 FORCE_EVAL(x + 0x1p120f);
16 if (u.i >> 31)
17 u.i += m;
18 u.i &= ~m;
19 } else {
20 FORCE_EVAL(x + 0x1p120f);
21 if (u.i >> 31 == 0)
22 u.i = 0;
23 else if (u.i << 1)
24 u.f = -1.0;
25 }
26 return u.f;
27}
lib/libc/musl/src/math/floorl.c deleted-34
......@@ -1,34 +0,0 @@
1#include "libm.h"
2
3#if LDBL_MANT_DIG == 53 && LDBL_MAX_EXP == 1024
4long double floorl(long double x)
5{
6 return floor(x);
7}
8#elif (LDBL_MANT_DIG == 64 || LDBL_MANT_DIG == 113) && LDBL_MAX_EXP == 16384
9
10static const long double toint = 1/LDBL_EPSILON;
11
12long double floorl(long double x)
13{
14 union ldshape u = {x};
15 int e = u.i.se & 0x7fff;
16 long double y;
17
18 if (e >= 0x3fff+LDBL_MANT_DIG-1 || x == 0)
19 return x;
20 /* y = int(x) - x, where int(x) is an integer neighbor of x */
21 if (u.i.se >> 15)
22 y = x - toint + toint - x;
23 else
24 y = x + toint - toint - x;
25 /* special case because of non-nearest rounding modes */
26 if (e <= 0x3fff-1) {
27 FORCE_EVAL(y);
28 return u.i.se >> 15 ? -1 : 0;
29 }
30 if (y > 0)
31 return x + y - 1;
32 return x + y;
33}
34#endif
lib/libc/musl/src/math/powerpc64/floor.c deleted-15
......@@ -1,15 +0,0 @@
1#include <math.h>
2
3#ifdef _ARCH_PWR5X
4
5double floor(double x)
6{
7 __asm__ ("frim %0, %1" : "=d"(x) : "d"(x));
8 return x;
9}
10
11#else
12
13#include "../floor.c"
14
15#endif
lib/libc/musl/src/math/powerpc64/floorf.c deleted-15
......@@ -1,15 +0,0 @@
1#include <math.h>
2
3#ifdef _ARCH_PWR5X
4
5float floorf(float x)
6{
7 __asm__ ("frim %0, %1" : "=f"(x) : "f"(x));
8 return x;
9}
10
11#else
12
13#include "../floorf.c"
14
15#endif
lib/libc/musl/src/math/s390x/floor.c deleted-15
......@@ -1,15 +0,0 @@
1#include <math.h>
2
3#if defined(__HTM__) || __ARCH__ >= 9
4
5double floor(double x)
6{
7 __asm__ ("fidbra %0, 7, %1, 4" : "=f"(x) : "f"(x));
8 return x;
9}
10
11#else
12
13#include "../floor.c"
14
15#endif
lib/libc/musl/src/math/s390x/floorf.c deleted-15
......@@ -1,15 +0,0 @@
1#include <math.h>
2
3#if defined(__HTM__) || __ARCH__ >= 9
4
5float floorf(float x)
6{
7 __asm__ ("fiebra %0, 7, %1, 4" : "=f"(x) : "f"(x));
8 return x;
9}
10
11#else
12
13#include "../floorf.c"
14
15#endif
lib/libc/musl/src/math/s390x/floorl.c deleted-15
......@@ -1,15 +0,0 @@
1#include <math.h>
2
3#if defined(__HTM__) || __ARCH__ >= 9
4
5long double floorl(long double x)
6{
7 __asm__ ("fixbra %0, 7, %1, 4" : "=f"(x) : "f"(x));
8 return x;
9}
10
11#else
12
13#include "../floorl.c"
14
15#endif
src/libs/musl.zig-10
......@@ -824,8 +824,6 @@ const src_files = [_][]const u8{
824824 "musl/src/malloc/replaced.c",
825825 "musl/src/math/aarch64/ceil.c",
826826 "musl/src/math/aarch64/ceilf.c",
827 "musl/src/math/aarch64/floor.c",
828 "musl/src/math/aarch64/floorf.c",
829827 "musl/src/math/aarch64/fma.c",
830828 "musl/src/math/aarch64/fmaf.c",
831829 "musl/src/math/aarch64/fmax.c",
......@@ -915,9 +913,6 @@ const src_files = [_][]const u8{
915913 "musl/src/math/fdiml.c",
916914 "musl/src/math/finite.c",
917915 "musl/src/math/finitef.c",
918 "musl/src/math/floor.c",
919 "musl/src/math/floorf.c",
920 "musl/src/math/floorl.c",
921916 "musl/src/math/fma.c",
922917 "musl/src/math/fmaf.c",
923918 "musl/src/math/fmal.c",
......@@ -1092,8 +1087,6 @@ const src_files = [_][]const u8{
10921087 "musl/src/math/pow_data.c",
10931088 "musl/src/math/powerpc64/ceil.c",
10941089 "musl/src/math/powerpc64/ceilf.c",
1095 "musl/src/math/powerpc64/floor.c",
1096 "musl/src/math/powerpc64/floorf.c",
10971090 "musl/src/math/powerpc64/fma.c",
10981091 "musl/src/math/powerpc64/fmaf.c",
10991092 "musl/src/math/powerpc64/fmax.c",
......@@ -1156,9 +1149,6 @@ const src_files = [_][]const u8{
11561149 "musl/src/math/s390x/ceil.c",
11571150 "musl/src/math/s390x/ceilf.c",
11581151 "musl/src/math/s390x/ceill.c",
1159 "musl/src/math/s390x/floor.c",
1160 "musl/src/math/s390x/floorf.c",
1161 "musl/src/math/s390x/floorl.c",
11621152 "musl/src/math/s390x/fma.c",
11631153 "musl/src/math/s390x/fmaf.c",
11641154 "musl/src/math/s390x/nearbyint.c",
src/libs/wasi_libc.zig-1
......@@ -754,7 +754,6 @@ const libc_top_half_src_files = [_][]const u8{
754754 "musl/src/math/fdiml.c",
755755 "musl/src/math/finite.c",
756756 "musl/src/math/finitef.c",
757 "musl/src/math/floorl.c",
758757 "musl/src/math/fma.c",
759758 "musl/src/math/fmaf.c",
760759 "musl/src/math/fmaxl.c",