xref: /openbmc/qemu/target/hexagon/arch.h (revision 15106f7dc3290ff3254611f265849a314a93eb0e)
1b2391681STaylor Simpson /*
2b2391681STaylor Simpson  *  Copyright(c) 2019-2021 Qualcomm Innovation Center, Inc. All Rights Reserved.
3b2391681STaylor Simpson  *
4b2391681STaylor Simpson  *  This program is free software; you can redistribute it and/or modify
5b2391681STaylor Simpson  *  it under the terms of the GNU General Public License as published by
6b2391681STaylor Simpson  *  the Free Software Foundation; either version 2 of the License, or
7b2391681STaylor Simpson  *  (at your option) any later version.
8b2391681STaylor Simpson  *
9b2391681STaylor Simpson  *  This program is distributed in the hope that it will be useful,
10b2391681STaylor Simpson  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
11b2391681STaylor Simpson  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12b2391681STaylor Simpson  *  GNU General Public License for more details.
13b2391681STaylor Simpson  *
14b2391681STaylor Simpson  *  You should have received a copy of the GNU General Public License
15b2391681STaylor Simpson  *  along with this program; if not, see <http://www.gnu.org/licenses/>.
16b2391681STaylor Simpson  */
17b2391681STaylor Simpson 
18b2391681STaylor Simpson #ifndef HEXAGON_ARCH_H
19b2391681STaylor Simpson #define HEXAGON_ARCH_H
20b2391681STaylor Simpson 
21b2391681STaylor Simpson #include "qemu/int128.h"
22b2391681STaylor Simpson 
23*e628c015STaylor Simpson extern const uint8_t rLPS_table_64x4[64][4];
24*e628c015STaylor Simpson extern const uint8_t AC_next_state_MPS_64[64];
25*e628c015STaylor Simpson extern const uint8_t AC_next_state_LPS_64[64];
26*e628c015STaylor Simpson 
27b2391681STaylor Simpson uint64_t interleave(uint32_t odd, uint32_t even);
28b2391681STaylor Simpson uint64_t deinterleave(uint64_t src);
29b2391681STaylor Simpson int32_t conv_round(int32_t a, int n);
30b2391681STaylor Simpson void arch_fpop_start(CPUHexagonState *env);
31b2391681STaylor Simpson void arch_fpop_end(CPUHexagonState *env);
32b2391681STaylor Simpson int arch_sf_recip_common(float32 *Rs, float32 *Rt, float32 *Rd,
33b2391681STaylor Simpson                          int *adjust, float_status *fp_status);
34b2391681STaylor Simpson int arch_sf_invsqrt_common(float32 *Rs, float32 *Rd, int *adjust,
35b2391681STaylor Simpson                           float_status *fp_status);
36b2391681STaylor Simpson 
37d934c16dSTaylor Simpson extern const uint8_t recip_lookup_table[128];
38d934c16dSTaylor Simpson 
39dd8705bdSTaylor Simpson extern const uint8_t invsqrt_lookup_table[128];
40dd8705bdSTaylor Simpson 
41b2391681STaylor Simpson #endif
42