Add a shared library containing sparc version 8 specific multiply, divide and

remainder functions (i.e. .[u]mul, .[u]div, .[u]rem).
This commit is contained in:
pk 2002-11-26 14:30:53 +00:00
parent 90bedd1cc7
commit 3fd797268f
5 changed files with 117 additions and 2 deletions

View File

@ -1,7 +1,7 @@
# $NetBSD: Makefile,v 1.19 2002/07/06 10:19:08 fvdl Exp $
# $NetBSD: Makefile,v 1.20 2002/11/26 14:30:53 pk Exp $
# These should always be a MACHINE_CPU value
ARCHDIRS= alpha arm i386 m68k x86_64
ARCHDIRS= alpha arm i386 m68k sparc x86_64
.for arch in ${ARCHDIRS}
.include "${.CURDIR}/${arch}/Makefile.inc"
@ -22,3 +22,4 @@ SHLIB_VERSION_FILE= ${.CURDIR}/${LIB}/shlib_version
# ... otherwise just build the manpages
.include <bsd.man.mk>
.endif
.include <bsd.subdir.mk>

View File

@ -0,0 +1,6 @@
# $NetBSD: Makefile.inc,v 1.1 2002/11/26 14:30:53 pk Exp $
.if (${MACHINE_ARCH} == "sparc")
SUBDIR=sparc/v8
.endif

View File

@ -0,0 +1,9 @@
# $NetBSD: Makefile,v 1.1 2002/11/26 14:30:54 pk Exp $
NOLINT= # defined
USE_SHLIBDIR= yes
LIB= sparc_v8
SRCS= sparc_v8.S
.include <bsd.lib.mk>

View File

@ -0,0 +1,5 @@
# $NetBSD: shlib_version,v 1.1 2002/11/26 14:30:54 pk Exp $
# Remember to update distrib/sets/lists/base/md.i386 when changing
#
major=0
minor=0

View File

@ -0,0 +1,94 @@
/*
* GCC generated output for sparc v8 mul/div/rem operations.
* Included in the sparc_v8.so shared library for use on sparc v8
* machines instead of the libc.so versions.
*/
.file "sparc_v8.S"
.section ".text"
/*--- .umul ---*/
.align 4
.global .umul
.type .umul,@function
.proc 016
.umul:
!#PROLOGUE# 0
!#PROLOGUE# 1
retl
umul %o0, %o1, %o0
.LLfe1:
.size .umul,.LLfe1-.umul
/*--- .mul ---*/
.align 4
.global .mul
.type .mul,@function
.proc 04
.mul:
!#PROLOGUE# 0
!#PROLOGUE# 1
retl
smul %o0, %o1, %o0
.LLfe2:
.size .mul,.LLfe2-.mul
/*--- .udiv ---*/
.align 4
.global .udiv
.type .udiv,@function
.proc 016
.udiv:
wr %g0, 0, %y
nop; nop; nop
retl
udiv %o0, %o1, %o0
.LLfe3:
.size .udiv,.LLfe3-.udiv
/*--- .div ---*/
.align 4
.global .div
.type .div,@function
.proc 04
.div:
sra %o0, 31, %g2
wr %g2, 0, %y
nop; nop; nop
retl
sdiv %o0, %o1, %o0
.LLfe4:
.size .div,.LLfe4-.div
/*--- .urem ---*/
.align 4
.global .urem
.type .urem,@function
.proc 016
.urem:
wr %g0, %g0, %y
nop; nop; nop
udiv %o0, %o1, %g2
smul %g2, %o1, %g2
retl
sub %o0, %g2, %o0
.LLfe5:
.size .urem,.LLfe5-.urem
/*--- .rem ---*/
.align 4
.global .rem
.type .rem,@function
.proc 04
.rem:
sra %o0, 31, %g3
wr %g3, 0, %y
nop; nop; nop
sdiv %o0, %o1, %g2
smul %g2, %o1, %g2
retl
sub %o0, %g2, %o0
.LLfe6:
.size .rem,.LLfe6-.rem
!.ident "GCC: (GNU) 2.95.3 20010315 (release) (NetBSD nb3)"