\r
[Sources.Ia32]\r
Ia32/ScanMem64.nasm\r
- Ia32/ScanMem64.S\r
Ia32/ScanMem32.nasm\r
- Ia32/ScanMem32.S\r
Ia32/ScanMem16.nasm\r
- Ia32/ScanMem16.S\r
Ia32/ScanMem8.nasm\r
- Ia32/ScanMem8.S\r
Ia32/CompareMem.nasm\r
- Ia32/CompareMem.S\r
Ia32/ZeroMem.nasm\r
- Ia32/ZeroMem.S\r
Ia32/SetMem64.nasm\r
- Ia32/SetMem64.S\r
Ia32/SetMem32.nasm\r
- Ia32/SetMem32.S\r
Ia32/SetMem16.nasm\r
- Ia32/SetMem16.S\r
Ia32/SetMem.nasm\r
- Ia32/SetMem.S\r
Ia32/CopyMem.nasm\r
- Ia32/CopyMem.S\r
Ia32/ScanMem64.nasm\r
Ia32/ScanMem32.nasm\r
Ia32/ScanMem16.nasm\r
X64/SetMem.nasm\r
X64/CopyMem.nasm\r
X64/ScanMem64.nasm\r
- X64/ScanMem64.S\r
X64/ScanMem32.nasm\r
- X64/ScanMem32.S\r
X64/ScanMem16.nasm\r
- X64/ScanMem16.S\r
X64/ScanMem8.nasm\r
- X64/ScanMem8.S\r
X64/CompareMem.nasm\r
- X64/CompareMem.S\r
X64/ZeroMem.nasm\r
- X64/ZeroMem.S\r
X64/SetMem64.nasm\r
- X64/SetMem64.S\r
X64/SetMem32.nasm\r
- X64/SetMem32.S\r
X64/SetMem16.nasm\r
- X64/SetMem16.S\r
X64/SetMem.nasm\r
- X64/SetMem.S\r
X64/CopyMem.nasm\r
- X64/CopyMem.S\r
X64/IsZeroBuffer.nasm\r
\r
[Packages]\r
+++ /dev/null
-#------------------------------------------------------------------------------\r
-#\r
-# Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>\r
-# This program and the accompanying materials\r
-# are licensed and made available under the terms and conditions of the BSD License\r
-# which accompanies this distribution. The full text of the license may be found at\r
-# http://opensource.org/licenses/bsd-license.php.\r
-#\r
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-#\r
-# Module Name:\r
-#\r
-# CompareMem.Asm\r
-#\r
-# Abstract:\r
-#\r
-# CompareMem function\r
-#\r
-# Notes:\r
-#\r
-# The following BaseMemoryLib instances contain the same copy of this file:\r
-#\r
-# BaseMemoryLibRepStr\r
-# BaseMemoryLibMmx\r
-# BaseMemoryLibSse2\r
-# BaseMemoryLibOptDxe\r
-# BaseMemoryLibOptPei\r
-#\r
-#------------------------------------------------------------------------------\r
-\r
-ASM_GLOBAL ASM_PFX(InternalMemCompareMem)\r
-\r
-#------------------------------------------------------------------------------\r
-# INTN\r
-# EFIAPI\r
-# InternalMemCompareMem (\r
-# IN CONST VOID *DestinationBuffer,\r
-# IN CONST VOID *SourceBuffer,\r
-# IN UINTN Length\r
-# );\r
-#------------------------------------------------------------------------------\r
-ASM_PFX(InternalMemCompareMem):\r
- push %esi\r
- push %edi\r
- movl 12(%esp), %esi\r
- movl 16(%esp), %edi\r
- movl 20(%esp), %ecx\r
- repe cmpsb\r
- movzbl -1(%esi), %eax\r
- movzbl -1(%edi), %edx\r
- subl %edx, %eax\r
- pop %edi\r
- pop %esi\r
- ret\r
+++ /dev/null
-#------------------------------------------------------------------------------\r
-#\r
-# Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>\r
-# This program and the accompanying materials\r
-# are licensed and made available under the terms and conditions of the BSD License\r
-# which accompanies this distribution. The full text of the license may be found at\r
-# http://opensource.org/licenses/bsd-license.php.\r
-#\r
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-#\r
-# Module Name:\r
-#\r
-# CopyMem.asm\r
-#\r
-# Abstract:\r
-#\r
-# CopyMem function\r
-#\r
-# Notes:\r
-#\r
-#------------------------------------------------------------------------------\r
-\r
-ASM_GLOBAL ASM_PFX(InternalMemCopyMem)\r
-\r
-#------------------------------------------------------------------------------\r
-# VOID *\r
-# EFIAPI\r
-# InternalMemCopyMem (\r
-# IN VOID *Destination,\r
-# IN VOID *Source,\r
-# IN UINTN Count\r
-# );\r
-#------------------------------------------------------------------------------\r
-ASM_PFX(InternalMemCopyMem):\r
- push %esi\r
- push %edi\r
- movl 16(%esp), %esi # esi <- Source\r
- movl 12(%esp), %edi # edi <- Destination\r
- movl 20(%esp), %edx # edx <- Count\r
- leal -1(%esi,%edx,), %eax # eax <- End of Source\r
- cmpl %edi, %esi\r
- jae L0\r
- cmpl %edi, %eax # Overlapped?\r
- jae L_CopyBackward # Copy backward if overlapped\r
-L0:\r
- xorl %ecx, %ecx\r
- subl %edi, %ecx\r
- andl $15, %ecx # ecx + edi aligns on 16-byte boundary\r
- jz L1\r
- cmpl %edx, %ecx\r
- cmova %edx, %ecx\r
- subl %ecx, %edx # edx <- remaining bytes to copy\r
- rep\r
- movsb\r
-L1:\r
- movl %edx, %ecx\r
- andl $15, %edx\r
- shrl $4, %ecx # ecx <- # of DQwords to copy\r
- jz L_CopyBytes\r
- addl $-16, %esp\r
- movdqu %xmm0, (%esp)\r
-L2:\r
- movdqu (%esi), %xmm0\r
- movntdq %xmm0, (%edi)\r
- addl $16, %esi\r
- addl $16, %edi\r
- loop L2\r
- mfence\r
- movdqu (%esp),%xmm0\r
- addl $16, %esp # stack cleanup\r
- jmp L_CopyBytes\r
-L_CopyBackward:\r
- movl %eax, %esi # esi <- Last byte in Source\r
- leal -1(%edi,%edx,), %edi # edi <- Last byte in Destination\r
- std\r
-L_CopyBytes:\r
- movl %edx, %ecx\r
- rep\r
- movsb\r
- cld\r
- movl 12(%esp), %eax # eax <- Destination as return value\r
- pop %edi\r
- pop %esi\r
- ret\r
+++ /dev/null
-#------------------------------------------------------------------------------\r
-#\r
-# Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>\r
-# This program and the accompanying materials\r
-# are licensed and made available under the terms and conditions of the BSD License\r
-# which accompanies this distribution. The full text of the license may be found at\r
-# http://opensource.org/licenses/bsd-license.php.\r
-#\r
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-#\r
-# Module Name:\r
-#\r
-# ScanMem16.Asm\r
-#\r
-# Abstract:\r
-#\r
-# ScanMem16 function\r
-#\r
-# Notes:\r
-#\r
-# The following BaseMemoryLib instances contain the same copy of this file:\r
-#\r
-# BaseMemoryLibRepStr\r
-# BaseMemoryLibMmx\r
-# BaseMemoryLibSse2\r
-# BaseMemoryLibOptDxe\r
-# BaseMemoryLibOptPei\r
-#\r
-#------------------------------------------------------------------------------\r
-\r
-ASM_GLOBAL ASM_PFX(InternalMemScanMem16)\r
-\r
-#------------------------------------------------------------------------------\r
-# CONST VOID *\r
-# EFIAPI\r
-# InternalMemScanMem16 (\r
-# IN CONST VOID *Buffer,\r
-# IN UINTN Length,\r
-# IN UINT16 Value\r
-# );\r
-#------------------------------------------------------------------------------\r
-ASM_PFX(InternalMemScanMem16):\r
- push %edi\r
- movl 12(%esp), %ecx\r
- movl 8(%esp), %edi\r
- movl 16(%esp), %eax\r
- repne scasw\r
- leal -2(%edi), %eax\r
- cmovnz %ecx, %eax\r
- pop %edi\r
- ret\r
+++ /dev/null
-#------------------------------------------------------------------------------\r
-#\r
-# Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>\r
-# This program and the accompanying materials\r
-# are licensed and made available under the terms and conditions of the BSD License\r
-# which accompanies this distribution. The full text of the license may be found at\r
-# http://opensource.org/licenses/bsd-license.php.\r
-#\r
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-#\r
-# Module Name:\r
-#\r
-# ScanMem32.Asm\r
-#\r
-# Abstract:\r
-#\r
-# ScanMem32 function\r
-#\r
-# Notes:\r
-#\r
-# The following BaseMemoryLib instances contain the same copy of this file:\r
-#\r
-# BaseMemoryLibRepStr\r
-# BaseMemoryLibMmx\r
-# BaseMemoryLibSse2\r
-# BaseMemoryLibOptDxe\r
-# BaseMemoryLibOptPei\r
-#\r
-#------------------------------------------------------------------------------\r
-\r
-ASM_GLOBAL ASM_PFX(InternalMemScanMem32)\r
-\r
-#------------------------------------------------------------------------------\r
-# CONST VOID *\r
-# EFIAPI\r
-# InternalMemScanMem32 (\r
-# IN CONST VOID *Buffer,\r
-# IN UINTN Length,\r
-# IN UINT32 Value\r
-# );\r
-#------------------------------------------------------------------------------\r
-ASM_PFX(InternalMemScanMem32):\r
- push %edi\r
- movl 12(%esp), %ecx\r
- movl 8(%esp), %edi\r
- movl 16(%esp), %eax\r
- repne scasl\r
- leal -4(%edi), %eax\r
- cmovnz %ecx, %eax\r
- pop %edi\r
- ret\r
+++ /dev/null
-#------------------------------------------------------------------------------\r
-#\r
-# Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>\r
-# This program and the accompanying materials\r
-# are licensed and made available under the terms and conditions of the BSD License\r
-# which accompanies this distribution. The full text of the license may be found at\r
-# http://opensource.org/licenses/bsd-license.php.\r
-#\r
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-#\r
-# Module Name:\r
-#\r
-# ScanMem64.Asm\r
-#\r
-# Abstract:\r
-#\r
-# ScanMem64 function\r
-#\r
-# Notes:\r
-#\r
-# The following BaseMemoryLib instances contain the same copy of this file:\r
-#\r
-# BaseMemoryLibRepStr\r
-# BaseMemoryLibMmx\r
-# BaseMemoryLibSse2\r
-# BaseMemoryLibOptDxe\r
-# BaseMemoryLibOptPei\r
-#\r
-#------------------------------------------------------------------------------\r
-\r
-ASM_GLOBAL ASM_PFX(InternalMemScanMem64)\r
-\r
-#------------------------------------------------------------------------------\r
-# CONST VOID *\r
-# EFIAPI\r
-# InternalMemScanMem64 (\r
-# IN CONST VOID *Buffer,\r
-# IN UINTN Length,\r
-# IN UINT64 Value\r
-# );\r
-#------------------------------------------------------------------------------\r
-ASM_PFX(InternalMemScanMem64):\r
- push %edi\r
- movl 12(%esp), %ecx\r
- movl 16(%esp), %eax\r
- movl 20(%esp), %edx\r
- movl 8(%esp), %edi\r
-L0:\r
- cmpl (%edi), %eax\r
- leal 8(%edi), %edi\r
- loopne L0\r
- jne L1\r
- cmpl -4(%edi), %edx\r
- jecxz L1\r
- jne L0\r
-L1:\r
- leal -8(%edi), %eax\r
- cmovne %ecx, %eax\r
- pop %edi\r
- ret\r
+++ /dev/null
-#------------------------------------------------------------------------------\r
-#\r
-# Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>\r
-# This program and the accompanying materials\r
-# are licensed and made available under the terms and conditions of the BSD License\r
-# which accompanies this distribution. The full text of the license may be found at\r
-# http://opensource.org/licenses/bsd-license.php.\r
-#\r
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-#\r
-# Module Name:\r
-#\r
-# ScanMem8.Asm\r
-#\r
-# Abstract:\r
-#\r
-# ScanMem8 function\r
-#\r
-# Notes:\r
-#\r
-# The following BaseMemoryLib instances contain the same copy of this file:\r
-#\r
-# BaseMemoryLibRepStr\r
-# BaseMemoryLibMmx\r
-# BaseMemoryLibSse2\r
-# BaseMemoryLibOptDxe\r
-# BaseMemoryLibOptPei\r
-#\r
-#------------------------------------------------------------------------------\r
-\r
-ASM_GLOBAL ASM_PFX(InternalMemScanMem8)\r
-\r
-#------------------------------------------------------------------------------\r
-# CONST VOID *\r
-# EFIAPI\r
-# InternalMemScanMem8 (\r
-# IN CONST VOID *Buffer,\r
-# IN UINTN Length,\r
-# IN UINT8 Value\r
-# );\r
-#------------------------------------------------------------------------------\r
-ASM_PFX(InternalMemScanMem8):\r
- push %edi\r
- movl 12(%esp), %ecx\r
- movl 8(%esp), %edi\r
- movb 16(%esp), %al\r
- repne scasb\r
- leal -1(%edi), %eax\r
- cmovnz %ecx, %eax\r
- pop %edi\r
- ret\r
+++ /dev/null
-#------------------------------------------------------------------------------\r
-#\r
-# Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>\r
-# This program and the accompanying materials\r
-# are licensed and made available under the terms and conditions of the BSD License\r
-# which accompanies this distribution. The full text of the license may be found at\r
-# http://opensource.org/licenses/bsd-license.php.\r
-#\r
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-#\r
-# Module Name:\r
-#\r
-# SetMem.asm\r
-#\r
-# Abstract:\r
-#\r
-# SetMem function\r
-#\r
-# Notes:\r
-#\r
-#------------------------------------------------------------------------------\r
-\r
-\r
- #.MODEL flat,C\r
- .xmm:\r
- .code:\r
-\r
-#------------------------------------------------------------------------------\r
-# VOID *\r
-# _mem_SetMem (\r
-# IN VOID *Buffer,\r
-# IN UINTN Count,\r
-# IN UINT8 Value\r
-# );\r
-#------------------------------------------------------------------------------\r
-ASM_GLOBAL ASM_PFX(InternalMemSetMem)\r
-ASM_PFX(InternalMemSetMem):\r
- push %edi\r
- movl 12(%esp), %edx # edx <- Count\r
- movl 8(%esp), %edi # edi <- Buffer\r
- movb 16(%esp), %al # al <- Value\r
- xorl %ecx, %ecx\r
- subl %edi, %ecx\r
- andl $15, %ecx # ecx + edi aligns on 16-byte boundary\r
- jz L0\r
- cmpl %edx, %ecx\r
- cmova %edx, %ecx\r
- subl %ecx, %edx\r
- rep\r
- stosb\r
-L0:\r
- movl %edx, %ecx\r
- andl $15, %edx\r
- shrl $4, %ecx # ecx <- # of DQwords to set\r
- jz L_SetBytes\r
- movb %al, %ah # ax <- Value | (Value << 8)\r
- addl $-16, %esp\r
- movdqu %xmm0, (%esp)\r
- movd %eax, %xmm0\r
- pshuflw $0, %xmm0, %xmm0\r
- movlhps %xmm0, %xmm0\r
-L1:\r
- movntdq %xmm0, (%edi)\r
- addl $16, %edi\r
- loop L1\r
- mfence\r
- movdqu (%esp), %xmm0\r
- addl $16, %esp # stack cleanup\r
-L_SetBytes:\r
- movl %edx, %ecx\r
- rep\r
- stosb\r
- movl 8(%esp), %eax # eax <- Buffer as return value\r
- pop %edi\r
- ret\r
+++ /dev/null
-#------------------------------------------------------------------------------\r
-#\r
-# Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>\r
-# This program and the accompanying materials\r
-# are licensed and made available under the terms and conditions of the BSD License\r
-# which accompanies this distribution. The full text of the license may be found at\r
-# http://opensource.org/licenses/bsd-license.php.\r
-#\r
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-#\r
-# Module Name:\r
-#\r
-# SetMem16.asm\r
-#\r
-# Abstract:\r
-#\r
-# SetMem16 function\r
-#\r
-# Notes:\r
-#\r
-#------------------------------------------------------------------------------\r
-\r
-ASM_GLOBAL ASM_PFX(InternalMemSetMem16)\r
-\r
-#------------------------------------------------------------------------------\r
-# VOID *\r
-# EFIAPI\r
-# InternalMemSetMem16 (\r
-# IN VOID *Buffer,\r
-# IN UINTN Count,\r
-# IN UINT16 Value\r
-# )\r
-#------------------------------------------------------------------------------\r
-ASM_PFX(InternalMemSetMem16):\r
- push %edi\r
- movl 12(%esp), %edx\r
- movl 8(%esp), %edi\r
- xorl %ecx, %ecx\r
- subl %edi, %ecx\r
- andl $15, %ecx # ecx + edi aligns on 16-byte boundary\r
- movl 16(%esp), %eax\r
- jz L0\r
- shrl %ecx\r
- cmpl %edx, %ecx\r
- cmova %edx, %ecx\r
- subl %ecx, %edx\r
- rep\r
- stosw\r
-L0:\r
- movl %edx, %ecx\r
- andl $7, %edx\r
- shrl $3, %ecx\r
- jz L_SetWords\r
- movd %eax, %xmm0\r
- pshuflw $0, %xmm0, %xmm0\r
- movlhps %xmm0, %xmm0\r
-L1:\r
- movntdq %xmm0, (%edi)\r
- addl $16, %edi\r
- loop L1\r
- mfence\r
-L_SetWords:\r
- movl %edx, %ecx\r
- rep\r
- stosw\r
- movl 8(%esp), %eax\r
- pop %edi\r
- ret\r
+++ /dev/null
-#------------------------------------------------------------------------------\r
-#\r
-# Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>\r
-# This program and the accompanying materials\r
-# are licensed and made available under the terms and conditions of the BSD License\r
-# which accompanies this distribution. The full text of the license may be found at\r
-# http://opensource.org/licenses/bsd-license.php.\r
-#\r
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-#\r
-# Module Name:\r
-#\r
-# SetMem32.asm\r
-#\r
-# Abstract:\r
-#\r
-# SetMem32 function\r
-#\r
-# Notes:\r
-#\r
-#------------------------------------------------------------------------------\r
-\r
-ASM_GLOBAL ASM_PFX(InternalMemSetMem32)\r
-\r
-#------------------------------------------------------------------------------\r
-# VOID *\r
-# EFIAPI\r
-# InternalMemSetMem32 (\r
-# IN VOID *Buffer,\r
-# IN UINTN Count,\r
-# IN UINT32 Value\r
-# );\r
-#------------------------------------------------------------------------------\r
-ASM_PFX(InternalMemSetMem32):\r
- push %edi\r
- movl 12(%esp), %edx\r
- movl 8(%esp), %edi\r
- xorl %ecx, %ecx\r
- subl %edi, %ecx\r
- andl $15, %ecx # ecx + edi aligns on 16-byte boundary\r
- movl 16(%esp), %eax\r
- jz L0\r
- shrl $2, %ecx\r
- cmpl %edx, %ecx\r
- cmova %edx, %ecx\r
- subl %ecx, %edx\r
- rep\r
- stosl\r
-L0:\r
- movl %edx, %ecx\r
- andl $3, %edx\r
- shrl $2, %ecx\r
- jz L_SetDwords\r
- movd %eax, %xmm0\r
- pshufd $0, %xmm0, %xmm0\r
-L1:\r
- movntdq %xmm0, (%edi)\r
- addl $16, %edi\r
- loop L1\r
- mfence\r
-L_SetDwords:\r
- movl %edx, %ecx\r
- rep\r
- stosl\r
- movl 8(%esp), %eax\r
- pop %edi\r
- ret\r
+++ /dev/null
-#------------------------------------------------------------------------------\r
-#\r
-# Copyright (c) 2006, Intel Corporation. All rights reserved.<BR>\r
-# This program and the accompanying materials\r
-# are licensed and made available under the terms and conditions of the BSD License\r
-# which accompanies this distribution. The full text of the license may be found at\r
-# http://opensource.org/licenses/bsd-license.php.\r
-#\r
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-#\r
-# Module Name:\r
-#\r
-# SetMem64.S\r
-#\r
-# Abstract:\r
-#\r
-# SetMem64 function\r
-#\r
-# Notes:\r
-#\r
-#------------------------------------------------------------------------------\r
-\r
-ASM_GLOBAL ASM_PFX(InternalMemSetMem64)\r
-\r
-#------------------------------------------------------------------------------\r
-# VOID *\r
-# EFIAPI\r
-# InternalMemSetMem64 (\r
-# IN VOID *Buffer,\r
-# IN UINTN Count,\r
-# IN UINT64 Value\r
-# );\r
-#------------------------------------------------------------------------------\r
-ASM_PFX(InternalMemSetMem64):\r
- movl 4(%esp), %eax\r
- movl 8(%esp), %ecx\r
- testb $8, %al\r
- movl %eax, %edx\r
- movq 0xc(%esp), %xmm0\r
- jz L1\r
- movq %xmm0, (%edx)\r
- addl $8, %edx\r
- decl %ecx\r
-L1:\r
- shrl %ecx\r
- jz L_SetQwords\r
- movlhps %xmm0, %xmm0\r
-L2:\r
- movntdq %xmm0, (%edx)\r
- leal 16(%edx), %edx\r
- loop L2\r
- mfence\r
-L_SetQwords:\r
- jnc L3\r
- movq %xmm0, (%edx)\r
-L3:\r
- ret\r
+++ /dev/null
-#------------------------------------------------------------------------------\r
-#\r
-# Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>\r
-# This program and the accompanying materials\r
-# are licensed and made available under the terms and conditions of the BSD License\r
-# which accompanies this distribution. The full text of the license may be found at\r
-# http://opensource.org/licenses/bsd-license.php.\r
-#\r
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-#\r
-# Module Name:\r
-#\r
-# ZeroMem.asm\r
-#\r
-# Abstract:\r
-#\r
-# ZeroMem function\r
-#\r
-# Notes:\r
-#\r
-#------------------------------------------------------------------------------\r
-\r
-ASM_GLOBAL ASM_PFX(InternalMemZeroMem)\r
-\r
-#------------------------------------------------------------------------------\r
-# VOID *\r
-# EFIAPI\r
-# InternalMemZeroMem (\r
-# IN VOID *Buffer,\r
-# IN UINTN Count\r
-# );\r
-#------------------------------------------------------------------------------\r
-ASM_PFX(InternalMemZeroMem):\r
- push %edi\r
- movl 8(%esp), %edi\r
- movl 12(%esp), %edx\r
- xorl %ecx, %ecx\r
- subl %edi, %ecx\r
- xorl %eax, %eax\r
- andl $15, %ecx\r
- jz L0\r
- cmpl %edx, %ecx\r
- cmova %edx, %ecx\r
- subl %ecx, %edx\r
- rep\r
- stosb\r
-L0:\r
- movl %edx, %ecx\r
- andl $15, %edx\r
- shrl $4, %ecx\r
- jz L_ZeroBytes\r
- pxor %xmm0, %xmm0\r
-L1:\r
- movntdq %xmm0, (%edi)\r
- addl $16, %edi\r
- loop L1\r
- mfence\r
-L_ZeroBytes:\r
- movl %edx, %ecx\r
- rep\r
- stosb\r
- movl 8(%esp), %eax\r
- pop %edi\r
- ret\r
+++ /dev/null
-#\r
-# ConvertAsm.py: Automatically generated from CompareMem.asm\r
-#\r
-#------------------------------------------------------------------------------\r
-#\r
-# Copyright (c) 2006 - 2009, Intel Corporation. All rights reserved.<BR>\r
-# This program and the accompanying materials\r
-# are licensed and made available under the terms and conditions of the BSD License\r
-# which accompanies this distribution. The full text of the license may be found at\r
-# http://opensource.org/licenses/bsd-license.php.\r
-#\r
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-#\r
-# Module Name:\r
-#\r
-# CompareMem.S\r
-#\r
-# Abstract:\r
-#\r
-# CompareMem function\r
-#\r
-# Notes:\r
-#\r
-# The following BaseMemoryLib instances contain the same copy of this file:\r
-#\r
-# BaseMemoryLibRepStr\r
-# BaseMemoryLibMmx\r
-# BaseMemoryLibSse2\r
-# BaseMemoryLibOptDxe\r
-# BaseMemoryLibOptPei\r
-#\r
-#------------------------------------------------------------------------------\r
-\r
-\r
-#------------------------------------------------------------------------------\r
-# INTN\r
-# EFIAPI\r
-# InternalMemCompareMem (\r
-# IN CONST VOID *DestinationBuffer,\r
-# IN CONST VOID *SourceBuffer,\r
-# IN UINTN Length\r
-# );\r
-#------------------------------------------------------------------------------\r
-ASM_GLOBAL ASM_PFX(InternalMemCompareMem)\r
-ASM_PFX(InternalMemCompareMem):\r
- pushq %rsi\r
- pushq %rdi\r
- movq %rcx, %rsi\r
- movq %rdx, %rdi\r
- movq %r8, %rcx\r
- repe cmpsb\r
- movzbq -1(%rsi) , %rax\r
- movzbq -1(%rdi) , %rdx\r
- subq %rdx, %rax\r
- popq %rdi\r
- popq %rsi\r
- ret\r
-\r
+++ /dev/null
-#\r
-# ConvertAsm.py: Automatically generated from CopyMem.asm\r
-#\r
-#------------------------------------------------------------------------------\r
-#\r
-# Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>\r
-# This program and the accompanying materials\r
-# are licensed and made available under the terms and conditions of the BSD License\r
-# which accompanies this distribution. The full text of the license may be found at\r
-# http://opensource.org/licenses/bsd-license.php.\r
-#\r
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-#\r
-# Module Name:\r
-#\r
-# CopyMem.S\r
-#\r
-# Abstract:\r
-#\r
-# CopyMem function\r
-#\r
-# Notes:\r
-#\r
-#------------------------------------------------------------------------------\r
-\r
-\r
-#------------------------------------------------------------------------------\r
-# VOID *\r
-# EFIAPI\r
-# InternalMemCopyMem (\r
-# IN VOID *Destination,\r
-# IN VOID *Source,\r
-# IN UINTN Count\r
-# )\r
-#------------------------------------------------------------------------------\r
-ASM_GLOBAL ASM_PFX(InternalMemCopyMem)\r
-ASM_PFX(InternalMemCopyMem):\r
- pushq %rsi\r
- pushq %rdi\r
- movq %rdx, %rsi # rsi <- Source\r
- movq %rcx, %rdi # rdi <- Destination\r
- leaq -1(%rsi, %r8,), %r9 # r9 <- Last byte of Source\r
- cmpq %rdi, %rsi\r
- movq %rdi, %rax # rax <- Destination as return value\r
- jae L0 # Copy forward if Source > Destination\r
- cmpq %rdi, %r9 # Overlapped?\r
- jae L_CopyBackward # Copy backward if overlapped\r
-L0:\r
- xorq %rcx, %rcx\r
- subq %rdi, %rcx # rcx <- -rdi\r
- andq $15, %rcx # rcx + rsi should be 16 bytes aligned\r
- jz L1 # skip if rcx == 0\r
- cmpq %r8, %rcx\r
- cmova %r8, %rcx\r
- subq %rcx, %r8\r
- rep movsb\r
-L1:\r
- movq %r8, %rcx\r
- andq $15, %r8\r
- shrq $4, %rcx # rcx <- # of DQwords to copy\r
- jz L_CopyBytes\r
- movdqa %xmm0, 0x18(%rsp) # save xmm0 on stack\r
-L2:\r
- movdqu (%rsi), %xmm0 # rsi may not be 16-byte aligned\r
- movntdq %xmm0, (%rdi) # rdi should be 16-byte aligned\r
- addq $16, %rsi\r
- addq $16, %rdi\r
- loop L2\r
- mfence\r
- movdqa 0x18(%rsp), %xmm0 # restore xmm0\r
- jmp L_CopyBytes # copy remaining bytes\r
-L_CopyBackward:\r
- movq %r9, %rsi # rsi <- Last byte of Source\r
- leaq -1(%rdi, %r8,), %rdi # rdi <- Last byte of Destination\r
- std\r
-L_CopyBytes:\r
- movq %r8, %rcx\r
- rep movsb\r
- cld\r
- popq %rdi\r
- popq %rsi\r
- ret\r
+++ /dev/null
-#\r
-# ConvertAsm.py: Automatically generated from ScanMem16.asm\r
-#\r
-#------------------------------------------------------------------------------\r
-#\r
-# Copyright (c) 2006 - 2009, Intel Corporation. All rights reserved.<BR>\r
-# This program and the accompanying materials\r
-# are licensed and made available under the terms and conditions of the BSD License\r
-# which accompanies this distribution. The full text of the license may be found at\r
-# http://opensource.org/licenses/bsd-license.php.\r
-#\r
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-#\r
-# Module Name:\r
-#\r
-# ScanMem16.S\r
-#\r
-# Abstract:\r
-#\r
-# ScanMem16 function\r
-#\r
-# Notes:\r
-#\r
-# The following BaseMemoryLib instances contain the same copy of this file:\r
-#\r
-# BaseMemoryLibRepStr\r
-# BaseMemoryLibMmx\r
-# BaseMemoryLibSse2\r
-# BaseMemoryLibOptDxe\r
-# BaseMemoryLibOptPei\r
-#\r
-#------------------------------------------------------------------------------\r
-\r
-\r
-#------------------------------------------------------------------------------\r
-# CONST VOID *\r
-# EFIAPI\r
-# InternalMemScanMem16 (\r
-# IN CONST VOID *Buffer,\r
-# IN UINTN Length,\r
-# IN UINT16 Value\r
-# );\r
-#------------------------------------------------------------------------------\r
-ASM_GLOBAL ASM_PFX(InternalMemScanMem16)\r
-ASM_PFX(InternalMemScanMem16):\r
- pushq %rdi\r
- movq %rcx, %rdi\r
- movq %rdx, %rcx\r
- movq %r8, %rax\r
- repne scasw\r
- leaq -2(%rdi), %rax\r
- cmovnz %rcx, %rax # set rax to 0 if not found\r
- popq %rdi\r
- ret\r
-\r
+++ /dev/null
-#\r
-# ConvertAsm.py: Automatically generated from ScanMem32.asm\r
-#\r
-#------------------------------------------------------------------------------\r
-#\r
-# Copyright (c) 2006 - 2009, Intel Corporation. All rights reserved.<BR>\r
-# This program and the accompanying materials\r
-# are licensed and made available under the terms and conditions of the BSD License\r
-# which accompanies this distribution. The full text of the license may be found at\r
-# http://opensource.org/licenses/bsd-license.php.\r
-#\r
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-#\r
-# Module Name:\r
-#\r
-# ScanMem32.S\r
-#\r
-# Abstract:\r
-#\r
-# ScanMem32 function\r
-#\r
-# Notes:\r
-#\r
-# The following BaseMemoryLib instances contain the same copy of this file:\r
-#\r
-# BaseMemoryLibRepStr\r
-# BaseMemoryLibMmx\r
-# BaseMemoryLibSse2\r
-# BaseMemoryLibOptDxe\r
-# BaseMemoryLibOptPei\r
-#\r
-#------------------------------------------------------------------------------\r
-\r
-\r
-#------------------------------------------------------------------------------\r
-# CONST VOID *\r
-# EFIAPI\r
-# InternalMemScanMem32 (\r
-# IN CONST VOID *Buffer,\r
-# IN UINTN Length,\r
-# IN UINT32 Value\r
-# );\r
-#------------------------------------------------------------------------------\r
-ASM_GLOBAL ASM_PFX(InternalMemScanMem32)\r
-ASM_PFX(InternalMemScanMem32):\r
- pushq %rdi\r
- movq %rcx, %rdi\r
- movq %rdx, %rcx\r
- movq %r8, %rax\r
- repne scasl\r
- leaq -4(%rdi), %rax\r
- cmovnz %rcx, %rax # set rax to 0 if not found\r
- popq %rdi\r
- ret\r
-\r
+++ /dev/null
-#\r
-# ConvertAsm.py: Automatically generated from ScanMem64.asm\r
-#\r
-#------------------------------------------------------------------------------\r
-#\r
-# Copyright (c) 2006 - 2009, Intel Corporation. All rights reserved.<BR>\r
-# This program and the accompanying materials\r
-# are licensed and made available under the terms and conditions of the BSD License\r
-# which accompanies this distribution. The full text of the license may be found at\r
-# http://opensource.org/licenses/bsd-license.php.\r
-#\r
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-#\r
-# Module Name:\r
-#\r
-# ScanMem64.S\r
-#\r
-# Abstract:\r
-#\r
-# ScanMem64 function\r
-#\r
-# Notes:\r
-#\r
-# The following BaseMemoryLib instances contain the same copy of this file:\r
-#\r
-# BaseMemoryLibRepStr\r
-# BaseMemoryLibMmx\r
-# BaseMemoryLibSse2\r
-# BaseMemoryLibOptDxe\r
-# BaseMemoryLibOptPei\r
-#\r
-#------------------------------------------------------------------------------\r
-\r
-\r
-#------------------------------------------------------------------------------\r
-# CONST VOID *\r
-# EFIAPI\r
-# InternalMemScanMem64 (\r
-# IN CONST VOID *Buffer,\r
-# IN UINTN Length,\r
-# IN UINT64 Value\r
-# );\r
-#------------------------------------------------------------------------------\r
-ASM_GLOBAL ASM_PFX(InternalMemScanMem64)\r
-ASM_PFX(InternalMemScanMem64):\r
- pushq %rdi\r
- movq %rcx, %rdi\r
- movq %rdx, %rcx\r
- movq %r8, %rax\r
- repne scasq\r
- leaq -8(%rdi), %rax\r
- cmovnz %rcx, %rax # set rax to 0 if not found\r
- popq %rdi\r
- ret\r
-\r
+++ /dev/null
-#\r
-# ConvertAsm.py: Automatically generated from ScanMem8.asm\r
-#\r
-#------------------------------------------------------------------------------\r
-#\r
-# Copyright (c) 2006 - 2009, Intel Corporation. All rights reserved.<BR>\r
-# This program and the accompanying materials\r
-# are licensed and made available under the terms and conditions of the BSD License\r
-# which accompanies this distribution. The full text of the license may be found at\r
-# http://opensource.org/licenses/bsd-license.php.\r
-#\r
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-#\r
-# Module Name:\r
-#\r
-# ScanMem8.S\r
-#\r
-# Abstract:\r
-#\r
-# ScanMem8 function\r
-#\r
-# Notes:\r
-#\r
-# The following BaseMemoryLib instances contain the same copy of this file:\r
-#\r
-# BaseMemoryLibRepStr\r
-# BaseMemoryLibMmx\r
-# BaseMemoryLibSse2\r
-# BaseMemoryLibOptDxe\r
-# BaseMemoryLibOptPei\r
-#\r
-#------------------------------------------------------------------------------\r
-\r
-\r
-#------------------------------------------------------------------------------\r
-# CONST VOID *\r
-# EFIAPI\r
-# InternalMemScanMem8 (\r
-# IN CONST VOID *Buffer,\r
-# IN UINTN Length,\r
-# IN UINT8 Value\r
-# );\r
-#------------------------------------------------------------------------------\r
-ASM_GLOBAL ASM_PFX(InternalMemScanMem8)\r
-ASM_PFX(InternalMemScanMem8):\r
- pushq %rdi\r
- movq %rcx, %rdi\r
- movq %rdx, %rcx\r
- movq %r8, %rax\r
- repne scasb\r
- leaq -1(%rdi), %rax\r
- cmovnz %rcx, %rax # set rax to 0 if not found\r
- popq %rdi\r
- ret\r
-\r
+++ /dev/null
-#\r
-# ConvertAsm.py: Automatically generated from SetMem.asm\r
-#\r
-#------------------------------------------------------------------------------\r
-#\r
-# Copyright (c) 2006 - 2009, Intel Corporation. All rights reserved.<BR>\r
-# This program and the accompanying materials\r
-# are licensed and made available under the terms and conditions of the BSD License\r
-# which accompanies this distribution. The full text of the license may be found at\r
-# http://opensource.org/licenses/bsd-license.php.\r
-#\r
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-#\r
-# Module Name:\r
-#\r
-# SetMem.S\r
-#\r
-# Abstract:\r
-#\r
-# SetMem function\r
-#\r
-# Notes:\r
-#\r
-#------------------------------------------------------------------------------\r
-\r
-\r
-#------------------------------------------------------------------------------\r
-# VOID *\r
-# EFIAPI\r
-# InternalMemSetMem (\r
-# IN VOID *Buffer,\r
-# IN UINTN Count,\r
-# IN UINT8 Value\r
-# )\r
-#------------------------------------------------------------------------------\r
-ASM_GLOBAL ASM_PFX(InternalMemSetMem)\r
-ASM_PFX(InternalMemSetMem):\r
- pushq %rdi\r
- movq %rcx, %rdi # rdi <- Buffer\r
- movb %r8b, %al # al <- Value\r
- movq %rdi, %r9 # r9 <- Buffer as return value\r
- xorq %rcx, %rcx\r
- subq %rdi, %rcx\r
- andq $15, %rcx # rcx + rdi aligns on 16-byte boundary\r
- jz L0\r
- cmpq %rdx, %rcx\r
- cmova %rdx, %rcx\r
- subq %rcx, %rdx\r
- rep stosb\r
-L0:\r
- movq %rdx, %rcx\r
- andq $15, %rdx\r
- shrq $4, %rcx\r
- jz L_SetBytes\r
- movb %al, %ah # ax <- Value repeats twice\r
- movdqa %xmm0, 0x10(%rsp) # save xmm0\r
- movd %eax, %xmm0 # xmm0[0..16] <- Value repeats twice\r
- pshuflw $0, %xmm0, %xmm0 # xmm0[0..63] <- Value repeats 8 times\r
- movlhps %xmm0, %xmm0 # xmm0 <- Value repeats 16 times\r
-L1:\r
- movntdq %xmm0, (%rdi) # rdi should be 16-byte aligned\r
- add $16, %rdi\r
- loop L1\r
- mfence\r
- movdqa 0x10(%rsp), %xmm0 # restore xmm0\r
-L_SetBytes:\r
- movl %edx, %ecx # high 32 bits of rcx are always zero\r
- rep stosb\r
- movq %r9, %rax # rax <- Return value\r
- popq %rdi\r
- ret\r
+++ /dev/null
-#\r
-# ConvertAsm.py: Automatically generated from SetMem16.asm\r
-#\r
-#------------------------------------------------------------------------------\r
-#\r
-# Copyright (c) 2006 - 2009, Intel Corporation. All rights reserved.<BR>\r
-# This program and the accompanying materials\r
-# are licensed and made available under the terms and conditions of the BSD License\r
-# which accompanies this distribution. The full text of the license may be found at\r
-# http://opensource.org/licenses/bsd-license.php.\r
-#\r
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-#\r
-# Module Name:\r
-#\r
-# SetMem16.S\r
-#\r
-# Abstract:\r
-#\r
-# SetMem16 function\r
-#\r
-# Notes:\r
-#\r
-#------------------------------------------------------------------------------\r
-\r
-\r
-#------------------------------------------------------------------------------\r
-# VOID *\r
-# EFIAPI\r
-# InternalMemSetMem16 (\r
-# IN VOID *Buffer,\r
-# IN UINTN Count,\r
-# IN UINT16 Value\r
-# )\r
-#------------------------------------------------------------------------------\r
-ASM_GLOBAL ASM_PFX(InternalMemSetMem16)\r
-ASM_PFX(InternalMemSetMem16):\r
- pushq %rdi\r
- movq %rcx, %rdi\r
- movq %rdi, %r9\r
- xorq %rcx, %rcx\r
- subq %rdi, %rcx\r
- andq $15, %rcx\r
- movq %r8, %rax\r
- jz L0\r
- shrq $1, %rcx\r
- cmpq %rdx, %rcx\r
- cmova %rdx, %rcx\r
- subq %rcx, %rdx\r
- rep stosw\r
-L0:\r
- movq %rdx, %rcx\r
- andl $7, %edx\r
- shrq $3, %rcx\r
- jz L_SetWords\r
- movd %eax, %xmm0\r
- pshuflw $0, %xmm0, %xmm0\r
- movlhps %xmm0, %xmm0\r
-L1:\r
- movntdq %xmm0, (%rdi)\r
- addq $16, %rdi\r
- loop L1\r
- mfence\r
-L_SetWords:\r
- movl %edx, %ecx\r
- rep stosw\r
- movq %r9, %rax\r
- popq %rdi\r
- ret\r
+++ /dev/null
-#\r
-# ConvertAsm.py: Automatically generated from SetMem32.asm\r
-#\r
-#------------------------------------------------------------------------------\r
-#\r
-# Copyright (c) 2006 - 2009, Intel Corporation. All rights reserved.<BR>\r
-# This program and the accompanying materials\r
-# are licensed and made available under the terms and conditions of the BSD License\r
-# which accompanies this distribution. The full text of the license may be found at\r
-# http://opensource.org/licenses/bsd-license.php.\r
-#\r
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-#\r
-# Module Name:\r
-#\r
-# SetMem32.S\r
-#\r
-# Abstract:\r
-#\r
-# SetMem32 function\r
-#\r
-# Notes:\r
-#\r
-#------------------------------------------------------------------------------\r
-\r
-\r
-#------------------------------------------------------------------------------\r
-# VOID *\r
-# EFIAPI\r
-# InternalMemSetMem32 (\r
-# IN VOID *Buffer,\r
-# IN UINTN Count,\r
-# IN UINT32 Value\r
-# );\r
-#------------------------------------------------------------------------------\r
-ASM_GLOBAL ASM_PFX(InternalMemSetMem32)\r
-ASM_PFX(InternalMemSetMem32):\r
- pushq %rdi\r
- movq %rcx, %rdi\r
- movq %rdi, %r9\r
- xorq %rcx, %rcx\r
- subq %rdi, %rcx\r
- andq $15, %rcx\r
- movq %r8, %rax\r
- jz L0\r
- shrq $2, %rcx\r
- cmpq %rdx, %rcx\r
- cmova %rdx, %rcx\r
- subq %rcx, %rdx\r
- rep stosl\r
-L0:\r
- movq %rdx, %rcx\r
- andl $3, %edx\r
- shrq $2, %rcx\r
- jz L_SetDwords\r
- movd %eax, %xmm0\r
- pshufd $0, %xmm0, %xmm0\r
-L1:\r
- movntdq %xmm0, (%rdi)\r
- addq $16, %rdi\r
- loop L1\r
- mfence\r
-L_SetDwords:\r
- movl %edx, %ecx\r
- rep stosl\r
- movq %r9, %rax\r
- popq %rdi\r
- ret\r
+++ /dev/null
-#\r
-# ConvertAsm.py: Automatically generated from SetMem64.asm\r
-#\r
-#------------------------------------------------------------------------------\r
-#\r
-# Copyright (c) 2006 - 2009, Intel Corporation. All rights reserved.<BR>\r
-# This program and the accompanying materials\r
-# are licensed and made available under the terms and conditions of the BSD License\r
-# which accompanies this distribution. The full text of the license may be found at\r
-# http://opensource.org/licenses/bsd-license.php.\r
-#\r
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-#\r
-# Module Name:\r
-#\r
-# SetMem64.S\r
-#\r
-# Abstract:\r
-#\r
-# SetMem64 function\r
-#\r
-# Notes:\r
-#\r
-#------------------------------------------------------------------------------\r
-\r
-\r
-#------------------------------------------------------------------------------\r
-# VOID *\r
-# InternalMemSetMem64 (\r
-# IN VOID *Buffer,\r
-# IN UINTN Count,\r
-# IN UINT64 Value\r
-# )\r
-#------------------------------------------------------------------------------\r
-ASM_GLOBAL ASM_PFX(InternalMemSetMem64)\r
-ASM_PFX(InternalMemSetMem64):\r
- movq %rcx, %rax # rax <- Buffer\r
- xchgq %rdx, %rcx # rcx <- Count & rdx <- Buffer\r
- testb $8, %dl\r
- movd %r8, %xmm0\r
- jz L0\r
- movq %r8, (%rdx)\r
- addq $8, %rdx\r
- decq %rcx\r
-L0:\r
- shrq $1, %rcx\r
- jz L_SetQwords\r
- movlhps %xmm0, %xmm0\r
-L1:\r
- movntdq %xmm0, (%rdx)\r
- leaq 16(%rdx), %rdx\r
- loop L1\r
- mfence\r
-L_SetQwords:\r
- jnc L2\r
- movq %r8, (%rdx)\r
-L2:\r
- ret\r
-\r
+++ /dev/null
-#\r
-# ConvertAsm.py: Automatically generated from ZeroMem.asm\r
-#\r
-#------------------------------------------------------------------------------\r
-#\r
-# Copyright (c) 2006 - 2009, Intel Corporation. All rights reserved.<BR>\r
-# This program and the accompanying materials\r
-# are licensed and made available under the terms and conditions of the BSD License\r
-# which accompanies this distribution. The full text of the license may be found at\r
-# http://opensource.org/licenses/bsd-license.php.\r
-#\r
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-#\r
-# Module Name:\r
-#\r
-# ZeroMem.S\r
-#\r
-# Abstract:\r
-#\r
-# ZeroMem function\r
-#\r
-# Notes:\r
-#\r
-#------------------------------------------------------------------------------\r
-\r
-\r
-#------------------------------------------------------------------------------\r
-# VOID *\r
-# InternalMemZeroMem (\r
-# IN VOID *Buffer,\r
-# IN UINTN Count\r
-# );\r
-#------------------------------------------------------------------------------\r
-ASM_GLOBAL ASM_PFX(InternalMemZeroMem)\r
-ASM_PFX(InternalMemZeroMem):\r
- pushq %rdi\r
- movq %rcx, %rdi\r
- xorq %rcx, %rcx\r
- xorl %eax, %eax\r
- subq %rdi, %rcx\r
- andq $15, %rcx\r
- movq %rdi, %r8\r
- jz L0\r
- cmpq %rdx, %rcx\r
- cmova %rdx, %rcx\r
- subq %rcx, %rdx\r
- rep stosb\r
-L0:\r
- movq %rdx, %rcx\r
- andl $15, %edx\r
- shrq $4, %rcx\r
- jz L_ZeroBytes\r
- pxor %xmm0, %xmm0\r
-L1:\r
- movntdq %xmm0, (%rdi) # rdi should be 16-byte aligned\r
- addq $16, %rdi\r
- loop L1\r
- mfence\r
-L_ZeroBytes:\r
- movl %edx, %ecx\r
- rep stosb\r
- movq %r8, %rax\r
- popq %rdi\r
- ret\r