summaryrefslogtreecommitdiff
path: root/MdePkg/Library/BaseMemoryLibRepStr/X64/ScanMem64.S
diff options
context:
space:
mode:
Diffstat (limited to 'MdePkg/Library/BaseMemoryLibRepStr/X64/ScanMem64.S')
-rw-r--r--MdePkg/Library/BaseMemoryLibRepStr/X64/ScanMem64.S17
1 files changed, 8 insertions, 9 deletions
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