]> git.proxmox.com Git - mirror_edk2.git/blame - MdePkg/Library/BaseMemoryLibSse2/Ia32/SetMem64.nasm
MdePkg: Replace BSD License with BSD+Patent License
[mirror_edk2.git] / MdePkg / Library / BaseMemoryLibSse2 / Ia32 / SetMem64.nasm
CommitLineData
dabe6500
JJ
1;------------------------------------------------------------------------------\r
2;\r
3; Copyright (c) 2006, Intel Corporation. All rights reserved.<BR>\r
9344f092 4; SPDX-License-Identifier: BSD-2-Clause-Patent\r
dabe6500
JJ
5;\r
6; Module Name:\r
7;\r
8; SetMem64.nasm\r
9;\r
10; Abstract:\r
11;\r
12; SetMem64 function\r
13;\r
14; Notes:\r
15;\r
16;------------------------------------------------------------------------------\r
17\r
18 SECTION .text\r
19\r
20;------------------------------------------------------------------------------\r
21; VOID *\r
22; EFIAPI\r
23; InternalMemSetMem64 (\r
24; IN VOID *Buffer,\r
25; IN UINTN Count,\r
26; IN UINT64 Value\r
27; )\r
28;------------------------------------------------------------------------------\r
29global ASM_PFX(InternalMemSetMem64)\r
30ASM_PFX(InternalMemSetMem64):\r
31 mov eax, [esp + 4] ; eax <- Buffer\r
32 mov ecx, [esp + 8] ; ecx <- Count\r
33 test al, 8\r
34 mov edx, eax\r
35 movq xmm0, qword [esp + 12]\r
36 jz .0\r
37 movq qword [edx], xmm0\r
38 add edx, 8\r
39 dec ecx\r
40.0:\r
41 shr ecx, 1\r
42 jz @SetQwords\r
43 movlhps xmm0, xmm0\r
44.1:\r
45 movntdq [edx], xmm0\r
46 lea edx, [edx + 16]\r
47 loop .1\r
48 mfence\r
49@SetQwords:\r
50 jnc .2\r
51 movq qword [edx], xmm0\r
52.2:\r
53 ret\r
54\r