mirror of https://gitee.com/openkylin/qemu.git
Use temporary registers for the MIPS FPU emulation.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4861 c046a42c-6fe2-441c-8c8c-71466251a162
This commit is contained in:
parent
bd5921b432
commit
b6d96beda3
|
@ -171,20 +171,14 @@ typedef struct CPUMIPSState CPUMIPSState;
|
|||
struct CPUMIPSState {
|
||||
TCState active_tc;
|
||||
|
||||
/* temporary hack for FP globals */
|
||||
#ifndef USE_HOST_FLOAT_REGS
|
||||
fpr_t ft0;
|
||||
fpr_t ft1;
|
||||
fpr_t ft2;
|
||||
#endif
|
||||
CPUMIPSMVPContext *mvp;
|
||||
CPUMIPSTLBContext *tlb;
|
||||
CPUMIPSFPUContext *fpu;
|
||||
uint32_t current_tc;
|
||||
|
||||
uint32_t SEGBITS;
|
||||
target_ulong SEGMask;
|
||||
uint32_t PABITS;
|
||||
target_ulong SEGMask;
|
||||
target_ulong PAMask;
|
||||
|
||||
int32_t CP0_Index;
|
||||
|
|
|
@ -10,29 +10,6 @@
|
|||
|
||||
register struct CPUMIPSState *env asm(AREG0);
|
||||
|
||||
#if defined (USE_HOST_FLOAT_REGS)
|
||||
#error "implement me."
|
||||
#else
|
||||
#define FDT0 (env->ft0.fd)
|
||||
#define FDT1 (env->ft1.fd)
|
||||
#define FDT2 (env->ft2.fd)
|
||||
#define FST0 (env->ft0.fs[FP_ENDIAN_IDX])
|
||||
#define FST1 (env->ft1.fs[FP_ENDIAN_IDX])
|
||||
#define FST2 (env->ft2.fs[FP_ENDIAN_IDX])
|
||||
#define FSTH0 (env->ft0.fs[!FP_ENDIAN_IDX])
|
||||
#define FSTH1 (env->ft1.fs[!FP_ENDIAN_IDX])
|
||||
#define FSTH2 (env->ft2.fs[!FP_ENDIAN_IDX])
|
||||
#define DT0 (env->ft0.d)
|
||||
#define DT1 (env->ft1.d)
|
||||
#define DT2 (env->ft2.d)
|
||||
#define WT0 (env->ft0.w[FP_ENDIAN_IDX])
|
||||
#define WT1 (env->ft1.w[FP_ENDIAN_IDX])
|
||||
#define WT2 (env->ft2.w[FP_ENDIAN_IDX])
|
||||
#define WTH0 (env->ft0.w[!FP_ENDIAN_IDX])
|
||||
#define WTH1 (env->ft1.w[!FP_ENDIAN_IDX])
|
||||
#define WTH2 (env->ft2.w[!FP_ENDIAN_IDX])
|
||||
#endif
|
||||
|
||||
#include "cpu.h"
|
||||
#include "exec-all.h"
|
||||
|
||||
|
|
|
@ -159,67 +159,85 @@ DEF_HELPER(target_ulong, do_yield, (target_ulong t0))
|
|||
DEF_HELPER(target_ulong, do_cfc1, (uint32_t reg))
|
||||
DEF_HELPER(void, do_ctc1, (target_ulong t0, uint32_t reg))
|
||||
|
||||
DEF_HELPER(void, do_float_cvtd_s, (void))
|
||||
DEF_HELPER(void, do_float_cvtd_w, (void))
|
||||
DEF_HELPER(void, do_float_cvtd_l, (void))
|
||||
DEF_HELPER(void, do_float_cvtl_d, (void))
|
||||
DEF_HELPER(void, do_float_cvtl_s, (void))
|
||||
DEF_HELPER(void, do_float_cvtps_pw, (void))
|
||||
DEF_HELPER(void, do_float_cvtpw_ps, (void))
|
||||
DEF_HELPER(void, do_float_cvts_d, (void))
|
||||
DEF_HELPER(void, do_float_cvts_w, (void))
|
||||
DEF_HELPER(void, do_float_cvts_l, (void))
|
||||
DEF_HELPER(void, do_float_cvts_pl, (void))
|
||||
DEF_HELPER(void, do_float_cvts_pu, (void))
|
||||
DEF_HELPER(void, do_float_cvtw_s, (void))
|
||||
DEF_HELPER(void, do_float_cvtw_d, (void))
|
||||
DEF_HELPER(uint64_t, do_float_cvtd_s, (uint32_t fst0))
|
||||
DEF_HELPER(uint64_t, do_float_cvtd_w, (uint32_t wt0))
|
||||
DEF_HELPER(uint64_t, do_float_cvtd_l, (uint64_t dt0))
|
||||
DEF_HELPER(uint64_t, do_float_cvtl_d, (uint64_t fd0))
|
||||
DEF_HELPER(uint64_t, do_float_cvtl_s, (uint32_t fst0))
|
||||
DEF_HELPER(uint64_t, do_float_cvtps_pw, (uint64_t dt0))
|
||||
DEF_HELPER(uint64_t, do_float_cvtpw_ps, (uint64_t fdt0))
|
||||
DEF_HELPER(uint32_t, do_float_cvts_d, (uint64_t fd0))
|
||||
DEF_HELPER(uint32_t, do_float_cvts_w, (uint32_t wt0))
|
||||
DEF_HELPER(uint32_t, do_float_cvts_l, (uint64_t dt0))
|
||||
DEF_HELPER(uint32_t, do_float_cvts_pl, (uint32_t wt0))
|
||||
DEF_HELPER(uint32_t, do_float_cvts_pu, (uint32_t wth0))
|
||||
DEF_HELPER(uint32_t, do_float_cvtw_s, (uint32_t fst0))
|
||||
DEF_HELPER(uint32_t, do_float_cvtw_d, (uint64_t fd0))
|
||||
|
||||
DEF_HELPER(void, do_float_addr_ps, (void))
|
||||
DEF_HELPER(void, do_float_mulr_ps, (void))
|
||||
DEF_HELPER(uint64_t, do_float_addr_ps, (uint64_t fdt0, uint64_t fdt1))
|
||||
DEF_HELPER(uint64_t, do_float_mulr_ps, (uint64_t fdt0, uint64_t fdt1))
|
||||
|
||||
#define FOP_PROTO(op) \
|
||||
DEF_HELPER(void, do_float_ ## op ## _s, (void)) \
|
||||
DEF_HELPER(void, do_float_ ## op ## _d, (void))
|
||||
#define FOP_PROTO(op) \
|
||||
DEF_HELPER(uint64_t, do_float_ ## op ## l_s, (uint32_t fst0)) \
|
||||
DEF_HELPER(uint64_t, do_float_ ## op ## l_d, (uint64_t fdt0)) \
|
||||
DEF_HELPER(uint32_t, do_float_ ## op ## w_s, (uint32_t fst0)) \
|
||||
DEF_HELPER(uint32_t, do_float_ ## op ## w_d, (uint64_t fdt0))
|
||||
FOP_PROTO(round)
|
||||
FOP_PROTO(trunc)
|
||||
FOP_PROTO(ceil)
|
||||
FOP_PROTO(floor)
|
||||
#undef FOP_PROTO
|
||||
|
||||
#define FOP_PROTO(op) \
|
||||
DEF_HELPER(uint32_t, do_float_ ## op ## _s, (uint32_t fst0)) \
|
||||
DEF_HELPER(uint64_t, do_float_ ## op ## _d, (uint64_t fdt0))
|
||||
FOP_PROTO(sqrt)
|
||||
FOP_PROTO(roundl)
|
||||
FOP_PROTO(roundw)
|
||||
FOP_PROTO(truncl)
|
||||
FOP_PROTO(truncw)
|
||||
FOP_PROTO(ceill)
|
||||
FOP_PROTO(ceilw)
|
||||
FOP_PROTO(floorl)
|
||||
FOP_PROTO(floorw)
|
||||
FOP_PROTO(rsqrt)
|
||||
FOP_PROTO(recip)
|
||||
#undef FOP_PROTO
|
||||
|
||||
#define FOP_PROTO(op) \
|
||||
DEF_HELPER(void, do_float_ ## op ## _s, (void)) \
|
||||
DEF_HELPER(void, do_float_ ## op ## _d, (void)) \
|
||||
DEF_HELPER(void, do_float_ ## op ## _ps, (void))
|
||||
#define FOP_PROTO(op) \
|
||||
DEF_HELPER(uint32_t, do_float_ ## op ## _s, (uint32_t fst0)) \
|
||||
DEF_HELPER(uint64_t, do_float_ ## op ## _d, (uint64_t fdt0)) \
|
||||
DEF_HELPER(uint64_t, do_float_ ## op ## _ps, (uint64_t fdt0))
|
||||
FOP_PROTO(abs)
|
||||
FOP_PROTO(chs)
|
||||
FOP_PROTO(recip1)
|
||||
FOP_PROTO(rsqrt1)
|
||||
#undef FOP_PROTO
|
||||
|
||||
#define FOP_PROTO(op) \
|
||||
DEF_HELPER(uint32_t, do_float_ ## op ## _s, (uint32_t fst0, uint32_t fst2)) \
|
||||
DEF_HELPER(uint64_t, do_float_ ## op ## _d, (uint64_t fdt0, uint64_t fdt2)) \
|
||||
DEF_HELPER(uint64_t, do_float_ ## op ## _ps, (uint64_t fdt0, uint64_t fdt2))
|
||||
FOP_PROTO(add)
|
||||
FOP_PROTO(sub)
|
||||
FOP_PROTO(mul)
|
||||
FOP_PROTO(div)
|
||||
FOP_PROTO(abs)
|
||||
FOP_PROTO(chs)
|
||||
FOP_PROTO(recip2)
|
||||
FOP_PROTO(rsqrt2)
|
||||
#undef FOP_PROTO
|
||||
|
||||
#define FOP_PROTO(op) \
|
||||
DEF_HELPER(uint32_t, do_float_ ## op ## _s, (uint32_t fst0, uint32_t fst1, \
|
||||
uint32_t fst2)) \
|
||||
DEF_HELPER(uint64_t, do_float_ ## op ## _d, (uint64_t fdt0, uint64_t fdt1, \
|
||||
uint64_t fdt2)) \
|
||||
DEF_HELPER(uint64_t, do_float_ ## op ## _ps, (uint64_t fdt0, uint64_t fdt1, \
|
||||
uint64_t fdt2))
|
||||
FOP_PROTO(muladd)
|
||||
FOP_PROTO(mulsub)
|
||||
FOP_PROTO(nmuladd)
|
||||
FOP_PROTO(nmulsub)
|
||||
FOP_PROTO(recip1)
|
||||
FOP_PROTO(recip2)
|
||||
FOP_PROTO(rsqrt1)
|
||||
FOP_PROTO(rsqrt2)
|
||||
#undef FOP_PROTO
|
||||
|
||||
#define FOP_PROTO(op) \
|
||||
DEF_HELPER(void, do_cmp_d_ ## op, (long cc)) \
|
||||
DEF_HELPER(void, do_cmpabs_d_ ## op, (long cc)) \
|
||||
DEF_HELPER(void, do_cmp_s_ ## op, (long cc)) \
|
||||
DEF_HELPER(void, do_cmpabs_s_ ## op, (long cc)) \
|
||||
DEF_HELPER(void, do_cmp_ps_ ## op, (long cc)) \
|
||||
DEF_HELPER(void, do_cmpabs_ps_ ## op, (long cc))
|
||||
#define FOP_PROTO(op) \
|
||||
DEF_HELPER(void, do_cmp_d_ ## op, (uint64_t fdt0, uint64_t fdt1, int cc)) \
|
||||
DEF_HELPER(void, do_cmpabs_d_ ## op, (uint64_t fdt0, uint64_t fdt1, int cc)) \
|
||||
DEF_HELPER(void, do_cmp_s_ ## op, (uint32_t fst0, uint32_t fst1, int cc)) \
|
||||
DEF_HELPER(void, do_cmpabs_s_ ## op, (uint32_t fst0, uint32_t fst1, int cc)) \
|
||||
DEF_HELPER(void, do_cmp_ps_ ## op, (uint64_t fdt0, uint64_t fdt1, int cc)) \
|
||||
DEF_HELPER(void, do_cmpabs_ps_ ## op, (uint64_t fdt0, uint64_t fdt1, int cc))
|
||||
FOP_PROTO(f)
|
||||
FOP_PROTO(un)
|
||||
FOP_PROTO(eq)
|
||||
|
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue