add basic FPU support
PATCH 1/1 add basic FPU support
Hello All,
this patch adds *basic* FPU support. Basic means:
- swc1
- lwc1
- ctc1
- cfc1
- only the lightest of testing was applied :-)
IOW, there is no real math on the host being done, I simply copy data back and forth. Alas, the basic infrastructure is there and might make it easier to add more CP1 functionality.
I'd be happy to further help improving this, and even happier if someone volunteered to help me with the job.
Thanks,
Marius
Signature · 4 lines
Marius Groeger <[email protected]> SYSGO AG Embedded and Real-Time Software Voice: +49 6136 9948 0 FAX: +49 6136 9948 10 www.sysgo.com | www.elinos.com | www.osek.de | www.pikeos.com
target-mips/cpu.h renamed from packages/BUILD/qemu-0.8.0/target-mips/cpu.h +10 -7
@@ -40,16 +40,19 @@ struct CPUMIPSState {uint32_t DCR ;/* ? */ #if defined(MIPS_USES_FPU )/* Floating point registers */ -fpr_t fpr[16 ]; -/* Floating point special purpose registers */ +fpr_t fpr[32 ]; +#ifndef USE_HOST_FLOAT_REGS +fpr_t ft0; +fpr_t ft1; +fpr_t ft2; +#endif +/* fpu implementation/revision register */ uint32_t fcr0; -uint32_t fcr25; -uint32_t fcr26; -uint32_t fcr28; -uint32_t fcsr; +/* fcsr */ +uint32_t fcr31;#endif #if defined(MIPS_USES_R4K_TLB ) -tlb_t tlb[16 ]; +tlb_t tlb[MIPS_TLB_NB ];#endif uint32_t CP0_index;uint32_t CP0_random;
target-mips/exec.h renamed from packages/BUILD/qemu-0.8.0/target-mips/exec.h +4 -0
@@ -65,6 +65,10 @@ void do_tlbwi (void);void do_tlbwr (void );void do_tlbp (void );void do_tlbr (void ); +#ifdef MIPS_USES_FPU +void do_cfc1 (int reg); +void do_ctc1 (int reg); +#endif void do_lwl_raw (uint32_t );void do_lwr_raw (uint32_t );uint32_t do_swl_raw (uint32_t );
target-mips/fop_template.c renamed from packages/BUILD/qemu-0.8.0/target-mips/fop_template.c +87 -0
87 lines not on this page · raw message
target-mips/mips-defs.h renamed from packages/BUILD/qemu-0.8.0/target-mips/mips-defs.h +3 -1
@@ -24,6 +24,8 @@ enum {/* Uses MIPS R4Kc TLB model */ #define MIPS_USES_R4K_TLB #define MIPS_TLB_NB 16 +/* basic FPU register support */ +#define MIPS_USES_FPU /* Have config1, runs in big-endian mode, uses TLB */ #define MIPS_CONFIG0 \ ((1 << CP0C0_M) | (0x000 << CP0C0_K23) | (0x000 << CP0C0_KU) | \
@@ -52,7 +54,7 @@ enum {#error "MIPS CPU not defined"/* Remainder for other flags */ //#define TARGET_MIPS64 -//define MIPS_USES_FPU +//#define MIPS_USES_FPU #endif #endif /* !defined (__QEMU_MIPS_DEFS_H__) */
target-mips/op.c renamed from packages/BUILD/qemu-0.8.0/target-mips/op.c +120 -0
132 lines not on this page · raw message
target-mips/op_helper.c renamed from packages/BUILD/qemu-0.8.0/target-mips/op_helper.c +62 -0
68 lines not on this page · raw message
target-mips/op_mem.c renamed from packages/BUILD/qemu-0.8.0/target-mips/op_mem.c +13 -0
@@ -124,3 +124,16 @@ void glue(op_sc, MEMSUFFIX) (void) }RETURN (); } + +#ifdef MIPS_USES_FPU +void glue (op_lwc1 ,MEMSUFFIX ) (void ) +{ +FT0 =glue (ldfl,MEMSUFFIX )(T0 ); +RETURN (); +} +void glue (op_swc1 ,MEMSUFFIX ) (void ) +{ +glue (stfl,MEMSUFFIX )(T0 ,FT1 ); +RETURN (); +} +#endif
target-mips/translate.c renamed from packages/BUILD/qemu-0.8.0/target-mips/translate.c +163 -3
220 lines not on this page · raw message