Import amd64 assembly implementations of div(3) family from NetBSD.
Obtained from: NetBSD
This commit is contained in:
parent
ab43ffd2f6
commit
eef2b291e9
4
lib/libc/amd64/stdlib/Makefile.inc
Normal file
4
lib/libc/amd64/stdlib/Makefile.inc
Normal file
@ -0,0 +1,4 @@
|
||||
# @(#)Makefile.inc 8.1 (Berkeley) 6/4/93
|
||||
# $FreeBSD$
|
||||
|
||||
MDSRCS+=div.S ldiv.S lldiv.S
|
17
lib/libc/amd64/stdlib/div.S
Normal file
17
lib/libc/amd64/stdlib/div.S
Normal 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
|
15
lib/libc/amd64/stdlib/ldiv.S
Normal file
15
lib/libc/amd64/stdlib/ldiv.S
Normal 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
|
15
lib/libc/amd64/stdlib/lldiv.S
Normal file
15
lib/libc/amd64/stdlib/lldiv.S
Normal 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
|
Loading…
Reference in New Issue
Block a user