]> git.proxmox.com Git - mirror_edk2.git/blame - ArmPkg/Library/ArmSoftFloatLib/softfloat-for-gcc.h
ArmPkg/DebugAgentSymbolsBaseLib: remove exception handling
[mirror_edk2.git] / ArmPkg / Library / ArmSoftFloatLib / softfloat-for-gcc.h
CommitLineData
1dbda2b4
AB
1/* $NetBSD: softfloat-for-gcc.h,v 1.12 2013/08/01 23:21:19 matt Exp $ */\r
2/*-\r
3 * Copyright (c) 2008 The NetBSD Foundation, Inc.\r
4 * All rights reserved.\r
5 *\r
6 * This code is derived from software contributed to The NetBSD Foundation\r
7 * by\r
8 *\r
9 * Redistribution and use in source and binary forms, with or without\r
10 * modification, are permitted provided that the following conditions\r
11 * are met:\r
12 * 1. Redistributions of source code must retain the above copyright\r
13 * notice, this list of conditions and the following disclaimer.\r
14 * 2. Redistributions in binary form must reproduce the above copyright\r
15 * notice, this list of conditions and the following disclaimer in the\r
16 * documentation and/or other materials provided with the distribution.\r
17 *\r
18 * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS\r
19 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED\r
20 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\r
21 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS\r
22 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\r
23 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\r
24 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\r
25 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\r
26 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\r
27 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\r
28 * POSSIBILITY OF SUCH DAMAGE.\r
29 */\r
30\r
31/*\r
32 * Move private identifiers with external linkage into implementation\r
33 * namespace. -- Klaus Klein <kleink@NetBSD.org>, May 5, 1999\r
34 */\r
35#define float_exception_flags _softfloat_float_exception_flags\r
36#define float_exception_mask _softfloat_float_exception_mask\r
37#define float_rounding_mode _softfloat_float_rounding_mode\r
38#define float_raise _softfloat_float_raise\r
39\r
40/* The following batch are called by GCC through wrappers */\r
41#define float32_eq _softfloat_float32_eq\r
42#define float32_le _softfloat_float32_le\r
43#define float32_lt _softfloat_float32_lt\r
44#define float64_eq _softfloat_float64_eq\r
45#define float64_le _softfloat_float64_le\r
46#define float64_lt _softfloat_float64_lt\r
47#define float128_eq _softfloat_float128_eq\r
48#define float128_le _softfloat_float128_le\r
49#define float128_lt _softfloat_float128_lt\r
50\r
51/*\r
52 * Macros to define functions with the GCC expected names\r
53 */\r
54\r
55#define float32_add __addsf3\r
56#define float64_add __adddf3\r
57#define floatx80_add __addxf3\r
58#define float128_add __addtf3\r
59\r
60#define float32_sub __subsf3\r
61#define float64_sub __subdf3\r
62#define floatx80_sub __subxf3\r
63#define float128_sub __subtf3\r
64\r
65#define float32_mul __mulsf3\r
66#define float64_mul __muldf3\r
67#define floatx80_mul __mulxf3\r
68#define float128_mul __multf3\r
69\r
70#define float32_div __divsf3\r
71#define float64_div __divdf3\r
72#define floatx80_div __divxf3\r
73#define float128_div __divtf3\r
74\r
75#if 0\r
76#define float32_neg __negsf2\r
77#define float64_neg __negdf2\r
78#define floatx80_neg __negxf2\r
79#define float128_neg __negtf2\r
80#endif\r
81\r
82#define int32_to_float32 __floatsisf\r
83#define int32_to_float64 __floatsidf\r
84#define int32_to_floatx80 __floatsixf\r
85#define int32_to_float128 __floatsitf\r
86\r
87#define int64_to_float32 __floatdisf\r
88#define int64_to_float64 __floatdidf\r
89#define int64_to_floatx80 __floatdixf\r
90#define int64_to_float128 __floatditf\r
91\r
92#define int128_to_float32 __floattisf\r
93#define int128_to_float64 __floattidf\r
94#define int128_to_floatx80 __floattixf\r
95#define int128_to_float128 __floattitf\r
96\r
97#define uint32_to_float32 __floatunsisf\r
98#define uint32_to_float64 __floatunsidf\r
99#define uint32_to_floatx80 __floatunsixf\r
100#define uint32_to_float128 __floatunsitf\r
101\r
102#define uint64_to_float32 __floatundisf\r
103#define uint64_to_float64 __floatundidf\r
104#define uint64_to_floatx80 __floatundixf\r
105#define uint64_to_float128 __floatunditf\r
106\r
107#define uint128_to_float32 __floatuntisf\r
108#define uint128_to_float64 __floatuntidf\r
109#define uint128_to_floatx80 __floatuntixf\r
110#define uint128_to_float128 __floatuntitf\r
111\r
112#define float32_to_int32_round_to_zero __fixsfsi\r
113#define float64_to_int32_round_to_zero __fixdfsi\r
114#define floatx80_to_int32_round_to_zero __fixxfsi\r
115#define float128_to_int32_round_to_zero __fixtfsi\r
116\r
117#define float32_to_int64_round_to_zero __fixsfdi\r
118#define float64_to_int64_round_to_zero __fixdfdi\r
119#define floatx80_to_int64_round_to_zero __fixxfdi\r
120#define float128_to_int64_round_to_zero __fixtfdi\r
121\r
122#define float32_to_int128_round_to_zero __fixsfti\r
123#define float64_to_int128_round_to_zero __fixdfti\r
124#define floatx80_to_int128_round_to_zero __fixxfti\r
125#define float128_to_int128_round_to_zero __fixtfti\r
126\r
127#define float32_to_uint32_round_to_zero __fixunssfsi\r
128#define float64_to_uint32_round_to_zero __fixunsdfsi\r
129#define floatx80_to_uint32_round_to_zero __fixunsxfsi\r
130#define float128_to_uint32_round_to_zero __fixunstfsi\r
131\r
132#define float32_to_uint64_round_to_zero __fixunssfdi\r
133#define float64_to_uint64_round_to_zero __fixunsdfdi\r
134#define floatx80_to_uint64_round_to_zero __fixunsxfdi\r
135#define float128_to_uint64_round_to_zero __fixunstfdi\r
136\r
137#define float32_to_uint128_round_to_zero __fixunssfti\r
138#define float64_to_uint128_round_to_zero __fixunsdfti\r
139#define floatx80_to_uint128_round_to_zero __fixunsxfti\r
140#define float128_to_uint128_round_to_zero __fixunstfti\r
141\r
142#define float32_to_float64 __extendsfdf2\r
143#define float32_to_floatx80 __extendsfxf2\r
144#define float32_to_float128 __extendsftf2\r
145#define float64_to_floatx80 __extenddfxf2\r
146#define float64_to_float128 __extenddftf2\r
147\r
148#define float128_to_float64 __trunctfdf2\r
149#define floatx80_to_float64 __truncxfdf2\r
150#define float128_to_float32 __trunctfsf2\r
151#define floatx80_to_float32 __truncxfsf2\r
152#define float64_to_float32 __truncdfsf2\r
153\r
154#if 0\r
155#define float32_cmp __cmpsf2\r
156#define float32_unord __unordsf2\r
157#define float32_eq __eqsf2\r
158#define float32_ne __nesf2\r
159#define float32_ge __gesf2\r
160#define float32_lt __ltsf2\r
161#define float32_le __lesf2\r
162#define float32_gt __gtsf2\r
163#endif\r
164\r
165#if 0\r
166#define float64_cmp __cmpdf2\r
167#define float64_unord __unorddf2\r
168#define float64_eq __eqdf2\r
169#define float64_ne __nedf2\r
170#define float64_ge __gedf2\r
171#define float64_lt __ltdf2\r
172#define float64_le __ledf2\r
173#define float64_gt __gtdf2\r
174#endif\r
175\r
176/* XXX not in libgcc */\r
177#if 1\r
178#define floatx80_cmp __cmpxf2\r
179#define floatx80_unord __unordxf2\r
180#define floatx80_eq __eqxf2\r
181#define floatx80_ne __nexf2\r
182#define floatx80_ge __gexf2\r
183#define floatx80_lt __ltxf2\r
184#define floatx80_le __lexf2\r
185#define floatx80_gt __gtxf2\r
186#endif\r
187\r
188#if 0\r
189#define float128_cmp __cmptf2\r
190#define float128_unord __unordtf2\r
191#define float128_eq __eqtf2\r
192#define float128_ne __netf2\r
193#define float128_ge __getf2\r
194#define float128_lt __lttf2\r
195#define float128_le __letf2\r
196#define float128_gt __gttf2\r
197#endif\r
198\r
0b5d7b6e 199#if defined (__ARM_EABI__) || defined (__CC_ARM)\r
1dbda2b4
AB
200#ifdef __ARM_PCS_VFP\r
201#include <arm/aeabi.h>\r
202#endif\r
203#define __addsf3 __aeabi_fadd\r
204#define __adddf3 __aeabi_dadd\r
205\r
206#define __subsf3 __aeabi_fsub\r
207#define __subdf3 __aeabi_dsub\r
208\r
209#define __mulsf3 __aeabi_fmul\r
210#define __muldf3 __aeabi_dmul\r
211\r
212#define __divsf3 __aeabi_fdiv\r
213#define __divdf3 __aeabi_ddiv\r
214\r
215#define __floatsisf __aeabi_i2f\r
216#define __floatsidf __aeabi_i2d\r
217\r
218#define __floatdisf __aeabi_l2f\r
219#define __floatdidf __aeabi_l2d\r
220\r
221#define __floatunsisf __aeabi_ui2f\r
222#define __floatunsidf __aeabi_ui2d\r
223\r
224#define __floatundisf __aeabi_ul2f\r
225#define __floatundidf __aeabi_ul2d\r
226\r
227#define __fixsfsi __aeabi_f2iz\r
228#define __fixdfsi __aeabi_d2iz\r
229\r
230#define __fixsfdi __aeabi_f2lz\r
231#define __fixdfdi __aeabi_d2lz\r
232\r
233#define __fixunssfsi __aeabi_f2uiz\r
234#define __fixunsdfsi __aeabi_d2uiz\r
235\r
236#define __fixunssfdi __aeabi_f2ulz\r
237#define __fixunsdfdi __aeabi_d2ulz\r
238\r
239#define __extendsfdf2 __aeabi_f2d\r
240#define __truncdfsf2 __aeabi_d2f\r
241\r
242#endif /* __ARM_EABI__ */\r