aboutsummaryrefslogtreecommitdiff
path: root/libpcsxcore/new_dynarec
diff options
context:
space:
mode:
authornotaz2011-10-13 02:27:43 +0300
committernotaz2011-10-30 23:48:07 +0200
commit777506907b6d2283e9a7fb51cdcad497b8989e24 (patch)
tree32e4e37e3b9c61b4c51126971ae0bc1365fbc028 /libpcsxcore/new_dynarec
parentb1be1eeee94d3547c20719acfa6b0082404897f1 (diff)
downloadpcsx_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.
Diffstat (limited to 'libpcsxcore/new_dynarec')
-rw-r--r--libpcsxcore/new_dynarec/assem_arm.c16
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;
}