[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-changelog] [xen master] x86/E820: improve insn selection
commit 6f0e865d0e9b875c2770b5634a002a0a531aceca Author: Jan Beulich <jbeulich@xxxxxxxx> AuthorDate: Wed Jan 3 11:04:26 2018 +0100 Commit: Jan Beulich <jbeulich@xxxxxxxx> CommitDate: Wed Jan 3 11:04:26 2018 +0100 x86/E820: improve insn selection ..., largely to shrink code size a little: - use TEST instead of CMP with zero immediate - use MOVZWL instead of AND with 0xffff immediate - compute final highmem_bk value in registers, accessing memory just once Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx> Reviewed-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx> --- xen/arch/x86/boot/mem.S | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/xen/arch/x86/boot/mem.S b/xen/arch/x86/boot/mem.S index ca90db0..c6a9bd4 100644 --- a/xen/arch/x86/boot/mem.S +++ b/xen/arch/x86/boot/mem.S @@ -29,8 +29,8 @@ get_memory_map: movw %di,%ax addw $20,%ax movw %ax,%di - cmpl $0,%ebx # check to see if - jne 1b # %ebx is set to EOF + testl %ebx,%ebx # check to see if + jnz 1b # %ebx is set to EOF .Lmem88: movb $0x88, %ah @@ -48,17 +48,17 @@ get_memory_map: int $0x15 jc .Lint12 - cmpw $0x0, %cx # Kludge to handle BIOSes - jne 1f # which report their extended - cmpw $0x0, %dx # memory in AX/BX rather than - jne 1f # CX/DX. The spec I have read + testw %cx, %cx # Kludge to handle BIOSes + jnz 1f # which report their extended + testw %dx, %dx # memory in AX/BX rather than + jnz 1f # CX/DX. The spec I have read movw %ax, %cx # seems to indicate AX/BX movw %bx, %dx # are more reasonable anyway... -1: andl $0xffff,%edx # clear sign extend +1: movzwl %dx, %edx shll $6,%edx # and go from 64k to 1k chunks + movzwl %cx, %ecx + addl %ecx, %edx # add in lower memory movl %edx,bootsym(highmem_kb) # store extended memory size - andl $0xffff,%ecx # clear sign extend - addl %ecx,bootsym(highmem_kb) # and add lower memory into .Lint12: int $0x12 -- generated by git-patchbot for /home/xen/git/xen.git#master _______________________________________________ Xen-changelog mailing list Xen-changelog@xxxxxxxxxxxxxxxxxxxx https://lists.xenproject.org/xen-changelog
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |