Added __flt_rounds(), fp{get,set}{round,mask,sticky}().

This commit is contained in:
jtc 1995-04-07 00:41:43 +00:00
parent 8dc1468412
commit 30c05ea2b8
8 changed files with 105 additions and 1 deletions

View File

@ -1,7 +1,9 @@
# $NetBSD: Makefile.inc,v 1.2 1995/02/25 16:24:29 cgd Exp $
# $NetBSD: Makefile.inc,v 1.3 1995/04/07 00:41:43 jtc Exp $
SRCS+= _setjmp.S alloca.S fabs.S frexp.c infinity.c isinf.c ldexp.S modf.S \
setjmp.S
SRCS+= flt_rounds.S fpgetmask.S fpgetround.S fpgetsticky.S fpsetmask.S \
fpsetround.S fpsetsticky.S
SRCS+= adddf3.S addsf3.S ashlsi3.S ashrsi3.S cmpdf2.S cmpsf2.S divdf3.S \
divsf3.S divsi3.S extendsfdf2.S fixdfsi.S fixunsdfsi.S \
floatsidf.S lshlsi3.S lshrsi3.S modsi3.S muldf3.S mulsf3.S mulsi3.S \

View File

@ -0,0 +1,21 @@
/*
* Written by J.T. Conklin, Apr 6, 1995
* Public domain.
*/
#include <machine/asm.h>
.text
.even
_map:
.long 1 /* round to nearest */
.long 0 /* round to zero */
.long 3 /* round to negative infinity */
.long 2 /* round to positive infinity */
ENTRY(__flt_rounds)
fmovel fpcr,d0
bfextu d0{#26:#2},d0
lea _map,a0
movel a0@(d0:l:4),d0
rts

View File

@ -0,0 +1,11 @@
/*
* Written by J.T. Conklin, Apr 5, 1995
* Public domain.
*/
/* #include <machine/asm.h> */
ENTRY(fpgetmask)
fmovel fpcr,d0
bfextu d0{#16:#8},d0
rts

View File

@ -0,0 +1,11 @@
/*
* Written by J.T. Conklin, Apr 5, 1995
* Public domain.
*/
/* #include <machine/asm.h> */
ENTRY(fpgetround)
fmovel fpcr,d0
bfextu d0{#26:#2},d0
rts

View File

@ -0,0 +1,11 @@
/*
* Written by J.T. Conklin, Apr 5, 1995
* Public domain.
*/
/* #include <machine/asm.h> */
ENTRY(fpgetsticky)
fmovel fpsr,d0
bfextu d0{#16:#8},d0
rts

View File

@ -0,0 +1,16 @@
/*
* Written by J.T. Conklin, Apr 5, 1995
* Public Domain.
*/
/* #include <machine/asm.h> */
ENTRY(fpsetmask)
movel d2,sp@-
movel sp@(8),d2
fmovel fpcr,d1
bfextu d1{#16:#8},d0
bfins d2,d1{#16:#8}
fmovel d1,fpcr
movel sp@+,d2
rts

View File

@ -0,0 +1,16 @@
/*
* Written by J.T. Conklin, Apr 5, 1995
* Public Domain.
*/
/* #include <machine/asm.h> */
ENTRY(fpsetround)
movel d2,sp@-
movel sp@(8),d2
fmovel fpcr,d1
bfextu d1{#26:#2},d0
bfins d2,d1{#26:#2}
fmovel d1,fpcr
movel sp@+,d2
rts

View File

@ -0,0 +1,16 @@
/*
* Written by J.T. Conklin, Apr 5, 1995
* Public domain.
*/
/* #include <machine/asm.h> */
ENTRY(fpsetsticky)
movl d2,sp@-
movl sp@(8),d2
fmovel fpsr,d1
bfextu d1{#16:#8},d0
bfins d2,d1{#16:#8}
fmovel d1,fpsr
movl sp@+,d2
rts