diff options
author | notaz | 2011-10-13 02:27:43 +0300 |
---|---|---|
committer | notaz | 2011-10-30 23:48:07 +0200 |
commit | 777506907b6d2283e9a7fb51cdcad497b8989e24 (patch) | |
tree | 32e4e37e3b9c61b4c51126971ae0bc1365fbc028 | |
parent | b1be1eeee94d3547c20719acfa6b0082404897f1 (diff) | |
download | pcsx_rearmed-777506907b6d2283e9a7fb51cdcad497b8989e24.tar.gz pcsx_rearmed-777506907b6d2283e9a7fb51cdcad497b8989e24.tar.bz2 pcsx_rearmed-777506907b6d2283e9a7fb51cdcad497b8989e24.zip |
drc: implement literal dupe merging
doesn't seem to make much difference, but theoretically should help.
-rw-r--r-- | libpcsxcore/new_dynarec/assem_arm.c | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/libpcsxcore/new_dynarec/assem_arm.c b/libpcsxcore/new_dynarec/assem_arm.c index c0e4116..29ad13f 100644 --- a/libpcsxcore/new_dynarec/assem_arm.c +++ b/libpcsxcore/new_dynarec/assem_arm.c @@ -2637,12 +2637,24 @@ void literal_pool(int n) int i; for(i=0;i<literalcount;i++) { + u_int l_addr=(u_int)out; + int j; + for(j=0;j<i;j++) { + if(literals[j][1]==literals[i][1]) { + //printf("dup %08x\n",literals[i][1]); + l_addr=literals[j][0]; + break; + } + } ptr=(u_int *)literals[i][0]; - u_int offset=(u_int)out-(u_int)ptr-8; + u_int offset=l_addr-(u_int)ptr-8; assert(offset<4096); assert(!(offset&3)); *ptr|=offset; - output_w32(literals[i][1]); + if(l_addr==(u_int)out) { + literals[i][0]=l_addr; // remember for dupes + output_w32(literals[i][1]); + } } literalcount=0; } |