\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/SetMem64.nasm\r
- Ia32/SetMem64.S\r
Ia32/SetMem32.nasm\r
- Ia32/SetMem32.S\r
Ia32/SetMem16.nasm\r
- Ia32/SetMem16.S\r
Ia32/ZeroMem.nasm\r
- Ia32/ZeroMem.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/SetMem64.nasm\r
- X64/SetMem64.S\r
X64/SetMem32.nasm\r
- X64/SetMem32.S\r
X64/SetMem16.nasm\r
- X64/SetMem16.S\r
X64/ZeroMem.nasm\r
- X64/ZeroMem.S\r
X64/SetMem.nasm\r
- X64/SetMem.S\r
X64/CopyMem.nasm\r
- X64/CopyMem.S\r
X64/IsZeroBuffer.nasm\r
\r
\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, 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 %esi, %ecx\r
- andl $7, %ecx # ecx + esi aligns on 8-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 $7, %edx\r
- shrl $3, %ecx # ecx <- # of Qwords to copy\r
- jz L_CopyBytes\r
- pushl %eax\r
- pushl %eax\r
- movq %mm0, (%esp) # save mm0\r
-L2:\r
- movq (%esi), %mm0\r
- movq %mm0, (%edi)\r
- addl $8, %esi\r
- addl $8, %edi\r
- loop L2\r
- movq (%esp), %mm0 # restore mm0\r
- popl %ecx # stack cleanup\r
- popl %ecx # 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\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, 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
-ASM_GLOBAL ASM_PFX(InternalMemSetMem)\r
-\r
-#------------------------------------------------------------------------------\r
-# VOID *\r
-# InternalMemSetMem (\r
-# IN VOID *Buffer,\r
-# IN UINTN Count,\r
-# IN UINT8 Value\r
-# )\r
-#------------------------------------------------------------------------------\r
-ASM_PFX(InternalMemSetMem):\r
- push %edi\r
- movb 16(%esp), %al\r
- movb %al, %ah\r
- shrdl $16, %eax, %edx\r
- shldl $16, %edx, %eax\r
- movl 12(%esp), %ecx # ecx <- Count\r
- movl 8(%esp), %edi # edi <- Buffer\r
- movl %ecx, %edx\r
- andl $7, %edx\r
- shrl $3, %ecx # # of Qwords to set\r
- jz L1\r
- addl $-16, %esp\r
- movq %mm0, (%esp) # save mm0\r
- movq %mm1, 8(%esp) # save mm1\r
- movd %eax, %mm0\r
- movd %eax, %mm1\r
- psllq $32, %mm0\r
- por %mm1, %mm0 # fill mm0 with 8 Value's\r
-L0:\r
- movq %mm0, (%edi)\r
- addl $8, %edi\r
- loop L0\r
- movq (%esp), %mm0 # restore mm0\r
- movq 8(%esp), %mm1 # restore mm1\r
- addl $0x10, %esp # stack cleanup\r
-L1:\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, 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
-# InternalMemSetMem16 (\r
-# IN VOID *Buffer,\r
-# IN UINTN Count,\r
-# IN UINT16 Value\r
-# )\r
-#------------------------------------------------------------------------------\r
-ASM_PFX(InternalMemSetMem16):\r
- push %edi\r
- movl 16(%esp), %eax\r
- shrdl $16, %eax, %edx\r
- shldl $16, %edx, %eax\r
- movl 12(%esp), %edx\r
- movl 8(%esp), %edi\r
- movl %edx, %ecx\r
- andl $3, %edx\r
- shrl $2, %ecx\r
- jz L1\r
- movd %eax, %mm0\r
- movd %eax, %mm1\r
- psllq $32, %mm0\r
- por %mm1, %mm0\r
-L0:\r
- movq %mm0, (%edi)\r
- addl $8, %edi\r
- loop L0\r
-L1:\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, 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
-# InternalMemSetMem32 (\r
-# IN VOID *Buffer,\r
-# IN UINTN Count,\r
-# IN UINT32 Value\r
-# )\r
-#------------------------------------------------------------------------------\r
-ASM_PFX(InternalMemSetMem32):\r
- movl 4(%esp), %eax\r
- movl 8(%esp), %ecx\r
- movd 12(%esp), %mm0\r
- shrl %ecx\r
- movl %eax, %edx\r
- jz L1\r
- movq %mm0, %mm1\r
- psllq $32, %mm1\r
- por %mm1, %mm0\r
-L0:\r
- movq %mm0, (%edx)\r
- lea 8(%edx), %edx\r
- loop L0\r
-L1:\r
- jnc L2\r
- movd %mm0, (%edx)\r
-L2:\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.asm\r
-#\r
-# Abstract:\r
-#\r
-# SetMem64 function\r
-#\r
-# Notes:\r
-#\r
-#------------------------------------------------------------------------------\r
-\r
-ASM_GLOBAL ASM_PFX(InternalMemSetMem64)\r
-\r
-#------------------------------------------------------------------------------\r
-# VOID *\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
- movq 12(%esp), %mm0\r
- movl %eax, %edx\r
-L0:\r
- movq %mm0, (%edx)\r
- lea 8(%edx), %edx\r
- loop L0\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
-# 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), %ecx\r
- movl %ecx, %edx\r
- shrl $3, %ecx\r
- jz L_ZeroBytes\r
- pxor %mm0, %mm0\r
-L0:\r
- movq %mm0, (%edi)\r
- addl $8, %edi\r
- loop L0\r
-L_ZeroBytes:\r
- andl $7, %edx\r
- xorl %eax, %eax\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 - 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
-# 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 <- End of Source\r
- cmpq %rdi, %rsi\r
- movq %rdi, %rax # rax <- Destination as return value\r
- jae L0\r
- cmpq %rdi, %r9\r
- jae L_CopyBackward # Copy backward if overlapped\r
-L0:\r
- movq %r8, %rcx\r
- andq $7, %r8\r
- shrq $3, %rcx # rcx <- # of Qwords to copy\r
- jz L_CopyBytes\r
- movd %mm0, %r10 # (Save mm0 in r10)\r
-L1:\r
- movq (%rsi), %mm0\r
- movntq %mm0, (%rdi)\r
- addq $8, %rsi\r
- addq $8, %rdi\r
- loop L1\r
- mfence\r
- movd %r10, %mm0 # (Restore mm0)\r
- jmp L_CopyBytes\r
-L_CopyBackward:\r
- movq %r9, %rsi # rsi <- End of Source\r
- leaq -1(%rdi, %r8,), %rdi # rdi <- End of Destination\r
- std # set direction flag\r
-L_CopyBytes:\r
- movq %r8, %rcx\r
- rep movsb # Copy bytes backward\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 - 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
-# 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 %r8, %rax\r
- movq %rdx, %rcx\r
- repne scasw\r
- leaq -2(%rdi), %rax\r
- cmovnz %rcx, %rax\r
- popq %rdi\r
- ret\r
-\r
+++ /dev/null
-#\r
-# ConvertAsm.py: Automatically generated from ScanMem32.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
-# 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 %r8, %rax\r
- movq %rdx, %rcx\r
- repne scasl\r
- leaq -4(%rdi), %rax\r
- cmovnz %rcx, %rax\r
- popq %rdi\r
- ret\r
-\r
+++ /dev/null
-#\r
-# ConvertAsm.py: Automatically generated from ScanMem64.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
-# 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 %r8, %rax\r
- movq %rdx, %rcx\r
- repne scasq\r
- leaq -8(%rdi), %rax\r
- cmovnz %rcx, %rax\r
- popq %rdi\r
- ret\r
+++ /dev/null
-#\r
-# ConvertAsm.py: Automatically generated from ScanMem8.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
-# 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 - 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
-# 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
- push %rdi\r
- movq %r8, %rax\r
- movb %al, %ah\r
- movd %rax, %mm0\r
- movq %rcx, %r8\r
- movq %r8, %rdi # rdi <- Buffer\r
- movq %rdx, %rcx\r
- andq $7, %rdx\r
- shrq $3, %rcx\r
- jz L_SetBytes\r
- .byte 0x0f, 0x70, 0x0C0, 0x00\r
-L0:\r
- movntq %mm0, (%rdi)\r
- addq $8, %rdi\r
- loop L0\r
- mfence\r
-L_SetBytes:\r
- movl %edx, %ecx\r
- rep stosb\r
- movq %r8, %rax\r
- pop %rdi\r
- ret\r
-\r
+++ /dev/null
-#\r
-# ConvertAsm.py: Automatically generated from SetMem16.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
-# 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 %r8, %rax\r
- movd %rax, %mm0\r
- movq %rcx, %r8\r
- movq %r8, %rdi\r
- movq %rdx, %rcx\r
- andl $3, %edx\r
- shrq $2, %rcx\r
- jz L_SetWords\r
- .byte 0x0f, 0x70, 0x0C0, 0x00\r
-L0:\r
- movntq %mm0, (%rdi)\r
- addq $8, %rdi\r
- loop L0\r
- mfence\r
-L_SetWords:\r
- movl %edx, %ecx\r
- rep stosw\r
- movq %r8, %rax\r
- popq %rdi\r
- ret\r
-\r
+++ /dev/null
-#\r
-# ConvertAsm.py: Automatically generated from SetMem32.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
-# 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
- movd %r8, %mm0 # mm0 <- Value\r
- movq %rcx, %rax # rax <- Buffer\r
- xchgq %rdx, %rcx # rcx <- Count rdx <- Buffer\r
- shrq $1, % rcx # rcx <- # of qwords to set\r
- jz L_SetDwords\r
- .byte 0x0f, 0x70, 0x0C0, 0x44\r
-L0:\r
- movntq %mm0, (%rdx)\r
- leaq 8(%rdx), %rdx # use "lea" to avoid flag changes\r
- loop L0\r
- mfence\r
-L_SetDwords:\r
- jnc L1\r
- movd %mm0, (%rdx)\r
-L1:\r
- ret\r
-\r
+++ /dev/null
-#\r
-# ConvertAsm.py: Automatically generated from SetMem64.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
-# 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
- movd %r8, %mm0 #Value\r
- movq %rcx, %rax #rax <- Buffer\r
- xchg %rdx, %rcx #rcx <- Count\r
-L0:\r
- movntq %mm0, (%rdx)\r
- addq $8, %rdx\r
- loop L0\r
- mfence\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
- movq %rdx, %rcx\r
- movq %rdi, %r8\r
- andq $7, %rdx\r
- shrq $3, %rcx\r
- jz L_ZeroBytes\r
- pxor %mm0, %mm0\r
-L0:\r
- movntq %mm0, (%rdi)\r
- addq $8, %rdi\r
- loop L0\r
- mfence\r
-L_ZeroBytes:\r
- xorl %eax, %eax\r
- movl %edx, %ecx\r
- rep stosb\r
- movq %r8, %rax\r
- popq %rdi\r
- ret\r
-\r