Search
lxdream.org :: lxdream/src/sh4/xltcache.c :: diff
lxdream 0.9.1
released Jun 29
Download Now
filename src/sh4/xltcache.c
changeset 901:32c5cf5e206f
prev809:8bdbf4d95da4
next905:4c17ebd9ef5e
author nkeynes
date Sun Oct 26 02:28:29 2008 +0000 (11 years ago)
permissions -rw-r--r--
last change Move the precision/size tests to translation-time rather than execution-time,
and flush/retranslate on a mismatch. Shaves a few percent off the core runtime
file annotate diff log raw
1.1 --- a/src/sh4/xltcache.c Sat Aug 09 10:48:03 2008 +0000
1.2 +++ b/src/sh4/xltcache.c Sun Oct 26 02:28:29 2008 +0000
1.3 @@ -38,7 +38,6 @@
1.4 #define XLAT_LUT_ENTRY_USED (void *)1
1.5
1.6 #define NEXT(block) ( (xlat_cache_block_t)&((block)->code[(block)->size]))
1.7 -#define BLOCK_FOR_CODE(code) (((xlat_cache_block_t)code)-1)
1.8 #define IS_ENTRY_POINT(ent) (ent > XLAT_LUT_ENTRY_USED)
1.9 #define IS_ENTRY_USED(ent) (ent != XLAT_LUT_ENTRY_EMPTY)
1.10
1.11 @@ -124,7 +123,7 @@
1.12 int i;
1.13 for( i=0; i<XLAT_LUT_PAGE_ENTRIES; i++ ) {
1.14 if( IS_ENTRY_POINT(page[i]) ) {
1.15 - BLOCK_FOR_CODE(page[i])->active = 0;
1.16 + XLAT_BLOCK_FOR_CODE(page[i])->active = 0;
1.17 }
1.18 page[i] = NULL;
1.19 }
1.20 @@ -212,7 +211,7 @@
1.21 {
1.22 if( code != NULL ) {
1.23 uintptr_t pc_offset = ((uint8_t *)native_pc) - ((uint8_t *)code);
1.24 - xlat_cache_block_t block = BLOCK_FOR_CODE(code);
1.25 + xlat_cache_block_t block = XLAT_BLOCK_FOR_CODE(code);
1.26 uint32_t count = block->recover_table_size;
1.27 xlat_recovery_record_t records = (xlat_recovery_record_t)(&block->code[block->recover_table_offset]);
1.28 uint32_t posn;
1.29 @@ -235,7 +234,7 @@
1.30 {
1.31 if( code != NULL ) {
1.32 uintptr_t pc_offset = ((uint8_t *)native_pc) - ((uint8_t *)code);
1.33 - xlat_cache_block_t block = BLOCK_FOR_CODE(code);
1.34 + xlat_cache_block_t block = XLAT_BLOCK_FOR_CODE(code);
1.35 uint32_t count = block->recover_table_size;
1.36 xlat_recovery_record_t records = (xlat_recovery_record_t)(&block->code[block->recover_table_offset]);
1.37 uint32_t posn;
1.38 @@ -334,6 +333,8 @@
1.39 start_block->active = 1;
1.40 start_block->size = allocation;
1.41 start_block->lut_entry = block->lut_entry;
1.42 + start_block->fpscr_mask = block->fpscr_mask;
1.43 + start_block->fpscr = block->fpscr;
1.44 start_block->recover_table_offset = block->recover_table_offset;
1.45 start_block->recover_table_size = block->recover_table_size;
1.46 *block->lut_entry = &start_block->code;
1.47 @@ -379,6 +380,8 @@
1.48 start_block->active = 1;
1.49 start_block->size = allocation;
1.50 start_block->lut_entry = block->lut_entry;
1.51 + start_block->fpscr_mask = block->fpscr_mask;
1.52 + start_block->fpscr = block->fpscr;
1.53 start_block->recover_table_offset = block->recover_table_offset;
1.54 start_block->recover_table_size = block->recover_table_size;
1.55 *block->lut_entry = &start_block->code;
1.56 @@ -416,7 +419,7 @@
1.57 }
1.58
1.59 if( IS_ENTRY_POINT(xlat_lut[XLAT_LUT_PAGE(address)][XLAT_LUT_ENTRY(address)]) ) {
1.60 - xlat_cache_block_t oldblock = BLOCK_FOR_CODE(xlat_lut[XLAT_LUT_PAGE(address)][XLAT_LUT_ENTRY(address)]);
1.61 + xlat_cache_block_t oldblock = XLAT_BLOCK_FOR_CODE(xlat_lut[XLAT_LUT_PAGE(address)][XLAT_LUT_ENTRY(address)]);
1.62 oldblock->active = 0;
1.63 }
1.64
.