]> git.proxmox.com Git - mirror_edk2.git/blob - MdePkg/Library/BaseMemoryLibSse2/X64/ScanMem16.nasm
MdePkg: Replace BSD License with BSD+Patent License
[mirror_edk2.git] / MdePkg / Library / BaseMemoryLibSse2 / X64 / ScanMem16.nasm
1 ;------------------------------------------------------------------------------
2 ;
3 ; Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>
4 ; SPDX-License-Identifier: BSD-2-Clause-Patent
5 ;
6 ; Module Name:
7 ;
8 ; ScanMem16.Asm
9 ;
10 ; Abstract:
11 ;
12 ; ScanMem16 function
13 ;
14 ; Notes:
15 ;
16 ; The following BaseMemoryLib instances contain the same copy of this file:
17 ;
18 ; BaseMemoryLibRepStr
19 ; BaseMemoryLibMmx
20 ; BaseMemoryLibSse2
21 ; BaseMemoryLibOptDxe
22 ; BaseMemoryLibOptPei
23 ;
24 ;------------------------------------------------------------------------------
25
26 DEFAULT REL
27 SECTION .text
28
29 ;------------------------------------------------------------------------------
30 ; CONST VOID *
31 ; EFIAPI
32 ; InternalMemScanMem16 (
33 ; IN CONST VOID *Buffer,
34 ; IN UINTN Length,
35 ; IN UINT16 Value
36 ; );
37 ;------------------------------------------------------------------------------
38 global ASM_PFX(InternalMemScanMem16)
39 ASM_PFX(InternalMemScanMem16):
40 push rdi
41 mov rdi, rcx
42 mov rax, r8
43 mov rcx, rdx
44 repne scasw
45 lea rax, [rdi - 2]
46 cmovnz rax, rcx
47 pop rdi
48 ret
49