summaryrefslogtreecommitdiff
path: root/sys/arch/hppa/spmath/fcnvfx.c
diff options
context:
space:
mode:
authorMichael Shalayeff <mickey@cvs.openbsd.org>1998-07-02 19:06:04 +0000
committerMichael Shalayeff <mickey@cvs.openbsd.org>1998-07-02 19:06:04 +0000
commit186df561f20e8ff3f8c74f3f4ef6ac29f67485e2 (patch)
tree8e23f01a9975fe3c59d7ee922be9e679137c65e3 /sys/arch/hppa/spmath/fcnvfx.c
parent387f724d77fa7589fc76165f07621db9817fb9b1 (diff)
ansi and fancy gcc
Diffstat (limited to 'sys/arch/hppa/spmath/fcnvfx.c')
-rw-r--r--sys/arch/hppa/spmath/fcnvfx.c45
1 files changed, 31 insertions, 14 deletions
diff --git a/sys/arch/hppa/spmath/fcnvfx.c b/sys/arch/hppa/spmath/fcnvfx.c
index 8997844cf76..edf379a09bf 100644
--- a/sys/arch/hppa/spmath/fcnvfx.c
+++ b/sys/arch/hppa/spmath/fcnvfx.c
@@ -1,3 +1,5 @@
+/* $OpenBSD: fcnvfx.c,v 1.3 1998/07/02 19:05:19 mickey Exp $ */
+
/*
* Copyright 1996 1995 by Open Software Foundation, Inc.
* All Rights Reserved
@@ -46,6 +48,7 @@
* Single Floating-point to Single Fixed-point
*/
/*ARGSUSED*/
+int
sgl_to_sgl_fcnvfx(srcptr,nullptr,dstptr,status)
sgl_floating_point *srcptr, *nullptr, *status;
@@ -97,9 +100,10 @@ int *dstptr;
case ROUNDNEAREST:
if (Sgl_isone_roundbit(src,src_exponent)) {
if (Sgl_isone_stickybit(src,src_exponent)
- || (Sgl_isone_lowmantissa(temp)))
+ || (Sgl_isone_lowmantissa(temp))) {
if (Sgl_iszero_sign(src)) result++;
else result--;
+ }
}
}
}
@@ -120,9 +124,10 @@ int *dstptr;
break;
case ROUNDNEAREST:
if (src_exponent == -1)
- if (Sgl_isnotzero_mantissa(src))
+ if (Sgl_isnotzero_mantissa(src)) {
if (Sgl_iszero_sign(src)) result++;
else result--;
+ }
}
}
}
@@ -138,11 +143,13 @@ int *dstptr;
* Single Floating-point to Double Fixed-point
*/
/*ARGSUSED*/
+int
sgl_to_dbl_fcnvfx(srcptr,nullptr,dstptr,status)
sgl_floating_point *srcptr;
dbl_integer *dstptr;
-unsigned int *nullptr, *status;
+void *nullptr;
+unsigned int *status;
{
register int src_exponent, resultp1;
register unsigned int src, temp, resultp2;
@@ -198,13 +205,14 @@ unsigned int *nullptr, *status;
case ROUNDNEAREST:
if (Sgl_isone_roundbit(src,src_exponent))
if (Sgl_isone_stickybit(src,src_exponent) ||
- (Dint_isone_lowp2(resultp2)))
+ (Dint_isone_lowp2(resultp2))) {
if (Sgl_iszero_sign(src)) {
Dint_increment(resultp1,resultp2);
}
else {
Dint_decrement(resultp1,resultp2);
}
+ }
}
}
}
@@ -228,13 +236,14 @@ unsigned int *nullptr, *status;
break;
case ROUNDNEAREST:
if (src_exponent == -1)
- if (Sgl_isnotzero_mantissa(src))
+ if (Sgl_isnotzero_mantissa(src)) {
if (Sgl_iszero_sign(src)) {
Dint_increment(resultp1,resultp2);
}
else {
Dint_decrement(resultp1,resultp2);
}
+ }
}
}
}
@@ -250,11 +259,13 @@ unsigned int *nullptr, *status;
* Double Floating-point to Single Fixed-point
*/
/*ARGSUSED*/
+int
dbl_to_sgl_fcnvfx(srcptr,nullptr,dstptr,status)
dbl_floating_point *srcptr;
int *dstptr;
-unsigned int *nullptr, *status;
+void *nullptr;
+unsigned int *status;
{
register unsigned int srcp1,srcp2, tempp1,tempp2;
register int src_exponent, result;
@@ -303,9 +314,10 @@ unsigned int *nullptr, *status;
case ROUNDNEAREST:
if (Dbl_isone_roundbit(srcp1,srcp2,src_exponent))
if (Dbl_isone_stickybit(srcp1,srcp2,src_exponent) ||
- (Dbl_isone_lowmantissap1(tempp1)))
+ (Dbl_isone_lowmantissap1(tempp1))) {
if (Dbl_iszero_sign(srcp1)) result++;
else result--;
+ }
}
/* check for overflow */
if ((Dbl_iszero_sign(srcp1) && result < 0) ||
@@ -330,9 +342,10 @@ unsigned int *nullptr, *status;
break;
case ROUNDNEAREST:
if (src_exponent == -1)
- if (Dbl_isnotzero_mantissa(srcp1,srcp2))
+ if (Dbl_isnotzero_mantissa(srcp1,srcp2)) {
if (Dbl_iszero_sign(srcp1)) result++;
else result--;
+ }
}
}
}
@@ -348,11 +361,13 @@ unsigned int *nullptr, *status;
* Double Floating-point to Double Fixed-point
*/
/*ARGSUSED*/
+int
dbl_to_dbl_fcnvfx(srcptr,nullptr,dstptr,status)
dbl_floating_point *srcptr;
dbl_integer *dstptr;
-unsigned int *nullptr, *status;
+void *nullptr;
+unsigned int *status;
{
register int src_exponent, resultp1;
register unsigned int srcp1, srcp2, tempp1, tempp2, resultp2;
@@ -384,8 +399,8 @@ unsigned int *nullptr, *status;
tempp1 = srcp1;
tempp2 = srcp2;
Dbl_clear_signexponent_set_hidden(tempp1);
- Dint_from_dbl_mantissa(tempp1,tempp2,src_exponent,resultp1,
- resultp2);
+ Dint_from_dbl_mantissa(tempp1,tempp2,src_exponent,
+ resultp1, resultp2);
if (Dbl_isone_sign(srcp1)) {
Dint_setone_sign(resultp1,resultp2);
}
@@ -408,13 +423,14 @@ unsigned int *nullptr, *status;
case ROUNDNEAREST:
if (Dbl_isone_roundbit(srcp1,srcp2,src_exponent))
if (Dbl_isone_stickybit(srcp1,srcp2,src_exponent) ||
- (Dint_isone_lowp2(resultp2)))
+ (Dint_isone_lowp2(resultp2))) {
if (Dbl_iszero_sign(srcp1)) {
Dint_increment(resultp1,resultp2);
}
else {
Dint_decrement(resultp1,resultp2);
}
+ }
}
}
}
@@ -438,13 +454,14 @@ unsigned int *nullptr, *status;
break;
case ROUNDNEAREST:
if (src_exponent == -1)
- if (Dbl_isnotzero_mantissa(srcp1,srcp2))
+ if (Dbl_isnotzero_mantissa(srcp1,srcp2)) {
if (Dbl_iszero_sign(srcp1)) {
Dint_increment(resultp1,resultp2);
}
else {
Dint_decrement(resultp1,resultp2);
- }
+ }
+ }
}
}
}