X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;ds=sidebyside;f=MdePkg%2FLibrary%2FBaseMemoryLibRepStr%2FX64%2FScanMem64.S;h=9bc02b06b2fae9cd0a870ffd68c3fa3647847349;hb=1fef058f4b8fefc455bb171e4908c3e835b1b492;hp=917c37c3c5b6064d63d84accbf7e0275ad98ae38;hpb=132f41f0a92082775d931067089a63ca50367225;p=mirror_edk2.git diff --git a/MdePkg/Library/BaseMemoryLibRepStr/X64/ScanMem64.S b/MdePkg/Library/BaseMemoryLibRepStr/X64/ScanMem64.S index 917c37c3c5..9bc02b06b2 100644 --- a/MdePkg/Library/BaseMemoryLibRepStr/X64/ScanMem64.S +++ b/MdePkg/Library/BaseMemoryLibRepStr/X64/ScanMem64.S @@ -3,7 +3,7 @@ # #------------------------------------------------------------------------------ # -# Copyright (c) 2006 - 2008, Intel Corporation +# Copyright (c) 2006 - 2009, Intel Corporation # All rights reserved. This program and the accompanying materials # are licensed and made available under the terms and conditions of the BSD License # which accompanies this distribution. The full text of the license may be found at @@ -42,16 +42,15 @@ # IN UINT64 Value # ); #------------------------------------------------------------------------------ -.intel_syntax noprefix ASM_GLOBAL ASM_PFX(InternalMemScanMem64) ASM_PFX(InternalMemScanMem64): - push rdi - mov rdi, rcx - mov rax, r8 - mov rcx, rdx + pushq %rdi + movq %rcx, %rdi + movq %rdx, %rcx + movq %r8, %rax repne scasq - lea rax, [rdi - 8] - cmovnz rax, rcx - pop rdi + leaq -8(%rdi), %rax + cmovnz %rcx, %rax # set rax to 0 if not found + popq %rdi ret