diff options
| author | David Senoner <seda18@rolmail.net> | 2025-07-04 13:13:30 +0200 |
|---|---|---|
| committer | David Senoner <seda18@rolmail.net> | 2025-07-04 20:05:18 +0200 |
| commit | b78751051f4b386899fb82054fc008f9dad73432 (patch) | |
| tree | 60adc0e4812d407893b7a1cdb5ab79de63158598 /lib | |
| parent | 3124f700c736383ca8c63e773b804ef78cc0bd19 (diff) | |
| download | zig-b78751051f4b386899fb82054fc008f9dad73432.tar.gz zig-b78751051f4b386899fb82054fc008f9dad73432.zip | |
delete superfluous assembly libc floor implementations
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/libc/mingw/math/x86/floorf.S | 51 | ||||
| -rw-r--r-- | lib/libc/mingw/math/x86/floorl.S | 63 | ||||
| -rw-r--r-- | lib/libc/musl/src/math/i386/floor.s | 17 | ||||
| -rw-r--r-- | lib/libc/musl/src/math/i386/floorf.s | 1 | ||||
| -rw-r--r-- | lib/libc/musl/src/math/i386/floorl.s | 1 |
5 files changed, 1 insertions, 132 deletions
diff --git a/lib/libc/mingw/math/x86/floorf.S b/lib/libc/mingw/math/x86/floorf.S deleted file mode 100644 index c6226f82b5..0000000000 --- a/lib/libc/mingw/math/x86/floorf.S +++ /dev/null @@ -1,51 +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. - */ - #include <_mingw_mac.h> - - .file "floorf.S" - .text - .p2align 4,,15 - .globl __MINGW_USYMBOL(floorf) - .def __MINGW_USYMBOL(floorf); .scl 2; .type 32; .endef -#ifdef __x86_64__ - .seh_proc __MINGW_USYMBOL(floorf) -#endif -__MINGW_USYMBOL(floorf): -#if defined(_AMD64_) || defined(__x86_64__) - subq $40, %rsp - .seh_stackalloc 40 - .seh_endprologue - unpcklps %xmm0, %xmm0 - cvtps2pd %xmm0, %xmm0 - call floor - unpcklpd %xmm0, %xmm0 - cvtpd2ps %xmm0, %xmm0 - addq $40, %rsp - ret - .seh_endproc - .def __MINGW_USYMBOL(floor); .scl 2; .type 32; .endef -#elif defined(_X86_) || defined(__i386__) - flds 4(%esp) - subl $8,%esp - - fstcw 4(%esp) /* store fpu control word */ - - /* We use here %edx although only the low 1 bits are defined. - But none of the operations should care and they are faster - than the 16 bit operations. */ - movl $0x400,%edx /* round towards -oo */ - orl 4(%esp),%edx - andl $0xf7ff,%edx - movl %edx,(%esp) - fldcw (%esp) /* load modified control word */ - - frndint /* round */ - - fldcw 4(%esp) /* restore original control word */ - - addl $8,%esp - ret -#endif diff --git a/lib/libc/mingw/math/x86/floorl.S b/lib/libc/mingw/math/x86/floorl.S deleted file mode 100644 index 6a08d590a1..0000000000 --- a/lib/libc/mingw/math/x86/floorl.S +++ /dev/null @@ -1,63 +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. - */ -#include <_mingw_mac.h> - - .file "floorl.S" - .text -#ifdef __x86_64__ - .align 8 -#else - .align 4 -#endif - .globl __MINGW_USYMBOL(floorl) - .def __MINGW_USYMBOL(floorl); .scl 2; .type 32; .endef -__MINGW_USYMBOL(floorl): -#if defined(_AMD64_) || defined(__x86_64__) - fldt (%rdx) - subq $24,%rsp - - fstcw 8(%rsp) /* store fpu control word */ - - /* We use here %edx although only the low 1 bits are defined. - But none of the operations should care and they are faster - than the 16 bit operations. */ - movl $0x400,%edx /* round towards -oo */ - orl 8(%rsp),%edx - andl $0xf7ff,%edx - movl %edx,(%rsp) - fldcw (%rsp) /* load modified control word */ - - frndint /* round */ - - fldcw 8(%rsp) /* restore original control word */ - - addq $24,%rsp - movq %rcx,%rax - movq $0,8(%rcx) - fstpt (%rcx) - ret -#elif defined(_X86_) || defined(__i386__) - fldt 4(%esp) - subl $8,%esp - - fstcw 4(%esp) /* store fpu control word */ - - /* We use here %edx although only the low 1 bits are defined. - But none of the operations should care and they are faster - than the 16 bit operations. */ - movl $0x400,%edx /* round towards -oo */ - orl 4(%esp),%edx - andl $0xf7ff,%edx - movl %edx,(%esp) - fldcw (%esp) /* load modified control word */ - - frndint /* round */ - - fldcw 4(%esp) /* restore original control word */ - - addl $8,%esp - ret -#endif diff --git a/lib/libc/musl/src/math/i386/floor.s b/lib/libc/musl/src/math/i386/floor.s index 46ba88db53..2571fb3ded 100644 --- a/lib/libc/musl/src/math/i386/floor.s +++ b/lib/libc/musl/src/math/i386/floor.s @@ -1,20 +1,5 @@ -.global floorf -.type floorf,@function -floorf: - flds 4(%esp) - jmp 1f - -.global floorl -.type floorl,@function -floorl: - fldt 4(%esp) - jmp 1f +/* zig patch: removed `floorl` and `floorf` in favor of using zig compiler_rt's implementations */ -.global floor -.type floor,@function -floor: - fldl 4(%esp) -1: mov $0x7,%al 1: fstcw 4(%esp) mov 5(%esp),%ah mov %al,5(%esp) diff --git a/lib/libc/musl/src/math/i386/floorf.s b/lib/libc/musl/src/math/i386/floorf.s deleted file mode 100644 index bc29f15ce7..0000000000 --- a/lib/libc/musl/src/math/i386/floorf.s +++ /dev/null @@ -1 +0,0 @@ -# see floor.s diff --git a/lib/libc/musl/src/math/i386/floorl.s b/lib/libc/musl/src/math/i386/floorl.s deleted file mode 100644 index bc29f15ce7..0000000000 --- a/lib/libc/musl/src/math/i386/floorl.s +++ /dev/null @@ -1 +0,0 @@ -# see floor.s |
