ldesnogu
Well-Known Member
Exophase: Yes, I often quote DynamoRIO work. It's probably because it's the only work I found that tested many things related to runtime code generation. But I'm well aware I should be cautious not to rely too much on what's in there since it's not a simulator (and also I usually don't accept things if I haven't tested them myself).
I think you can gain one instruction this way:
Note that it wouldn't be necessarily faster
Did you play with various HT sizes? QEMU went for 4096 entries but it doesn't use open hashing.
The writeback is for open hashing?The hash algorithm that I use in mupen64plus is: hash_table[((vaddr>>16)^vaddr)&0xFFFF]
The lookup and comparison (in linkage_arm.s) is as follows:
Code:jump_vaddr: eor r2, r0, r0, lsl #16 ldr r1, .htptr lsr r2, r2, #12 bic r2, r2, #15 ldr r2, [r1, r2]! teq r2, r0 [...] .htptr: .word hash_table
I think you can gain one instruction this way:
Code:
jump_vaddr:
eor r2, r0, r0, lsl #16
ldr r1, .htptr
lsr r2, r2, #16
ldr r2, [r1, r2, lsl #4]!
teq r2, r0
Did you play with various HT sizes? QEMU went for 4096 entries but it doesn't use open hashing.
Does that happen often in n64 programs?The reason I did not try to merge blocks in hot paths is that it makes block invalidation more complicated. If a write hits any one of the merged blocks, then you have to invalidate them all.
Good point One of the guys working on Google v8 (Javascript engine) told us the same: he could run his code without having to flush.BTW I don't flush the cache every time it modifies an instruction. Since the new code is functionally equivalent to the old code, nothing really bad happens if the old code stays in the i-cache. It still works, it's just slower, but maybe not as slow as flushing the cache.