diff options
author | Michael Shalayeff <mickey@cvs.openbsd.org> | 1998-07-02 19:06:04 +0000 |
---|---|---|
committer | Michael Shalayeff <mickey@cvs.openbsd.org> | 1998-07-02 19:06:04 +0000 |
commit | 186df561f20e8ff3f8c74f3f4ef6ac29f67485e2 (patch) | |
tree | 8e23f01a9975fe3c59d7ee922be9e679137c65e3 /sys/arch/hppa/spmath/cnv_float.h | |
parent | 387f724d77fa7589fc76165f07621db9817fb9b1 (diff) |
ansi and fancy gcc
Diffstat (limited to 'sys/arch/hppa/spmath/cnv_float.h')
-rw-r--r-- | sys/arch/hppa/spmath/cnv_float.h | 43 |
1 files changed, 31 insertions, 12 deletions
diff --git a/sys/arch/hppa/spmath/cnv_float.h b/sys/arch/hppa/spmath/cnv_float.h index 2e5fcf89ff4..3ecc40bbe9d 100644 --- a/sys/arch/hppa/spmath/cnv_float.h +++ b/sys/arch/hppa/spmath/cnv_float.h @@ -1,3 +1,5 @@ +/* $OpenBSD: cnv_float.h,v 1.3 1998/07/02 19:04:54 mickey Exp $ */ + /* * Copyright 1996 1995 by Open Software Foundation, Inc. * All Rights Reserved @@ -71,27 +73,27 @@ ((exponent < (SGL_P - 1)) ? \ (Sall(sgl_value) << (SGL_EXP_LENGTH + 1 + exponent)) : FALSE) -#define Int_isinexact_to_sgl(int_value) (int_value << 33 - SGL_EXP_LENGTH) +#define Int_isinexact_to_sgl(int_value) (int_value << (33 - SGL_EXP_LENGTH)) #define Sgl_roundnearest_from_int(int_value,sgl_value) \ if (int_value & 1<<(SGL_EXP_LENGTH - 2)) /* round bit */ \ - if ((int_value << 34 - SGL_EXP_LENGTH) || Slow(sgl_value)) \ + if ((int_value << (34 - SGL_EXP_LENGTH)) || Slow(sgl_value)) \ Sall(sgl_value)++ #define Dint_isinexact_to_sgl(dint_valueA,dint_valueB) \ - ((Dintp1(dint_valueA) << 33 - SGL_EXP_LENGTH) || Dintp2(dint_valueB)) + ((Dintp1(dint_valueA) << (33 - SGL_EXP_LENGTH)) || Dintp2(dint_valueB)) #define Sgl_roundnearest_from_dint(dint_valueA,dint_valueB,sgl_value) \ if (Dintp1(dint_valueA) & 1<<(SGL_EXP_LENGTH - 2)) \ - if ((Dintp1(dint_valueA) << 34 - SGL_EXP_LENGTH) || \ + if ((Dintp1(dint_valueA) << (34 - SGL_EXP_LENGTH)) || \ Dintp2(dint_valueB) || Slow(sgl_value)) Sall(sgl_value)++ #define Dint_isinexact_to_dbl(dint_value) \ - (Dintp2(dint_value) << 33 - DBL_EXP_LENGTH) + (Dintp2(dint_value) << (33 - DBL_EXP_LENGTH)) #define Dbl_roundnearest_from_dint(dint_opndB,dbl_opndA,dbl_opndB) \ if (Dintp2(dint_opndB) & 1<<(DBL_EXP_LENGTH - 2)) \ - if ((Dintp2(dint_opndB) << 34 - DBL_EXP_LENGTH) || Dlowp2(dbl_opndB)) \ + if ((Dintp2(dint_opndB) << (34 -DBL_EXP_LENGTH)) || Dlowp2(dbl_opndB)) \ if ((++Dallp2(dbl_opndB))==0) Dallp1(dbl_opndA)++ #define Sgl_isone_roundbit(sgl_value,exponent) \ @@ -253,13 +255,13 @@ {if (exponent < 32) { \ Dintp1(destA) = 0; \ if (exponent <= 20) \ - Dintp2(destB) = Dallp1(dbl_valueA) >> 20-exponent; \ + Dintp2(destB) = Dallp1(dbl_valueA) >> (20-(exponent)); \ else Variable_shift_double(Dallp1(dbl_valueA),Dallp2(dbl_valueB), \ - 52-exponent,Dintp2(destB)); \ + (52-(exponent)),Dintp2(destB)); \ } \ else { \ if (exponent <= 52) { \ - Dintp1(destA) = Dallp1(dbl_valueA) >> 52-exponent; \ + Dintp1(destA) = Dallp1(dbl_valueA) >> (52-(exponent)); \ if (exponent == 52) Dintp2(destB) = Dallp2(dbl_valueB); \ else Variable_shift_double(Dallp1(dbl_valueA),Dallp2(dbl_valueB), \ 52-exponent,Dintp2(destB)); \ @@ -267,7 +269,7 @@ else { \ Variable_shift_double(Dallp1(dbl_valueA),Dallp2(dbl_valueB), \ 84-exponent,Dintp1(destA)); \ - Dintp2(destB) = Dallp2(dbl_valueB) << exponent-52; \ + Dintp2(destB) = Dallp2(dbl_valueB) << ((exponent)-52); \ } \ }} @@ -309,11 +311,11 @@ { \ int var; \ for (var=8; var >=1; var >>= 1) { \ - if (value >> 32 - position) \ + if (value >> (32 - position)) \ position -= var; \ else position += var; \ } \ - if ((value >> 32 - position) == 0) \ + if ((value >> (32 - position)) == 0) \ position--; \ else position -= 2; \ } @@ -412,3 +414,20 @@ return(NOEXCEPTION); \ } +int sgl_to_sgl_fcnvfx __P((sgl_floating_point *, sgl_floating_point *, int *, sgl_floating_point *)); +int sgl_to_dbl_fcnvfx __P((sgl_floating_point *, void *, dbl_integer *, unsigned int *)); +int dbl_to_sgl_fcnvfx __P((dbl_floating_point *, void *, int *, unsigned int *)); +int dbl_to_dbl_fcnvfx __P((dbl_floating_point *, void *, dbl_integer *, unsigned int *)); + +int sgl_to_sgl_fcnvfxt __P((sgl_floating_point *, void *, int *, unsigned int *)); +int sgl_to_dbl_fcnvfxt __P((sgl_floating_point *, void *, dbl_integer *, unsigned int *)); +int dbl_to_sgl_fcnvfxt __P((dbl_floating_point *, void *, int *, unsigned int *)); +int dbl_to_dbl_fcnvfxt __P((dbl_floating_point *, void *, dbl_integer *, unsigned int *)); + +int sgl_to_sgl_fcnvxf __P((int *, void *, sgl_floating_point *, unsigned int *)); +int sgl_to_dbl_fcnvxf __P((int *, void *, dbl_floating_point *, unsigned int *)); +int dbl_to_sgl_fcnvxf __P((dbl_integer *, void *, sgl_floating_point *, unsigned int *)); +int dbl_to_dbl_fcnvxf __P((dbl_integer *, void *, dbl_floating_point *, unsigned int *)); + + + |