diff options
Diffstat (limited to 'lib/libc/amd64/stdlib')
-rw-r--r-- | lib/libc/amd64/stdlib/Makefile.inc | 4 | ||||
-rw-r--r-- | lib/libc/amd64/stdlib/div.S | 17 | ||||
-rw-r--r-- | lib/libc/amd64/stdlib/ldiv.S | 15 | ||||
-rw-r--r-- | lib/libc/amd64/stdlib/lldiv.S | 15 |
4 files changed, 51 insertions, 0 deletions
diff --git a/lib/libc/amd64/stdlib/Makefile.inc b/lib/libc/amd64/stdlib/Makefile.inc new file mode 100644 index 0000000..5b7e675 --- /dev/null +++ b/lib/libc/amd64/stdlib/Makefile.inc @@ -0,0 +1,4 @@ +# @(#)Makefile.inc 8.1 (Berkeley) 6/4/93 +# $FreeBSD$ + +MDSRCS+=div.S ldiv.S lldiv.S diff --git a/lib/libc/amd64/stdlib/div.S b/lib/libc/amd64/stdlib/div.S new file mode 100644 index 0000000..f8595f9 --- /dev/null +++ b/lib/libc/amd64/stdlib/div.S @@ -0,0 +1,17 @@ +/* $NetBSD: div.S,v 1.1 2001/06/19 00:25:04 fvdl Exp $ */ + +/*- + * Written by Frank van der Linden (fvdl@wasabisystems.com) + * Public domain. + */ + +#include <machine/asm.h> +__FBSDID("$FreeBSD$"); + +ENTRY(div) + movl %edi,%eax + cltd + idivl %esi + salq $32,%rdx + orq %rdx,%rax + ret diff --git a/lib/libc/amd64/stdlib/ldiv.S b/lib/libc/amd64/stdlib/ldiv.S new file mode 100644 index 0000000..de952f0 --- /dev/null +++ b/lib/libc/amd64/stdlib/ldiv.S @@ -0,0 +1,15 @@ +/* $NetBSD: ldiv.S,v 1.1 2001/06/19 00:25:04 fvdl Exp $ */ + +/*- + * Written by gcc 3.0. + * Copy/pasted by Frank van der Linden (fvdl@wasabisystems.com) + */ + +#include <machine/asm.h> +__FBSDID("$FreeBSD$"); + +ENTRY(ldiv) + movq %rdi,%rax + cqto + idivq %rsi + ret diff --git a/lib/libc/amd64/stdlib/lldiv.S b/lib/libc/amd64/stdlib/lldiv.S new file mode 100644 index 0000000..7353754 --- /dev/null +++ b/lib/libc/amd64/stdlib/lldiv.S @@ -0,0 +1,15 @@ +/* $NetBSD: ldiv.S,v 1.1 2001/06/19 00:25:04 fvdl Exp $ */ + +/*- + * Written by gcc 3.0. + * Copy/pasted by Frank van der Linden (fvdl@wasabisystems.com) + */ + +#include <machine/asm.h> +__FBSDID("$FreeBSD$"); + +ENTRY(lldiv) + movq %rdi,%rax + cqto + idivq %rsi + ret |