Import amd64 assembly implementations of div(3) family from NetBSD.

Obtained from:	NetBSD
This commit is contained in:
Jung-uk Kim 2007-04-04 01:19:54 +00:00
parent ab43ffd2f6
commit eef2b291e9
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=168336
4 changed files with 51 additions and 0 deletions

View file

@ -0,0 +1,4 @@
# @(#)Makefile.inc 8.1 (Berkeley) 6/4/93
# $FreeBSD$
MDSRCS+=div.S ldiv.S lldiv.S

View file

@ -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

View file

@ -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

View file

@ -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