source: mainline/uspace/lib/softfloat/conversion.h@ ae7d03c

lfn serial ticket/834-toolchain-update topic/msim-upgrade topic/simplify-dev-export
Last change on this file since ae7d03c was ae7d03c, checked in by Jiri Svoboda <jiri@…>, 7 years ago

Selected ccheck-proposed comment fixes.

  • Property mode set to 100644
File size: 6.1 KB
Line 
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#include <mathtypes.h>
40
41extern float64 float32_to_float64(float32);
42extern float96 float32_to_float96(float32);
43extern float128 float32_to_float128(float32);
44extern float96 float64_to_float96(float64);
45extern float128 float64_to_float128(float64);
46extern float128 float96_to_float128(float96);
47
48extern float32 float64_to_float32(float64);
49extern float32 float96_to_float32(float96);
50extern float64 float96_to_float64(float96);
51extern float32 float128_to_float32(float128);
52extern float64 float128_to_float64(float128);
53extern float96 float128_to_float96(float128);
54
55extern uint32_t float32_to_uint32(float32);
56extern int32_t float32_to_int32(float32);
57
58extern uint64_t float32_to_uint64(float32);
59extern int64_t float32_to_int64(float32);
60
61extern uint32_t float64_to_uint32(float64);
62extern int32_t float64_to_int32(float64);
63
64extern uint64_t float64_to_uint64(float64);
65extern int64_t float64_to_int64(float64);
66
67extern uint32_t float96_to_uint32(float96);
68extern int32_t float96_to_int32(float96);
69
70extern uint64_t float96_to_uint64(float96);
71extern int64_t float96_to_int64(float96);
72
73extern uint32_t float128_to_uint32(float128);
74extern int32_t float128_to_int32(float128);
75
76extern uint64_t float128_to_uint64(float128);
77extern int64_t float128_to_int64(float128);
78
79extern float32 uint32_to_float32(uint32_t);
80extern float32 int32_to_float32(int32_t);
81
82extern float32 uint64_to_float32(uint64_t);
83extern float32 int64_to_float32(int64_t);
84
85extern float64 uint32_to_float64(uint32_t);
86extern float64 int32_to_float64(int32_t);
87
88extern float64 uint64_to_float64(uint64_t);
89extern float64 int64_to_float64(int64_t);
90
91extern float96 uint32_to_float96(uint32_t);
92extern float96 int32_to_float96(int32_t);
93
94extern float96 uint64_to_float96(uint64_t);
95extern float96 int64_to_float96(int64_t);
96
97extern float128 uint32_to_float128(uint32_t);
98extern float128 int32_to_float128(int32_t);
99
100extern float128 uint64_to_float128(uint64_t);
101extern float128 int64_to_float128(int64_t);
102
103#ifdef float32_t
104extern float32_t __floatsisf(int32_t);
105extern float32_t __floatdisf(int64_t);
106extern float32_t __floatunsisf(uint32_t);
107extern float32_t __floatundisf(uint64_t);
108extern int32_t __fixsfsi(float32_t);
109extern int64_t __fixsfdi(float32_t);
110extern uint32_t __fixunssfsi(float32_t);
111extern uint64_t __fixunssfdi(float32_t);
112extern int32_t __aeabi_f2iz(float32_t);
113extern int64_t __aeabi_f2lz(float32_t);
114extern uint32_t __aeabi_f2uiz(float32_t);
115extern float32_t __aeabi_i2f(int32_t);
116extern float32_t __aeabi_l2f(int64_t);
117extern float32_t __aeabi_ui2f(uint32_t);
118extern float32_t __aeabi_ul2f(uint64_t);
119#endif
120
121#ifdef float64_t
122extern float64_t __floatsidf(int32_t);
123extern float64_t __floatdidf(int64_t);
124extern float64_t __floatunsidf(uint32_t);
125extern float64_t __floatundidf(uint64_t);
126extern int32_t __fixdfsi(float64_t);
127extern int64_t __fixdfdi(float64_t);
128extern uint32_t __fixunsdfsi(float64_t);
129extern uint64_t __fixunsdfdi(float64_t);
130extern float64_t __aeabi_i2d(int32_t);
131extern float64_t __aeabi_ui2d(uint32_t);
132extern float64_t __aeabi_l2d(int64_t);
133extern int32_t __aeabi_d2iz(float64_t);
134extern int64_t __aeabi_d2lz(float64_t);
135extern uint32_t __aeabi_d2uiz(float64_t);
136#endif
137
138#ifdef float128_t
139extern float128_t __floatsitf(int32_t);
140extern float128_t __floatditf(int64_t);
141extern float128_t __floatunsitf(uint32_t);
142extern float128_t __floatunditf(uint64_t);
143extern int32_t __fixtfsi(float128_t);
144extern int64_t __fixtfdi(float128_t);
145extern uint32_t __fixunstfsi(float128_t);
146extern uint64_t __fixunstfdi(float128_t);
147extern int32_t _Qp_qtoi(float128_t *);
148extern int64_t _Qp_qtox(float128_t *);
149extern uint32_t _Qp_qtoui(float128_t *);
150extern uint64_t _Qp_qtoux(float128_t *);
151extern void _Qp_itoq(float128_t *, int32_t);
152extern void _Qp_xtoq(float128_t *, int64_t);
153extern void _Qp_uitoq(float128_t *, uint32_t);
154extern void _Qp_uxtoq(float128_t *, uint64_t);
155#endif
156
157#if (defined(float32_t) && defined(float64_t))
158extern float32_t __truncdfsf2(float64_t);
159extern float64_t __extendsfdf2(float32_t);
160extern float64_t __aeabi_f2d(float32_t);
161extern float32_t __aeabi_d2f(float64_t);
162#endif
163
164#if (defined(float32_t) && defined(float128_t))
165extern float32_t __trunctfsf2(float128_t);
166extern float128_t __extendsftf2(float32_t);
167extern void _Qp_stoq(float128_t *, float32_t);
168extern float32_t _Qp_qtos(float128_t *);
169#endif
170
171#if (defined(float64_t) && defined(float128_t))
172extern float64_t __trunctfdf2(float128_t);
173extern float128_t __extenddftf2(float64_t);
174extern void _Qp_dtoq(float128_t *, float64_t);
175extern float64_t _Qp_qtod(float128_t *);
176#endif
177
178#endif
179
180/** @}
181 */
Note: See TracBrowser for help on using the repository browser.