summaryrefslogtreecommitdiff
path: root/MdePkg/Library/BaseMemoryLibSse2/X64/ScanMem64.S
diff options
context:
space:
mode:
Diffstat (limited to 'MdePkg/Library/BaseMemoryLibSse2/X64/ScanMem64.S')
-rw-r--r--MdePkg/Library/BaseMemoryLibSse2/X64/ScanMem64.S19
1 files changed, 9 insertions, 10 deletions
diff --git a/MdePkg/Library/BaseMemoryLibSse2/X64/ScanMem64.S b/MdePkg/Library/BaseMemoryLibSse2/X64/ScanMem64.S
index 917c37c..22784ab 100644
--- a/MdePkg/Library/BaseMemoryLibSse2/X64/ScanMem64.S
+++ b/MdePkg/Library/BaseMemoryLibSse2/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
@@ -37,21 +37,20 @@
# CONST VOID *
# EFIAPI
# InternalMemScanMem64 (
-# IN CONST VOID *Buffer,
+# IN CONST VOID *Buffer,
# IN UINTN Length,
# 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