]>
Commit | Line | Data |
---|---|---|
4df876ad | 1 | # |
2 | # ConvertAsm.py: Automatically generated from SetMem16.asm | |
3 | # | |
4 | #------------------------------------------------------------------------------ | |
5 | # | |
6 | # Copyright (c) 2006, 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 | # SetMem16.S | |
18 | # | |
19 | # Abstract: | |
20 | # | |
21 | # SetMem16 function | |
22 | # | |
23 | # Notes: | |
24 | # | |
25 | #------------------------------------------------------------------------------ | |
26 | ||
27 | ||
28 | #------------------------------------------------------------------------------ | |
29 | # VOID * | |
30 | # EFIAPI | |
31 | # InternalMemSetMem16 ( | |
32 | # IN VOID *Buffer, | |
33 | # IN UINTN Count, | |
34 | # IN UINT16 Value | |
35 | # ) | |
36 | #------------------------------------------------------------------------------ | |
37 | .intel_syntax noprefix | |
38 | .globl ASM_PFX(InternalMemSetMem16) | |
39 | ASM_PFX(InternalMemSetMem16): | |
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, 1 | |
49 | cmp rcx, rdx | |
50 | cmova rcx, rdx | |
51 | sub rdx, rcx | |
52 | rep stosw | |
53 | L0: | |
54 | mov rcx, rdx | |
55 | and edx, 7 | |
56 | shr rcx, 3 | |
57 | jz _SetWords_L2 | |
58 | movd xmm0, eax | |
59 | pshuflw xmm0, xmm0, 0 | |
60 | movlhps xmm0, xmm0 | |
61 | L1: | |
62 | movntdq [rdi], xmm0 | |
63 | add rdi, 16 | |
64 | loop L1 | |
65 | mfence | |
66 | _SetWords_L2: | |
67 | mov ecx, edx | |
68 | rep stosw | |
69 | mov rax, r9 | |
70 | pop rdi | |
71 | ret |