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