filename | src/sh4/shadow.c |
changeset | 1191:12fdf3aafcd4 |
prev | 1128:180abbb2a1f3 |
next | 1194:ee6ce5804608 |
author | nkeynes |
date | Fri Dec 02 18:18:04 2011 +1000 (10 years ago) |
permissions | -rw-r--r-- |
last change | SH4 shadow-mode tweaks - Fix exceptions generated by the translator to account for the excepting instruction(s) in the cycle counts. - Compare floating point regs bitwise rather than with FP comparisons (otherwise can fail due to nan != nan) - Dump the translated block when we abort with an inconsistency |
file | annotate | diff | log | raw |
1.1 --- a/src/sh4/shadow.c Fri Sep 17 20:04:02 2010 +10001.2 +++ b/src/sh4/shadow.c Fri Dec 02 18:18:04 2011 +10001.3 @@ -129,15 +129,23 @@1.4 }1.5 }1.6 for( unsigned i=0; i<16; i++ ) {1.7 - if( xsh4r->fr[0][i] != esh4r->fr[0][i] ) {1.8 + if( *((uint32_t *)&xsh4r->fr[0][i]) != *((uint32_t *)&esh4r->fr[0][i]) ) {1.9 isgood = FALSE;1.10 - fprintf( stderr, "FR%d Xlt = %f, Emu = %f\n", i, xsh4r->fr[0][i], esh4r->fr[0][i] );1.11 + fprintf( stderr, "FR%d Xlt = %f (0x%08X), Emu = %f (0x%08X)\n", i, xsh4r->fr[0][i],1.12 + *((uint32_t *)&xsh4r->fr[0][i]),1.13 + esh4r->fr[0][i],1.14 + *((uint32_t *)&esh4r->fr[0][i])1.15 + );1.16 }1.17 }1.18 for( unsigned i=0; i<16; i++ ) {1.19 - if( xsh4r->fr[1][i] != esh4r->fr[1][i] ) {1.20 + if( *((uint32_t *)&xsh4r->fr[1][i]) != *((uint32_t *)&esh4r->fr[1][i]) ) {1.21 isgood = FALSE;1.22 - fprintf( stderr, "XF%d Xlt = %f, Emu = %f\n", i, xsh4r->fr[1][i], esh4r->fr[1][i] );1.23 + fprintf( stderr, "XF%d Xlt = %f (0x%08X), Emu = %f (0x%08X)\n", i, xsh4r->fr[1][i],1.24 + *((uint32_t *)&xsh4r->fr[1][i]),1.25 + esh4r->fr[1][i],1.26 + *((uint32_t *)&esh4r->fr[1][i])1.27 + );1.28 }1.29 }1.31 @@ -306,6 +314,8 @@1.33 if( !check_registers( &temp_sh4r, &sh4r ) ) {1.34 fprintf( stderr, "After executing block at %08X\n", shadow_sh4r.pc );1.35 + fprintf( stderr, "Translated block was:\n" );1.36 + sh4_translate_dump_block(shadow_sh4r.pc);1.37 abort();1.38 }1.39 if( mem_check_posn < mem_log_posn ) {
.