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