]>
Commit | Line | Data |
---|---|---|
6e3b8c47 | 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 | ||
b7089db1 | 24 | .globl _InternalMemSetMem16 |
6e3b8c47 | 25 | |
26 | #------------------------------------------------------------------------------ | |
27 | # VOID * | |
eb227e96 | 28 | # EFIAPI |
29 | # InternalMemSetMem16 ( | |
6e3b8c47 | 30 | # IN VOID *Buffer, |
31 | # IN UINTN Count, | |
32 | # IN UINT16 Value | |
33 | # ) | |
34 | #------------------------------------------------------------------------------ | |
6e3b8c47 | 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 | |
eb227e96 | 50 | L0: |
6e3b8c47 | 51 | movl %edx, %ecx |
52 | andl $7, %edx | |
53 | shrl $3, %ecx | |
b7089db1 | 54 | jz L_SetWords |
6e3b8c47 | 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 | |
b7089db1 | 63 | L_SetWords: |
6e3b8c47 | 64 | movl %edx, %ecx |
65 | rep | |
66 | stosw | |
67 | movl 8(%esp), %eax | |
68 | pop %edi | |
69 | ret |