1 | /*
|
---|
2 | * Copyright (c) 2005 Josef Cejka
|
---|
3 | * Copyright (c) 2011 Petr Koupy
|
---|
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 |
|
---|
30 | /** @addtogroup softfloat
|
---|
31 | * @{
|
---|
32 | */
|
---|
33 | /** @file Conversion of precision and conversion between integers and floats.
|
---|
34 | */
|
---|
35 |
|
---|
36 | #ifndef __CONVERSION_H__
|
---|
37 | #define __CONVERSION_H__
|
---|
38 |
|
---|
39 | extern float64 float32_to_float64(float32);
|
---|
40 | extern float96 float32_to_float96(float32);
|
---|
41 | extern float128 float32_to_float128(float32);
|
---|
42 | extern float96 float64_to_float96(float64);
|
---|
43 | extern float128 float64_to_float128(float64);
|
---|
44 | extern float128 float96_to_float128(float96);
|
---|
45 |
|
---|
46 | extern float32 float64_to_float32(float64);
|
---|
47 | extern float32 float96_to_float32(float96);
|
---|
48 | extern float64 float96_to_float64(float96);
|
---|
49 | extern float32 float128_to_float32(float128);
|
---|
50 | extern float64 float128_to_float64(float128);
|
---|
51 | extern float96 float128_to_float96(float128);
|
---|
52 |
|
---|
53 | extern uint32_t float32_to_uint32(float32);
|
---|
54 | extern int32_t float32_to_int32(float32);
|
---|
55 |
|
---|
56 | extern uint64_t float32_to_uint64(float32);
|
---|
57 | extern int64_t float32_to_int64(float32);
|
---|
58 |
|
---|
59 | extern uint32_t float64_to_uint32(float64);
|
---|
60 | extern int32_t float64_to_int32(float64);
|
---|
61 |
|
---|
62 | extern uint64_t float64_to_uint64(float64);
|
---|
63 | extern int64_t float64_to_int64(float64);
|
---|
64 |
|
---|
65 | extern uint32_t float96_to_uint32(float96);
|
---|
66 | extern int32_t float96_to_int32(float96);
|
---|
67 |
|
---|
68 | extern uint64_t float96_to_uint64(float96);
|
---|
69 | extern int64_t float96_to_int64(float96);
|
---|
70 |
|
---|
71 | extern uint32_t float128_to_uint32(float128);
|
---|
72 | extern int32_t float128_to_int32(float128);
|
---|
73 |
|
---|
74 | extern uint64_t float128_to_uint64(float128);
|
---|
75 | extern int64_t float128_to_int64(float128);
|
---|
76 |
|
---|
77 | extern float32 uint32_to_float32(uint32_t);
|
---|
78 | extern float32 int32_to_float32(int32_t);
|
---|
79 |
|
---|
80 | extern float32 uint64_to_float32(uint64_t);
|
---|
81 | extern float32 int64_to_float32(int64_t);
|
---|
82 |
|
---|
83 | extern float64 uint32_to_float64(uint32_t);
|
---|
84 | extern float64 int32_to_float64(int32_t);
|
---|
85 |
|
---|
86 | extern float64 uint64_to_float64(uint64_t);
|
---|
87 | extern float64 int64_to_float64(int64_t);
|
---|
88 |
|
---|
89 | extern float96 uint32_to_float96(uint32_t);
|
---|
90 | extern float96 int32_to_float96(int32_t);
|
---|
91 |
|
---|
92 | extern float96 uint64_to_float96(uint64_t);
|
---|
93 | extern float96 int64_to_float96(int64_t);
|
---|
94 |
|
---|
95 | extern float128 uint32_to_float128(uint32_t);
|
---|
96 | extern float128 int32_to_float128(int32_t);
|
---|
97 |
|
---|
98 | extern float128 uint64_to_float128(uint64_t);
|
---|
99 | extern float128 int64_to_float128(int64_t);
|
---|
100 |
|
---|
101 | #endif
|
---|
102 |
|
---|
103 | /** @}
|
---|
104 | */
|
---|