]> git.proxmox.com Git - mirror_edk2.git/blame - MdePkg/Library/BaseMemoryLibSse2/Ia32/SetMem16.S
add a error macro to prevent this file from included for now #error "UEFI 2.1 HII...
[mirror_edk2.git] / MdePkg / Library / BaseMemoryLibSse2 / Ia32 / SetMem16.S
CommitLineData
e1f414b6 1//\r
2// Include common header file for this module.\r
3//\r
4#include "CommonHeader.h"\r
5\r
6#------------------------------------------------------------------------------\r
7#\r
8# Copyright (c) 2006, Intel Corporation\r
9# All rights reserved. This program and the accompanying materials\r
10# are licensed and made available under the terms and conditions of the BSD License\r
11# which accompanies this distribution. The full text of the license may be found at\r
12# http://opensource.org/licenses/bsd-license.php\r
13#\r
14# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
15# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
16#\r
17# Module Name:\r
18#\r
19# SetMem16.asm\r
20#\r
21# Abstract:\r
22#\r
23# SetMem16 function\r
24#\r
25# Notes:\r
26#\r
27#------------------------------------------------------------------------------\r
28\r
29.globl _InternalMemSetMem16\r
30\r
31#------------------------------------------------------------------------------\r
32# VOID *\r
33# EFIAPI\r
34# InternalMemSetMem16 (\r
35# IN VOID *Buffer,\r
36# IN UINTN Count,\r
37# IN UINT16 Value\r
38# )\r
39#------------------------------------------------------------------------------\r
40_InternalMemSetMem16:\r
41 push %edi\r
42 movl 12(%esp), %edx\r
43 movl 8(%esp), %edi\r
44 xorl %ecx, %ecx\r
45 subl %edi, %ecx\r
46 andl $15, %ecx # ecx + edi aligns on 16-byte boundary\r
47 movl 16(%esp), %eax\r
48 jz L0\r
49 shrl %ecx\r
50 cmpl %edx, %ecx\r
51 cmova %edx, %ecx\r
52 subl %ecx, %edx\r
53 rep\r
54 stosw\r
55L0:\r
56 movl %edx, %ecx\r
57 andl $7, %edx\r
58 shrl $3, %ecx\r
59 jz L_SetWords\r
60 movd %eax, %xmm0\r
61 pshuflw $0, %xmm0, %xmm0\r
62 movlhps %xmm0, %xmm0\r
63L1:\r
64 movntdq %xmm0, (%edi)\r
65 addl $16, %edi\r
66 loop L1\r
67 mfence\r
68L_SetWords:\r
69 movl %edx, %ecx\r
70 rep\r
71 stosw\r
72 movl 8(%esp), %eax\r
73 pop %edi\r
74 ret\r