sparc fixes

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1117 c046a42c-6fe2-441c-8c8c-71466251a162
This commit is contained in:
bellard 2004-10-10 17:46:24 +00:00
parent 188d857911
commit a0c4cb4a70
4 changed files with 43 additions and 14 deletions

View File

@ -25,6 +25,8 @@ void helper_st_asi(int asi, int size, int sign);
void helper_rett(void); void helper_rett(void);
void helper_ldfsr(void); void helper_ldfsr(void);
void set_cwp(int new_cwp); void set_cwp(int new_cwp);
void do_fitos(void);
void do_fitod(void);
void do_fabss(void); void do_fabss(void);
void do_fsqrts(void); void do_fsqrts(void);
void do_fsqrtd(void); void do_fsqrtd(void);

View File

@ -932,20 +932,32 @@ void OPPROTO op_fcmpd(void)
do_fcmpd(); do_fcmpd();
} }
#ifdef USE_INT_TO_FLOAT_HELPERS
void OPPROTO op_fitos(void)
{
do_fitos();
}
void OPPROTO op_fitod(void)
{
do_fitod();
}
#else
void OPPROTO op_fitos(void) void OPPROTO op_fitos(void)
{ {
FT0 = (float) *((int32_t *)&FT1); FT0 = (float) *((int32_t *)&FT1);
} }
void OPPROTO op_fdtos(void)
{
FT0 = (float) DT1;
}
void OPPROTO op_fitod(void) void OPPROTO op_fitod(void)
{ {
DT0 = (double) *((int32_t *)&FT1); DT0 = (double) *((int32_t *)&FT1);
} }
#endif
void OPPROTO op_fdtos(void)
{
FT0 = (float) DT1;
}
void OPPROTO op_fstod(void) void OPPROTO op_fstod(void)
{ {

View File

@ -2,22 +2,34 @@
#include <fenv.h> #include <fenv.h>
#include "exec.h" #include "exec.h"
void OPPROTO do_fabss(void) #ifdef USE_INT_TO_FLOAT_HELPERS
void do_fitos(void)
{
FT0 = (float) *((int32_t *)&FT1);
}
void do_fitod(void)
{
DT0 = (double) *((int32_t *)&FT1);
}
#endif
void do_fabss(void)
{ {
FT0 = fabsf(FT1); FT0 = fabsf(FT1);
} }
void OPPROTO do_fsqrts(void) void do_fsqrts(void)
{ {
FT0 = sqrtf(FT1); FT0 = sqrtf(FT1);
} }
void OPPROTO do_fsqrtd(void) void do_fsqrtd(void)
{ {
DT0 = sqrt(DT1); DT0 = sqrt(DT1);
} }
void OPPROTO do_fcmps (void) void do_fcmps (void)
{ {
if (isnan(FT0) || isnan(FT1)) { if (isnan(FT0) || isnan(FT1)) {
T0 = FSR_FCC1 | FSR_FCC0; T0 = FSR_FCC1 | FSR_FCC0;
@ -31,7 +43,7 @@ void OPPROTO do_fcmps (void)
env->fsr = T0; env->fsr = T0;
} }
void OPPROTO do_fcmpd (void) void do_fcmpd (void)
{ {
if (isnan(DT0) || isnan(DT1)) { if (isnan(DT0) || isnan(DT1)) {
T0 = FSR_FCC1 | FSR_FCC0; T0 = FSR_FCC1 | FSR_FCC0;
@ -45,7 +57,7 @@ void OPPROTO do_fcmpd (void)
env->fsr = T0; env->fsr = T0;
} }
void OPPROTO helper_ld_asi(int asi, int size, int sign) void helper_ld_asi(int asi, int size, int sign)
{ {
switch(asi) { switch(asi) {
case 3: /* MMU probe */ case 3: /* MMU probe */
@ -76,7 +88,7 @@ void OPPROTO helper_ld_asi(int asi, int size, int sign)
} }
} }
void OPPROTO helper_st_asi(int asi, int size, int sign) void helper_st_asi(int asi, int size, int sign)
{ {
switch(asi) { switch(asi) {
case 3: /* MMU flush */ case 3: /* MMU flush */
@ -125,7 +137,7 @@ void do_ldd_kernel(uint32_t addr)
#endif #endif
#endif #endif
void OPPROTO helper_rett() void helper_rett()
{ {
int cwp; int cwp;
env->psret = 1; env->psret = 1;

View File

@ -291,7 +291,10 @@ GEN32(gen_op_store_DT2_fpr, gen_op_store_DT2_fpr_fprf);
#if defined(CONFIG_USER_ONLY) #if defined(CONFIG_USER_ONLY)
#define gen_op_ldst(name) gen_op_##name##_raw() #define gen_op_ldst(name) gen_op_##name##_raw()
#define OP_LD_TABLE(width) #define OP_LD_TABLE(width) \
static void gen_op_##width##a(int insn, int is_ld, int size, int sign) \
{ \
}
#define supervisor(dc) 0 #define supervisor(dc) 0
#else #else
#define gen_op_ldst(name) (*gen_op_##name[dc->mem_idx])() #define gen_op_ldst(name) (*gen_op_##name[dc->mem_idx])()