Added flt_rounds, fpget{round,mask,sticky}.
This commit is contained in:
parent
d0d1dc8a4e
commit
80bba6a1e1
@ -1,5 +1,6 @@
|
||||
# $NetBSD: Makefile.inc,v 1.2 1995/02/25 16:24:26 cgd Exp $
|
||||
# $NetBSD: Makefile.inc,v 1.3 1995/04/07 14:57:16 jtc Exp $
|
||||
|
||||
SRCS+= _setjmp.S alloca.S fabs.S frexp.c infinity.c isinf.c ldexp.c modf.S \
|
||||
setjmp.S sigsetjmp.S
|
||||
SRCS+= flt_rounds.S fpgetmask.S fpgetround.S fpgetsticky.S
|
||||
SRCS+= divsi3.S fixdfsi.S fixunsdfsi.S udivsi3.S
|
||||
|
24
lib/libc/arch/i386/gen/flt_rounds.S
Normal file
24
lib/libc/arch/i386/gen/flt_rounds.S
Normal file
@ -0,0 +1,24 @@
|
||||
/*
|
||||
* Written by J.T. Conklin, Apr 4, 1995
|
||||
* Public domain.
|
||||
*/
|
||||
|
||||
#include <machine/asm.h>
|
||||
|
||||
.text
|
||||
.align 2
|
||||
_map:
|
||||
.long 1 /* round to nearest */
|
||||
.long 3 /* round to negative infinity */
|
||||
.long 2 /* round to positive infinity */
|
||||
.long 0 /* round to zero */
|
||||
|
||||
ENTRY(__flt_rounds)
|
||||
subl $4,%esp
|
||||
fnstcw 2(%esp)
|
||||
movw 2(%esp),%ax
|
||||
shrl $10,%eax
|
||||
andl $3,%eax
|
||||
movl _map(,%eax,4),%eax
|
||||
addl $4,%esp
|
||||
ret
|
15
lib/libc/arch/i386/gen/fpgetmask.S
Normal file
15
lib/libc/arch/i386/gen/fpgetmask.S
Normal file
@ -0,0 +1,15 @@
|
||||
/*
|
||||
* Written by J.T. Conklin, Apr 4, 1995
|
||||
* Public domain.
|
||||
*/
|
||||
|
||||
#include <machine/asm.h>
|
||||
|
||||
ENTRY(fpgetmask)
|
||||
subl $4,%esp
|
||||
fnstcw (%esp)
|
||||
movw (%esp),%ax
|
||||
notl %eax
|
||||
andl $63,%eax
|
||||
addl $4,%esp
|
||||
ret
|
15
lib/libc/arch/i386/gen/fpgetround.S
Normal file
15
lib/libc/arch/i386/gen/fpgetround.S
Normal file
@ -0,0 +1,15 @@
|
||||
/*
|
||||
* Written by J.T. Conklin, Apr 4, 1995
|
||||
* Public domain.
|
||||
*/
|
||||
|
||||
#include <machine/asm.h>
|
||||
|
||||
ENTRY(fpgetround)
|
||||
subl $4,%esp
|
||||
fnstcw (%esp)
|
||||
movw (%esp),%ax
|
||||
shrl $10,%eax
|
||||
andl $3,%eax
|
||||
addl $4,%esp
|
||||
ret
|
15
lib/libc/arch/i386/gen/fpgetsticky.S
Normal file
15
lib/libc/arch/i386/gen/fpgetsticky.S
Normal file
@ -0,0 +1,15 @@
|
||||
/*
|
||||
* Written by J.T. Conklin, Apr 4, 1995
|
||||
* Public domain.
|
||||
*/
|
||||
|
||||
#include <machine/asm.h>
|
||||
|
||||
ENTRY(fpgetmask)
|
||||
subl $4,%esp
|
||||
fnstsw (%esp)
|
||||
movw (%esp),%ax
|
||||
notl %eax
|
||||
andl $63,%eax
|
||||
addl $4,%esp
|
||||
ret
|
Loading…
Reference in New Issue
Block a user