diff --git a/emu/gadgets-x86/gadgets.h b/emu/gadgets-x86/gadgets.h index e97d5d1497..8f4f431e9e 100644 --- a/emu/gadgets-x86/gadgets.h +++ b/emu/gadgets-x86/gadgets.h @@ -42,9 +42,9 @@ cmpl TLB_ENTRY_page_if_writable(%_tlb,%r14), %r15d .endif movl %r15d, -TLB_entries+TLB_dirty_page(%_tlb) - je 2f + je 10f call handle_\type\()_miss -2: +10: addq TLB_ENTRY_data_minus_addr(%_tlb,%r14), %_addrq .endm diff --git a/emu/gadgets-x86/string.S b/emu/gadgets-x86/string.S index f8232a78d0..96f195abd5 100644 --- a/emu/gadgets-x86/string.S +++ b/emu/gadgets-x86/string.S @@ -15,7 +15,11 @@ .endif .gadget \op\size\()_\rep + .ifc \rep,rep + testl %ecx, %ecx + jz 2f 1: + .endif .ifc \op,stos movl %edi, %_addr write_prep @@ -38,6 +42,7 @@ .ifc \rep,rep decl %ecx jnz 1b + 2: .endif gret 1 .endm