]> git.proxmox.com Git - mirror_edk2.git/blob - MdePkg/Library/BaseMemoryLibMmx/Ia32/SetMem32.S
Use capital S for GCC assembly. This enables pre-processing for PCD support.
[mirror_edk2.git] / MdePkg / Library / BaseMemoryLibMmx / Ia32 / SetMem32.S
1 #------------------------------------------------------------------------------
2 #
3 # Copyright (c) 2006, Intel Corporation
4 # All rights reserved. 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 # SetMem32.asm
15 #
16 # Abstract:
17 #
18 # SetMem32 function
19 #
20 # Notes:
21 #
22 #------------------------------------------------------------------------------
23
24 .686:
25 #.MODEL flat,C
26 .xmm:
27 .code:
28
29 #------------------------------------------------------------------------------
30 # VOID *
31 # _mem_SetMem32 (
32 # IN VOID *Buffer,
33 # IN UINTN Count,
34 # IN UINT32 Value
35 # )
36 #------------------------------------------------------------------------------
37 .global _InternalMemSetMem32
38 _InternalMemSetMem32:
39 push %edi
40 movl 12(%esp), %edx
41 movl 8(%esp), %edi
42 movl %edx, %ecx
43 shrl %ecx
44 movd 16(%esp), %mm0
45 movl %edi, %eax
46 jz @SetDwords
47 pshufw $0x44, %mm0, %mm0
48 L0:
49 movntq %mm0, (%edi)
50 addl $8, %edi
51 loopl L0
52 mfence
53 @SetDwords:
54 testb $1, %dl
55 jz @F
56 movd %mm0, (%edi)
57 L1:
58 pop %edi
59 ret