summaryrefslogtreecommitdiff
path: root/MdePkg/Library/BaseMemoryLibSse2/X64/ScanMem16.S
diff options
context:
space:
mode:
Diffstat (limited to 'MdePkg/Library/BaseMemoryLibSse2/X64/ScanMem16.S')
-rw-r--r--MdePkg/Library/BaseMemoryLibSse2/X64/ScanMem16.S17
1 files changed, 8 insertions, 9 deletions
diff --git a/MdePkg/Library/BaseMemoryLibSse2/X64/ScanMem16.S b/MdePkg/Library/BaseMemoryLibSse2/X64/ScanMem16.S
index 140b0a40e5..c60998b38c 100644
--- a/MdePkg/Library/BaseMemoryLibSse2/X64/ScanMem16.S
+++ b/MdePkg/Library/BaseMemoryLibSse2/X64/ScanMem16.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 UINT16 Value
# );
#------------------------------------------------------------------------------
-.intel_syntax noprefix
ASM_GLOBAL ASM_PFX(InternalMemScanMem16)
ASM_PFX(InternalMemScanMem16):
- push rdi
- mov rdi, rcx
- mov rax, r8
- mov rcx, rdx
+ pushq %rdi
+ movq %rcx, %rdi
+ movq %rdx, %rcx
+ movq %r8, %rax
repne scasw
- lea rax, [rdi - 2]
- cmovnz rax, rcx
- pop rdi
+ leaq -2(%rdi), %rax
+ cmovnz %rcx, %rax # set rax to 0 if not found
+ popq %rdi
ret