Changeset 1cc4a09 in mainline for uspace/lib/softfloat/include
- Timestamp:
- 2011-08-14T00:19:31Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- b705ecc
- Parents:
- 6d100fd (diff), e0e922d (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - Location:
- uspace/lib/softfloat/include
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/softfloat/include/add.h
r6d100fd r1cc4a09 1 1 /* 2 2 * Copyright (c) 2005 Josef Cejka 3 * Copyright (c) 2011 Petr Koupy 3 4 * All rights reserved. 4 5 * … … 30 31 * @{ 31 32 */ 32 /** @file 33 /** @file Addition functions. 33 34 */ 34 35 … … 38 39 extern float32 addFloat32(float32, float32); 39 40 extern float64 addFloat64(float64, float64); 41 extern float128 addFloat128(float128, float128); 40 42 41 43 #endif -
uspace/lib/softfloat/include/common.h
r6d100fd r1cc4a09 1 1 /* 2 2 * Copyright (c) 2005 Josef Cejka 3 * Copyright (c) 2011 Petr Koupy 3 4 * All rights reserved. 4 5 * … … 30 31 * @{ 31 32 */ 32 /** @file 33 /** @file Common helper operations. 33 34 */ 34 35 … … 39 40 40 41 extern float64 finishFloat64(int32_t, uint64_t, char); 42 extern float128 finishFloat128(int32_t, uint64_t, uint64_t, char, uint64_t); 41 43 44 extern int countZeroes8(uint8_t); 45 extern int countZeroes32(uint32_t); 42 46 extern int countZeroes64(uint64_t); 43 extern int countZeroes32(uint32_t);44 extern int countZeroes8(uint8_t);45 47 46 48 extern void roundFloat32(int32_t *, uint32_t *); 47 49 extern void roundFloat64(int32_t *, uint64_t *); 50 extern void roundFloat128(int32_t *, uint64_t *, uint64_t *); 51 52 extern void lshift128(uint64_t, uint64_t, int, uint64_t *, uint64_t *); 53 extern void rshift128(uint64_t, uint64_t, int, uint64_t *, uint64_t *); 54 55 extern void and128(uint64_t, uint64_t, uint64_t, uint64_t, uint64_t *, uint64_t *); 56 extern void or128(uint64_t, uint64_t, uint64_t, uint64_t, uint64_t *, uint64_t *); 57 extern void xor128(uint64_t, uint64_t, uint64_t, uint64_t, uint64_t *, uint64_t *); 58 extern void not128(uint64_t, uint64_t, uint64_t *, uint64_t *); 59 60 extern int eq128(uint64_t, uint64_t, uint64_t, uint64_t); 61 extern int le128(uint64_t, uint64_t, uint64_t, uint64_t); 62 extern int lt128(uint64_t, uint64_t, uint64_t, uint64_t); 63 64 extern void add128(uint64_t, uint64_t, uint64_t, uint64_t, uint64_t *, uint64_t *); 65 extern void sub128(uint64_t, uint64_t, uint64_t, uint64_t, uint64_t *, uint64_t *); 66 67 extern void mul64(uint64_t, uint64_t, uint64_t *, uint64_t *); 68 extern void mul128(uint64_t, uint64_t, uint64_t, uint64_t, 69 uint64_t *, uint64_t *, uint64_t *, uint64_t *); 70 71 extern uint64_t div128est(uint64_t, uint64_t, uint64_t); 48 72 49 73 #endif -
uspace/lib/softfloat/include/comparison.h
r6d100fd r1cc4a09 1 1 /* 2 2 * Copyright (c) 2005 Josef Cejka 3 * Copyright (c) 2011 Petr Koupy 3 4 * All rights reserved. 4 5 * … … 30 31 * @{ 31 32 */ 32 /** @file 33 /** @file Comparison functions. 33 34 */ 34 35 … … 42 43 extern int isFloat32Zero(float32); 43 44 45 extern int isFloat32eq(float32, float32); 46 extern int isFloat32lt(float32, float32); 47 extern int isFloat32gt(float32, float32); 48 44 49 extern int isFloat64NaN(float64); 45 50 extern int isFloat64SigNaN(float64); … … 48 53 extern int isFloat64Zero(float64); 49 54 50 extern int isFloat32eq(float32, float32); 51 extern int isFloat32lt(float32, float32); 52 extern int isFloat32gt(float32, float32); 55 extern int isFloat64eq(float64, float64); 56 extern int isFloat64lt(float64, float64); 57 extern int isFloat64gt(float64, float64); 58 59 extern int isFloat128NaN(float128); 60 extern int isFloat128SigNaN(float128); 61 62 extern int isFloat128Infinity(float128); 63 extern int isFloat128Zero(float128); 64 65 extern int isFloat128eq(float128, float128); 66 extern int isFloat128lt(float128, float128); 67 extern int isFloat128gt(float128, float128); 53 68 54 69 #endif -
uspace/lib/softfloat/include/conversion.h
r6d100fd r1cc4a09 1 1 /* 2 2 * Copyright (c) 2005 Josef Cejka 3 * Copyright (c) 2011 Petr Koupy 3 4 * All rights reserved. 4 5 * … … 30 31 * @{ 31 32 */ 32 /** @file 33 /** @file Conversion of precision and conversion between integers and floats. 33 34 */ 34 35 … … 37 38 38 39 extern float64 convertFloat32ToFloat64(float32); 40 extern float128 convertFloat32ToFloat128(float32); 41 extern float128 convertFloat64ToFloat128(float64); 42 43 39 44 extern float32 convertFloat64ToFloat32(float64); 45 extern float32 convertFloat128ToFloat32(float128); 46 extern float64 convertFloat128ToFloat64(float128); 47 40 48 41 49 extern uint32_t float32_to_uint32(float32); … … 45 53 extern int64_t float32_to_int64(float32); 46 54 55 extern uint32_t float64_to_uint32(float64); 56 extern int32_t float64_to_int32(float64); 57 47 58 extern uint64_t float64_to_uint64(float64); 48 59 extern int64_t float64_to_int64(float64); 49 60 50 extern uint32_t float64_to_uint32(float64); 51 extern int32_t float64_to_int32(float64); 61 extern uint32_t float128_to_uint32(float128); 62 extern int32_t float128_to_int32(float128); 63 64 extern uint64_t float128_to_uint64(float128); 65 extern int64_t float128_to_int64(float128); 66 52 67 53 68 extern float32 uint32_to_float32(uint32_t); … … 63 78 extern float64 int64_to_float64(int64_t); 64 79 80 extern float128 uint32_to_float128(uint32_t); 81 extern float128 int32_to_float128(int32_t); 82 83 extern float128 uint64_to_float128(uint64_t); 84 extern float128 int64_to_float128(int64_t); 85 65 86 #endif 66 87 -
uspace/lib/softfloat/include/div.h
r6d100fd r1cc4a09 1 1 /* 2 2 * Copyright (c) 2005 Josef Cejka 3 * Copyright (c) 2011 Petr Koupy 3 4 * All rights reserved. 4 5 * … … 30 31 * @{ 31 32 */ 32 /** @file 33 /** @file Division functions. 33 34 */ 34 35 … … 38 39 extern float32 divFloat32(float32, float32); 39 40 extern float64 divFloat64(float64, float64); 40 41 extern uint64_t divFloat64estim(uint64_t, uint64_t); 41 extern float128 divFloat128(float128, float128); 42 42 43 43 #endif -
uspace/lib/softfloat/include/mul.h
r6d100fd r1cc4a09 1 1 /* 2 2 * Copyright (c) 2005 Josef Cejka 3 * Copyright (c) 2011 Petr Koupy 3 4 * All rights reserved. 4 5 * … … 30 31 * @{ 31 32 */ 32 /** @file 33 /** @file Multiplication functions. 33 34 */ 34 35 … … 38 39 extern float32 mulFloat32(float32, float32); 39 40 extern float64 mulFloat64(float64, float64); 40 41 extern void mul64integers(uint64_t, uint64_t, uint64_t *, uint64_t *); 41 extern float128 mulFloat128(float128, float128); 42 42 43 43 #endif -
uspace/lib/softfloat/include/other.h
r6d100fd r1cc4a09 30 30 * @{ 31 31 */ 32 /** @file 32 /** @file Other functions (power, complex). 33 33 */ 34 34 -
uspace/lib/softfloat/include/sftypes.h
r6d100fd r1cc4a09 1 1 /* 2 2 * Copyright (c) 2005 Josef Cejka 3 * Copyright (c) 2011 Petr Koupy 3 4 * All rights reserved. 4 5 * … … 30 31 * @{ 31 32 */ 32 /** @file 33 /** @file Floating point types and constants. 33 34 */ 34 35 … … 77 78 } float64; 78 79 79 #define FLOAT32_MAX 0x7f800000 80 #define FLOAT32_MIN 0xff800000 81 #define FLOAT64_MAX 82 #define FLOAT64_MIN 80 typedef union { 81 long double ld; 82 struct { 83 #if defined(__BE__) 84 uint64_t hi; 85 uint64_t lo; 86 #elif defined(__LE__) 87 uint64_t lo; 88 uint64_t hi; 89 #else 90 #error Unknown endianess 91 #endif 92 } binary; 93 94 struct { 95 #if defined(__BE__) 96 uint64_t sign : 1; 97 uint64_t exp : 15; 98 uint64_t frac_hi : 48; 99 uint64_t frac_lo : 64; 100 #elif defined(__LE__) 101 uint64_t frac_lo : 64; 102 uint64_t frac_hi : 48; 103 uint64_t exp : 15; 104 uint64_t sign : 1; 105 #else 106 #error Unknown endianess 107 #endif 108 } parts __attribute__ ((packed)); 109 } float128; 83 110 84 111 /* 85 * For recognizing NaNs or infinity use isFloat32NaN and is Float32Inf,112 * For recognizing NaNs or infinity use specialized comparison functions, 86 113 * comparing with these constants is not sufficient. 87 114 */ … … 95 122 #define FLOAT64_INF 0x7FF0000000000000ll 96 123 97 #define FLOAT32_FRACTION_SIZE 23 98 #define FLOAT64_FRACTION_SIZE 52 124 #define FLOAT128_NAN_HI 0x7FFF800000000000ll 125 #define FLOAT128_NAN_LO 0x0000000000000001ll 126 #define FLOAT128_SIGNAN_HI 0x7FFF000000000000ll 127 #define FLOAT128_SIGNAN_LO 0x0000000000000001ll 128 #define FLOAT128_INF_HI 0x7FFF000000000000ll 129 #define FLOAT128_INF_LO 0x0000000000000000ll 99 130 100 #define FLOAT32_HIDDEN_BIT_MASK 0x800000 101 #define FLOAT64_HIDDEN_BIT_MASK 0x10000000000000ll 131 #define FLOAT32_FRACTION_SIZE 23 132 #define FLOAT64_FRACTION_SIZE 52 133 #define FLOAT128_FRACTION_SIZE 112 134 #define FLOAT128_FRAC_HI_SIZE 48 135 #define FLOAT128_FRAC_LO_SIZE 64 136 137 #define FLOAT32_HIDDEN_BIT_MASK 0x800000 138 #define FLOAT64_HIDDEN_BIT_MASK 0x10000000000000ll 139 #define FLOAT128_HIDDEN_BIT_MASK_HI 0x1000000000000ll 140 #define FLOAT128_HIDDEN_BIT_MASK_LO 0x0000000000000000ll 102 141 103 142 #define FLOAT32_MAX_EXPONENT 0xFF 104 143 #define FLOAT64_MAX_EXPONENT 0x7FF 144 #define FLOAT128_MAX_EXPONENT 0x7FFF 105 145 106 146 #define FLOAT32_BIAS 0x7F 107 147 #define FLOAT64_BIAS 0x3FF 108 148 #define FLOAT80_BIAS 0x3FFF 149 #define FLOAT128_BIAS 0x3FFF 109 150 110 151 #endif -
uspace/lib/softfloat/include/softfloat.h
r6d100fd r1cc4a09 1 1 /* 2 2 * Copyright (c) 2005 Josef Cejka 3 * Copyright (c) 2011 Petr Koupy 3 4 * All rights reserved. 4 5 * … … 30 31 * @{ 31 32 */ 32 /** @file 33 /** @file Softfloat API. 33 34 */ 34 35 … … 156 157 extern int __ltdf2(double, double); 157 158 extern int __lttf2(long double, long double); 159 158 160 extern int __lesf2(float, float); 159 161 extern int __ledf2(double, double); … … 166 168 /* Not implemented yet */ 167 169 extern float __powisf2(float, int); 170 extern double __powidf2 (double, int); 171 extern long double __powitf2 (long double, int); 172 extern long double __powixf2 (long double, int); 173 174 175 176 /* SPARC quadruple-precision wrappers */ 177 178 extern void _Qp_add(long double *, long double *, long double *); 179 extern void _Qp_sub(long double *, long double *, long double *); 180 extern void _Qp_mul(long double *, long double *, long double *); 181 extern void _Qp_div(long double *, long double *, long double *); 182 extern void _Qp_neg(long double *, long double *); 183 184 extern void _Qp_stoq(long double *, float); 185 extern void _Qp_dtoq(long double *, double); 186 extern float _Qp_qtos(long double *); 187 extern double _Qp_qtod(long double *); 188 189 extern int _Qp_qtoi(long double *); 190 extern unsigned int _Qp_qtoui(long double *); 191 extern long _Qp_qtox(long double *); 192 extern unsigned long _Qp_qtoux(long double *); 193 194 extern void _Qp_itoq(long double *, int); 195 extern void _Qp_uitoq(long double *, unsigned int); 196 extern void _Qp_xtoq(long double *, long); 197 extern void _Qp_uxtoq(long double *, unsigned long); 198 199 extern int _Qp_cmp(long double *, long double *); 200 extern int _Qp_cmpe(long double *, long double *); 201 extern int _Qp_feq(long double *, long double *); 202 extern int _Qp_fge(long double *, long double *); 203 extern int _Qp_fgt(long double *, long double *); 204 extern int _Qp_fle(long double*, long double *); 205 extern int _Qp_flt(long double *, long double *); 206 extern int _Qp_fne(long double *, long double *); 207 208 /* Not implemented yet */ 209 extern void _Qp_sqrt(long double *, long double *); 168 210 169 211 #endif -
uspace/lib/softfloat/include/sub.h
r6d100fd r1cc4a09 1 1 /* 2 2 * Copyright (c) 2005 Josef Cejka 3 * Copyright (c) 2011 Petr Koupy 3 4 * All rights reserved. 4 5 * … … 30 31 * @{ 31 32 */ 32 /** @file 33 /** @file Substraction functions. 33 34 */ 34 35 … … 38 39 extern float32 subFloat32(float32, float32); 39 40 extern float64 subFloat64(float64, float64); 41 extern float128 subFloat128(float128, float128); 40 42 41 43 #endif
Note:
See TracChangeset
for help on using the changeset viewer.