diff --git a/lib/libc/mingw/math/x86/fmodf.c b/lib/libc/mingw/math/x86/fmodf.c deleted file mode 100644 index 45106adaa6..0000000000 --- a/lib/libc/mingw/math/x86/fmodf.c +++ /dev/null @@ -1,29 +0,0 @@ -/** - * This file has no copyright assigned and is placed in the Public Domain. - * This file is part of the mingw-w64 runtime package. - * No warranty is given; refer to the file DISCLAIMER.PD within this package. - */ -/* - * Written by J.T. Conklin . - * Public domain. - * - * Adapted for float type by Danny Smith - * . - */ - -#include - -float -fmodf (float x, float y) -{ - float res = 0.0F; - - asm volatile ( - "1:\tfprem\n\t" - "fstsw %%ax\n\t" - "sahf\n\t" - "jp 1b\n\t" - "fstp %%st(1)" - : "=t" (res) : "0" (x), "u" (y) : "ax", "st(1)"); - return res; -} diff --git a/lib/libc/mingw/math/x86/fmodl.c b/lib/libc/mingw/math/x86/fmodl.c deleted file mode 100644 index 462b6fa79f..0000000000 --- a/lib/libc/mingw/math/x86/fmodl.c +++ /dev/null @@ -1,21 +0,0 @@ -/** - * This file has no copyright assigned and is placed in the Public Domain. - * This file is part of the mingw-w64 runtime package. - * No warranty is given; refer to the file DISCLAIMER.PD within this package. - */ -long double fmodl (long double x, long double y); - -long double -fmodl (long double x, long double y) -{ - long double res = 0.0L; - - asm volatile ( - "1:\tfprem\n\t" - "fstsw %%ax\n\t" - "sahf\n\t" - "jp 1b\n\t" - "fstp %%st(1)" - : "=t" (res) : "0" (x), "u" (y) : "ax", "st(1)"); - return res; -} diff --git a/lib/libc/musl/src/math/i386/fmod.c b/lib/libc/musl/src/math/i386/fmod.c deleted file mode 100644 index ea0c58d9b4..0000000000 --- a/lib/libc/musl/src/math/i386/fmod.c +++ /dev/null @@ -1,10 +0,0 @@ -#include - -double fmod(double x, double y) -{ - unsigned short fpsr; - // fprem does not introduce excess precision into x - do __asm__ ("fprem; fnstsw %%ax" : "+t"(x), "=a"(fpsr) : "u"(y)); - while (fpsr & 0x400); - return x; -} diff --git a/lib/libc/musl/src/math/i386/fmodf.c b/lib/libc/musl/src/math/i386/fmodf.c deleted file mode 100644 index 90b56ab0fa..0000000000 --- a/lib/libc/musl/src/math/i386/fmodf.c +++ /dev/null @@ -1,10 +0,0 @@ -#include - -float fmodf(float x, float y) -{ - unsigned short fpsr; - // fprem does not introduce excess precision into x - do __asm__ ("fprem; fnstsw %%ax" : "+t"(x), "=a"(fpsr) : "u"(y)); - while (fpsr & 0x400); - return x; -} diff --git a/lib/libc/musl/src/math/i386/fmodl.c b/lib/libc/musl/src/math/i386/fmodl.c deleted file mode 100644 index 3daeab0600..0000000000 --- a/lib/libc/musl/src/math/i386/fmodl.c +++ /dev/null @@ -1,9 +0,0 @@ -#include - -long double fmodl(long double x, long double y) -{ - unsigned short fpsr; - do __asm__ ("fprem; fnstsw %%ax" : "+t"(x), "=a"(fpsr) : "u"(y)); - while (fpsr & 0x400); - return x; -} diff --git a/lib/libc/musl/src/math/x32/fmodl.s b/lib/libc/musl/src/math/x32/fmodl.s deleted file mode 100644 index c3f790c9bf..0000000000 --- a/lib/libc/musl/src/math/x32/fmodl.s +++ /dev/null @@ -1,11 +0,0 @@ -.global fmodl -.type fmodl,@function -fmodl: - fldt 24(%esp) - fldt 8(%esp) -1: fprem - fnstsw %ax - testb $4,%ah - jnz 1b - fstp %st(1) - ret diff --git a/lib/libc/musl/src/math/x86_64/fmodl.c b/lib/libc/musl/src/math/x86_64/fmodl.c deleted file mode 100644 index 3daeab0600..0000000000 --- a/lib/libc/musl/src/math/x86_64/fmodl.c +++ /dev/null @@ -1,9 +0,0 @@ -#include - -long double fmodl(long double x, long double y) -{ - unsigned short fpsr; - do __asm__ ("fprem; fnstsw %%ax" : "+t"(x), "=a"(fpsr) : "u"(y)); - while (fpsr & 0x400); - return x; -} diff --git a/src/libs/mingw.zig b/src/libs/mingw.zig index 62e451acfb..f36fde251e 100644 --- a/src/libs/mingw.zig +++ b/src/libs/mingw.zig @@ -966,7 +966,6 @@ const mingw32_x86_src = [_][]const u8{ "math" ++ path.sep_str ++ "x86" ++ path.sep_str ++ "exp2l.S", "math" ++ path.sep_str ++ "x86" ++ path.sep_str ++ "expl.c", "math" ++ path.sep_str ++ "x86" ++ path.sep_str ++ "expm1l.c", - "math" ++ path.sep_str ++ "x86" ++ path.sep_str ++ "fmodl.c", "math" ++ path.sep_str ++ "x86" ++ path.sep_str ++ "fucom.c", "math" ++ path.sep_str ++ "x86" ++ path.sep_str ++ "ilogbl.S", "math" ++ path.sep_str ++ "x86" ++ path.sep_str ++ "internal_logl.S", @@ -1005,7 +1004,6 @@ const mingw32_x86_32_src = [_][]const u8{ "math" ++ path.sep_str ++ "x86" ++ path.sep_str ++ "asinf.c", "math" ++ path.sep_str ++ "x86" ++ path.sep_str ++ "atan2f.c", "math" ++ path.sep_str ++ "x86" ++ path.sep_str ++ "atanf.c", - "math" ++ path.sep_str ++ "x86" ++ path.sep_str ++ "fmodf.c", }; const mingw32_arm_src = [_][]const u8{ diff --git a/src/libs/musl.zig b/src/libs/musl.zig index ebd2727eb8..1aa4c84136 100644 --- a/src/libs/musl.zig +++ b/src/libs/musl.zig @@ -924,9 +924,6 @@ const src_files = [_][]const u8{ "musl/src/math/i386/exp_ld.s", "musl/src/math/i386/expl.s", "musl/src/math/i386/expm1l.s", - "musl/src/math/i386/fmod.c", - "musl/src/math/i386/fmodf.c", - "musl/src/math/i386/fmodl.c", "musl/src/math/i386/hypotf.s", "musl/src/math/i386/hypot.s", "musl/src/math/i386/__invtrigl.s", @@ -1147,7 +1144,6 @@ const src_files = [_][]const u8{ "musl/src/math/x32/expm1l.s", "musl/src/math/x32/fma.c", "musl/src/math/x32/fmaf.c", - "musl/src/math/x32/fmodl.s", "musl/src/math/x32/__invtrigl.s", "musl/src/math/x32/llrintf.s", "musl/src/math/x32/llrintl.s", @@ -1173,7 +1169,6 @@ const src_files = [_][]const u8{ "musl/src/math/x86_64/expm1l.s", "musl/src/math/x86_64/fma.c", "musl/src/math/x86_64/fmaf.c", - "musl/src/math/x86_64/fmodl.c", "musl/src/math/x86_64/__invtrigl.s", "musl/src/math/x86_64/llrint.c", "musl/src/math/x86_64/llrintf.c",