Added flt_rounds, fpget{round,mask,sticky}.

This commit is contained in:
jtc 1995-04-07 14:57:16 +00:00
parent d0d1dc8a4e
commit 80bba6a1e1
5 changed files with 71 additions and 1 deletions

View File

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

View 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

View 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

View 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

View 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