revision 922:8a8361264b1e
summary |
tree |
shortlog |
changelog |
graph |
changeset |
raw | bz2 | zip | gz changeset | 922:8a8361264b1e |
parent | 921:6c0e9a8f5618 |
child | 923:13ac59a786f4 |
author | nkeynes |
date | Thu Dec 11 23:26:03 2008 +0000 (15 years ago) |
Disable the generational translation cache - I've got no evidence that it
actually helps performance, and it simplifies things to get rid of it (in
particular, translated code doesn't have to worry about being moved now).
actually helps performance, and it simplifies things to get rid of it (in
particular, translated code doesn't have to worry about being moved now).
src/dreamcast.h | view | annotate | diff | log | ||
src/sh4/xltcache.c | view | annotate | diff | log | ||
src/test/testxlt.c | view | annotate | diff | log |
1.1 --- a/src/dreamcast.h Thu Dec 11 21:33:08 2008 +00001.2 +++ b/src/dreamcast.h Thu Dec 11 23:26:03 2008 +00001.3 @@ -31,7 +31,7 @@1.5 #define DEFAULT_TIMESLICE_LENGTH 1000000 /* nanoseconds */1.7 -#define XLAT_NEW_CACHE_SIZE 32 MB1.8 +#define XLAT_NEW_CACHE_SIZE 40 MB1.9 #define XLAT_TEMP_CACHE_SIZE 2 MB1.10 #define XLAT_OLD_CACHE_SIZE 8 MB
2.1 --- a/src/sh4/xltcache.c Thu Dec 11 21:33:08 2008 +00002.2 +++ b/src/sh4/xltcache.c Thu Dec 11 23:26:03 2008 +00002.3 @@ -51,10 +51,14 @@2.4 xlat_cache_block_t xlat_new_cache;2.5 xlat_cache_block_t xlat_new_cache_ptr;2.6 xlat_cache_block_t xlat_new_create_ptr;2.7 +2.8 +#ifdef XLAT_GENERATIONAL_CACHE2.9 xlat_cache_block_t xlat_temp_cache;2.10 xlat_cache_block_t xlat_temp_cache_ptr;2.11 xlat_cache_block_t xlat_old_cache;2.12 xlat_cache_block_t xlat_old_cache_ptr;2.13 +#endif2.14 +2.15 static void ***xlat_lut;2.16 static gboolean xlat_initialized = FALSE;2.18 @@ -64,15 +68,16 @@2.19 xlat_initialized = TRUE;2.20 xlat_new_cache = mmap( NULL, XLAT_NEW_CACHE_SIZE, PROT_EXEC|PROT_READ|PROT_WRITE,2.21 MAP_PRIVATE|MAP_ANON, -1, 0 );2.22 + xlat_new_cache_ptr = xlat_new_cache;2.23 + xlat_new_create_ptr = xlat_new_cache;2.24 +#ifdef XLAT_GENERATIONAL_CACHE2.25 xlat_temp_cache = mmap( NULL, XLAT_TEMP_CACHE_SIZE, PROT_EXEC|PROT_READ|PROT_WRITE,2.26 MAP_PRIVATE|MAP_ANON, -1, 0 );2.27 xlat_old_cache = mmap( NULL, XLAT_OLD_CACHE_SIZE, PROT_EXEC|PROT_READ|PROT_WRITE,2.28 MAP_PRIVATE|MAP_ANON, -1, 0 );2.29 - xlat_new_cache_ptr = xlat_new_cache;2.30 xlat_temp_cache_ptr = xlat_temp_cache;2.31 xlat_old_cache_ptr = xlat_old_cache;2.32 - xlat_new_create_ptr = xlat_new_cache;2.33 -2.34 +#endif2.35 xlat_lut = mmap( NULL, XLAT_LUT_PAGES*sizeof(void *), PROT_READ|PROT_WRITE,2.36 MAP_PRIVATE|MAP_ANON, -1, 0);2.37 memset( xlat_lut, 0, XLAT_LUT_PAGES*sizeof(void *) );2.38 @@ -80,12 +85,6 @@2.39 xlat_flush_cache();2.40 }2.42 -void xlat_print_free( FILE *out )2.43 -{2.44 - fprintf( out, "New space: %d\nTemp space: %d\nOld space: %d\n",2.45 - xlat_new_cache_ptr->size, xlat_temp_cache_ptr->size, xlat_old_cache_ptr->size );2.46 -}2.47 -2.48 /**2.49 * Reset the cache structure to its default state2.50 */2.51 @@ -99,6 +98,7 @@2.52 tmp = NEXT(xlat_new_cache_ptr);2.53 tmp->active = 1;2.54 tmp->size = 0;2.55 +#ifdef XLAT_GENERATIONAL_CACHE2.56 xlat_temp_cache_ptr = xlat_temp_cache;2.57 xlat_temp_cache_ptr->active = 0;2.58 xlat_temp_cache_ptr->size = XLAT_TEMP_CACHE_SIZE - 2*sizeof(struct xlat_cache_block);2.59 @@ -111,6 +111,7 @@2.60 tmp = NEXT(xlat_old_cache_ptr);2.61 tmp->active = 1;2.62 tmp->size = 0;2.63 +#endif2.64 for( i=0; i<XLAT_LUT_PAGES; i++ ) {2.65 if( xlat_lut[i] != NULL ) {2.66 memset( xlat_lut[i], 0, XLAT_LUT_PAGE_SIZE );2.67 @@ -303,6 +304,7 @@2.68 }2.69 }2.71 +#ifdef XLAT_GENERATIONAL_CACHE2.72 /**2.73 * Promote a block in temp space (or elsewhere for that matter) to old space.2.74 *2.75 @@ -392,6 +394,12 @@2.76 }2.78 }2.79 +#else2.80 +void xlat_promote_to_temp_space( xlat_cache_block_t block )2.81 +{2.82 + *block->lut_entry = 0;2.83 +}2.84 +#endif2.86 /**2.87 * Returns the next block in the new cache list that can be written to by the2.88 @@ -510,7 +518,9 @@2.89 void xlat_check_integrity( )2.90 {2.91 xlat_check_cache_integrity( xlat_new_cache, xlat_new_cache_ptr, XLAT_NEW_CACHE_SIZE );2.92 +#ifdef XLAT_GENERATIONAL_CACHE2.93 xlat_check_cache_integrity( xlat_temp_cache, xlat_temp_cache_ptr, XLAT_TEMP_CACHE_SIZE );2.94 xlat_check_cache_integrity( xlat_old_cache, xlat_old_cache_ptr, XLAT_OLD_CACHE_SIZE );2.95 +#endif2.96 }
3.1 --- a/src/test/testxlt.c Thu Dec 11 21:33:08 2008 +00003.2 +++ b/src/test/testxlt.c Thu Dec 11 23:26:03 2008 +00003.3 @@ -22,8 +22,6 @@3.5 extern xlat_cache_block_t xlat_new_cache;3.6 extern xlat_cache_block_t xlat_new_cache_ptr;3.7 -extern xlat_cache_block_t xlat_temp_cache;3.8 -extern xlat_cache_block_t xlat_temp_cache_ptr;3.10 /**3.11 * Test initial allocations from the new cache3.12 @@ -75,14 +73,6 @@3.13 xlat_commit_block(6142, 432);3.14 addr = xlat_get_code( 0x0D009800 );3.15 assert( addr == &block3a->code );3.16 - /* check promoted block in temp cache */3.17 - addr = xlat_get_code( 0x0C008000 );3.18 - assert( addr == &xlat_temp_cache->code );3.19 - assert( xlat_temp_cache->active == 1 );3.20 - assert( xlat_temp_cache->size == 8192 );3.21 - for( i=0; i<8192; i++ ) {3.22 - assert( xlat_temp_cache->code[i] == 0xB5 );3.23 - }3.24 }3.26 int main()
.