summaryrefslogtreecommitdiffstats
path: root/lib/libc/amd64/stdlib
diff options
context:
space:
mode:
authorjkim <jkim@FreeBSD.org>2007-04-04 01:19:54 +0000
committerjkim <jkim@FreeBSD.org>2007-04-04 01:19:54 +0000
commit930f0277fa6fdb971a869e3537d3786d192ac049 (patch)
treec96aeec3cb962698d239a5b5d310436af7fac852 /lib/libc/amd64/stdlib
parenta327b55608acad9b4aea8b694d7f4e13b1befd1b (diff)
downloadFreeBSD-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/stdlib')
-rw-r--r--lib/libc/amd64/stdlib/Makefile.inc4
-rw-r--r--lib/libc/amd64/stdlib/div.S17
-rw-r--r--lib/libc/amd64/stdlib/ldiv.S15
-rw-r--r--lib/libc/amd64/stdlib/lldiv.S15
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
OpenPOWER on IntegriCloud