]> git.proxmox.com Git - mirror_edk2.git/blob - MdePkg/Library/BaseMemoryLibSse2/X64/SetMem32.S
ff6b0d7b4e649d69402fb2090c616151fbde1105
[mirror_edk2.git] / MdePkg / Library / BaseMemoryLibSse2 / X64 / SetMem32.S
1 #
2 # ConvertAsm.py: Automatically generated from SetMem32.asm
3 #
4 #------------------------------------------------------------------------------
5 #
6 # Copyright (c) 2006 - 2008, Intel Corporation
7 # All rights reserved. This program and the accompanying materials
8 # are licensed and made available under the terms and conditions of the BSD License
9 # which accompanies this distribution. The full text of the license may be found at
10 # http://opensource.org/licenses/bsd-license.php
11 #
12 # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
13 # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
14 #
15 # Module Name:
16 #
17 # SetMem32.S
18 #
19 # Abstract:
20 #
21 # SetMem32 function
22 #
23 # Notes:
24 #
25 #------------------------------------------------------------------------------
26
27
28 #------------------------------------------------------------------------------
29 # VOID *
30 # EFIAPI
31 # InternalMemSetMem32 (
32 # IN VOID *Buffer,
33 # IN UINTN Count,
34 # IN UINT32 Value
35 # );
36 #------------------------------------------------------------------------------
37 .intel_syntax noprefix
38 ASM_GLOBAL ASM_PFX(InternalMemSetMem32)
39 ASM_PFX(InternalMemSetMem32):
40 push rdi
41 mov rdi, rcx
42 mov r9, rdi
43 xor rcx, rcx
44 sub rcx, rdi
45 and rcx, 15
46 mov rax, r8
47 jz L0
48 shr rcx, 2
49 cmp rcx, rdx
50 cmova rcx, rdx
51 sub rdx, rcx
52 rep stosd
53 L0:
54 mov rcx, rdx
55 and edx, 3
56 shr rcx, 2
57 jz L_SetDwords
58 movd xmm0, eax
59 pshufd xmm0, xmm0, 0
60 L1:
61 movntdq [rdi], xmm0
62 add rdi, 16
63 loop L1
64 mfence
65 L_SetDwords:
66 mov ecx, edx
67 rep stosd
68 mov rax, r9
69 pop rdi
70 ret