diff options
author | jkim <jkim@FreeBSD.org> | 2007-04-04 01:19:54 +0000 |
---|---|---|
committer | jkim <jkim@FreeBSD.org> | 2007-04-04 01:19:54 +0000 |
commit | 930f0277fa6fdb971a869e3537d3786d192ac049 (patch) | |
tree | c96aeec3cb962698d239a5b5d310436af7fac852 /lib/libc/amd64 | |
parent | a327b55608acad9b4aea8b694d7f4e13b1befd1b (diff) | |
download | FreeBSD-src-930f0277fa6fdb971a869e3537d3786d192ac049.zip FreeBSD-src-930f0277fa6fdb971a869e3537d3786d192ac049.tar.gz |
Import amd64 assembly implementations of div(3) family from NetBSD.
Obtained from: NetBSD
Diffstat (limited to 'lib/libc/amd64')
-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 |