]>
Commit | Line | Data |
---|---|---|
b1ff428c | 1 | #\r |
2 | # ConvertAsm.py: Automatically generated from ZeroMem.asm\r | |
3 | #\r | |
4 | #------------------------------------------------------------------------------\r | |
5 | #\r | |
c33c6476 HT |
6 | # Copyright (c) 2006 - 2009, Intel Corporation. All rights reserved.<BR>\r |
7 | # This program and the accompanying materials\r | |
b1ff428c | 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 | # ZeroMem.S\r | |
18 | #\r | |
19 | # Abstract:\r | |
20 | #\r | |
21 | # ZeroMem function\r | |
22 | #\r | |
23 | # Notes:\r | |
24 | #\r | |
25 | #------------------------------------------------------------------------------\r | |
26 | \r | |
27 | \r | |
28 | #------------------------------------------------------------------------------\r | |
29 | # VOID *\r | |
30 | # InternalMemZeroMem (\r | |
31 | # IN VOID *Buffer,\r | |
32 | # IN UINTN Count\r | |
33 | # );\r | |
34 | #------------------------------------------------------------------------------\r | |
132f41f0 | 35 | ASM_GLOBAL ASM_PFX(InternalMemZeroMem)\r |
b1ff428c | 36 | ASM_PFX(InternalMemZeroMem):\r |
1fef058f | 37 | pushq %rdi\r |
38 | movq %rcx, %rdi\r | |
39 | xorq %rcx, %rcx\r | |
40 | xorl %eax, %eax\r | |
41 | subq %rdi, %rcx\r | |
42 | andq $15, %rcx\r | |
43 | movq %rdi, %r8\r | |
b1ff428c | 44 | jz L0\r |
1fef058f | 45 | cmpq %rdx, %rcx\r |
46 | cmova %rdx, %rcx\r | |
47 | subq %rcx, %rdx\r | |
b1ff428c | 48 | rep stosb\r |
49 | L0:\r | |
1fef058f | 50 | movq %rdx, %rcx\r |
51 | andl $15, %edx\r | |
52 | shrq $4, %rcx\r | |
b1ff428c | 53 | jz L_ZeroBytes\r |
1fef058f | 54 | pxor %xmm0, %xmm0\r |
b1ff428c | 55 | L1:\r |
1fef058f | 56 | movntdq %xmm0, (%rdi) # rdi should be 16-byte aligned\r |
57 | addq $16, %rdi\r | |
b1ff428c | 58 | loop L1\r |
59 | mfence\r | |
60 | L_ZeroBytes:\r | |
1fef058f | 61 | movl %edx, %ecx\r |
b1ff428c | 62 | rep stosb\r |
1fef058f | 63 | movq %r8, %rax\r |
64 | popq %rdi\r | |
b1ff428c | 65 | ret\r |