]> git.proxmox.com Git - mirror_edk2.git/blame - MdePkg/Library/BaseMemoryLibSse2/X64/SetMem16.S
Update copyright for files modified in this year
[mirror_edk2.git] / MdePkg / Library / BaseMemoryLibSse2 / X64 / SetMem16.S
CommitLineData
b1ff428c 1#\r
2# ConvertAsm.py: Automatically generated from SetMem16.asm\r
3#\r
4#------------------------------------------------------------------------------\r
5#\r
373ade0e 6# Copyright (c) 2006 - 2008, 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# SetMem16.S\r
18#\r
19# Abstract:\r
20#\r
21# SetMem16 function\r
22#\r
23# Notes:\r
24#\r
25#------------------------------------------------------------------------------\r
26\r
27\r
28#------------------------------------------------------------------------------\r
29# VOID *\r
30# EFIAPI\r
31# InternalMemSetMem16 (\r
32# IN VOID *Buffer,\r
33# IN UINTN Count,\r
34# IN UINT16 Value\r
35# )\r
36#------------------------------------------------------------------------------\r
37.intel_syntax noprefix\r
38.globl ASM_PFX(InternalMemSetMem16)\r
39ASM_PFX(InternalMemSetMem16):\r
40 push rdi\r
41 mov rdi, rcx\r
42 mov r9, rdi\r
43 xor rcx, rcx\r
44 sub rcx, rdi\r
45 and rcx, 15\r
46 mov rax, r8\r
47 jz L0\r
48 shr rcx, 1\r
49 cmp rcx, rdx\r
50 cmova rcx, rdx\r
51 sub rdx, rcx\r
52 rep stosw\r
53L0:\r
54 mov rcx, rdx\r
55 and edx, 7\r
56 shr rcx, 3\r
57 jz L_SetWords\r
58 movd xmm0, eax\r
59 pshuflw xmm0, xmm0, 0\r
60 movlhps xmm0, xmm0\r
61L1:\r
62 movntdq [rdi], xmm0\r
63 add rdi, 16\r
64 loop L1\r
65 mfence\r
66L_SetWords:\r
67 mov ecx, edx\r
68 rep stosw\r
69 mov rax, r9\r
70 pop rdi\r
71 ret\r