]> git.proxmox.com Git - mirror_edk2.git/blob - MdePkg/Library/BaseMemoryLibSse2/Ia32/SetMem64.nasm
MdePkg/BaseLib: Add bit field population calculating methods
[mirror_edk2.git] / MdePkg / Library / BaseMemoryLibSse2 / Ia32 / SetMem64.nasm
1 ;------------------------------------------------------------------------------
2 ;
3 ; Copyright (c) 2006, Intel Corporation. All rights reserved.<BR>
4 ; This program and the accompanying materials
5 ; are licensed and made available under the terms and conditions of the BSD License
6 ; which accompanies this distribution. The full text of the license may be found at
7 ; http://opensource.org/licenses/bsd-license.php.
8 ;
9 ; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
10 ; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
11 ;
12 ; Module Name:
13 ;
14 ; SetMem64.nasm
15 ;
16 ; Abstract:
17 ;
18 ; SetMem64 function
19 ;
20 ; Notes:
21 ;
22 ;------------------------------------------------------------------------------
23
24 SECTION .text
25
26 ;------------------------------------------------------------------------------
27 ; VOID *
28 ; EFIAPI
29 ; InternalMemSetMem64 (
30 ; IN VOID *Buffer,
31 ; IN UINTN Count,
32 ; IN UINT64 Value
33 ; )
34 ;------------------------------------------------------------------------------
35 global ASM_PFX(InternalMemSetMem64)
36 ASM_PFX(InternalMemSetMem64):
37 mov eax, [esp + 4] ; eax <- Buffer
38 mov ecx, [esp + 8] ; ecx <- Count
39 test al, 8
40 mov edx, eax
41 movq xmm0, qword [esp + 12]
42 jz .0
43 movq qword [edx], xmm0
44 add edx, 8
45 dec ecx
46 .0:
47 shr ecx, 1
48 jz @SetQwords
49 movlhps xmm0, xmm0
50 .1:
51 movntdq [edx], xmm0
52 lea edx, [edx + 16]
53 loop .1
54 mfence
55 @SetQwords:
56 jnc .2
57 movq qword [edx], xmm0
58 .2:
59 ret
60