1.Fix SetMem64.S to not use SSE3 instruction
[mirror_edk2.git] / MdePkg / Library / BaseMemoryLibSse2 / Ia32 / SetMem64.S
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 # SetMem64.S
15 #
16 # Abstract:
17 #
18 # SetMem64 function
19 #
20 # Notes:
21 #
22 #------------------------------------------------------------------------------
23
24 #------------------------------------------------------------------------------
25 # VOID *
26 # InternalMemSetMem64 (
27 # IN VOID *Buffer,
28 # IN UINTN Count,
29 # IN UINT64 Value
30 # )
31 #------------------------------------------------------------------------------
32 .globl _InternalMemSetMem64
33 _InternalMemSetMem64:
34 movl 4(%esp), %eax
35 movl 8(%esp), %ecx
36 testb $8, %al
37 movl %eax, %edx
38 movq 0xc(%esp), %xmm0
39 jz L1
40 movq %xmm0, (%edx)
41 addl $8, %edx
42 decl %ecx
43 L1:
44 shrl %ecx
45 jz @SetQwords
46 movlhps %xmm0, %xmm0
47 L2:
48 movntdq %xmm0, (%edx)
49 leal 16(%edx), %edx
50 loop L2
51 mfence
52 @SetQwords:
53 jnc L3
54 movq %xmm0, (%edx)
55 L3:
56 ret
57
58
59