]> git.proxmox.com Git - mirror_edk2.git/blob - MdePkg/Library/BaseMemoryLibSse2/Ia32/SetMem64.asm
Removed CommonHeader.h generated file from the MdePkg.
[mirror_edk2.git] / MdePkg / Library / BaseMemoryLibSse2 / Ia32 / SetMem64.asm
1 //
2 // Include common header file for this module.
3 //
4
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 ; SetMem64.asm
20 ;
21 ; Abstract:
22 ;
23 ; SetMem64 function
24 ;
25 ; Notes:
26 ;
27 ;------------------------------------------------------------------------------
28
29 .686
30 .model flat,C
31 .xmm
32 .code
33
34 ;------------------------------------------------------------------------------
35 ; VOID *
36 ; EFIAPI
37 ; InternalMemSetMem64 (
38 ; IN VOID *Buffer,
39 ; IN UINTN Count,
40 ; IN UINT64 Value
41 ; )
42 ;------------------------------------------------------------------------------
43 InternalMemSetMem64 PROC
44 mov eax, [esp + 4] ; eax <- Buffer
45 mov ecx, [esp + 8] ; ecx <- Count
46 test al, 8
47 mov edx, eax
48 movq xmm0, [esp + 12]
49 jz @F
50 movq [edx], xmm0
51 add edx, 8
52 dec ecx
53 @@:
54 shr ecx, 1
55 jz @SetQwords
56 movlhps xmm0, xmm0
57 @@:
58 movntdq [edx], xmm0
59 lea edx, [edx + 16]
60 loop @B
61 mfence
62 @SetQwords:
63 jnc @F
64 movq [edx], xmm0
65 @@:
66 ret
67 InternalMemSetMem64 ENDP
68
69 END