summaryrefslogtreecommitdiffstats
path: root/lib/libc/amd64/stdlib
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libc/amd64/stdlib')
-rw-r--r--lib/libc/amd64/stdlib/Makefile.inc4
-rw-r--r--lib/libc/amd64/stdlib/div.S20
-rw-r--r--lib/libc/amd64/stdlib/ldiv.S18
-rw-r--r--lib/libc/amd64/stdlib/lldiv.S18
4 files changed, 60 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..366010c
--- /dev/null
+++ b/lib/libc/amd64/stdlib/div.S
@@ -0,0 +1,20 @@
+/* $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
+END(div)
+
+ .section .note.GNU-stack,"",%progbits
diff --git a/lib/libc/amd64/stdlib/ldiv.S b/lib/libc/amd64/stdlib/ldiv.S
new file mode 100644
index 0000000..f11472c
--- /dev/null
+++ b/lib/libc/amd64/stdlib/ldiv.S
@@ -0,0 +1,18 @@
+/* $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
+END(ldiv)
+
+ .section .note.GNU-stack,"",%progbits
diff --git a/lib/libc/amd64/stdlib/lldiv.S b/lib/libc/amd64/stdlib/lldiv.S
new file mode 100644
index 0000000..4dab0fd
--- /dev/null
+++ b/lib/libc/amd64/stdlib/lldiv.S
@@ -0,0 +1,18 @@
+/* $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
+END(lldiv)
+
+ .section .note.GNU-stack,"",%progbits
OpenPOWER on IntegriCloud