]>
Commit | Line | Data |
---|---|---|
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 | # SetMem32.asm\r | |
20 | #\r | |
21 | # Abstract:\r | |
22 | #\r | |
23 | # SetMem32 function\r | |
24 | #\r | |
25 | # Notes:\r | |
26 | #\r | |
27 | #------------------------------------------------------------------------------\r | |
28 | \r | |
29 | .globl _InternalMemSetMem32\r | |
30 | \r | |
31 | #------------------------------------------------------------------------------\r | |
32 | # VOID *\r | |
33 | # EFIAPI\r | |
34 | # InternalMemSetMem32 (\r | |
35 | # IN VOID *Buffer,\r | |
36 | # IN UINTN Count,\r | |
37 | # IN UINT32 Value\r | |
38 | # );\r | |
39 | #------------------------------------------------------------------------------\r | |
40 | _InternalMemSetMem32:\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 $2, %ecx\r | |
50 | cmpl %edx, %ecx\r | |
51 | cmova %edx, %ecx\r | |
52 | subl %ecx, %edx\r | |
53 | rep\r | |
54 | stosl\r | |
55 | L0:\r | |
56 | movl %edx, %ecx\r | |
57 | andl $3, %edx\r | |
58 | shrl $2, %ecx\r | |
59 | jz L_SetDwords\r | |
60 | movd %eax, %xmm0\r | |
61 | pshufd $0, %xmm0, %xmm0\r | |
62 | L1:\r | |
63 | movntdq %xmm0, (%edi)\r | |
64 | addl $16, %edi\r | |
65 | loop L1\r | |
66 | mfence\r | |
67 | L_SetDwords:\r | |
68 | movl %edx, %ecx\r | |
69 | rep\r | |
70 | stosl\r | |
71 | movl 8(%esp), %eax\r | |
72 | pop %edi\r | |
73 | ret\r |