xref: /qemu/target/hexagon/fma_emu.h (revision a7f77545d401266a6415e6e03c7738c95314f0e6)
1becbf4b8STaylor Simpson /*
2*77ccf444STaylor Simpson  *  Copyright(c) 2019-2022 Qualcomm Innovation Center, Inc. All Rights Reserved.
3becbf4b8STaylor Simpson  *
4becbf4b8STaylor Simpson  *  This program is free software; you can redistribute it and/or modify
5becbf4b8STaylor Simpson  *  it under the terms of the GNU General Public License as published by
6becbf4b8STaylor Simpson  *  the Free Software Foundation; either version 2 of the License, or
7becbf4b8STaylor Simpson  *  (at your option) any later version.
8becbf4b8STaylor Simpson  *
9becbf4b8STaylor Simpson  *  This program is distributed in the hope that it will be useful,
10becbf4b8STaylor Simpson  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
11becbf4b8STaylor Simpson  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12becbf4b8STaylor Simpson  *  GNU General Public License for more details.
13becbf4b8STaylor Simpson  *
14becbf4b8STaylor Simpson  *  You should have received a copy of the GNU General Public License
15becbf4b8STaylor Simpson  *  along with this program; if not, see <http://www.gnu.org/licenses/>.
16becbf4b8STaylor Simpson  */
17becbf4b8STaylor Simpson 
18becbf4b8STaylor Simpson #ifndef HEXAGON_FMA_EMU_H
19becbf4b8STaylor Simpson #define HEXAGON_FMA_EMU_H
20becbf4b8STaylor Simpson 
is_finite(float64 x)21becbf4b8STaylor Simpson static inline bool is_finite(float64 x)
22becbf4b8STaylor Simpson {
23becbf4b8STaylor Simpson     return !float64_is_any_nan(x) && !float64_is_infinity(x);
24becbf4b8STaylor Simpson }
25becbf4b8STaylor Simpson 
26becbf4b8STaylor Simpson int32_t float64_getexp(float64 f64);
float32_getexp_raw(float32 f32)27*77ccf444STaylor Simpson static inline uint32_t float32_getexp_raw(float32 f32)
28*77ccf444STaylor Simpson {
29*77ccf444STaylor Simpson     return extract32(f32, 23, 8);
30*77ccf444STaylor Simpson }
31becbf4b8STaylor Simpson int32_t float32_getexp(float32 f32);
32becbf4b8STaylor Simpson float32 infinite_float32(uint8_t sign);
33becbf4b8STaylor Simpson float64 internal_mpyhh(float64 a, float64 b,
34becbf4b8STaylor Simpson                        unsigned long long int accumulated,
35becbf4b8STaylor Simpson                        float_status *fp_status);
36becbf4b8STaylor Simpson 
37becbf4b8STaylor Simpson #endif
38