]> git.proxmox.com Git - mirror_edk2.git/blob - MdePkg/Library/BaseMemoryLibSse2/Ia32/SetMem32.asm
Removed CommonHeader.h generated file from the MdePkg.
[mirror_edk2.git] / MdePkg / Library / BaseMemoryLibSse2 / Ia32 / SetMem32.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 ; SetMem32.asm
20 ;
21 ; Abstract:
22 ;
23 ; SetMem32 function
24 ;
25 ; Notes:
26 ;
27 ;------------------------------------------------------------------------------
28
29 .686
30 .model flat,C
31 .xmm
32 .code
33
34 ;------------------------------------------------------------------------------
35 ; VOID *
36 ; EFIAPI
37 ; InternalMemSetMem32 (
38 ; IN VOID *Buffer,
39 ; IN UINTN Count,
40 ; IN UINT32 Value
41 ; );
42 ;------------------------------------------------------------------------------
43 InternalMemSetMem32 PROC USES edi
44 mov edx, [esp + 12]
45 mov edi, [esp + 8]
46 xor ecx, ecx
47 sub ecx, edi
48 and ecx, 15 ; ecx + edi aligns on 16-byte boundary
49 mov eax, [esp + 16]
50 jz @F
51 shr ecx, 2
52 cmp ecx, edx
53 cmova ecx, edx
54 sub edx, ecx
55 rep stosd
56 @@:
57 mov ecx, edx
58 and edx, 3
59 shr ecx, 2
60 jz @SetDwords
61 movd xmm0, eax
62 pshufd xmm0, xmm0, 0
63 @@:
64 movntdq [edi], xmm0
65 add edi, 16
66 loop @B
67 mfence
68 @SetDwords:
69 mov ecx, edx
70 rep stosd
71 mov eax, [esp + 8]
72 ret
73 InternalMemSetMem32 ENDP
74
75 END