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