mirror of
https://codeberg.org/ziglang/zig.git
synced 2026-03-08 08:04:50 +01:00
libc: remove fmod implementations
This commit is contained in:
parent
9dd32d5e65
commit
a2861a6c8d
9 changed files with 0 additions and 106 deletions
29
lib/libc/mingw/math/x86/fmodf.c
vendored
29
lib/libc/mingw/math/x86/fmodf.c
vendored
|
|
@ -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 <jtc@netbsd.org>.
|
||||
* Public domain.
|
||||
*
|
||||
* Adapted for float type by Danny Smith
|
||||
* <dannysmith@users.sourceforge.net>.
|
||||
*/
|
||||
|
||||
#include <math.h>
|
||||
|
||||
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;
|
||||
}
|
||||
21
lib/libc/mingw/math/x86/fmodl.c
vendored
21
lib/libc/mingw/math/x86/fmodl.c
vendored
|
|
@ -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;
|
||||
}
|
||||
10
lib/libc/musl/src/math/i386/fmod.c
vendored
10
lib/libc/musl/src/math/i386/fmod.c
vendored
|
|
@ -1,10 +0,0 @@
|
|||
#include <math.h>
|
||||
|
||||
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;
|
||||
}
|
||||
10
lib/libc/musl/src/math/i386/fmodf.c
vendored
10
lib/libc/musl/src/math/i386/fmodf.c
vendored
|
|
@ -1,10 +0,0 @@
|
|||
#include <math.h>
|
||||
|
||||
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;
|
||||
}
|
||||
9
lib/libc/musl/src/math/i386/fmodl.c
vendored
9
lib/libc/musl/src/math/i386/fmodl.c
vendored
|
|
@ -1,9 +0,0 @@
|
|||
#include <math.h>
|
||||
|
||||
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;
|
||||
}
|
||||
11
lib/libc/musl/src/math/x32/fmodl.s
vendored
11
lib/libc/musl/src/math/x32/fmodl.s
vendored
|
|
@ -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
|
||||
9
lib/libc/musl/src/math/x86_64/fmodl.c
vendored
9
lib/libc/musl/src/math/x86_64/fmodl.c
vendored
|
|
@ -1,9 +0,0 @@
|
|||
#include <math.h>
|
||||
|
||||
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;
|
||||
}
|
||||
|
|
@ -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{
|
||||
|
|
|
|||
|
|
@ -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",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue