]> git.proxmox.com Git - mirror_edk2.git/blob - MdePkg/Library/BaseMemoryLibSse2/Ia32/ScanMem64.S
Import some basic libraries instances for Mde Packages.
[mirror_edk2.git] / MdePkg / Library / BaseMemoryLibSse2 / Ia32 / ScanMem64.S
1 //
2 // Include common header file for this module.
3 //
4 #include "CommonHeader.h"
5
6 #------------------------------------------------------------------------------
7 #
8 # Copyright (c) 2006, Intel Corporation
9 # All rights reserved. This program and the accompanying materials
10 # are licensed and made available under the terms and conditions of the BSD License
11 # which accompanies this distribution. The full text of the license may be found at
12 # http://opensource.org/licenses/bsd-license.php
13 #
14 # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
15 # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
16 #
17 # Module Name:
18 #
19 # ScanMem64.Asm
20 #
21 # Abstract:
22 #
23 # ScanMem64 function
24 #
25 # Notes:
26 #
27 # The following BaseMemoryLib instances share the same version of this file:
28 #
29 # BaseMemoryLibRepStr
30 # BaseMemoryLibMmx
31 # BaseMemoryLibSse2
32 #
33 #------------------------------------------------------------------------------
34
35 .globl _InternalMemScanMem64
36
37 #------------------------------------------------------------------------------
38 # CONST VOID *
39 # EFIAPI
40 # InternalMemScanMem64 (
41 # IN CONST VOID *Buffer,
42 # IN UINTN Length,
43 # IN UINT64 Value
44 # );
45 #------------------------------------------------------------------------------
46 _InternalMemScanMem64:
47 push %edi
48 movl 12(%esp), %ecx
49 movl 16(%esp), %eax
50 movl 20(%esp), %edx
51 movl 8(%esp), %edi
52 L0:
53 cmpl (%edi), %eax
54 leal 8(%edi), %edi
55 loopne L0
56 jne L1
57 cmpl -4(%edi), %edx
58 jecxz L1
59 jne L0
60 L1:
61 leal -8(%edi), %eax
62 cmovne %ecx, %eax
63 pop %edi
64 ret