/tags/0.4.0/uspace/lib/softfloat/include/sftypes.h |
---|
0,0 → 1,115 |
/* |
* Copyright (c) 2005 Josef Cejka |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - Redistributions in binary form must reproduce the above copyright |
* notice, this list of conditions and the following disclaimer in the |
* documentation and/or other materials provided with the distribution. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR |
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES |
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. |
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, |
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT |
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF |
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
*/ |
/** @addtogroup softfloat |
* @{ |
*/ |
/** @file |
*/ |
#ifndef __SFTYPES_H__ |
#define __SFTYPES_H__ |
#include <byteorder.h> |
#include <stdint.h> |
typedef union { |
float f; |
uint32_t binary; |
struct { |
#if defined(ARCH_IS_BIG_ENDIAN) |
uint32_t sign:1; |
uint32_t exp:8; |
uint32_t fraction:23; |
#elif defined(ARCH_IS_LITTLE_ENDIAN) |
uint32_t fraction:23; |
uint32_t exp:8; |
uint32_t sign:1; |
#else |
#error "Unknown endians." |
#endif |
} parts __attribute__ ((packed)); |
} float32; |
typedef union { |
double d; |
uint64_t binary; |
struct { |
#if defined(ARCH_IS_BIG_ENDIAN) |
uint64_t sign:1; |
uint64_t exp:11; |
uint64_t fraction:52; |
#elif defined(ARCH_IS_LITTLE_ENDIAN) |
uint64_t fraction:52; |
uint64_t exp:11; |
uint64_t sign:1; |
#else |
#error "Unknown endians." |
#endif |
} parts __attribute__ ((packed)); |
} float64; |
#define FLOAT32_MAX 0x7f800000 |
#define FLOAT32_MIN 0xff800000 |
#define FLOAT64_MAX |
#define FLOAT64_MIN |
/* |
* For recognizing NaNs or infinity use isFloat32NaN and is Float32Inf, |
* comparing with these constants is not sufficient. |
*/ |
#define FLOAT32_NAN 0x7FC00001 |
#define FLOAT32_SIGNAN 0x7F800001 |
#define FLOAT32_INF 0x7F800000 |
#define FLOAT64_NAN 0x7FF8000000000001ll |
#define FLOAT64_SIGNAN 0x7FF0000000000001ll |
#define FLOAT64_INF 0x7FF0000000000000ll |
#define FLOAT32_FRACTION_SIZE 23 |
#define FLOAT64_FRACTION_SIZE 52 |
#define FLOAT32_HIDDEN_BIT_MASK 0x800000 |
#define FLOAT64_HIDDEN_BIT_MASK 0x10000000000000ll |
#define FLOAT32_MAX_EXPONENT 0xFF |
#define FLOAT64_MAX_EXPONENT 0x7FF |
#define FLOAT32_BIAS 0x7F |
#define FLOAT64_BIAS 0x3FF |
#define FLOAT80_BIAS 0x3FFF |
#endif |
/** @} |
*/ |
/tags/0.4.0/uspace/lib/softfloat/include/sub.h |
---|
0,0 → 1,47 |
/* |
* Copyright (c) 2005 Josef Cejka |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - Redistributions in binary form must reproduce the above copyright |
* notice, this list of conditions and the following disclaimer in the |
* documentation and/or other materials provided with the distribution. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR |
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES |
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. |
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, |
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT |
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF |
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
*/ |
/** @addtogroup softfloat |
* @{ |
*/ |
/** @file |
*/ |
#ifndef __SUB_H__ |
#define __SUB_H__ |
float32 subFloat32(float32 a, float32 b); |
float64 subFloat64(float64 a, float64 b); |
#endif |
/** @} |
*/ |
/tags/0.4.0/uspace/lib/softfloat/include/comparison.h |
---|
0,0 → 1,59 |
/* |
* Copyright (c) 2005 Josef Cejka |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - Redistributions in binary form must reproduce the above copyright |
* notice, this list of conditions and the following disclaimer in the |
* documentation and/or other materials provided with the distribution. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR |
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES |
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. |
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, |
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT |
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF |
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
*/ |
/** @addtogroup softfloat |
* @{ |
*/ |
/** @file |
*/ |
#ifndef __COMPARISON_H__ |
#define __COMPARISON_H__ |
inline int isFloat32NaN(float32 f); |
inline int isFloat32SigNaN(float32 f); |
inline int isFloat32Infinity(float32 f); |
inline int isFloat32Zero(float32 f); |
inline int isFloat64NaN(float64 d); |
inline int isFloat64SigNaN(float64 d); |
inline int isFloat64Infinity(float64 d); |
inline int isFloat64Zero(float64 d); |
inline int isFloat32eq(float32 a, float32 b); |
inline int isFloat32lt(float32 a, float32 b); |
inline int isFloat32gt(float32 a, float32 b); |
#endif |
/** @} |
*/ |
/tags/0.4.0/uspace/lib/softfloat/include/mul.h |
---|
0,0 → 1,49 |
/* |
* Copyright (c) 2005 Josef Cejka |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - Redistributions in binary form must reproduce the above copyright |
* notice, this list of conditions and the following disclaimer in the |
* documentation and/or other materials provided with the distribution. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR |
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES |
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. |
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, |
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT |
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF |
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
*/ |
/** @addtogroup softfloat |
* @{ |
*/ |
/** @file |
*/ |
#ifndef __MUL_H__ |
#define __MUL_H__ |
float32 mulFloat32(float32 a, float32 b); |
float64 mulFloat64(float64 a, float64 b); |
void mul64integers(uint64_t a,uint64_t b, uint64_t *lo, uint64_t *hi); |
#endif |
/** @} |
*/ |
/tags/0.4.0/uspace/lib/softfloat/include/other.h |
---|
0,0 → 1,43 |
/* |
* Copyright (c) 2005 Josef Cejka |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - Redistributions in binary form must reproduce the above copyright |
* notice, this list of conditions and the following disclaimer in the |
* documentation and/or other materials provided with the distribution. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR |
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES |
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. |
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, |
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT |
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF |
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
*/ |
/** @addtogroup softfloat |
* @{ |
*/ |
/** @file |
*/ |
#ifndef __OTHER_H__ |
#define __OTHER_H__ |
#endif |
/** @} |
*/ |
/tags/0.4.0/uspace/lib/softfloat/include/softfloat.h |
---|
0,0 → 1,174 |
/* |
* Copyright (c) 2005 Josef Cejka |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - Redistributions in binary form must reproduce the above copyright |
* notice, this list of conditions and the following disclaimer in the |
* documentation and/or other materials provided with the distribution. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR |
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES |
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. |
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, |
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT |
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF |
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
*/ |
/** @addtogroup softfloat |
* @{ |
*/ |
/** @file |
*/ |
#ifndef __SOFTFLOAT_H__ |
#define __SOFTFLOAT_H__ |
float __addsf3(float a, float b); |
double __adddf3(double a, double b); |
long double __addtf3(long double a, long double b); |
long double __addxf3(long double a, long double b); |
float __subsf3(float a, float b); |
double __subdf3(double a, double b); |
long double __subtf3(long double a, long double b); |
long double __subxf3(long double a, long double b); |
float __mulsf3(float a, float b); |
double __muldf3(double a, double b); |
long double __multf3(long double a, long double b); |
long double __mulxf3(long double a, long double b); |
float __divsf3(float a, float b); |
double __divdf3(double a, double b); |
long double __divtf3(long double a, long double b); |
long double __divxf3(long double a, long double b); |
float __negsf2(float a); |
double __negdf2(double a); |
long double __negtf2(long double a); |
long double __negxf2(long double a); |
double __extendsfdf2(float a); |
long double __extendsftf2(float a); |
long double __extendsfxf2(float a); |
long double __extenddftf2(double a); |
long double __extenddfxf2(double a); |
double __truncxfdf2(long double a); |
double __trunctfdf2(long double a); |
float __truncxfsf2(long double a); |
float __trunctfsf2(long double a); |
float __truncdfsf2(double a); |
int __fixsfsi(float a); |
int __fixdfsi(double a); |
int __fixtfsi(long double a); |
int __fixxfsi(long double a); |
long __fixsfdi(float a); |
long __fixdfdi(double a); |
long __fixtfdi(long double a); |
long __fixxfdi(long double a); |
long long __fixsfti(float a); |
long long __fixdfti(double a); |
long long __fixtfti(long double a); |
long long __fixxfti(long double a); |
unsigned int __fixunssfsi(float a); |
unsigned int __fixunsdfsi(double a); |
unsigned int __fixunstfsi(long double a); |
unsigned int __fixunsxfsi(long double a); |
unsigned long __fixunssfdi(float a); |
unsigned long __fixunsdfdi(double a); |
unsigned long __fixunstfdi(long double a); |
unsigned long __fixunsxfdi(long double a); |
unsigned long long __fixunssfti(float a); |
unsigned long long __fixunsdfti(double a); |
unsigned long long __fixunstfti(long double a); |
unsigned long long __fixunsxfti(long double a); |
float __floatsisf(int i); |
double __floatsidf(int i); |
long double __floatsitf(int i); |
long double __floatsixf(int i); |
float __floatdisf(long i); |
double __floatdidf(long i); |
long double __floatditf(long i); |
long double __floatdixf(long i); |
float __floattisf(long long i); |
double __floattidf(long long i); |
long double __floattitf(long long i); |
long double __floattixf(long long i); |
float __floatunsisf(unsigned int i); |
double __floatunsidf(unsigned int i); |
long double __floatunsitf(unsigned int i); |
long double __floatunsixf(unsigned int i); |
float __floatundisf(unsigned long i); |
double __floatundidf(unsigned long i); |
long double __floatunditf(unsigned long i); |
long double __floatundixf(unsigned long i); |
float __floatuntisf(unsigned long long i); |
double __floatuntidf(unsigned long long i); |
long double __floatuntitf(unsigned long long i); |
long double __floatuntixf(unsigned long long i); |
int __cmpsf2(float a, float b); |
int __cmpdf2(double a, double b); |
int __cmptf2(long double a, long double b); |
int __unordsf2(float a, float b); |
int __unorddf2(double a, double b); |
int __unordtf2(long double a, long double b); |
int __eqsf2(float a, float b); |
int __eqdf2(double a, double b); |
int __eqtf2(long double a, long double b); |
int __nesf2(float a, float b); |
int __nedf2(double a, double b); |
int __netf2(long double a, long double b); |
int __gesf2(float a, float b); |
int __gedf2(double a, double b); |
int __getf2(long double a, long double b); |
int __ltsf2(float a, float b); |
int __ltdf2(double a, double b); |
int __lttf2(long double a, long double b); |
int __lesf2(float a, float b); |
int __ledf2(double a, double b); |
int __letf2(long double a, long double b); |
int __gtsf2(float a, float b); |
int __gtdf2(double a, double b); |
int __gttf2(long double a, long double b); |
/* Not implemented yet*/ |
float __powisf2(float a, int b); |
#endif |
/** @} |
*/ |
/tags/0.4.0/uspace/lib/softfloat/include/div.h |
---|
0,0 → 1,48 |
/* |
* Copyright (c) 2005 Josef Cejka |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - Redistributions in binary form must reproduce the above copyright |
* notice, this list of conditions and the following disclaimer in the |
* documentation and/or other materials provided with the distribution. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR |
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES |
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. |
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, |
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT |
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF |
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
*/ |
/** @addtogroup softfloat |
* @{ |
*/ |
/** @file |
*/ |
#ifndef __DIV_H__ |
#define __DIV_H__ |
float32 divFloat32(float32 a, float32 b); |
float64 divFloat64(float64 a, float64 b); |
uint64_t divFloat64estim(uint64_t a, uint64_t b); |
#endif |
/** @} |
*/ |
/tags/0.4.0/uspace/lib/softfloat/include/conversion.h |
---|
0,0 → 1,71 |
/* |
* Copyright (c) 2005 Josef Cejka |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - Redistributions in binary form must reproduce the above copyright |
* notice, this list of conditions and the following disclaimer in the |
* documentation and/or other materials provided with the distribution. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR |
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES |
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. |
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, |
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT |
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF |
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
*/ |
/** @addtogroup softfloat |
* @{ |
*/ |
/** @file |
*/ |
#ifndef __CONVERSION_H__ |
#define __CONVERSION_H__ |
float64 convertFloat32ToFloat64(float32 a); |
float32 convertFloat64ToFloat32(float64 a); |
uint32_t float32_to_uint32(float32 a); |
int32_t float32_to_int32(float32 a); |
uint64_t float32_to_uint64(float32 a); |
int64_t float32_to_int64(float32 a); |
uint64_t float64_to_uint64(float64 a); |
int64_t float64_to_int64(float64 a); |
uint32_t float64_to_uint32(float64 a); |
int32_t float64_to_int32(float64 a); |
float32 uint32_to_float32(uint32_t i); |
float32 int32_to_float32(int32_t i); |
float32 uint64_to_float32(uint64_t i); |
float32 int64_to_float32(int64_t i); |
float64 uint32_to_float64(uint32_t i); |
float64 int32_to_float64(int32_t i); |
float64 uint64_to_float64(uint64_t i); |
float64 int64_to_float64(int64_t i); |
#endif |
/** @} |
*/ |
/tags/0.4.0/uspace/lib/softfloat/include/add.h |
---|
0,0 → 1,47 |
/* |
* Copyright (c) 2005 Josef Cejka |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - Redistributions in binary form must reproduce the above copyright |
* notice, this list of conditions and the following disclaimer in the |
* documentation and/or other materials provided with the distribution. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR |
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES |
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. |
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, |
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT |
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF |
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
*/ |
/** @addtogroup softfloat |
* @{ |
*/ |
/** @file |
*/ |
#ifndef __ADD_H__ |
#define __ADD_H__ |
float32 addFloat32(float32 a, float32 b); |
float64 addFloat64(float64 a, float64 b); |
#endif |
/** @} |
*/ |
/tags/0.4.0/uspace/lib/softfloat/include/common.h |
---|
0,0 → 1,53 |
/* |
* Copyright (c) 2005 Josef Cejka |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - Redistributions in binary form must reproduce the above copyright |
* notice, this list of conditions and the following disclaimer in the |
* documentation and/or other materials provided with the distribution. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR |
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES |
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. |
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, |
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT |
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF |
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
*/ |
/** @addtogroup softfloat |
* @{ |
*/ |
/** @file |
*/ |
#ifndef __COMMON_H__ |
#define __COMMON_H__ |
#include<sftypes.h> |
float64 finishFloat64(int32_t cexp, uint64_t cfrac, char sign); |
int countZeroes64(uint64_t i); |
int countZeroes32(uint32_t i); |
int countZeroes8(uint8_t i); |
void roundFloat32(int32_t *exp, uint32_t *fraction); |
void roundFloat64(int32_t *exp, uint64_t *fraction); |
#endif |
/** @} |
*/ |