]> git.proxmox.com Git - mirror_edk2.git/blame - MdePkg/Library/BaseMemoryLibSse2/Ia32/SetMem64.asm
Removed CommonHeader.h generated file from the MdePkg.
[mirror_edk2.git] / MdePkg / Library / BaseMemoryLibSse2 / Ia32 / SetMem64.asm
CommitLineData
e1f414b6 1//\r
2// Include common header file for this module.\r
3//\r
f734a10a 4\r
e1f414b6 5\r
6;------------------------------------------------------------------------------\r
7;\r
8; Copyright (c) 2006, Intel Corporation\r
9; All rights reserved. This program and the accompanying materials\r
10; are licensed and made available under the terms and conditions of the BSD License\r
11; which accompanies this distribution. The full text of the license may be found at\r
12; http://opensource.org/licenses/bsd-license.php\r
13;\r
14; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
15; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
16;\r
17; Module Name:\r
18;\r
19; SetMem64.asm\r
20;\r
21; Abstract:\r
22;\r
23; SetMem64 function\r
24;\r
25; Notes:\r
26;\r
27;------------------------------------------------------------------------------\r
28\r
29 .686\r
30 .model flat,C\r
31 .xmm\r
32 .code\r
33\r
34;------------------------------------------------------------------------------\r
35; VOID *\r
36; EFIAPI\r
37; InternalMemSetMem64 (\r
38; IN VOID *Buffer,\r
39; IN UINTN Count,\r
40; IN UINT64 Value\r
41; )\r
42;------------------------------------------------------------------------------\r
43InternalMemSetMem64 PROC\r
44 mov eax, [esp + 4] ; eax <- Buffer\r
45 mov ecx, [esp + 8] ; ecx <- Count\r
46 test al, 8\r
47 mov edx, eax\r
48 movq xmm0, [esp + 12]\r
49 jz @F\r
50 movq [edx], xmm0\r
51 add edx, 8\r
52 dec ecx\r
53@@:\r
54 shr ecx, 1\r
55 jz @SetQwords\r
56 movlhps xmm0, xmm0\r
57@@:\r
58 movntdq [edx], xmm0\r
59 lea edx, [edx + 16]\r
60 loop @B\r
61 mfence\r
62@SetQwords:\r
63 jnc @F\r
64 movq [edx], xmm0\r
65@@:\r
66 ret\r
67InternalMemSetMem64 ENDP\r
68\r
69 END\r