[b5440cf] | 1 | /*
|
---|
[df4ed85] | 2 | * Copyright (c) 2005 Josef Cejka
|
---|
[c67aff2] | 3 | * Copyright (c) 2011 Petr Koupy
|
---|
[b5440cf] | 4 | * All rights reserved.
|
---|
| 5 | *
|
---|
| 6 | * Redistribution and use in source and binary forms, with or without
|
---|
| 7 | * modification, are permitted provided that the following conditions
|
---|
| 8 | * are met:
|
---|
| 9 | *
|
---|
| 10 | * - Redistributions of source code must retain the above copyright
|
---|
| 11 | * notice, this list of conditions and the following disclaimer.
|
---|
| 12 | * - Redistributions in binary form must reproduce the above copyright
|
---|
| 13 | * notice, this list of conditions and the following disclaimer in the
|
---|
| 14 | * documentation and/or other materials provided with the distribution.
|
---|
| 15 | * - The name of the author may not be used to endorse or promote products
|
---|
| 16 | * derived from this software without specific prior written permission.
|
---|
| 17 | *
|
---|
| 18 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
|
---|
| 19 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
---|
| 20 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
---|
| 21 | * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
|
---|
| 22 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
---|
| 23 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
---|
| 24 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
---|
| 25 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
---|
| 26 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
---|
| 27 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
---|
| 28 | */
|
---|
| 29 |
|
---|
[750636a] | 30 | /** @addtogroup softfloat
|
---|
[846848a6] | 31 | * @{
|
---|
| 32 | */
|
---|
[c67aff2] | 33 | /** @file Conversion of precision and conversion between integers and floats.
|
---|
[846848a6] | 34 | */
|
---|
| 35 |
|
---|
[b5440cf] | 36 | #ifndef __CONVERSION_H__
|
---|
| 37 | #define __CONVERSION_H__
|
---|
| 38 |
|
---|
[750636a] | 39 | extern float64 convertFloat32ToFloat64(float32);
|
---|
[c67aff2] | 40 | extern float128 convertFloat32ToFloat128(float32);
|
---|
| 41 | extern float128 convertFloat64ToFloat128(float64);
|
---|
| 42 |
|
---|
| 43 |
|
---|
[750636a] | 44 | extern float32 convertFloat64ToFloat32(float64);
|
---|
[c67aff2] | 45 | extern float32 convertFloat128ToFloat32(float128);
|
---|
| 46 | extern float64 convertFloat128ToFloat64(float128);
|
---|
| 47 |
|
---|
[feef1cd] | 48 |
|
---|
[750636a] | 49 | extern uint32_t float32_to_uint32(float32);
|
---|
| 50 | extern int32_t float32_to_int32(float32);
|
---|
[feef1cd] | 51 |
|
---|
[750636a] | 52 | extern uint64_t float32_to_uint64(float32);
|
---|
| 53 | extern int64_t float32_to_int64(float32);
|
---|
[1d83419] | 54 |
|
---|
[c67aff2] | 55 | extern uint32_t float64_to_uint32(float64);
|
---|
| 56 | extern int32_t float64_to_int32(float64);
|
---|
| 57 |
|
---|
[750636a] | 58 | extern uint64_t float64_to_uint64(float64);
|
---|
| 59 | extern int64_t float64_to_int64(float64);
|
---|
[1d83419] | 60 |
|
---|
[c67aff2] | 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 |
|
---|
[1d83419] | 67 |
|
---|
[750636a] | 68 | extern float32 uint32_to_float32(uint32_t);
|
---|
| 69 | extern float32 int32_to_float32(int32_t);
|
---|
[a82695c] | 70 |
|
---|
[750636a] | 71 | extern float32 uint64_to_float32(uint64_t);
|
---|
| 72 | extern float32 int64_to_float32(int64_t);
|
---|
[a82695c] | 73 |
|
---|
[750636a] | 74 | extern float64 uint32_to_float64(uint32_t);
|
---|
| 75 | extern float64 int32_to_float64(int32_t);
|
---|
[f37d769] | 76 |
|
---|
[750636a] | 77 | extern float64 uint64_to_float64(uint64_t);
|
---|
| 78 | extern float64 int64_to_float64(int64_t);
|
---|
[f37d769] | 79 |
|
---|
[c67aff2] | 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 |
|
---|
[b5440cf] | 86 | #endif
|
---|
| 87 |
|
---|
[750636a] | 88 | /** @}
|
---|
[846848a6] | 89 | */
|
---|