source: mainline/uspace/lib/softfloat/comparison.h@ 516e780

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

Strip down libmath. (#45)

libmath is mostly unused (except for trunc(), sin() and cos()), and most functions in it are either very imprecise or downright broken. Additionally, it is implemented in manner that conflicts with C standard. Instead of trying to fix all the shortcomings while maintaining unused functionality, I'm opting to simply remove most of it and only keep the parts that are currently necessary.

Later readdition of the removed functions is possible, but there needs to be a reliable way to evaluate their quality first.

  • Property mode set to 100644
File size: 4.8 KB
RevLine 
[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 Comparison functions.
[846848a6]34 */
35
[b5440cf]36#ifndef __COMPARISON_H__
37#define __COMPARISON_H__
38
[c0c38c7c]39#include <mathtypes.h>
40
[88d5c1e]41extern int is_float32_nan(float32);
42extern int is_float32_signan(float32);
[b5440cf]43
[88d5c1e]44extern int is_float32_infinity(float32);
45extern int is_float32_zero(float32);
[e649dfa]46
[88d5c1e]47extern int is_float32_eq(float32, float32);
48extern int is_float32_lt(float32, float32);
49extern int is_float32_gt(float32, float32);
[c67aff2]50
[88d5c1e]51extern int is_float64_nan(float64);
52extern int is_float64_signan(float64);
[feef1cd]53
[88d5c1e]54extern int is_float64_infinity(float64);
55extern int is_float64_zero(float64);
[feef1cd]56
[88d5c1e]57extern int is_float64_eq(float64, float64);
58extern int is_float64_lt(float64, float64);
59extern int is_float64_gt(float64, float64);
[c67aff2]60
[88d5c1e]61extern int is_float96_nan(float96);
62extern int is_float96_signan(float96);
[c67aff2]63
[88d5c1e]64extern int is_float96_infinity(float96);
65extern int is_float96_zero(float96);
[c67aff2]66
[88d5c1e]67extern int is_float96_eq(float96, float96);
68extern int is_float96_lt(float96, float96);
69extern int is_float96_gt(float96, float96);
70
71extern int is_float128_nan(float128);
72extern int is_float128_signan(float128);
73
74extern int is_float128_infinity(float128);
75extern int is_float128_zero(float128);
76
77extern int is_float128_eq(float128, float128);
78extern int is_float128_lt(float128, float128);
79extern int is_float128_gt(float128, float128);
[e649dfa]80
[c0c38c7c]81#ifdef float32_t
82extern int __gtsf2(float32_t, float32_t);
83extern int __gesf2(float32_t, float32_t);
84extern int __ltsf2(float32_t, float32_t);
85extern int __lesf2(float32_t, float32_t);
86extern int __eqsf2(float32_t, float32_t);
87extern int __nesf2(float32_t, float32_t);
88extern int __cmpsf2(float32_t, float32_t);
89extern int __unordsf2(float32_t, float32_t);
90extern int __aeabi_fcmpgt(float32_t, float32_t);
91extern int __aeabi_fcmplt(float32_t, float32_t);
92extern int __aeabi_fcmpge(float32_t, float32_t);
[3212921]93extern int __aeabi_fcmple(float32_t, float32_t);
[c0c38c7c]94extern int __aeabi_fcmpeq(float32_t, float32_t);
[516e780]95extern int __aeabi_fcmpun(float32_t, float32_t);
[c0c38c7c]96#endif
97
98#ifdef float64_t
99extern int __gtdf2(float64_t, float64_t);
100extern int __gedf2(float64_t, float64_t);
101extern int __ltdf2(float64_t, float64_t);
102extern int __ledf2(float64_t, float64_t);
103extern int __eqdf2(float64_t, float64_t);
104extern int __nedf2(float64_t, float64_t);
105extern int __cmpdf2(float64_t, float64_t);
106extern int __unorddf2(float64_t, float64_t);
107extern int __aeabi_dcmplt(float64_t, float64_t);
108extern int __aeabi_dcmpeq(float64_t, float64_t);
109extern int __aeabi_dcmpgt(float64_t, float64_t);
110extern int __aeabi_dcmpge(float64_t, float64_t);
111extern int __aeabi_dcmple(float64_t, float64_t);
[516e780]112extern int __aeabi_dcmpun(float64_t, float64_t);
[c0c38c7c]113#endif
114
115#ifdef float128_t
116extern int __gttf2(float128_t, float128_t);
117extern int __getf2(float128_t, float128_t);
118extern int __lttf2(float128_t, float128_t);
119extern int __letf2(float128_t, float128_t);
120extern int __eqtf2(float128_t, float128_t);
121extern int __netf2(float128_t, float128_t);
122extern int __cmptf2(float128_t, float128_t);
123extern int __unordtf2(float128_t, float128_t);
124extern int _Qp_cmp(float128_t *, float128_t *);
125extern int _Qp_cmpe(float128_t *, float128_t *);
126extern int _Qp_fgt(float128_t *, float128_t *);
127extern int _Qp_fge(float128_t *, float128_t *);
128extern int _Qp_flt(float128_t *, float128_t *);
129extern int _Qp_fle(float128_t *, float128_t *);
130extern int _Qp_feq(float128_t *, float128_t *);
131extern int _Qp_fne(float128_t *, float128_t *);
132
133#endif
134
[b5440cf]135#endif
136
[750636a]137/** @}
[846848a6]138 */
Note: See TracBrowser for help on using the repository browser.