Search
lxdream.org :: lxdream :: r942:05e5d6a62e67
lxdream 0.9.1
released Jun 29
Download Now
changeset942:05e5d6a62e67 lxdream-mem
parent941:c67574ed4355
child943:9a277733eafa
authornkeynes
dateMon Jan 05 04:13:42 2009 +0000 (11 years ago)
branchlxdream-mem
Simplify address translation by 1 instruction
src/sh4/mmux86.c
1.1 --- a/src/sh4/mmux86.c Sat Jan 03 08:55:15 2009 +0000
1.2 +++ b/src/sh4/mmux86.c Mon Jan 05 04:13:42 2009 +0000
1.3 @@ -40,6 +40,7 @@
1.4 void mmu_utlb_init_vtable( struct utlb_entry *ent, struct utlb_page_entry *page, gboolean writable )
1.5 {
1.6 uint32_t mask = ent->mask;
1.7 + uint32_t vpn = ent->vpn & mask;
1.8 uint32_t ppn = ent->ppn & mask;
1.9 int inc = writable ? 1 : 2;
1.10 int i;
1.11 @@ -56,8 +57,7 @@
1.12 #else
1.13 OP(0x83); MODRM_r32_disp32(0, (uintptr_t)&mmu_urc); OP(0x01); // ADD #1, mmu_urc
1.14 #endif
1.15 - AND_imm32_r32( ~mask, ARG1 ); // 6
1.16 - OR_imm32_r32( ppn, ARG1 ); // 6
1.17 + ADD_imm32_r32( ppn-vpn, ARG1 ); // 6
1.18 if( ent->mask >= 0xFFFFF000 ) {
1.19 // Maps to a single page, so jump directly there
1.20 int rel = (*fn - xlat_output);
.