]> git.proxmox.com Git - mirror_edk2.git/blob - MdePkg/Library/BaseMemoryLibSse2/Ia32/SetMem64.S
Import some basic libraries instances for Mde Packages.
[mirror_edk2.git] / MdePkg / Library / BaseMemoryLibSse2 / Ia32 / SetMem64.S
1 //
2 // Include common header file for this module.
3 //
4 #include "CommonHeader.h"
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.S
20 #
21 # Abstract:
22 #
23 # SetMem64 function
24 #
25 # Notes:
26 #
27 #------------------------------------------------------------------------------
28
29 .globl _InternalMemSetMem64
30
31 #------------------------------------------------------------------------------
32 # VOID *
33 # EFIAPI
34 # InternalMemSetMem64 (
35 # IN VOID *Buffer,
36 # IN UINTN Count,
37 # IN UINT64 Value
38 # );
39 #------------------------------------------------------------------------------
40 _InternalMemSetMem64:
41 movl 4(%esp), %eax
42 movl 8(%esp), %ecx
43 testb $8, %al
44 movl %eax, %edx
45 movq 0xc(%esp), %xmm0
46 jz L1
47 movq %xmm0, (%edx)
48 addl $8, %edx
49 decl %ecx
50 L1:
51 shrl %ecx
52 jz L_SetQwords
53 movlhps %xmm0, %xmm0
54 L2:
55 movntdq %xmm0, (%edx)
56 leal 16(%edx), %edx
57 loop L2
58 mfence
59 L_SetQwords:
60 jnc L3
61 movq %xmm0, (%edx)
62 L3:
63 ret