target/i386: make cpu_get_fp80()/cpu_set_fp80() static

Move cpu_get_fp80()/cpu_set_fp80() from fpu_helper.c to
machine.c because fpu_helper.c will be disabled if tcg is
disabled in the build.

Backports commit db573d2cf7ae6b5a4fc324be6f55e078fc218464 from qemu.
In unicorn's case, they can be moved into unicorn.c
This commit is contained in:
Yang Zhong 2018-03-03 21:42:43 -05:00 committed by Lioncash
parent 35e0595d1c
commit 24225cb6fa
No known key found for this signature in database
GPG key ID: 4E3C3CC1031BA9C7
3 changed files with 18 additions and 20 deletions

View file

@ -1393,8 +1393,6 @@ int cpu_x86_get_descr_debug(CPUX86State *env, unsigned int selector,
/* op_helper.c */
/* used for debug or cpu save/restore */
void cpu_get_fp80(uint64_t *pmant, uint16_t *pexp, floatx80 f);
floatx80 cpu_set_fp80(uint64_t mant, uint16_t upper);
/* cpu-exec.c */
/* the following helpers are only usable in user mode simulation as

View file

@ -1561,24 +1561,6 @@ void helper_xsetbv(CPUX86State *env, uint32_t ecx, uint64_t mask)
raise_exception_ra(env, EXCP0D_GPF, GETPC());
}
void cpu_get_fp80(uint64_t *pmant, uint16_t *pexp, floatx80 f)
{
CPU_LDoubleU temp;
temp.d = f;
*pmant = temp.l.lower;
*pexp = temp.l.upper;
}
floatx80 cpu_set_fp80(uint64_t mant, uint16_t upper)
{
CPU_LDoubleU temp;
temp.l.upper = upper;
temp.l.lower = mant;
return temp.d;
}
/* MMX/SSE */
/* XXX: optimize by storing fptt and fptags in the static cpu state */

View file

@ -12,6 +12,24 @@
#include <unicorn/x86.h> /* needed for uc_x86_mmr */
#include "uc_priv.h"
static void cpu_get_fp80(uint64_t *pmant, uint16_t *pexp, floatx80 f)
{
CPU_LDoubleU temp;
temp.d = f;
*pmant = temp.l.lower;
*pexp = temp.l.upper;
}
static floatx80 cpu_set_fp80(uint64_t mant, uint16_t upper)
{
CPU_LDoubleU temp;
temp.l.upper = upper;
temp.l.lower = mant;
return temp.d;
}
#define X86_NON_CS_FLAGS (DESC_P_MASK | DESC_S_MASK | DESC_W_MASK | DESC_A_MASK)
static void load_seg_16_helper(CPUX86State *env, int seg, uint32_t selector)
{