]> git.proxmox.com Git - mirror_edk2.git/blob - MdePkg/Library/BaseMemoryLibMmx/X64/SetMem16.nasm
MdePkg: Replace Opcode with the corresponding instructions.
[mirror_edk2.git] / MdePkg / Library / BaseMemoryLibMmx / X64 / SetMem16.nasm
1 ;------------------------------------------------------------------------------
2 ;
3 ; Copyright (c) 2006 - 2022, Intel Corporation. All rights reserved.<BR>
4 ; SPDX-License-Identifier: BSD-2-Clause-Patent
5 ;
6 ; Module Name:
7 ;
8 ; SetMem16.nasm
9 ;
10 ; Abstract:
11 ;
12 ; SetMem16 function
13 ;
14 ; Notes:
15 ;
16 ;------------------------------------------------------------------------------
17
18 DEFAULT REL
19 SECTION .text
20
21 ;------------------------------------------------------------------------------
22 ; VOID *
23 ; EFIAPI
24 ; InternalMemSetMem16 (
25 ; OUT VOID *Buffer,
26 ; IN UINTN Length,
27 ; IN UINT16 Value
28 ; );
29 ;------------------------------------------------------------------------------
30 global ASM_PFX(InternalMemSetMem16)
31 ASM_PFX(InternalMemSetMem16):
32 push rdi
33 mov rax, r8
34 movq mm0, rax
35 mov r8, rcx
36 mov rdi, r8
37 mov rcx, rdx
38 and edx, 3
39 shr rcx, 2
40 jz @SetWords
41 pshufw mm0, mm0, 0
42 .0:
43 movntq [rdi], mm0
44 add rdi, 8
45 loop .0
46 mfence
47 @SetWords:
48 mov ecx, edx
49 rep stosw
50 mov rax, r8
51 pop rdi
52 ret
53