]> git.proxmox.com Git - mirror_edk2.git/blame_incremental - MdePkg/Library/BaseMemoryLibSse2/Ia32/SetMem64.S
1.Fix SetMem64.S to not use SSE3 instruction
[mirror_edk2.git] / MdePkg / Library / BaseMemoryLibSse2 / Ia32 / SetMem64.S
... / ...
CommitLineData
1#------------------------------------------------------------------------------\r
2#\r
3# Copyright (c) 2006, Intel Corporation\r
4# All rights reserved. This program and the accompanying materials\r
5# are licensed and made available under the terms and conditions of the BSD License\r
6# which accompanies this distribution. The full text of the license may be found at\r
7# http://opensource.org/licenses/bsd-license.php\r
8#\r
9# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
10# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
11#\r
12# Module Name:\r
13#\r
14# SetMem64.S\r
15#\r
16# Abstract:\r
17#\r
18# SetMem64 function\r
19#\r
20# Notes:\r
21#\r
22#------------------------------------------------------------------------------\r
23\r
24#------------------------------------------------------------------------------\r
25# VOID *\r
26# InternalMemSetMem64 (\r
27# IN VOID *Buffer,\r
28# IN UINTN Count,\r
29# IN UINT64 Value\r
30# )\r
31#------------------------------------------------------------------------------\r
32.globl _InternalMemSetMem64\r
33_InternalMemSetMem64:\r
34 movl 4(%esp), %eax\r
35 movl 8(%esp), %ecx\r
36 testb $8, %al\r
37 movl %eax, %edx\r
38 movq 0xc(%esp), %xmm0\r
39 jz L1\r
40 movq %xmm0, (%edx)\r
41 addl $8, %edx\r
42 decl %ecx\r
43L1: \r
44 shrl %ecx\r
45 jz @SetQwords\r
46 movlhps %xmm0, %xmm0\r
47L2: \r
48 movntdq %xmm0, (%edx)\r
49 leal 16(%edx), %edx\r
50 loop L2\r
51 mfence\r
52@SetQwords: \r
53 jnc L3\r
54 movq %xmm0, (%edx)\r
55L3: \r
56 ret\r
57\r
58\r
59\r