diff options
author | Mitchell Horne <mhorne@FreeBSD.org> | 2020-06-03 18:44:51 +0000 |
---|---|---|
committer | Mitchell Horne <mhorne@FreeBSD.org> | 2020-06-03 18:44:51 +0000 |
commit | 4a14dfcc1110b35118d5be8054fecf59ffb83032 (patch) | |
tree | 8bf1574ccba91c926acbe0a05d32482ba8825e26 /MdePkg/Library/BaseMemoryLibSse2 | |
parent | 0499b37cea9ca98acfe36368e521ad36b7783f2d (diff) | |
download | src-4a14dfcc1110b35118d5be8054fecf59ffb83032.tar.gz src-4a14dfcc1110b35118d5be8054fecf59ffb83032.zip |
Import edk2-stable202005vendor/edk2/ca407c7246bf405da6d9b1b9d93e5e7f17b4b1f9vendor/edk2
As with the previous import, only the MdePkg subdirectory has been
brought in. The line-endings were also converted using:
% find . -type f | xargs -n 1 sed -I.BAK -e `printf "s/\r//g"`
% find . -name \*.BAK | xargs rm
Notes
Notes:
svn path=/vendor/edk2/dist/; revision=361765
svn path=/vendor/edk2/ca407c7246bf405da6d9b1b9d93e5e7f17b4b1f9/; revision=361766; tag=vendor/edk2/ca407c7246bf405da6d9b1b9d93e5e7f17b4b1f9
Diffstat (limited to 'MdePkg/Library/BaseMemoryLibSse2')
84 files changed, 68 insertions, 3130 deletions
diff --git a/MdePkg/Library/BaseMemoryLibSse2/BaseMemoryLibSse2.inf b/MdePkg/Library/BaseMemoryLibSse2/BaseMemoryLibSse2.inf index 726d398637bc..7cb1c276a7bb 100644 --- a/MdePkg/Library/BaseMemoryLibSse2/BaseMemoryLibSse2.inf +++ b/MdePkg/Library/BaseMemoryLibSse2/BaseMemoryLibSse2.inf @@ -3,14 +3,9 @@ # # Base Memory Library that uses SSE2 registers for high performance. # -# Copyright (c) 2007 - 2016, Intel Corporation. All rights reserved.<BR> +# Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.<BR> # -# This program and the accompanying materials -# are licensed and made available under the terms and conditions of the BSD License -# which accompanies this distribution. The full text of the license may be found at -# http://opensource.org/licenses/bsd-license.php. -# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. +# SPDX-License-Identifier: BSD-2-Clause-Patent # # ## @@ -22,7 +17,7 @@ FILE_GUID = 65a18235-5096-4032-8c63-214f0249ce8d MODULE_TYPE = BASE VERSION_STRING = 1.0 - LIBRARY_CLASS = BaseMemoryLib + LIBRARY_CLASS = BaseMemoryLib # @@ -47,96 +42,52 @@ [Sources.Ia32] Ia32/ScanMem64.nasm - Ia32/ScanMem64.S Ia32/ScanMem32.nasm - Ia32/ScanMem32.S Ia32/ScanMem16.nasm - Ia32/ScanMem16.S Ia32/ScanMem8.nasm - Ia32/ScanMem8.S Ia32/CompareMem.nasm - Ia32/CompareMem.S Ia32/ZeroMem.nasm - Ia32/ZeroMem.S Ia32/SetMem64.nasm - Ia32/SetMem64.S Ia32/SetMem32.nasm - Ia32/SetMem32.S Ia32/SetMem16.nasm - Ia32/SetMem16.S Ia32/SetMem.nasm - Ia32/SetMem.S Ia32/CopyMem.nasm - Ia32/CopyMem.S Ia32/ScanMem64.nasm - Ia32/ScanMem64.asm Ia32/ScanMem32.nasm - Ia32/ScanMem32.asm Ia32/ScanMem16.nasm - Ia32/ScanMem16.asm Ia32/ScanMem8.nasm - Ia32/ScanMem8.asm Ia32/CompareMem.nasm - Ia32/CompareMem.asm Ia32/ZeroMem.nasm - Ia32/ZeroMem.asm Ia32/SetMem64.nasm - Ia32/SetMem64.asm Ia32/SetMem32.nasm - Ia32/SetMem32.asm Ia32/SetMem16.nasm - Ia32/SetMem16.asm Ia32/SetMem.nasm - Ia32/SetMem.asm Ia32/CopyMem.nasm - Ia32/CopyMem.asm Ia32/IsZeroBuffer.nasm [Sources.X64] X64/ScanMem64.nasm - X64/ScanMem64.asm X64/ScanMem32.nasm - X64/ScanMem32.asm X64/ScanMem16.nasm - X64/ScanMem16.asm X64/ScanMem8.nasm - X64/ScanMem8.asm X64/CompareMem.nasm - X64/CompareMem.asm X64/ZeroMem.nasm - X64/ZeroMem.asm X64/SetMem64.nasm - X64/SetMem64.asm X64/SetMem32.nasm - X64/SetMem32.asm X64/SetMem16.nasm - X64/SetMem16.asm X64/SetMem.nasm - X64/SetMem.asm X64/CopyMem.nasm - X64/CopyMem.asm X64/ScanMem64.nasm - X64/ScanMem64.S X64/ScanMem32.nasm - X64/ScanMem32.S X64/ScanMem16.nasm - X64/ScanMem16.S X64/ScanMem8.nasm - X64/ScanMem8.S X64/CompareMem.nasm - X64/CompareMem.S X64/ZeroMem.nasm - X64/ZeroMem.S X64/SetMem64.nasm - X64/SetMem64.S X64/SetMem32.nasm - X64/SetMem32.S X64/SetMem16.nasm - X64/SetMem16.S X64/SetMem.nasm - X64/SetMem.S X64/CopyMem.nasm - X64/CopyMem.S X64/IsZeroBuffer.nasm [Packages] diff --git a/MdePkg/Library/BaseMemoryLibSse2/BaseMemoryLibSse2.uni b/MdePkg/Library/BaseMemoryLibSse2/BaseMemoryLibSse2.uni index 70155dc138b0..8060784c4052 100644 --- a/MdePkg/Library/BaseMemoryLibSse2/BaseMemoryLibSse2.uni +++ b/MdePkg/Library/BaseMemoryLibSse2/BaseMemoryLibSse2.uni @@ -5,12 +5,7 @@ // // Copyright (c) 2007 - 2014, Intel Corporation. All rights reserved.<BR> // -// This program and the accompanying materials -// are licensed and made available under the terms and conditions of the BSD License -// which accompanies this distribution. The full text of the license may be found at -// http://opensource.org/licenses/bsd-license.php. -// THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -// WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. +// SPDX-License-Identifier: BSD-2-Clause-Patent // // **/ diff --git a/MdePkg/Library/BaseMemoryLibSse2/CompareMemWrapper.c b/MdePkg/Library/BaseMemoryLibSse2/CompareMemWrapper.c index aa7c2aab812c..c19d2140d2e4 100644 --- a/MdePkg/Library/BaseMemoryLibSse2/CompareMemWrapper.c +++ b/MdePkg/Library/BaseMemoryLibSse2/CompareMemWrapper.c @@ -11,14 +11,8 @@ PeiMemoryLib UefiMemoryLib -Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR> -This program and the accompanying materials -are licensed and made available under the terms and conditions of the BSD License -which accompanies this distribution. The full text of the license may be found at -http://opensource.org/licenses/bsd-license.php. - -THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. +Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR> +SPDX-License-Identifier: BSD-2-Clause-Patent **/ @@ -31,7 +25,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. If all Length bytes of the two buffers are identical, then 0 is returned. Otherwise, the value returned is the first mismatched byte in SourceBuffer subtracted from the first mismatched byte in DestinationBuffer. - + If Length > 0 and DestinationBuffer is NULL, then ASSERT(). If Length > 0 and SourceBuffer is NULL, then ASSERT(). If Length is greater than (MAX_ADDRESS - DestinationBuffer + 1), then ASSERT(). @@ -44,7 +38,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. @return 0 All Length bytes of the two buffers are identical. @retval Non-zero The first mismatched byte in SourceBuffer subtracted from the first mismatched byte in DestinationBuffer. - + **/ INTN EFIAPI diff --git a/MdePkg/Library/BaseMemoryLibSse2/CopyMemWrapper.c b/MdePkg/Library/BaseMemoryLibSse2/CopyMemWrapper.c index f1a97699445d..9db53b0b5732 100644 --- a/MdePkg/Library/BaseMemoryLibSse2/CopyMemWrapper.c +++ b/MdePkg/Library/BaseMemoryLibSse2/CopyMemWrapper.c @@ -2,7 +2,7 @@ CopyMem() implementation. The following BaseMemoryLib instances contain the same copy of this file: - + BaseMemoryLib BaseMemoryLibMmx BaseMemoryLibSse2 @@ -12,14 +12,8 @@ PeiMemoryLib UefiMemoryLib - Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR> - This program and the accompanying materials - are licensed and made available under the terms and conditions of the BSD License - which accompanies this distribution. The full text of the license may be found at - http://opensource.org/licenses/bsd-license.php. - - THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, - WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. + Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR> + SPDX-License-Identifier: BSD-2-Clause-Patent **/ @@ -31,7 +25,7 @@ This function copies Length bytes from SourceBuffer to DestinationBuffer, and returns DestinationBuffer. The implementation must be reentrant, and it must handle the case where SourceBuffer overlaps DestinationBuffer. - + If Length is greater than (MAX_ADDRESS - DestinationBuffer + 1), then ASSERT(). If Length is greater than (MAX_ADDRESS - SourceBuffer + 1), then ASSERT(). diff --git a/MdePkg/Library/BaseMemoryLibSse2/Ia32/CompareMem.S b/MdePkg/Library/BaseMemoryLibSse2/Ia32/CompareMem.S deleted file mode 100644 index 1c9239eb3d09..000000000000 --- a/MdePkg/Library/BaseMemoryLibSse2/Ia32/CompareMem.S +++ /dev/null @@ -1,55 +0,0 @@ -#------------------------------------------------------------------------------ -# -# Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR> -# This program and the accompanying materials -# are licensed and made available under the terms and conditions of the BSD License -# which accompanies this distribution. The full text of the license may be found at -# http://opensource.org/licenses/bsd-license.php. -# -# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. -# -# Module Name: -# -# CompareMem.Asm -# -# Abstract: -# -# CompareMem function -# -# Notes: -# -# The following BaseMemoryLib instances contain the same copy of this file: -# -# BaseMemoryLibRepStr -# BaseMemoryLibMmx -# BaseMemoryLibSse2 -# BaseMemoryLibOptDxe -# BaseMemoryLibOptPei -# -#------------------------------------------------------------------------------ - -ASM_GLOBAL ASM_PFX(InternalMemCompareMem) - -#------------------------------------------------------------------------------ -# INTN -# EFIAPI -# InternalMemCompareMem ( -# IN CONST VOID *DestinationBuffer, -# IN CONST VOID *SourceBuffer, -# IN UINTN Length -# ); -#------------------------------------------------------------------------------ -ASM_PFX(InternalMemCompareMem): - push %esi - push %edi - movl 12(%esp), %esi - movl 16(%esp), %edi - movl 20(%esp), %ecx - repe cmpsb - movzbl -1(%esi), %eax - movzbl -1(%edi), %edx - subl %edx, %eax - pop %edi - pop %esi - ret diff --git a/MdePkg/Library/BaseMemoryLibSse2/Ia32/CompareMem.asm b/MdePkg/Library/BaseMemoryLibSse2/Ia32/CompareMem.asm deleted file mode 100644 index ba31a1875712..000000000000 --- a/MdePkg/Library/BaseMemoryLibSse2/Ia32/CompareMem.asm +++ /dev/null @@ -1,56 +0,0 @@ -;------------------------------------------------------------------------------ -; -; Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR> -; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BSD License -; which accompanies this distribution. The full text of the license may be found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. -; -; Module Name: -; -; CompareMem.Asm -; -; Abstract: -; -; CompareMem function -; -; Notes: -; -; The following BaseMemoryLib instances contain the same copy of this file: -; -; BaseMemoryLibRepStr -; BaseMemoryLibMmx -; BaseMemoryLibSse2 -; BaseMemoryLibOptDxe -; BaseMemoryLibOptPei -; -;------------------------------------------------------------------------------ - - .686 - .model flat,C - .code - -;------------------------------------------------------------------------------ -; INTN -; EFIAPI -; InternalMemCompareMem ( -; IN CONST VOID *DestinationBuffer, -; IN CONST VOID *SourceBuffer, -; IN UINTN Length -; ); -;------------------------------------------------------------------------------ -InternalMemCompareMem PROC USES esi edi - mov esi, [esp + 12] - mov edi, [esp + 16] - mov ecx, [esp + 20] - repe cmpsb - movzx eax, byte ptr [esi - 1] - movzx edx, byte ptr [edi - 1] - sub eax, edx - ret -InternalMemCompareMem ENDP - - END diff --git a/MdePkg/Library/BaseMemoryLibSse2/Ia32/CompareMem.nasm b/MdePkg/Library/BaseMemoryLibSse2/Ia32/CompareMem.nasm index e8d1abdc17fc..e8b51143c52a 100644 --- a/MdePkg/Library/BaseMemoryLibSse2/Ia32/CompareMem.nasm +++ b/MdePkg/Library/BaseMemoryLibSse2/Ia32/CompareMem.nasm @@ -1,13 +1,7 @@ ;------------------------------------------------------------------------------ ; ; Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR> -; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BSD License -; which accompanies this distribution. The full text of the license may be found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. +; SPDX-License-Identifier: BSD-2-Clause-Patent ; ; Module Name: ; diff --git a/MdePkg/Library/BaseMemoryLibSse2/Ia32/CopyMem.S b/MdePkg/Library/BaseMemoryLibSse2/Ia32/CopyMem.S deleted file mode 100644 index 0716182143ee..000000000000 --- a/MdePkg/Library/BaseMemoryLibSse2/Ia32/CopyMem.S +++ /dev/null @@ -1,85 +0,0 @@ -#------------------------------------------------------------------------------ -# -# Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR> -# This program and the accompanying materials -# are licensed and made available under the terms and conditions of the BSD License -# which accompanies this distribution. The full text of the license may be found at -# http://opensource.org/licenses/bsd-license.php. -# -# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. -# -# Module Name: -# -# CopyMem.asm -# -# Abstract: -# -# CopyMem function -# -# Notes: -# -#------------------------------------------------------------------------------ - -ASM_GLOBAL ASM_PFX(InternalMemCopyMem) - -#------------------------------------------------------------------------------ -# VOID * -# EFIAPI -# InternalMemCopyMem ( -# IN VOID *Destination, -# IN VOID *Source, -# IN UINTN Count -# ); -#------------------------------------------------------------------------------ -ASM_PFX(InternalMemCopyMem): - push %esi - push %edi - movl 16(%esp), %esi # esi <- Source - movl 12(%esp), %edi # edi <- Destination - movl 20(%esp), %edx # edx <- Count - leal -1(%esi,%edx,), %eax # eax <- End of Source - cmpl %edi, %esi - jae L0 - cmpl %edi, %eax # Overlapped? - jae L_CopyBackward # Copy backward if overlapped -L0: - xorl %ecx, %ecx - subl %edi, %ecx - andl $15, %ecx # ecx + edi aligns on 16-byte boundary - jz L1 - cmpl %edx, %ecx - cmova %edx, %ecx - subl %ecx, %edx # edx <- remaining bytes to copy - rep - movsb -L1: - movl %edx, %ecx - andl $15, %edx - shrl $4, %ecx # ecx <- # of DQwords to copy - jz L_CopyBytes - addl $-16, %esp - movdqu %xmm0, (%esp) -L2: - movdqu (%esi), %xmm0 - movntdq %xmm0, (%edi) - addl $16, %esi - addl $16, %edi - loop L2 - mfence - movdqu (%esp),%xmm0 - addl $16, %esp # stack cleanup - jmp L_CopyBytes -L_CopyBackward: - movl %eax, %esi # esi <- Last byte in Source - leal -1(%edi,%edx,), %edi # edi <- Last byte in Destination - std -L_CopyBytes: - movl %edx, %ecx - rep - movsb - cld - movl 12(%esp), %eax # eax <- Destination as return value - pop %edi - pop %esi - ret diff --git a/MdePkg/Library/BaseMemoryLibSse2/Ia32/CopyMem.asm b/MdePkg/Library/BaseMemoryLibSse2/Ia32/CopyMem.asm deleted file mode 100644 index 84fad9190d2f..000000000000 --- a/MdePkg/Library/BaseMemoryLibSse2/Ia32/CopyMem.asm +++ /dev/null @@ -1,84 +0,0 @@ -;------------------------------------------------------------------------------ -; -; Copyright (c) 2006, Intel Corporation. All rights reserved.<BR> -; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BSD License -; which accompanies this distribution. The full text of the license may be found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. -; -; Module Name: -; -; CopyMem.asm -; -; Abstract: -; -; CopyMem function -; -; Notes: -; -;------------------------------------------------------------------------------ - - .686 - .model flat,C - .xmm - .code - -;------------------------------------------------------------------------------ -; VOID * -; InternalMemCopyMem ( -; IN VOID *Destination, -; IN VOID *Source, -; IN UINTN Count -; ); -;------------------------------------------------------------------------------ -InternalMemCopyMem PROC USES esi edi - mov esi, [esp + 16] ; esi <- Source - mov edi, [esp + 12] ; edi <- Destination - mov edx, [esp + 20] ; edx <- Count - lea eax, [esi + edx - 1] ; eax <- End of Source - cmp esi, edi - jae @F - cmp eax, edi ; Overlapped? - jae @CopyBackward ; Copy backward if overlapped -@@: - xor ecx, ecx - sub ecx, edi - and ecx, 15 ; ecx + edi aligns on 16-byte boundary - jz @F - cmp ecx, edx - cmova ecx, edx - sub edx, ecx ; edx <- remaining bytes to copy - rep movsb -@@: - mov ecx, edx - and edx, 15 - shr ecx, 4 ; ecx <- # of DQwords to copy - jz @CopyBytes - add esp, -16 - movdqu [esp], xmm0 ; save xmm0 -@@: - movdqu xmm0, [esi] ; esi may not be 16-bytes aligned - movntdq [edi], xmm0 ; edi should be 16-bytes aligned - add esi, 16 - add edi, 16 - loop @B - mfence - movdqu xmm0, [esp] ; restore xmm0 - add esp, 16 ; stack cleanup - jmp @CopyBytes -@CopyBackward: - mov esi, eax ; esi <- Last byte in Source - lea edi, [edi + edx - 1] ; edi <- Last byte in Destination - std -@CopyBytes: - mov ecx, edx - rep movsb - cld - mov eax, [esp + 12] ; eax <- Destination as return value - ret -InternalMemCopyMem ENDP - - END diff --git a/MdePkg/Library/BaseMemoryLibSse2/Ia32/CopyMem.nasm b/MdePkg/Library/BaseMemoryLibSse2/Ia32/CopyMem.nasm index 6913874d3055..d3aaaf0d1ebf 100644 --- a/MdePkg/Library/BaseMemoryLibSse2/Ia32/CopyMem.nasm +++ b/MdePkg/Library/BaseMemoryLibSse2/Ia32/CopyMem.nasm @@ -1,13 +1,7 @@ ;------------------------------------------------------------------------------ ; ; Copyright (c) 2006, Intel Corporation. All rights reserved.<BR> -; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BSD License -; which accompanies this distribution. The full text of the license may be found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. +; SPDX-License-Identifier: BSD-2-Clause-Patent ; ; Module Name: ; diff --git a/MdePkg/Library/BaseMemoryLibSse2/Ia32/IsZeroBuffer.nasm b/MdePkg/Library/BaseMemoryLibSse2/Ia32/IsZeroBuffer.nasm index e09ef850f818..46589105f674 100644 --- a/MdePkg/Library/BaseMemoryLibSse2/Ia32/IsZeroBuffer.nasm +++ b/MdePkg/Library/BaseMemoryLibSse2/Ia32/IsZeroBuffer.nasm @@ -1,13 +1,7 @@ ;------------------------------------------------------------------------------ ; ; Copyright (c) 2016, Intel Corporation. All rights reserved.<BR> -; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BSD License -; which accompanies this distribution. The full text of the license may be found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. +; SPDX-License-Identifier: BSD-2-Clause-Patent ; ; Module Name: ; diff --git a/MdePkg/Library/BaseMemoryLibSse2/Ia32/ScanMem16.S b/MdePkg/Library/BaseMemoryLibSse2/Ia32/ScanMem16.S deleted file mode 100644 index c485543e873e..000000000000 --- a/MdePkg/Library/BaseMemoryLibSse2/Ia32/ScanMem16.S +++ /dev/null @@ -1,52 +0,0 @@ -#------------------------------------------------------------------------------ -# -# Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR> -# This program and the accompanying materials -# are licensed and made available under the terms and conditions of the BSD License -# which accompanies this distribution. The full text of the license may be found at -# http://opensource.org/licenses/bsd-license.php. -# -# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. -# -# Module Name: -# -# ScanMem16.Asm -# -# Abstract: -# -# ScanMem16 function -# -# Notes: -# -# The following BaseMemoryLib instances contain the same copy of this file: -# -# BaseMemoryLibRepStr -# BaseMemoryLibMmx -# BaseMemoryLibSse2 -# BaseMemoryLibOptDxe -# BaseMemoryLibOptPei -# -#------------------------------------------------------------------------------ - -ASM_GLOBAL ASM_PFX(InternalMemScanMem16) - -#------------------------------------------------------------------------------ -# CONST VOID * -# EFIAPI -# InternalMemScanMem16 ( -# IN CONST VOID *Buffer, -# IN UINTN Length, -# IN UINT16 Value -# ); -#------------------------------------------------------------------------------ -ASM_PFX(InternalMemScanMem16): - push %edi - movl 12(%esp), %ecx - movl 8(%esp), %edi - movl 16(%esp), %eax - repne scasw - leal -2(%edi), %eax - cmovnz %ecx, %eax - pop %edi - ret diff --git a/MdePkg/Library/BaseMemoryLibSse2/Ia32/ScanMem16.asm b/MdePkg/Library/BaseMemoryLibSse2/Ia32/ScanMem16.asm deleted file mode 100644 index bca66e02c896..000000000000 --- a/MdePkg/Library/BaseMemoryLibSse2/Ia32/ScanMem16.asm +++ /dev/null @@ -1,55 +0,0 @@ -;------------------------------------------------------------------------------ -; -; Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR> -; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BSD License -; which accompanies this distribution. The full text of the license may be found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. -; -; Module Name: -; -; ScanMem16.Asm -; -; Abstract: -; -; ScanMem16 function -; -; Notes: -; -; The following BaseMemoryLib instances contain the same copy of this file: -; -; BaseMemoryLibRepStr -; BaseMemoryLibMmx -; BaseMemoryLibSse2 -; BaseMemoryLibOptDxe -; BaseMemoryLibOptPei -; -;------------------------------------------------------------------------------ - - .686 - .model flat,C - .code - -;------------------------------------------------------------------------------ -; CONST VOID * -; EFIAPI -; InternalMemScanMem16 ( -; IN CONST VOID *Buffer, -; IN UINTN Length, -; IN UINT16 Value -; ); -;------------------------------------------------------------------------------ -InternalMemScanMem16 PROC USES edi - mov ecx, [esp + 12] - mov edi, [esp + 8] - mov eax, [esp + 16] - repne scasw - lea eax, [edi - 2] - cmovnz eax, ecx - ret -InternalMemScanMem16 ENDP - - END diff --git a/MdePkg/Library/BaseMemoryLibSse2/Ia32/ScanMem16.nasm b/MdePkg/Library/BaseMemoryLibSse2/Ia32/ScanMem16.nasm index 78d9f3071e8c..421742e9e113 100644 --- a/MdePkg/Library/BaseMemoryLibSse2/Ia32/ScanMem16.nasm +++ b/MdePkg/Library/BaseMemoryLibSse2/Ia32/ScanMem16.nasm @@ -1,13 +1,7 @@ ;------------------------------------------------------------------------------ ; ; Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR> -; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BSD License -; which accompanies this distribution. The full text of the license may be found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. +; SPDX-License-Identifier: BSD-2-Clause-Patent ; ; Module Name: ; diff --git a/MdePkg/Library/BaseMemoryLibSse2/Ia32/ScanMem32.S b/MdePkg/Library/BaseMemoryLibSse2/Ia32/ScanMem32.S deleted file mode 100644 index a9b497579442..000000000000 --- a/MdePkg/Library/BaseMemoryLibSse2/Ia32/ScanMem32.S +++ /dev/null @@ -1,52 +0,0 @@ -#------------------------------------------------------------------------------ -# -# Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR> -# This program and the accompanying materials -# are licensed and made available under the terms and conditions of the BSD License -# which accompanies this distribution. The full text of the license may be found at -# http://opensource.org/licenses/bsd-license.php. -# -# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. -# -# Module Name: -# -# ScanMem32.Asm -# -# Abstract: -# -# ScanMem32 function -# -# Notes: -# -# The following BaseMemoryLib instances contain the same copy of this file: -# -# BaseMemoryLibRepStr -# BaseMemoryLibMmx -# BaseMemoryLibSse2 -# BaseMemoryLibOptDxe -# BaseMemoryLibOptPei -# -#------------------------------------------------------------------------------ - -ASM_GLOBAL ASM_PFX(InternalMemScanMem32) - -#------------------------------------------------------------------------------ -# CONST VOID * -# EFIAPI -# InternalMemScanMem32 ( -# IN CONST VOID *Buffer, -# IN UINTN Length, -# IN UINT32 Value -# ); -#------------------------------------------------------------------------------ -ASM_PFX(InternalMemScanMem32): - push %edi - movl 12(%esp), %ecx - movl 8(%esp), %edi - movl 16(%esp), %eax - repne scasl - leal -4(%edi), %eax - cmovnz %ecx, %eax - pop %edi - ret diff --git a/MdePkg/Library/BaseMemoryLibSse2/Ia32/ScanMem32.asm b/MdePkg/Library/BaseMemoryLibSse2/Ia32/ScanMem32.asm deleted file mode 100644 index 8c24bd010953..000000000000 --- a/MdePkg/Library/BaseMemoryLibSse2/Ia32/ScanMem32.asm +++ /dev/null @@ -1,55 +0,0 @@ -;------------------------------------------------------------------------------ -; -; Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR> -; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BSD License -; which accompanies this distribution. The full text of the license may be found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. -; -; Module Name: -; -; ScanMem32.Asm -; -; Abstract: -; -; ScanMem32 function -; -; Notes: -; -; The following BaseMemoryLib instances contain the same copy of this file: -; -; BaseMemoryLibRepStr -; BaseMemoryLibMmx -; BaseMemoryLibSse2 -; BaseMemoryLibOptDxe -; BaseMemoryLibOptPei -; -;------------------------------------------------------------------------------ - - .686 - .model flat,C - .code - -;------------------------------------------------------------------------------ -; CONST VOID * -; EFIAPI -; InternalMemScanMem32 ( -; IN CONST VOID *Buffer, -; IN UINTN Length, -; IN UINT32 Value -; ); -;------------------------------------------------------------------------------ -InternalMemScanMem32 PROC USES edi - mov ecx, [esp + 12] - mov edi, [esp + 8] - mov eax, [esp + 16] - repne scasd - lea eax, [edi - 4] - cmovnz eax, ecx - ret -InternalMemScanMem32 ENDP - - END diff --git a/MdePkg/Library/BaseMemoryLibSse2/Ia32/ScanMem32.nasm b/MdePkg/Library/BaseMemoryLibSse2/Ia32/ScanMem32.nasm index bbacf38a7245..c74f74d03f2e 100644 --- a/MdePkg/Library/BaseMemoryLibSse2/Ia32/ScanMem32.nasm +++ b/MdePkg/Library/BaseMemoryLibSse2/Ia32/ScanMem32.nasm @@ -1,13 +1,7 @@ ;------------------------------------------------------------------------------ ; ; Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR> -; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BSD License -; which accompanies this distribution. The full text of the license may be found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. +; SPDX-License-Identifier: BSD-2-Clause-Patent ; ; Module Name: ; diff --git a/MdePkg/Library/BaseMemoryLibSse2/Ia32/ScanMem64.S b/MdePkg/Library/BaseMemoryLibSse2/Ia32/ScanMem64.S deleted file mode 100644 index e23cf5f5dc28..000000000000 --- a/MdePkg/Library/BaseMemoryLibSse2/Ia32/ScanMem64.S +++ /dev/null @@ -1,61 +0,0 @@ -#------------------------------------------------------------------------------ -# -# Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR> -# This program and the accompanying materials -# are licensed and made available under the terms and conditions of the BSD License -# which accompanies this distribution. The full text of the license may be found at -# http://opensource.org/licenses/bsd-license.php. -# -# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. -# -# Module Name: -# -# ScanMem64.Asm -# -# Abstract: -# -# ScanMem64 function -# -# Notes: -# -# The following BaseMemoryLib instances contain the same copy of this file: -# -# BaseMemoryLibRepStr -# BaseMemoryLibMmx -# BaseMemoryLibSse2 -# BaseMemoryLibOptDxe -# BaseMemoryLibOptPei -# -#------------------------------------------------------------------------------ - -ASM_GLOBAL ASM_PFX(InternalMemScanMem64) - -#------------------------------------------------------------------------------ -# CONST VOID * -# EFIAPI -# InternalMemScanMem64 ( -# IN CONST VOID *Buffer, -# IN UINTN Length, -# IN UINT64 Value -# ); -#------------------------------------------------------------------------------ -ASM_PFX(InternalMemScanMem64): - push %edi - movl 12(%esp), %ecx - movl 16(%esp), %eax - movl 20(%esp), %edx - movl 8(%esp), %edi -L0: - cmpl (%edi), %eax - leal 8(%edi), %edi - loopne L0 - jne L1 - cmpl -4(%edi), %edx - jecxz L1 - jne L0 -L1: - leal -8(%edi), %eax - cmovne %ecx, %eax - pop %edi - ret diff --git a/MdePkg/Library/BaseMemoryLibSse2/Ia32/ScanMem64.asm b/MdePkg/Library/BaseMemoryLibSse2/Ia32/ScanMem64.asm deleted file mode 100644 index c835effc0cea..000000000000 --- a/MdePkg/Library/BaseMemoryLibSse2/Ia32/ScanMem64.asm +++ /dev/null @@ -1,64 +0,0 @@ -;------------------------------------------------------------------------------ -; -; Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR> -; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BSD License -; which accompanies this distribution. The full text of the license may be found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. -; -; Module Name: -; -; ScanMem64.Asm -; -; Abstract: -; -; ScanMem64 function -; -; Notes: -; -; The following BaseMemoryLib instances contain the same copy of this file: -; -; BaseMemoryLibRepStr -; BaseMemoryLibMmx -; BaseMemoryLibSse2 -; BaseMemoryLibOptDxe -; BaseMemoryLibOptPei -; -;------------------------------------------------------------------------------ - - .686 - .model flat,C - .code - -;------------------------------------------------------------------------------ -; CONST VOID * -; EFIAPI -; InternalMemScanMem64 ( -; IN CONST VOID *Buffer, -; IN UINTN Length, -; IN UINT64 Value -; ); -;------------------------------------------------------------------------------ -InternalMemScanMem64 PROC USES edi - mov ecx, [esp + 12] - mov eax, [esp + 16] - mov edx, [esp + 20] - mov edi, [esp + 8] -@@: - cmp eax, [edi] - lea edi, [edi + 8] - loopne @B - jne @F - cmp edx, [edi - 4] - jecxz @F - jne @B -@@: - lea eax, [edi - 8] - cmovne eax, ecx - ret -InternalMemScanMem64 ENDP - - END diff --git a/MdePkg/Library/BaseMemoryLibSse2/Ia32/ScanMem64.nasm b/MdePkg/Library/BaseMemoryLibSse2/Ia32/ScanMem64.nasm index e994d4ac437a..ed72af5cef21 100644 --- a/MdePkg/Library/BaseMemoryLibSse2/Ia32/ScanMem64.nasm +++ b/MdePkg/Library/BaseMemoryLibSse2/Ia32/ScanMem64.nasm @@ -1,13 +1,7 @@ ;------------------------------------------------------------------------------ ; ; Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR> -; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BSD License -; which accompanies this distribution. The full text of the license may be found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. +; SPDX-License-Identifier: BSD-2-Clause-Patent ; ; Module Name: ; diff --git a/MdePkg/Library/BaseMemoryLibSse2/Ia32/ScanMem8.S b/MdePkg/Library/BaseMemoryLibSse2/Ia32/ScanMem8.S deleted file mode 100644 index afefaab917ea..000000000000 --- a/MdePkg/Library/BaseMemoryLibSse2/Ia32/ScanMem8.S +++ /dev/null @@ -1,52 +0,0 @@ -#------------------------------------------------------------------------------ -# -# Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR> -# This program and the accompanying materials -# are licensed and made available under the terms and conditions of the BSD License -# which accompanies this distribution. The full text of the license may be found at -# http://opensource.org/licenses/bsd-license.php. -# -# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. -# -# Module Name: -# -# ScanMem8.Asm -# -# Abstract: -# -# ScanMem8 function -# -# Notes: -# -# The following BaseMemoryLib instances contain the same copy of this file: -# -# BaseMemoryLibRepStr -# BaseMemoryLibMmx -# BaseMemoryLibSse2 -# BaseMemoryLibOptDxe -# BaseMemoryLibOptPei -# -#------------------------------------------------------------------------------ - -ASM_GLOBAL ASM_PFX(InternalMemScanMem8) - -#------------------------------------------------------------------------------ -# CONST VOID * -# EFIAPI -# InternalMemScanMem8 ( -# IN CONST VOID *Buffer, -# IN UINTN Length, -# IN UINT8 Value -# ); -#------------------------------------------------------------------------------ -ASM_PFX(InternalMemScanMem8): - push %edi - movl 12(%esp), %ecx - movl 8(%esp), %edi - movb 16(%esp), %al - repne scasb - leal -1(%edi), %eax - cmovnz %ecx, %eax - pop %edi - ret diff --git a/MdePkg/Library/BaseMemoryLibSse2/Ia32/ScanMem8.asm b/MdePkg/Library/BaseMemoryLibSse2/Ia32/ScanMem8.asm deleted file mode 100644 index f199bb957a6c..000000000000 --- a/MdePkg/Library/BaseMemoryLibSse2/Ia32/ScanMem8.asm +++ /dev/null @@ -1,55 +0,0 @@ -;------------------------------------------------------------------------------ -; -; Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR> -; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BSD License -; which accompanies this distribution. The full text of the license may be found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. -; -; Module Name: -; -; ScanMem8.Asm -; -; Abstract: -; -; ScanMem8 function -; -; Notes: -; -; The following BaseMemoryLib instances contain the same copy of this file: -; -; BaseMemoryLibRepStr -; BaseMemoryLibMmx -; BaseMemoryLibSse2 -; BaseMemoryLibOptDxe -; BaseMemoryLibOptPei -; -;------------------------------------------------------------------------------ - - .686 - .model flat,C - .code - -;------------------------------------------------------------------------------ -; CONST VOID * -; EFIAPI -; InternalMemScanMem8 ( -; IN CONST VOID *Buffer, -; IN UINTN Length, -; IN UINT8 Value -; ); -;------------------------------------------------------------------------------ -InternalMemScanMem8 PROC USES edi - mov ecx, [esp + 12] - mov edi, [esp + 8] - mov al, [esp + 16] - repne scasb - lea eax, [edi - 1] - cmovnz eax, ecx - ret -InternalMemScanMem8 ENDP - - END diff --git a/MdePkg/Library/BaseMemoryLibSse2/Ia32/ScanMem8.nasm b/MdePkg/Library/BaseMemoryLibSse2/Ia32/ScanMem8.nasm index d13c9c7bf400..4ee2f6b190ac 100644 --- a/MdePkg/Library/BaseMemoryLibSse2/Ia32/ScanMem8.nasm +++ b/MdePkg/Library/BaseMemoryLibSse2/Ia32/ScanMem8.nasm @@ -1,13 +1,7 @@ ;------------------------------------------------------------------------------ ; ; Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR> -; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BSD License -; which accompanies this distribution. The full text of the license may be found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. +; SPDX-License-Identifier: BSD-2-Clause-Patent ; ; Module Name: ; diff --git a/MdePkg/Library/BaseMemoryLibSse2/Ia32/SetMem.S b/MdePkg/Library/BaseMemoryLibSse2/Ia32/SetMem.S deleted file mode 100644 index bcbe0cdf8000..000000000000 --- a/MdePkg/Library/BaseMemoryLibSse2/Ia32/SetMem.S +++ /dev/null @@ -1,76 +0,0 @@ -#------------------------------------------------------------------------------ -# -# Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR> -# This program and the accompanying materials -# are licensed and made available under the terms and conditions of the BSD License -# which accompanies this distribution. The full text of the license may be found at -# http://opensource.org/licenses/bsd-license.php. -# -# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. -# -# Module Name: -# -# SetMem.asm -# -# Abstract: -# -# SetMem function -# -# Notes: -# -#------------------------------------------------------------------------------ - - - #.MODEL flat,C - .xmm: - .code: - -#------------------------------------------------------------------------------ -# VOID * -# _mem_SetMem ( -# IN VOID *Buffer, -# IN UINTN Count, -# IN UINT8 Value -# ); -#------------------------------------------------------------------------------ -ASM_GLOBAL ASM_PFX(InternalMemSetMem) -ASM_PFX(InternalMemSetMem): - push %edi - movl 12(%esp), %edx # edx <- Count - movl 8(%esp), %edi # edi <- Buffer - movb 16(%esp), %al # al <- Value - xorl %ecx, %ecx - subl %edi, %ecx - andl $15, %ecx # ecx + edi aligns on 16-byte boundary - jz L0 - cmpl %edx, %ecx - cmova %edx, %ecx - subl %ecx, %edx - rep - stosb -L0: - movl %edx, %ecx - andl $15, %edx - shrl $4, %ecx # ecx <- # of DQwords to set - jz L_SetBytes - movb %al, %ah # ax <- Value | (Value << 8) - addl $-16, %esp - movdqu %xmm0, (%esp) - movd %eax, %xmm0 - pshuflw $0, %xmm0, %xmm0 - movlhps %xmm0, %xmm0 -L1: - movntdq %xmm0, (%edi) - addl $16, %edi - loop L1 - mfence - movdqu (%esp), %xmm0 - addl $16, %esp # stack cleanup -L_SetBytes: - movl %edx, %ecx - rep - stosb - movl 8(%esp), %eax # eax <- Buffer as return value - pop %edi - ret diff --git a/MdePkg/Library/BaseMemoryLibSse2/Ia32/SetMem.asm b/MdePkg/Library/BaseMemoryLibSse2/Ia32/SetMem.asm deleted file mode 100644 index 424f69ef4af7..000000000000 --- a/MdePkg/Library/BaseMemoryLibSse2/Ia32/SetMem.asm +++ /dev/null @@ -1,75 +0,0 @@ -;------------------------------------------------------------------------------ -; -; Copyright (c) 2006, Intel Corporation. All rights reserved.<BR> -; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BSD License -; which accompanies this distribution. The full text of the license may be found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. -; -; Module Name: -; -; SetMem.asm -; -; Abstract: -; -; SetMem function -; -; Notes: -; -;------------------------------------------------------------------------------ - - .686 - .model flat,C - .xmm - .code - -;------------------------------------------------------------------------------ -; VOID * -; EFIAPI -; InternalMemSetMem ( -; IN VOID *Buffer, -; IN UINTN Count, -; IN UINT8 Value -; ); -;------------------------------------------------------------------------------ -InternalMemSetMem PROC USES edi - mov edx, [esp + 12] ; edx <- Count - mov edi, [esp + 8] ; edi <- Buffer - mov al, [esp + 16] ; al <- Value - xor ecx, ecx - sub ecx, edi - and ecx, 15 ; ecx + edi aligns on 16-byte boundary - jz @F - cmp ecx, edx - cmova ecx, edx - sub edx, ecx - rep stosb -@@: - mov ecx, edx - and edx, 15 - shr ecx, 4 ; ecx <- # of DQwords to set - jz @SetBytes - mov ah, al ; ax <- Value | (Value << 8) - add esp, -16 - movdqu [esp], xmm0 ; save xmm0 - movd xmm0, eax - pshuflw xmm0, xmm0, 0 ; xmm0[0..63] <- Value repeats 8 times - movlhps xmm0, xmm0 ; xmm0 <- Value repeats 16 times -@@: - movntdq [edi], xmm0 ; edi should be 16-byte aligned - add edi, 16 - loop @B - mfence - movdqu xmm0, [esp] ; restore xmm0 - add esp, 16 ; stack cleanup -@SetBytes: - mov ecx, edx - rep stosb - mov eax, [esp + 8] ; eax <- Buffer as return value - ret -InternalMemSetMem ENDP - - END diff --git a/MdePkg/Library/BaseMemoryLibSse2/Ia32/SetMem.nasm b/MdePkg/Library/BaseMemoryLibSse2/Ia32/SetMem.nasm index 2852ee5e6adf..a719a4aafc1b 100644 --- a/MdePkg/Library/BaseMemoryLibSse2/Ia32/SetMem.nasm +++ b/MdePkg/Library/BaseMemoryLibSse2/Ia32/SetMem.nasm @@ -1,13 +1,7 @@ ;------------------------------------------------------------------------------ ; ; Copyright (c) 2006, Intel Corporation. All rights reserved.<BR> -; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BSD License -; which accompanies this distribution. The full text of the license may be found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. +; SPDX-License-Identifier: BSD-2-Clause-Patent ; ; Module Name: ; diff --git a/MdePkg/Library/BaseMemoryLibSse2/Ia32/SetMem16.S b/MdePkg/Library/BaseMemoryLibSse2/Ia32/SetMem16.S deleted file mode 100644 index 4269833599ef..000000000000 --- a/MdePkg/Library/BaseMemoryLibSse2/Ia32/SetMem16.S +++ /dev/null @@ -1,69 +0,0 @@ -#------------------------------------------------------------------------------ -# -# Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR> -# This program and the accompanying materials -# are licensed and made available under the terms and conditions of the BSD License -# which accompanies this distribution. The full text of the license may be found at -# http://opensource.org/licenses/bsd-license.php. -# -# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. -# -# Module Name: -# -# SetMem16.asm -# -# Abstract: -# -# SetMem16 function -# -# Notes: -# -#------------------------------------------------------------------------------ - -ASM_GLOBAL ASM_PFX(InternalMemSetMem16) - -#------------------------------------------------------------------------------ -# VOID * -# EFIAPI -# InternalMemSetMem16 ( -# IN VOID *Buffer, -# IN UINTN Count, -# IN UINT16 Value -# ) -#------------------------------------------------------------------------------ -ASM_PFX(InternalMemSetMem16): - push %edi - movl 12(%esp), %edx - movl 8(%esp), %edi - xorl %ecx, %ecx - subl %edi, %ecx - andl $15, %ecx # ecx + edi aligns on 16-byte boundary - movl 16(%esp), %eax - jz L0 - shrl %ecx - cmpl %edx, %ecx - cmova %edx, %ecx - subl %ecx, %edx - rep - stosw -L0: - movl %edx, %ecx - andl $7, %edx - shrl $3, %ecx - jz L_SetWords - movd %eax, %xmm0 - pshuflw $0, %xmm0, %xmm0 - movlhps %xmm0, %xmm0 -L1: - movntdq %xmm0, (%edi) - addl $16, %edi - loop L1 - mfence -L_SetWords: - movl %edx, %ecx - rep - stosw - movl 8(%esp), %eax - pop %edi - ret diff --git a/MdePkg/Library/BaseMemoryLibSse2/Ia32/SetMem16.asm b/MdePkg/Library/BaseMemoryLibSse2/Ia32/SetMem16.asm deleted file mode 100644 index 6086415f7f94..000000000000 --- a/MdePkg/Library/BaseMemoryLibSse2/Ia32/SetMem16.asm +++ /dev/null @@ -1,71 +0,0 @@ -;------------------------------------------------------------------------------ -; -; Copyright (c) 2006, Intel Corporation. All rights reserved.<BR> -; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BSD License -; which accompanies this distribution. The full text of the license may be found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. -; -; Module Name: -; -; SetMem16.asm -; -; Abstract: -; -; SetMem16 function -; -; Notes: -; -;------------------------------------------------------------------------------ - - .686 - .model flat,C - .xmm - .code - -;------------------------------------------------------------------------------ -; VOID * -; EFIAPI -; InternalMemSetMem16 ( -; IN VOID *Buffer, -; IN UINTN Count, -; IN UINT16 Value -; ); -;------------------------------------------------------------------------------ -InternalMemSetMem16 PROC USES edi - mov edx, [esp + 12] - mov edi, [esp + 8] - xor ecx, ecx - sub ecx, edi - and ecx, 15 ; ecx + edi aligns on 16-byte boundary - mov eax, [esp + 16] - jz @F - shr ecx, 1 - cmp ecx, edx - cmova ecx, edx - sub edx, ecx - rep stosw -@@: - mov ecx, edx - and edx, 7 - shr ecx, 3 - jz @SetWords - movd xmm0, eax - pshuflw xmm0, xmm0, 0 - movlhps xmm0, xmm0 -@@: - movntdq [edi], xmm0 ; edi should be 16-byte aligned - add edi, 16 - loop @B - mfence -@SetWords: - mov ecx, edx - rep stosw - mov eax, [esp + 8] - ret -InternalMemSetMem16 ENDP - - END diff --git a/MdePkg/Library/BaseMemoryLibSse2/Ia32/SetMem16.nasm b/MdePkg/Library/BaseMemoryLibSse2/Ia32/SetMem16.nasm index 3a79e7908ccf..335756c965c9 100644 --- a/MdePkg/Library/BaseMemoryLibSse2/Ia32/SetMem16.nasm +++ b/MdePkg/Library/BaseMemoryLibSse2/Ia32/SetMem16.nasm @@ -1,13 +1,7 @@ ;------------------------------------------------------------------------------ ; ; Copyright (c) 2006, Intel Corporation. All rights reserved.<BR> -; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BSD License -; which accompanies this distribution. The full text of the license may be found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. +; SPDX-License-Identifier: BSD-2-Clause-Patent ; ; Module Name: ; diff --git a/MdePkg/Library/BaseMemoryLibSse2/Ia32/SetMem32.S b/MdePkg/Library/BaseMemoryLibSse2/Ia32/SetMem32.S deleted file mode 100644 index 9e9c7e268321..000000000000 --- a/MdePkg/Library/BaseMemoryLibSse2/Ia32/SetMem32.S +++ /dev/null @@ -1,68 +0,0 @@ -#------------------------------------------------------------------------------ -# -# Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR> -# This program and the accompanying materials -# are licensed and made available under the terms and conditions of the BSD License -# which accompanies this distribution. The full text of the license may be found at -# http://opensource.org/licenses/bsd-license.php. -# -# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. -# -# Module Name: -# -# SetMem32.asm -# -# Abstract: -# -# SetMem32 function -# -# Notes: -# -#------------------------------------------------------------------------------ - -ASM_GLOBAL ASM_PFX(InternalMemSetMem32) - -#------------------------------------------------------------------------------ -# VOID * -# EFIAPI -# InternalMemSetMem32 ( -# IN VOID *Buffer, -# IN UINTN Count, -# IN UINT32 Value -# ); -#------------------------------------------------------------------------------ -ASM_PFX(InternalMemSetMem32): - push %edi - movl 12(%esp), %edx - movl 8(%esp), %edi - xorl %ecx, %ecx - subl %edi, %ecx - andl $15, %ecx # ecx + edi aligns on 16-byte boundary - movl 16(%esp), %eax - jz L0 - shrl $2, %ecx - cmpl %edx, %ecx - cmova %edx, %ecx - subl %ecx, %edx - rep - stosl -L0: - movl %edx, %ecx - andl $3, %edx - shrl $2, %ecx - jz L_SetDwords - movd %eax, %xmm0 - pshufd $0, %xmm0, %xmm0 -L1: - movntdq %xmm0, (%edi) - addl $16, %edi - loop L1 - mfence -L_SetDwords: - movl %edx, %ecx - rep - stosl - movl 8(%esp), %eax - pop %edi - ret diff --git a/MdePkg/Library/BaseMemoryLibSse2/Ia32/SetMem32.asm b/MdePkg/Library/BaseMemoryLibSse2/Ia32/SetMem32.asm deleted file mode 100644 index 21b01b9ac097..000000000000 --- a/MdePkg/Library/BaseMemoryLibSse2/Ia32/SetMem32.asm +++ /dev/null @@ -1,70 +0,0 @@ -;------------------------------------------------------------------------------ -; -; Copyright (c) 2006, Intel Corporation. All rights reserved.<BR> -; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BSD License -; which accompanies this distribution. The full text of the license may be found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. -; -; Module Name: -; -; SetMem32.asm -; -; Abstract: -; -; SetMem32 function -; -; Notes: -; -;------------------------------------------------------------------------------ - - .686 - .model flat,C - .xmm - .code - -;------------------------------------------------------------------------------ -; VOID * -; EFIAPI -; InternalMemSetMem32 ( -; IN VOID *Buffer, -; IN UINTN Count, -; IN UINT32 Value -; ); -;------------------------------------------------------------------------------ -InternalMemSetMem32 PROC USES edi - mov edx, [esp + 12] - mov edi, [esp + 8] - xor ecx, ecx - sub ecx, edi - and ecx, 15 ; ecx + edi aligns on 16-byte boundary - mov eax, [esp + 16] - jz @F - shr ecx, 2 - cmp ecx, edx - cmova ecx, edx - sub edx, ecx - rep stosd -@@: - mov ecx, edx - and edx, 3 - shr ecx, 2 - jz @SetDwords - movd xmm0, eax - pshufd xmm0, xmm0, 0 -@@: - movntdq [edi], xmm0 - add edi, 16 - loop @B - mfence -@SetDwords: - mov ecx, edx - rep stosd - mov eax, [esp + 8] - ret -InternalMemSetMem32 ENDP - - END diff --git a/MdePkg/Library/BaseMemoryLibSse2/Ia32/SetMem32.nasm b/MdePkg/Library/BaseMemoryLibSse2/Ia32/SetMem32.nasm index 7d2d9fb84a88..9274265902d1 100644 --- a/MdePkg/Library/BaseMemoryLibSse2/Ia32/SetMem32.nasm +++ b/MdePkg/Library/BaseMemoryLibSse2/Ia32/SetMem32.nasm @@ -1,13 +1,7 @@ ;------------------------------------------------------------------------------ ; ; Copyright (c) 2006, Intel Corporation. All rights reserved.<BR> -; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BSD License -; which accompanies this distribution. The full text of the license may be found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. +; SPDX-License-Identifier: BSD-2-Clause-Patent ; ; Module Name: ; diff --git a/MdePkg/Library/BaseMemoryLibSse2/Ia32/SetMem64.S b/MdePkg/Library/BaseMemoryLibSse2/Ia32/SetMem64.S deleted file mode 100644 index d5983e768c23..000000000000 --- a/MdePkg/Library/BaseMemoryLibSse2/Ia32/SetMem64.S +++ /dev/null @@ -1,58 +0,0 @@ -#------------------------------------------------------------------------------ -# -# Copyright (c) 2006, Intel Corporation. All rights reserved.<BR> -# This program and the accompanying materials -# are licensed and made available under the terms and conditions of the BSD License -# which accompanies this distribution. The full text of the license may be found at -# http://opensource.org/licenses/bsd-license.php. -# -# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. -# -# Module Name: -# -# SetMem64.S -# -# Abstract: -# -# SetMem64 function -# -# Notes: -# -#------------------------------------------------------------------------------ - -ASM_GLOBAL ASM_PFX(InternalMemSetMem64) - -#------------------------------------------------------------------------------ -# VOID * -# EFIAPI -# InternalMemSetMem64 ( -# IN VOID *Buffer, -# IN UINTN Count, -# IN UINT64 Value -# ); -#------------------------------------------------------------------------------ -ASM_PFX(InternalMemSetMem64): - movl 4(%esp), %eax - movl 8(%esp), %ecx - testb $8, %al - movl %eax, %edx - movq 0xc(%esp), %xmm0 - jz L1 - movq %xmm0, (%edx) - addl $8, %edx - decl %ecx -L1: - shrl %ecx - jz L_SetQwords - movlhps %xmm0, %xmm0 -L2: - movntdq %xmm0, (%edx) - leal 16(%edx), %edx - loop L2 - mfence -L_SetQwords: - jnc L3 - movq %xmm0, (%edx) -L3: - ret diff --git a/MdePkg/Library/BaseMemoryLibSse2/Ia32/SetMem64.asm b/MdePkg/Library/BaseMemoryLibSse2/Ia32/SetMem64.asm deleted file mode 100644 index 801e4c33da51..000000000000 --- a/MdePkg/Library/BaseMemoryLibSse2/Ia32/SetMem64.asm +++ /dev/null @@ -1,64 +0,0 @@ -;------------------------------------------------------------------------------ -; -; Copyright (c) 2006, Intel Corporation. All rights reserved.<BR> -; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BSD License -; which accompanies this distribution. The full text of the license may be found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. -; -; Module Name: -; -; SetMem64.asm -; -; Abstract: -; -; SetMem64 function -; -; Notes: -; -;------------------------------------------------------------------------------ - - .686 - .model flat,C - .xmm - .code - -;------------------------------------------------------------------------------ -; VOID * -; EFIAPI -; InternalMemSetMem64 ( -; IN VOID *Buffer, -; IN UINTN Count, -; IN UINT64 Value -; ) -;------------------------------------------------------------------------------ -InternalMemSetMem64 PROC - mov eax, [esp + 4] ; eax <- Buffer - mov ecx, [esp + 8] ; ecx <- Count - test al, 8 - mov edx, eax - movq xmm0, qword ptr [esp + 12] - jz @F - movq qword ptr [edx], xmm0 - add edx, 8 - dec ecx -@@: - shr ecx, 1 - jz @SetQwords - movlhps xmm0, xmm0 -@@: - movntdq [edx], xmm0 - lea edx, [edx + 16] - loop @B - mfence -@SetQwords: - jnc @F - movq qword ptr [edx], xmm0 -@@: - ret -InternalMemSetMem64 ENDP - - END diff --git a/MdePkg/Library/BaseMemoryLibSse2/Ia32/SetMem64.nasm b/MdePkg/Library/BaseMemoryLibSse2/Ia32/SetMem64.nasm index ace62749426f..4a79ae6f180d 100644 --- a/MdePkg/Library/BaseMemoryLibSse2/Ia32/SetMem64.nasm +++ b/MdePkg/Library/BaseMemoryLibSse2/Ia32/SetMem64.nasm @@ -1,13 +1,7 @@ ;------------------------------------------------------------------------------ ; ; Copyright (c) 2006, Intel Corporation. All rights reserved.<BR> -; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BSD License -; which accompanies this distribution. The full text of the license may be found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. +; SPDX-License-Identifier: BSD-2-Clause-Patent ; ; Module Name: ; diff --git a/MdePkg/Library/BaseMemoryLibSse2/Ia32/ZeroMem.S b/MdePkg/Library/BaseMemoryLibSse2/Ia32/ZeroMem.S deleted file mode 100644 index 2a8c8b751d2a..000000000000 --- a/MdePkg/Library/BaseMemoryLibSse2/Ia32/ZeroMem.S +++ /dev/null @@ -1,65 +0,0 @@ -#------------------------------------------------------------------------------ -# -# Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR> -# This program and the accompanying materials -# are licensed and made available under the terms and conditions of the BSD License -# which accompanies this distribution. The full text of the license may be found at -# http://opensource.org/licenses/bsd-license.php. -# -# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. -# -# Module Name: -# -# ZeroMem.asm -# -# Abstract: -# -# ZeroMem function -# -# Notes: -# -#------------------------------------------------------------------------------ - -ASM_GLOBAL ASM_PFX(InternalMemZeroMem) - -#------------------------------------------------------------------------------ -# VOID * -# EFIAPI -# InternalMemZeroMem ( -# IN VOID *Buffer, -# IN UINTN Count -# ); -#------------------------------------------------------------------------------ -ASM_PFX(InternalMemZeroMem): - push %edi - movl 8(%esp), %edi - movl 12(%esp), %edx - xorl %ecx, %ecx - subl %edi, %ecx - xorl %eax, %eax - andl $15, %ecx - jz L0 - cmpl %edx, %ecx - cmova %edx, %ecx - subl %ecx, %edx - rep - stosb -L0: - movl %edx, %ecx - andl $15, %edx - shrl $4, %ecx - jz L_ZeroBytes - pxor %xmm0, %xmm0 -L1: - movntdq %xmm0, (%edi) - addl $16, %edi - loop L1 - mfence -L_ZeroBytes: - movl %edx, %ecx - rep - stosb - movl 8(%esp), %eax - pop %edi - ret diff --git a/MdePkg/Library/BaseMemoryLibSse2/Ia32/ZeroMem.asm b/MdePkg/Library/BaseMemoryLibSse2/Ia32/ZeroMem.asm deleted file mode 100644 index 847d96bf7ea5..000000000000 --- a/MdePkg/Library/BaseMemoryLibSse2/Ia32/ZeroMem.asm +++ /dev/null @@ -1,67 +0,0 @@ -;------------------------------------------------------------------------------ -; -; Copyright (c) 2006, Intel Corporation. All rights reserved.<BR> -; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BSD License -; which accompanies this distribution. The full text of the license may be found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. -; -; Module Name: -; -; ZeroMem.asm -; -; Abstract: -; -; ZeroMem function -; -; Notes: -; -;------------------------------------------------------------------------------ - - .686 - .model flat,C - .xmm - .code - -;------------------------------------------------------------------------------ -; VOID * -; EFIAPI -; InternalMemZeroMem ( -; IN VOID *Buffer, -; IN UINTN Count -; ); -;------------------------------------------------------------------------------ -InternalMemZeroMem PROC USES edi - mov edi, [esp + 8] - mov edx, [esp + 12] - xor ecx, ecx - sub ecx, edi - xor eax, eax - and ecx, 15 - jz @F - cmp ecx, edx - cmova ecx, edx - sub edx, ecx - rep stosb -@@: - mov ecx, edx - and edx, 15 - shr ecx, 4 - jz @ZeroBytes - pxor xmm0, xmm0 -@@: - movntdq [edi], xmm0 - add edi, 16 - loop @B - mfence -@ZeroBytes: - mov ecx, edx - rep stosb - mov eax, [esp + 8] - ret -InternalMemZeroMem ENDP - - END diff --git a/MdePkg/Library/BaseMemoryLibSse2/Ia32/ZeroMem.nasm b/MdePkg/Library/BaseMemoryLibSse2/Ia32/ZeroMem.nasm index cee361871f70..423fd713658a 100644 --- a/MdePkg/Library/BaseMemoryLibSse2/Ia32/ZeroMem.nasm +++ b/MdePkg/Library/BaseMemoryLibSse2/Ia32/ZeroMem.nasm @@ -1,13 +1,7 @@ ;------------------------------------------------------------------------------ ; ; Copyright (c) 2006, Intel Corporation. All rights reserved.<BR> -; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BSD License -; which accompanies this distribution. The full text of the license may be found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. +; SPDX-License-Identifier: BSD-2-Clause-Patent ; ; Module Name: ; diff --git a/MdePkg/Library/BaseMemoryLibSse2/IsZeroBufferWrapper.c b/MdePkg/Library/BaseMemoryLibSse2/IsZeroBufferWrapper.c index 078c924da153..40d73f0c253c 100644 --- a/MdePkg/Library/BaseMemoryLibSse2/IsZeroBufferWrapper.c +++ b/MdePkg/Library/BaseMemoryLibSse2/IsZeroBufferWrapper.c @@ -13,13 +13,7 @@ UefiMemoryLib Copyright (c) 2016, Intel Corporation. All rights reserved.<BR> - This program and the accompanying materials - are licensed and made available under the terms and conditions of the BSD License - which accompanies this distribution. The full text of the license may be found at - http://opensource.org/licenses/bsd-license.php - - THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, - WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. + SPDX-License-Identifier: BSD-2-Clause-Patent **/ diff --git a/MdePkg/Library/BaseMemoryLibSse2/MemLibGuid.c b/MdePkg/Library/BaseMemoryLibSse2/MemLibGuid.c index 4aab05d53b67..e214695ae96b 100644 --- a/MdePkg/Library/BaseMemoryLibSse2/MemLibGuid.c +++ b/MdePkg/Library/BaseMemoryLibSse2/MemLibGuid.c @@ -2,7 +2,7 @@ Implementation of GUID functions. The following BaseMemoryLib instances contain the same copy of this file: - + BaseMemoryLib BaseMemoryLibMmx BaseMemoryLibSse2 @@ -12,14 +12,8 @@ PeiMemoryLib UefiMemoryLib - Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.<BR> - This program and the accompanying materials - are licensed and made available under the terms and conditions of the BSD License - which accompanies this distribution. The full text of the license may be found at - http://opensource.org/licenses/bsd-license.php. - - THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, - WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. + Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR> + SPDX-License-Identifier: BSD-2-Clause-Patent **/ @@ -30,7 +24,7 @@ This function copies the contents of the 128-bit GUID specified by SourceGuid to DestinationGuid, and returns DestinationGuid. - + If DestinationGuid is NULL, then ASSERT(). If SourceGuid is NULL, then ASSERT(). @@ -63,7 +57,7 @@ CopyGuid ( This function compares Guid1 to Guid2. If the GUIDs are identical then TRUE is returned. If there are any bit differences in the two GUIDs, then FALSE is returned. - + If Guid1 is NULL, then ASSERT(). If Guid2 is NULL, then ASSERT(). @@ -103,7 +97,7 @@ CompareGuid ( GUID value that matches Guid. If a match is found, then a pointer to the matching GUID in the target buffer is returned. If no match is found, then NULL is returned. If Length is 0, then NULL is returned. - + If Length > 0 and Buffer is NULL, then ASSERT(). If Buffer is not aligned on a 32-bit boundary, then ASSERT(). If Length is not aligned on a 128-bit boundary, then ASSERT(). diff --git a/MdePkg/Library/BaseMemoryLibSse2/MemLibInternals.h b/MdePkg/Library/BaseMemoryLibSse2/MemLibInternals.h index e7afa2337464..bb032dff0c87 100644 --- a/MdePkg/Library/BaseMemoryLibSse2/MemLibInternals.h +++ b/MdePkg/Library/BaseMemoryLibSse2/MemLibInternals.h @@ -10,13 +10,7 @@ BaseMemoryLibOptPei Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.<BR> - This program and the accompanying materials - are licensed and made available under the terms and conditions of the BSD License - which accompanies this distribution. The full text of the license may be found at - http://opensource.org/licenses/bsd-license.php. - - THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, - WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. + SPDX-License-Identifier: BSD-2-Clause-Patent **/ diff --git a/MdePkg/Library/BaseMemoryLibSse2/ScanMem16Wrapper.c b/MdePkg/Library/BaseMemoryLibSse2/ScanMem16Wrapper.c index c407469843c4..1e284f5f13f3 100644 --- a/MdePkg/Library/BaseMemoryLibSse2/ScanMem16Wrapper.c +++ b/MdePkg/Library/BaseMemoryLibSse2/ScanMem16Wrapper.c @@ -12,14 +12,8 @@ PeiMemoryLib UefiMemoryLib - Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR> - This program and the accompanying materials - are licensed and made available under the terms and conditions of the BSD License - which accompanies this distribution. The full text of the license may be found at - http://opensource.org/licenses/bsd-license.php. - - THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, - WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. + Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR> + SPDX-License-Identifier: BSD-2-Clause-Patent **/ @@ -33,7 +27,7 @@ address to the highest address for a 16-bit value that matches Value. If a match is found, then a pointer to the matching byte in the target buffer is returned. If no match is found, then NULL is returned. If Length is 0, then NULL is returned. - + If Length > 0 and Buffer is NULL, then ASSERT(). If Buffer is not aligned on a 16-bit boundary, then ASSERT(). If Length is not aligned on a 16-bit boundary, then ASSERT(). diff --git a/MdePkg/Library/BaseMemoryLibSse2/ScanMem32Wrapper.c b/MdePkg/Library/BaseMemoryLibSse2/ScanMem32Wrapper.c index a3243a67089c..758c14284599 100644 --- a/MdePkg/Library/BaseMemoryLibSse2/ScanMem32Wrapper.c +++ b/MdePkg/Library/BaseMemoryLibSse2/ScanMem32Wrapper.c @@ -11,14 +11,8 @@ PeiMemoryLib UefiMemoryLib - Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR> - This program and the accompanying materials - are licensed and made available under the terms and conditions of the BSD License - which accompanies this distribution. The full text of the license may be found at - http://opensource.org/licenses/bsd-license.php. - - THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, - WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. + Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR> + SPDX-License-Identifier: BSD-2-Clause-Patent **/ @@ -32,7 +26,7 @@ address to the highest address for a 32-bit value that matches Value. If a match is found, then a pointer to the matching byte in the target buffer is returned. If no match is found, then NULL is returned. If Length is 0, then NULL is returned. - + If Length > 0 and Buffer is NULL, then ASSERT(). If Buffer is not aligned on a 32-bit boundary, then ASSERT(). If Length is not aligned on a 32-bit boundary, then ASSERT(). diff --git a/MdePkg/Library/BaseMemoryLibSse2/ScanMem64Wrapper.c b/MdePkg/Library/BaseMemoryLibSse2/ScanMem64Wrapper.c index 10ed74d50256..89a82fc52e73 100644 --- a/MdePkg/Library/BaseMemoryLibSse2/ScanMem64Wrapper.c +++ b/MdePkg/Library/BaseMemoryLibSse2/ScanMem64Wrapper.c @@ -12,14 +12,8 @@ PeiMemoryLib UefiMemoryLib - Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR> - This program and the accompanying materials - are licensed and made available under the terms and conditions of the BSD License - which accompanies this distribution. The full text of the license may be found at - http://opensource.org/licenses/bsd-license.php. - - THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, - WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. + Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR> + SPDX-License-Identifier: BSD-2-Clause-Patent **/ @@ -33,7 +27,7 @@ address to the highest address for a 64-bit value that matches Value. If a match is found, then a pointer to the matching byte in the target buffer is returned. If no match is found, then NULL is returned. If Length is 0, then NULL is returned. - + If Length > 0 and Buffer is NULL, then ASSERT(). If Buffer is not aligned on a 64-bit boundary, then ASSERT(). If Length is not aligned on a 64-bit boundary, then ASSERT(). diff --git a/MdePkg/Library/BaseMemoryLibSse2/ScanMem8Wrapper.c b/MdePkg/Library/BaseMemoryLibSse2/ScanMem8Wrapper.c index f296da2e7a48..7f1c7d220069 100644 --- a/MdePkg/Library/BaseMemoryLibSse2/ScanMem8Wrapper.c +++ b/MdePkg/Library/BaseMemoryLibSse2/ScanMem8Wrapper.c @@ -12,14 +12,8 @@ PeiMemoryLib UefiMemoryLib - Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR> - This program and the accompanying materials - are licensed and made available under the terms and conditions of the BSD License - which accompanies this distribution. The full text of the license may be found at - http://opensource.org/licenses/bsd-license.php. - - THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, - WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. + Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR> + SPDX-License-Identifier: BSD-2-Clause-Patent **/ @@ -33,7 +27,7 @@ address to the highest address for an 8-bit value that matches Value. If a match is found, then a pointer to the matching byte in the target buffer is returned. If no match is found, then NULL is returned. If Length is 0, then NULL is returned. - + If Length > 0 and Buffer is NULL, then ASSERT(). If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT(). @@ -57,19 +51,19 @@ ScanMem8 ( } ASSERT (Buffer != NULL); ASSERT ((Length - 1) <= (MAX_ADDRESS - (UINTN)Buffer)); - + return (VOID*)InternalMemScanMem8 (Buffer, Length, Value); } /** - Scans a target buffer for a UINTN sized value, and returns a pointer to the matching + Scans a target buffer for a UINTN sized value, and returns a pointer to the matching UINTN sized value in the target buffer. This function searches the target buffer specified by Buffer and Length from the lowest address to the highest address for a UINTN sized value that matches Value. If a match is found, then a pointer to the matching byte in the target buffer is returned. If no match is found, then NULL is returned. If Length is 0, then NULL is returned. - + If Length > 0 and Buffer is NULL, then ASSERT(). If Buffer is not aligned on a UINTN boundary, then ASSERT(). If Length is not aligned on a UINTN boundary, then ASSERT(). diff --git a/MdePkg/Library/BaseMemoryLibSse2/SetMem16Wrapper.c b/MdePkg/Library/BaseMemoryLibSse2/SetMem16Wrapper.c index 8e6daa3928cc..0186218c7eb7 100644 --- a/MdePkg/Library/BaseMemoryLibSse2/SetMem16Wrapper.c +++ b/MdePkg/Library/BaseMemoryLibSse2/SetMem16Wrapper.c @@ -12,13 +12,7 @@ UefiMemoryLib Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR> - This program and the accompanying materials - are licensed and made available under the terms and conditions of the BSD License - which accompanies this distribution. The full text of the license may be found at - http://opensource.org/licenses/bsd-license.php. - - THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, - WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. + SPDX-License-Identifier: BSD-2-Clause-Patent **/ diff --git a/MdePkg/Library/BaseMemoryLibSse2/SetMem32Wrapper.c b/MdePkg/Library/BaseMemoryLibSse2/SetMem32Wrapper.c index 7758e1f438db..077174794944 100644 --- a/MdePkg/Library/BaseMemoryLibSse2/SetMem32Wrapper.c +++ b/MdePkg/Library/BaseMemoryLibSse2/SetMem32Wrapper.c @@ -12,13 +12,7 @@ UefiMemoryLib Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR> - This program and the accompanying materials - are licensed and made available under the terms and conditions of the BSD License - which accompanies this distribution. The full text of the license may be found at - http://opensource.org/licenses/bsd-license.php. - - THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, - WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. + SPDX-License-Identifier: BSD-2-Clause-Patent **/ diff --git a/MdePkg/Library/BaseMemoryLibSse2/SetMem64Wrapper.c b/MdePkg/Library/BaseMemoryLibSse2/SetMem64Wrapper.c index 5273a864f187..41d96291afdc 100644 --- a/MdePkg/Library/BaseMemoryLibSse2/SetMem64Wrapper.c +++ b/MdePkg/Library/BaseMemoryLibSse2/SetMem64Wrapper.c @@ -12,13 +12,7 @@ UefiMemoryLib Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR> - This program and the accompanying materials - are licensed and made available under the terms and conditions of the BSD License - which accompanies this distribution. The full text of the license may be found at - http://opensource.org/licenses/bsd-license.php. - - THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, - WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. + SPDX-License-Identifier: BSD-2-Clause-Patent **/ diff --git a/MdePkg/Library/BaseMemoryLibSse2/SetMemWrapper.c b/MdePkg/Library/BaseMemoryLibSse2/SetMemWrapper.c index b6646d81fc32..ac6402fa34a9 100644 --- a/MdePkg/Library/BaseMemoryLibSse2/SetMemWrapper.c +++ b/MdePkg/Library/BaseMemoryLibSse2/SetMemWrapper.c @@ -12,14 +12,8 @@ PeiMemoryLib UefiMemoryLib - Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR> - This program and the accompanying materials - are licensed and made available under the terms and conditions of the BSD License - which accompanies this distribution. The full text of the license may be found at - http://opensource.org/licenses/bsd-license.php. - - THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, - WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. + Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR> + SPDX-License-Identifier: BSD-2-Clause-Patent **/ @@ -29,7 +23,7 @@ Fills a target buffer with a byte value, and returns the target buffer. This function fills Length bytes of Buffer with Value, and returns Buffer. - + If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT(). @param Buffer The memory to set. diff --git a/MdePkg/Library/BaseMemoryLibSse2/X64/CompareMem.S b/MdePkg/Library/BaseMemoryLibSse2/X64/CompareMem.S deleted file mode 100644 index 503127c23e0d..000000000000 --- a/MdePkg/Library/BaseMemoryLibSse2/X64/CompareMem.S +++ /dev/null @@ -1,59 +0,0 @@ -# -# ConvertAsm.py: Automatically generated from CompareMem.asm -# -#------------------------------------------------------------------------------ -# -# Copyright (c) 2006 - 2009, Intel Corporation. All rights reserved.<BR> -# This program and the accompanying materials -# are licensed and made available under the terms and conditions of the BSD License -# which accompanies this distribution. The full text of the license may be found at -# http://opensource.org/licenses/bsd-license.php. -# -# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. -# -# Module Name: -# -# CompareMem.S -# -# Abstract: -# -# CompareMem function -# -# Notes: -# -# The following BaseMemoryLib instances contain the same copy of this file: -# -# BaseMemoryLibRepStr -# BaseMemoryLibMmx -# BaseMemoryLibSse2 -# BaseMemoryLibOptDxe -# BaseMemoryLibOptPei -# -#------------------------------------------------------------------------------ - - -#------------------------------------------------------------------------------ -# INTN -# EFIAPI -# InternalMemCompareMem ( -# IN CONST VOID *DestinationBuffer, -# IN CONST VOID *SourceBuffer, -# IN UINTN Length -# ); -#------------------------------------------------------------------------------ -ASM_GLOBAL ASM_PFX(InternalMemCompareMem) -ASM_PFX(InternalMemCompareMem): - pushq %rsi - pushq %rdi - movq %rcx, %rsi - movq %rdx, %rdi - movq %r8, %rcx - repe cmpsb - movzbq -1(%rsi) , %rax - movzbq -1(%rdi) , %rdx - subq %rdx, %rax - popq %rdi - popq %rsi - ret - diff --git a/MdePkg/Library/BaseMemoryLibSse2/X64/CompareMem.asm b/MdePkg/Library/BaseMemoryLibSse2/X64/CompareMem.asm deleted file mode 100644 index 09f077b85df8..000000000000 --- a/MdePkg/Library/BaseMemoryLibSse2/X64/CompareMem.asm +++ /dev/null @@ -1,54 +0,0 @@ -;------------------------------------------------------------------------------ -; -; Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR> -; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BSD License -; which accompanies this distribution. The full text of the license may be found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. -; -; Module Name: -; -; CompareMem.Asm -; -; Abstract: -; -; CompareMem function -; -; Notes: -; -; The following BaseMemoryLib instances contain the same copy of this file: -; -; BaseMemoryLibRepStr -; BaseMemoryLibMmx -; BaseMemoryLibSse2 -; BaseMemoryLibOptDxe -; BaseMemoryLibOptPei -; -;------------------------------------------------------------------------------ - - .code - -;------------------------------------------------------------------------------ -; INTN -; EFIAPI -; InternalMemCompareMem ( -; IN CONST VOID *DestinationBuffer, -; IN CONST VOID *SourceBuffer, -; IN UINTN Length -; ); -;------------------------------------------------------------------------------ -InternalMemCompareMem PROC USES rsi rdi - mov rsi, rcx - mov rdi, rdx - mov rcx, r8 - repe cmpsb - movzx rax, byte ptr [rsi - 1] - movzx rdx, byte ptr [rdi - 1] - sub rax, rdx - ret -InternalMemCompareMem ENDP - - END diff --git a/MdePkg/Library/BaseMemoryLibSse2/X64/CompareMem.nasm b/MdePkg/Library/BaseMemoryLibSse2/X64/CompareMem.nasm index cb0d88658387..e367c494f78c 100644 --- a/MdePkg/Library/BaseMemoryLibSse2/X64/CompareMem.nasm +++ b/MdePkg/Library/BaseMemoryLibSse2/X64/CompareMem.nasm @@ -1,13 +1,7 @@ ;------------------------------------------------------------------------------ ; ; Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR> -; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BSD License -; which accompanies this distribution. The full text of the license may be found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. +; SPDX-License-Identifier: BSD-2-Clause-Patent ; ; Module Name: ; diff --git a/MdePkg/Library/BaseMemoryLibSse2/X64/CopyMem.S b/MdePkg/Library/BaseMemoryLibSse2/X64/CopyMem.S deleted file mode 100644 index bf26cd384455..000000000000 --- a/MdePkg/Library/BaseMemoryLibSse2/X64/CopyMem.S +++ /dev/null @@ -1,83 +0,0 @@ -# -# ConvertAsm.py: Automatically generated from CopyMem.asm -# -#------------------------------------------------------------------------------ -# -# Copyright (c) 2006 - 2009, Intel Corporation. All rights reserved.<BR> -# This program and the accompanying materials -# are licensed and made available under the terms and conditions of the BSD License -# which accompanies this distribution. The full text of the license may be found at -# http://opensource.org/licenses/bsd-license.php. -# -# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. -# -# Module Name: -# -# CopyMem.S -# -# Abstract: -# -# CopyMem function -# -# Notes: -# -#------------------------------------------------------------------------------ - - -#------------------------------------------------------------------------------ -# VOID * -# EFIAPI -# InternalMemCopyMem ( -# IN VOID *Destination, -# IN VOID *Source, -# IN UINTN Count -# ) -#------------------------------------------------------------------------------ -ASM_GLOBAL ASM_PFX(InternalMemCopyMem) -ASM_PFX(InternalMemCopyMem): - pushq %rsi - pushq %rdi - movq %rdx, %rsi # rsi <- Source - movq %rcx, %rdi # rdi <- Destination - leaq -1(%rsi, %r8,), %r9 # r9 <- Last byte of Source - cmpq %rdi, %rsi - movq %rdi, %rax # rax <- Destination as return value - jae L0 # Copy forward if Source > Destination - cmpq %rdi, %r9 # Overlapped? - jae L_CopyBackward # Copy backward if overlapped -L0: - xorq %rcx, %rcx - subq %rdi, %rcx # rcx <- -rdi - andq $15, %rcx # rcx + rsi should be 16 bytes aligned - jz L1 # skip if rcx == 0 - cmpq %r8, %rcx - cmova %r8, %rcx - subq %rcx, %r8 - rep movsb -L1: - movq %r8, %rcx - andq $15, %r8 - shrq $4, %rcx # rcx <- # of DQwords to copy - jz L_CopyBytes - movdqa %xmm0, 0x18(%rsp) # save xmm0 on stack -L2: - movdqu (%rsi), %xmm0 # rsi may not be 16-byte aligned - movntdq %xmm0, (%rdi) # rdi should be 16-byte aligned - addq $16, %rsi - addq $16, %rdi - loop L2 - mfence - movdqa 0x18(%rsp), %xmm0 # restore xmm0 - jmp L_CopyBytes # copy remaining bytes -L_CopyBackward: - movq %r9, %rsi # rsi <- Last byte of Source - leaq -1(%rdi, %r8,), %rdi # rdi <- Last byte of Destination - std -L_CopyBytes: - movq %r8, %rcx - rep movsb - cld - popq %rdi - popq %rsi - ret diff --git a/MdePkg/Library/BaseMemoryLibSse2/X64/CopyMem.asm b/MdePkg/Library/BaseMemoryLibSse2/X64/CopyMem.asm deleted file mode 100644 index 9218003428f6..000000000000 --- a/MdePkg/Library/BaseMemoryLibSse2/X64/CopyMem.asm +++ /dev/null @@ -1,79 +0,0 @@ -;------------------------------------------------------------------------------ -; -; Copyright (c) 2006, Intel Corporation. All rights reserved.<BR> -; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BSD License -; which accompanies this distribution. The full text of the license may be found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. -; -; Module Name: -; -; CopyMem.asm -; -; Abstract: -; -; CopyMem function -; -; Notes: -; -;------------------------------------------------------------------------------ - - .code - -;------------------------------------------------------------------------------ -; VOID * -; EFIAPI -; InternalMemCopyMem ( -; IN VOID *Destination, -; IN VOID *Source, -; IN UINTN Count -; ); -;------------------------------------------------------------------------------ -InternalMemCopyMem PROC USES rsi rdi - mov rsi, rdx ; rsi <- Source - mov rdi, rcx ; rdi <- Destination - lea r9, [rsi + r8 - 1] ; r9 <- Last byte of Source - cmp rsi, rdi - mov rax, rdi ; rax <- Destination as return value - jae @F ; Copy forward if Source > Destination - cmp r9, rdi ; Overlapped? - jae @CopyBackward ; Copy backward if overlapped -@@: - xor rcx, rcx - sub rcx, rdi ; rcx <- -rdi - and rcx, 15 ; rcx + rsi should be 16 bytes aligned - jz @F ; skip if rcx == 0 - cmp rcx, r8 - cmova rcx, r8 - sub r8, rcx - rep movsb -@@: - mov rcx, r8 - and r8, 15 - shr rcx, 4 ; rcx <- # of DQwords to copy - jz @CopyBytes - movdqa [rsp + 18h], xmm0 ; save xmm0 on stack -@@: - movdqu xmm0, [rsi] ; rsi may not be 16-byte aligned - movntdq [rdi], xmm0 ; rdi should be 16-byte aligned - add rsi, 16 - add rdi, 16 - loop @B - mfence - movdqa xmm0, [rsp + 18h] ; restore xmm0 - jmp @CopyBytes ; copy remaining bytes -@CopyBackward: - mov rsi, r9 ; rsi <- Last byte of Source - lea rdi, [rdi + r8 - 1] ; rdi <- Last byte of Destination - std -@CopyBytes: - mov rcx, r8 - rep movsb - cld - ret -InternalMemCopyMem ENDP - - END diff --git a/MdePkg/Library/BaseMemoryLibSse2/X64/CopyMem.nasm b/MdePkg/Library/BaseMemoryLibSse2/X64/CopyMem.nasm index 9fe45d4e8c2f..235536801a7a 100644 --- a/MdePkg/Library/BaseMemoryLibSse2/X64/CopyMem.nasm +++ b/MdePkg/Library/BaseMemoryLibSse2/X64/CopyMem.nasm @@ -1,13 +1,7 @@ ;------------------------------------------------------------------------------ ; ; Copyright (c) 2006, Intel Corporation. All rights reserved.<BR> -; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BSD License -; which accompanies this distribution. The full text of the license may be found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. +; SPDX-License-Identifier: BSD-2-Clause-Patent ; ; Module Name: ; diff --git a/MdePkg/Library/BaseMemoryLibSse2/X64/IsZeroBuffer.nasm b/MdePkg/Library/BaseMemoryLibSse2/X64/IsZeroBuffer.nasm index 3d5b6a128104..ce2dd57adffa 100644 --- a/MdePkg/Library/BaseMemoryLibSse2/X64/IsZeroBuffer.nasm +++ b/MdePkg/Library/BaseMemoryLibSse2/X64/IsZeroBuffer.nasm @@ -1,13 +1,7 @@ ;------------------------------------------------------------------------------ ; ; Copyright (c) 2016, Intel Corporation. All rights reserved.<BR> -; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BSD License -; which accompanies this distribution. The full text of the license may be found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. +; SPDX-License-Identifier: BSD-2-Clause-Patent ; ; Module Name: ; diff --git a/MdePkg/Library/BaseMemoryLibSse2/X64/ScanMem16.S b/MdePkg/Library/BaseMemoryLibSse2/X64/ScanMem16.S deleted file mode 100644 index 5bdf2473a640..000000000000 --- a/MdePkg/Library/BaseMemoryLibSse2/X64/ScanMem16.S +++ /dev/null @@ -1,56 +0,0 @@ -# -# ConvertAsm.py: Automatically generated from ScanMem16.asm -# -#------------------------------------------------------------------------------ -# -# Copyright (c) 2006 - 2009, Intel Corporation. All rights reserved.<BR> -# This program and the accompanying materials -# are licensed and made available under the terms and conditions of the BSD License -# which accompanies this distribution. The full text of the license may be found at -# http://opensource.org/licenses/bsd-license.php. -# -# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. -# -# Module Name: -# -# ScanMem16.S -# -# Abstract: -# -# ScanMem16 function -# -# Notes: -# -# The following BaseMemoryLib instances contain the same copy of this file: -# -# BaseMemoryLibRepStr -# BaseMemoryLibMmx -# BaseMemoryLibSse2 -# BaseMemoryLibOptDxe -# BaseMemoryLibOptPei -# -#------------------------------------------------------------------------------ - - -#------------------------------------------------------------------------------ -# CONST VOID * -# EFIAPI -# InternalMemScanMem16 ( -# IN CONST VOID *Buffer, -# IN UINTN Length, -# IN UINT16 Value -# ); -#------------------------------------------------------------------------------ -ASM_GLOBAL ASM_PFX(InternalMemScanMem16) -ASM_PFX(InternalMemScanMem16): - pushq %rdi - movq %rcx, %rdi - movq %rdx, %rcx - movq %r8, %rax - repne scasw - leaq -2(%rdi), %rax - cmovnz %rcx, %rax # set rax to 0 if not found - popq %rdi - ret - diff --git a/MdePkg/Library/BaseMemoryLibSse2/X64/ScanMem16.asm b/MdePkg/Library/BaseMemoryLibSse2/X64/ScanMem16.asm deleted file mode 100644 index 75200414d1c1..000000000000 --- a/MdePkg/Library/BaseMemoryLibSse2/X64/ScanMem16.asm +++ /dev/null @@ -1,53 +0,0 @@ -;------------------------------------------------------------------------------ -; -; Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR> -; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BSD License -; which accompanies this distribution. The full text of the license may be found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. -; -; Module Name: -; -; ScanMem16.Asm -; -; Abstract: -; -; ScanMem16 function -; -; Notes: -; -; The following BaseMemoryLib instances contain the same copy of this file: -; -; BaseMemoryLibRepStr -; BaseMemoryLibMmx -; BaseMemoryLibSse2 -; BaseMemoryLibOptDxe -; BaseMemoryLibOptPei -; -;------------------------------------------------------------------------------ - - .code - -;------------------------------------------------------------------------------ -; CONST VOID * -; EFIAPI -; InternalMemScanMem16 ( -; IN CONST VOID *Buffer, -; IN UINTN Length, -; IN UINT16 Value -; ); -;------------------------------------------------------------------------------ -InternalMemScanMem16 PROC USES rdi - mov rdi, rcx - mov rax, r8 - mov rcx, rdx - repne scasw - lea rax, [rdi - 2] - cmovnz rax, rcx - ret -InternalMemScanMem16 ENDP - - END diff --git a/MdePkg/Library/BaseMemoryLibSse2/X64/ScanMem16.nasm b/MdePkg/Library/BaseMemoryLibSse2/X64/ScanMem16.nasm index 9f0de63ea655..93c480878dc1 100644 --- a/MdePkg/Library/BaseMemoryLibSse2/X64/ScanMem16.nasm +++ b/MdePkg/Library/BaseMemoryLibSse2/X64/ScanMem16.nasm @@ -1,13 +1,7 @@ ;------------------------------------------------------------------------------ ; ; Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR> -; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BSD License -; which accompanies this distribution. The full text of the license may be found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. +; SPDX-License-Identifier: BSD-2-Clause-Patent ; ; Module Name: ; diff --git a/MdePkg/Library/BaseMemoryLibSse2/X64/ScanMem32.S b/MdePkg/Library/BaseMemoryLibSse2/X64/ScanMem32.S deleted file mode 100644 index 9979e972cfaa..000000000000 --- a/MdePkg/Library/BaseMemoryLibSse2/X64/ScanMem32.S +++ /dev/null @@ -1,56 +0,0 @@ -# -# ConvertAsm.py: Automatically generated from ScanMem32.asm -# -#------------------------------------------------------------------------------ -# -# Copyright (c) 2006 - 2009, Intel Corporation. All rights reserved.<BR> -# This program and the accompanying materials -# are licensed and made available under the terms and conditions of the BSD License -# which accompanies this distribution. The full text of the license may be found at -# http://opensource.org/licenses/bsd-license.php. -# -# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. -# -# Module Name: -# -# ScanMem32.S -# -# Abstract: -# -# ScanMem32 function -# -# Notes: -# -# The following BaseMemoryLib instances contain the same copy of this file: -# -# BaseMemoryLibRepStr -# BaseMemoryLibMmx -# BaseMemoryLibSse2 -# BaseMemoryLibOptDxe -# BaseMemoryLibOptPei -# -#------------------------------------------------------------------------------ - - -#------------------------------------------------------------------------------ -# CONST VOID * -# EFIAPI -# InternalMemScanMem32 ( -# IN CONST VOID *Buffer, -# IN UINTN Length, -# IN UINT32 Value -# ); -#------------------------------------------------------------------------------ -ASM_GLOBAL ASM_PFX(InternalMemScanMem32) -ASM_PFX(InternalMemScanMem32): - pushq %rdi - movq %rcx, %rdi - movq %rdx, %rcx - movq %r8, %rax - repne scasl - leaq -4(%rdi), %rax - cmovnz %rcx, %rax # set rax to 0 if not found - popq %rdi - ret - diff --git a/MdePkg/Library/BaseMemoryLibSse2/X64/ScanMem32.asm b/MdePkg/Library/BaseMemoryLibSse2/X64/ScanMem32.asm deleted file mode 100644 index ad47e5a53a13..000000000000 --- a/MdePkg/Library/BaseMemoryLibSse2/X64/ScanMem32.asm +++ /dev/null @@ -1,53 +0,0 @@ -;------------------------------------------------------------------------------ -; -; Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR> -; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BSD License -; which accompanies this distribution. The full text of the license may be found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. -; -; Module Name: -; -; ScanMem32.Asm -; -; Abstract: -; -; ScanMem32 function -; -; Notes: -; -; The following BaseMemoryLib instances contain the same copy of this file: -; -; BaseMemoryLibRepStr -; BaseMemoryLibMmx -; BaseMemoryLibSse2 -; BaseMemoryLibOptDxe -; BaseMemoryLibOptPei -; -;------------------------------------------------------------------------------ - - .code - -;------------------------------------------------------------------------------ -; CONST VOID * -; EFIAPI -; InternalMemScanMem32 ( -; IN CONST VOID *Buffer, -; IN UINTN Length, -; IN UINT32 Value -; ); -;------------------------------------------------------------------------------ -InternalMemScanMem32 PROC USES rdi - mov rdi, rcx - mov rax, r8 - mov rcx, rdx - repne scasd - lea rax, [rdi - 4] - cmovnz rax, rcx - ret -InternalMemScanMem32 ENDP - - END diff --git a/MdePkg/Library/BaseMemoryLibSse2/X64/ScanMem32.nasm b/MdePkg/Library/BaseMemoryLibSse2/X64/ScanMem32.nasm index 5c9ae5d08389..352debaee2ab 100644 --- a/MdePkg/Library/BaseMemoryLibSse2/X64/ScanMem32.nasm +++ b/MdePkg/Library/BaseMemoryLibSse2/X64/ScanMem32.nasm @@ -1,13 +1,7 @@ ;------------------------------------------------------------------------------ ; ; Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR> -; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BSD License -; which accompanies this distribution. The full text of the license may be found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. +; SPDX-License-Identifier: BSD-2-Clause-Patent ; ; Module Name: ; diff --git a/MdePkg/Library/BaseMemoryLibSse2/X64/ScanMem64.S b/MdePkg/Library/BaseMemoryLibSse2/X64/ScanMem64.S deleted file mode 100644 index 4c994b9d5a1a..000000000000 --- a/MdePkg/Library/BaseMemoryLibSse2/X64/ScanMem64.S +++ /dev/null @@ -1,56 +0,0 @@ -# -# ConvertAsm.py: Automatically generated from ScanMem64.asm -# -#------------------------------------------------------------------------------ -# -# Copyright (c) 2006 - 2009, Intel Corporation. All rights reserved.<BR> -# This program and the accompanying materials -# are licensed and made available under the terms and conditions of the BSD License -# which accompanies this distribution. The full text of the license may be found at -# http://opensource.org/licenses/bsd-license.php. -# -# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. -# -# Module Name: -# -# ScanMem64.S -# -# Abstract: -# -# ScanMem64 function -# -# Notes: -# -# The following BaseMemoryLib instances contain the same copy of this file: -# -# BaseMemoryLibRepStr -# BaseMemoryLibMmx -# BaseMemoryLibSse2 -# BaseMemoryLibOptDxe -# BaseMemoryLibOptPei -# -#------------------------------------------------------------------------------ - - -#------------------------------------------------------------------------------ -# CONST VOID * -# EFIAPI -# InternalMemScanMem64 ( -# IN CONST VOID *Buffer, -# IN UINTN Length, -# IN UINT64 Value -# ); -#------------------------------------------------------------------------------ -ASM_GLOBAL ASM_PFX(InternalMemScanMem64) -ASM_PFX(InternalMemScanMem64): - pushq %rdi - movq %rcx, %rdi - movq %rdx, %rcx - movq %r8, %rax - repne scasq - leaq -8(%rdi), %rax - cmovnz %rcx, %rax # set rax to 0 if not found - popq %rdi - ret - diff --git a/MdePkg/Library/BaseMemoryLibSse2/X64/ScanMem64.asm b/MdePkg/Library/BaseMemoryLibSse2/X64/ScanMem64.asm deleted file mode 100644 index 3eb5b719fa07..000000000000 --- a/MdePkg/Library/BaseMemoryLibSse2/X64/ScanMem64.asm +++ /dev/null @@ -1,53 +0,0 @@ -;------------------------------------------------------------------------------ -; -; Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR> -; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BSD License -; which accompanies this distribution. The full text of the license may be found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. -; -; Module Name: -; -; ScanMem64.Asm -; -; Abstract: -; -; ScanMem64 function -; -; Notes: -; -; The following BaseMemoryLib instances contain the same copy of this file: -; -; BaseMemoryLibRepStr -; BaseMemoryLibMmx -; BaseMemoryLibSse2 -; BaseMemoryLibOptDxe -; BaseMemoryLibOptPei -; -;------------------------------------------------------------------------------ - - .code - -;------------------------------------------------------------------------------ -; CONST VOID * -; EFIAPI -; InternalMemScanMem64 ( -; IN CONST VOID *Buffer, -; IN UINTN Length, -; IN UINT64 Value -; ); -;------------------------------------------------------------------------------ -InternalMemScanMem64 PROC USES rdi - mov rdi, rcx - mov rax, r8 - mov rcx, rdx - repne scasq - lea rax, [rdi - 8] - cmovnz rax, rcx - ret -InternalMemScanMem64 ENDP - - END diff --git a/MdePkg/Library/BaseMemoryLibSse2/X64/ScanMem64.nasm b/MdePkg/Library/BaseMemoryLibSse2/X64/ScanMem64.nasm index b98c6dece330..601801053cbc 100644 --- a/MdePkg/Library/BaseMemoryLibSse2/X64/ScanMem64.nasm +++ b/MdePkg/Library/BaseMemoryLibSse2/X64/ScanMem64.nasm @@ -1,13 +1,7 @@ ;------------------------------------------------------------------------------ ; ; Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR> -; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BSD License -; which accompanies this distribution. The full text of the license may be found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. +; SPDX-License-Identifier: BSD-2-Clause-Patent ; ; Module Name: ; diff --git a/MdePkg/Library/BaseMemoryLibSse2/X64/ScanMem8.S b/MdePkg/Library/BaseMemoryLibSse2/X64/ScanMem8.S deleted file mode 100644 index 1bb04aa41464..000000000000 --- a/MdePkg/Library/BaseMemoryLibSse2/X64/ScanMem8.S +++ /dev/null @@ -1,56 +0,0 @@ -# -# ConvertAsm.py: Automatically generated from ScanMem8.asm -# -#------------------------------------------------------------------------------ -# -# Copyright (c) 2006 - 2009, Intel Corporation. All rights reserved.<BR> -# This program and the accompanying materials -# are licensed and made available under the terms and conditions of the BSD License -# which accompanies this distribution. The full text of the license may be found at -# http://opensource.org/licenses/bsd-license.php. -# -# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. -# -# Module Name: -# -# ScanMem8.S -# -# Abstract: -# -# ScanMem8 function -# -# Notes: -# -# The following BaseMemoryLib instances contain the same copy of this file: -# -# BaseMemoryLibRepStr -# BaseMemoryLibMmx -# BaseMemoryLibSse2 -# BaseMemoryLibOptDxe -# BaseMemoryLibOptPei -# -#------------------------------------------------------------------------------ - - -#------------------------------------------------------------------------------ -# CONST VOID * -# EFIAPI -# InternalMemScanMem8 ( -# IN CONST VOID *Buffer, -# IN UINTN Length, -# IN UINT8 Value -# ); -#------------------------------------------------------------------------------ -ASM_GLOBAL ASM_PFX(InternalMemScanMem8) -ASM_PFX(InternalMemScanMem8): - pushq %rdi - movq %rcx, %rdi - movq %rdx, %rcx - movq %r8, %rax - repne scasb - leaq -1(%rdi), %rax - cmovnz %rcx, %rax # set rax to 0 if not found - popq %rdi - ret - diff --git a/MdePkg/Library/BaseMemoryLibSse2/X64/ScanMem8.asm b/MdePkg/Library/BaseMemoryLibSse2/X64/ScanMem8.asm deleted file mode 100644 index 8ece85e5b4a2..000000000000 --- a/MdePkg/Library/BaseMemoryLibSse2/X64/ScanMem8.asm +++ /dev/null @@ -1,53 +0,0 @@ -;------------------------------------------------------------------------------ -; -; Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR> -; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BSD License -; which accompanies this distribution. The full text of the license may be found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. -; -; Module Name: -; -; ScanMem8.Asm -; -; Abstract: -; -; ScanMem8 function -; -; Notes: -; -; The following BaseMemoryLib instances contain the same copy of this file: -; -; BaseMemoryLibRepStr -; BaseMemoryLibMmx -; BaseMemoryLibSse2 -; BaseMemoryLibOptDxe -; BaseMemoryLibOptPei -; -;------------------------------------------------------------------------------ - - .code - -;------------------------------------------------------------------------------ -; CONST VOID * -; EFIAPI -; InternalMemScanMem8 ( -; IN CONST VOID *Buffer, -; IN UINTN Length, -; IN UINT8 Value -; ); -;------------------------------------------------------------------------------ -InternalMemScanMem8 PROC USES rdi - mov rdi, rcx - mov rcx, rdx - mov rax, r8 - repne scasb - lea rax, [rdi - 1] - cmovnz rax, rcx ; set rax to 0 if not found - ret -InternalMemScanMem8 ENDP - - END diff --git a/MdePkg/Library/BaseMemoryLibSse2/X64/ScanMem8.nasm b/MdePkg/Library/BaseMemoryLibSse2/X64/ScanMem8.nasm index 8499795a1d7e..b304315c6d8d 100644 --- a/MdePkg/Library/BaseMemoryLibSse2/X64/ScanMem8.nasm +++ b/MdePkg/Library/BaseMemoryLibSse2/X64/ScanMem8.nasm @@ -1,13 +1,7 @@ ;------------------------------------------------------------------------------ ; ; Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR> -; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BSD License -; which accompanies this distribution. The full text of the license may be found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. +; SPDX-License-Identifier: BSD-2-Clause-Patent ; ; Module Name: ; diff --git a/MdePkg/Library/BaseMemoryLibSse2/X64/SetMem.S b/MdePkg/Library/BaseMemoryLibSse2/X64/SetMem.S deleted file mode 100644 index 25012d402b0e..000000000000 --- a/MdePkg/Library/BaseMemoryLibSse2/X64/SetMem.S +++ /dev/null @@ -1,72 +0,0 @@ -# -# ConvertAsm.py: Automatically generated from SetMem.asm -# -#------------------------------------------------------------------------------ -# -# Copyright (c) 2006 - 2009, Intel Corporation. All rights reserved.<BR> -# This program and the accompanying materials -# are licensed and made available under the terms and conditions of the BSD License -# which accompanies this distribution. The full text of the license may be found at -# http://opensource.org/licenses/bsd-license.php. -# -# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. -# -# Module Name: -# -# SetMem.S -# -# Abstract: -# -# SetMem function -# -# Notes: -# -#------------------------------------------------------------------------------ - - -#------------------------------------------------------------------------------ -# VOID * -# EFIAPI -# InternalMemSetMem ( -# IN VOID *Buffer, -# IN UINTN Count, -# IN UINT8 Value -# ) -#------------------------------------------------------------------------------ -ASM_GLOBAL ASM_PFX(InternalMemSetMem) -ASM_PFX(InternalMemSetMem): - pushq %rdi - movq %rcx, %rdi # rdi <- Buffer - movb %r8b, %al # al <- Value - movq %rdi, %r9 # r9 <- Buffer as return value - xorq %rcx, %rcx - subq %rdi, %rcx - andq $15, %rcx # rcx + rdi aligns on 16-byte boundary - jz L0 - cmpq %rdx, %rcx - cmova %rdx, %rcx - subq %rcx, %rdx - rep stosb -L0: - movq %rdx, %rcx - andq $15, %rdx - shrq $4, %rcx - jz L_SetBytes - movb %al, %ah # ax <- Value repeats twice - movdqa %xmm0, 0x10(%rsp) # save xmm0 - movd %eax, %xmm0 # xmm0[0..16] <- Value repeats twice - pshuflw $0, %xmm0, %xmm0 # xmm0[0..63] <- Value repeats 8 times - movlhps %xmm0, %xmm0 # xmm0 <- Value repeats 16 times -L1: - movntdq %xmm0, (%rdi) # rdi should be 16-byte aligned - add $16, %rdi - loop L1 - mfence - movdqa 0x10(%rsp), %xmm0 # restore xmm0 -L_SetBytes: - movl %edx, %ecx # high 32 bits of rcx are always zero - rep stosb - movq %r9, %rax # rax <- Return value - popq %rdi - ret diff --git a/MdePkg/Library/BaseMemoryLibSse2/X64/SetMem.asm b/MdePkg/Library/BaseMemoryLibSse2/X64/SetMem.asm deleted file mode 100644 index 5b5623ff186f..000000000000 --- a/MdePkg/Library/BaseMemoryLibSse2/X64/SetMem.asm +++ /dev/null @@ -1,69 +0,0 @@ -;------------------------------------------------------------------------------ -; -; Copyright (c) 2006, Intel Corporation. All rights reserved.<BR> -; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BSD License -; which accompanies this distribution. The full text of the license may be found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. -; -; Module Name: -; -; SetMem.asm -; -; Abstract: -; -; SetMem function -; -; Notes: -; -;------------------------------------------------------------------------------ - - .code - -;------------------------------------------------------------------------------ -; VOID * -; InternalMemSetMem ( -; IN VOID *Buffer, -; IN UINTN Count, -; IN UINT8 Value -; ) -;------------------------------------------------------------------------------ -InternalMemSetMem PROC USES rdi - mov rdi, rcx ; rdi <- Buffer - mov al, r8b ; al <- Value - mov r9, rdi ; r9 <- Buffer as return value - xor rcx, rcx - sub rcx, rdi - and rcx, 15 ; rcx + rdi aligns on 16-byte boundary - jz @F - cmp rcx, rdx - cmova rcx, rdx - sub rdx, rcx - rep stosb -@@: - mov rcx, rdx - and rdx, 15 - shr rcx, 4 - jz @SetBytes - mov ah, al ; ax <- Value repeats twice - movdqa [rsp + 10h], xmm0 ; save xmm0 - movd xmm0, eax ; xmm0[0..16] <- Value repeats twice - pshuflw xmm0, xmm0, 0 ; xmm0[0..63] <- Value repeats 8 times - movlhps xmm0, xmm0 ; xmm0 <- Value repeats 16 times -@@: - movntdq [rdi], xmm0 ; rdi should be 16-byte aligned - add rdi, 16 - loop @B - mfence - movdqa xmm0, [rsp + 10h] ; restore xmm0 -@SetBytes: - mov ecx, edx ; high 32 bits of rcx are always zero - rep stosb - mov rax, r9 ; rax <- Return value - ret -InternalMemSetMem ENDP - - END diff --git a/MdePkg/Library/BaseMemoryLibSse2/X64/SetMem.nasm b/MdePkg/Library/BaseMemoryLibSse2/X64/SetMem.nasm index fddf4c9e9e99..5c7103e00482 100644 --- a/MdePkg/Library/BaseMemoryLibSse2/X64/SetMem.nasm +++ b/MdePkg/Library/BaseMemoryLibSse2/X64/SetMem.nasm @@ -1,13 +1,7 @@ ;------------------------------------------------------------------------------ ; ; Copyright (c) 2006, Intel Corporation. All rights reserved.<BR> -; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BSD License -; which accompanies this distribution. The full text of the license may be found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. +; SPDX-License-Identifier: BSD-2-Clause-Patent ; ; Module Name: ; diff --git a/MdePkg/Library/BaseMemoryLibSse2/X64/SetMem16.S b/MdePkg/Library/BaseMemoryLibSse2/X64/SetMem16.S deleted file mode 100644 index e6bdc14eabeb..000000000000 --- a/MdePkg/Library/BaseMemoryLibSse2/X64/SetMem16.S +++ /dev/null @@ -1,70 +0,0 @@ -# -# ConvertAsm.py: Automatically generated from SetMem16.asm -# -#------------------------------------------------------------------------------ -# -# Copyright (c) 2006 - 2009, Intel Corporation. All rights reserved.<BR> -# This program and the accompanying materials -# are licensed and made available under the terms and conditions of the BSD License -# which accompanies this distribution. The full text of the license may be found at -# http://opensource.org/licenses/bsd-license.php. -# -# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. -# -# Module Name: -# -# SetMem16.S -# -# Abstract: -# -# SetMem16 function -# -# Notes: -# -#------------------------------------------------------------------------------ - - -#------------------------------------------------------------------------------ -# VOID * -# EFIAPI -# InternalMemSetMem16 ( -# IN VOID *Buffer, -# IN UINTN Count, -# IN UINT16 Value -# ) -#------------------------------------------------------------------------------ -ASM_GLOBAL ASM_PFX(InternalMemSetMem16) -ASM_PFX(InternalMemSetMem16): - pushq %rdi - movq %rcx, %rdi - movq %rdi, %r9 - xorq %rcx, %rcx - subq %rdi, %rcx - andq $15, %rcx - movq %r8, %rax - jz L0 - shrq $1, %rcx - cmpq %rdx, %rcx - cmova %rdx, %rcx - subq %rcx, %rdx - rep stosw -L0: - movq %rdx, %rcx - andl $7, %edx - shrq $3, %rcx - jz L_SetWords - movd %eax, %xmm0 - pshuflw $0, %xmm0, %xmm0 - movlhps %xmm0, %xmm0 -L1: - movntdq %xmm0, (%rdi) - addq $16, %rdi - loop L1 - mfence -L_SetWords: - movl %edx, %ecx - rep stosw - movq %r9, %rax - popq %rdi - ret diff --git a/MdePkg/Library/BaseMemoryLibSse2/X64/SetMem16.asm b/MdePkg/Library/BaseMemoryLibSse2/X64/SetMem16.asm deleted file mode 100644 index 785cf9ae7d43..000000000000 --- a/MdePkg/Library/BaseMemoryLibSse2/X64/SetMem16.asm +++ /dev/null @@ -1,67 +0,0 @@ -;------------------------------------------------------------------------------ -; -; Copyright (c) 2006, Intel Corporation. All rights reserved.<BR> -; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BSD License -; which accompanies this distribution. The full text of the license may be found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. -; -; Module Name: -; -; SetMem16.asm -; -; Abstract: -; -; SetMem16 function -; -; Notes: -; -;------------------------------------------------------------------------------ - - .code - -;------------------------------------------------------------------------------ -; VOID * -; InternalMemSetMem16 ( -; IN VOID *Buffer, -; IN UINTN Count, -; IN UINT16 Value -; ) -;------------------------------------------------------------------------------ -InternalMemSetMem16 PROC USES rdi - mov rdi, rcx - mov r9, rdi - xor rcx, rcx - sub rcx, rdi - and rcx, 15 - mov rax, r8 - jz @F - shr rcx, 1 - cmp rcx, rdx - cmova rcx, rdx - sub rdx, rcx - rep stosw -@@: - mov rcx, rdx - and edx, 7 - shr rcx, 3 - jz @SetWords - movd xmm0, eax - pshuflw xmm0, xmm0, 0 - movlhps xmm0, xmm0 -@@: - movntdq [rdi], xmm0 - add rdi, 16 - loop @B - mfence -@SetWords: - mov ecx, edx - rep stosw - mov rax, r9 - ret -InternalMemSetMem16 ENDP - - END diff --git a/MdePkg/Library/BaseMemoryLibSse2/X64/SetMem16.nasm b/MdePkg/Library/BaseMemoryLibSse2/X64/SetMem16.nasm index f2e61e891dd2..d8c68d87445e 100644 --- a/MdePkg/Library/BaseMemoryLibSse2/X64/SetMem16.nasm +++ b/MdePkg/Library/BaseMemoryLibSse2/X64/SetMem16.nasm @@ -1,13 +1,7 @@ ;------------------------------------------------------------------------------ ; ; Copyright (c) 2006, Intel Corporation. All rights reserved.<BR> -; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BSD License -; which accompanies this distribution. The full text of the license may be found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. +; SPDX-License-Identifier: BSD-2-Clause-Patent ; ; Module Name: ; diff --git a/MdePkg/Library/BaseMemoryLibSse2/X64/SetMem32.S b/MdePkg/Library/BaseMemoryLibSse2/X64/SetMem32.S deleted file mode 100644 index e0abd7195729..000000000000 --- a/MdePkg/Library/BaseMemoryLibSse2/X64/SetMem32.S +++ /dev/null @@ -1,69 +0,0 @@ -# -# ConvertAsm.py: Automatically generated from SetMem32.asm -# -#------------------------------------------------------------------------------ -# -# Copyright (c) 2006 - 2009, Intel Corporation. All rights reserved.<BR> -# This program and the accompanying materials -# are licensed and made available under the terms and conditions of the BSD License -# which accompanies this distribution. The full text of the license may be found at -# http://opensource.org/licenses/bsd-license.php. -# -# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. -# -# Module Name: -# -# SetMem32.S -# -# Abstract: -# -# SetMem32 function -# -# Notes: -# -#------------------------------------------------------------------------------ - - -#------------------------------------------------------------------------------ -# VOID * -# EFIAPI -# InternalMemSetMem32 ( -# IN VOID *Buffer, -# IN UINTN Count, -# IN UINT32 Value -# ); -#------------------------------------------------------------------------------ -ASM_GLOBAL ASM_PFX(InternalMemSetMem32) -ASM_PFX(InternalMemSetMem32): - pushq %rdi - movq %rcx, %rdi - movq %rdi, %r9 - xorq %rcx, %rcx - subq %rdi, %rcx - andq $15, %rcx - movq %r8, %rax - jz L0 - shrq $2, %rcx - cmpq %rdx, %rcx - cmova %rdx, %rcx - subq %rcx, %rdx - rep stosl -L0: - movq %rdx, %rcx - andl $3, %edx - shrq $2, %rcx - jz L_SetDwords - movd %eax, %xmm0 - pshufd $0, %xmm0, %xmm0 -L1: - movntdq %xmm0, (%rdi) - addq $16, %rdi - loop L1 - mfence -L_SetDwords: - movl %edx, %ecx - rep stosl - movq %r9, %rax - popq %rdi - ret diff --git a/MdePkg/Library/BaseMemoryLibSse2/X64/SetMem32.asm b/MdePkg/Library/BaseMemoryLibSse2/X64/SetMem32.asm deleted file mode 100644 index 4c93f89b7aff..000000000000 --- a/MdePkg/Library/BaseMemoryLibSse2/X64/SetMem32.asm +++ /dev/null @@ -1,66 +0,0 @@ -;------------------------------------------------------------------------------ -; -; Copyright (c) 2006, Intel Corporation. All rights reserved.<BR> -; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BSD License -; which accompanies this distribution. The full text of the license may be found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. -; -; Module Name: -; -; SetMem32.asm -; -; Abstract: -; -; SetMem32 function -; -; Notes: -; -;------------------------------------------------------------------------------ - - .code - -;------------------------------------------------------------------------------ -; VOID * -; InternalMemSetMem32 ( -; IN VOID *Buffer, -; IN UINTN Count, -; IN UINT8 Value -; ) -;------------------------------------------------------------------------------ -InternalMemSetMem32 PROC USES rdi - mov rdi, rcx - mov r9, rdi - xor rcx, rcx - sub rcx, rdi - and rcx, 15 - mov rax, r8 - jz @F - shr rcx, 2 - cmp rcx, rdx - cmova rcx, rdx - sub rdx, rcx - rep stosd -@@: - mov rcx, rdx - and edx, 3 - shr rcx, 2 - jz @SetDwords - movd xmm0, eax - pshufd xmm0, xmm0, 0 -@@: - movntdq [rdi], xmm0 - add rdi, 16 - loop @B - mfence -@SetDwords: - mov ecx, edx - rep stosd - mov rax, r9 - ret -InternalMemSetMem32 ENDP - - END diff --git a/MdePkg/Library/BaseMemoryLibSse2/X64/SetMem32.nasm b/MdePkg/Library/BaseMemoryLibSse2/X64/SetMem32.nasm index d4ecf170a48a..0fb531660b08 100644 --- a/MdePkg/Library/BaseMemoryLibSse2/X64/SetMem32.nasm +++ b/MdePkg/Library/BaseMemoryLibSse2/X64/SetMem32.nasm @@ -1,13 +1,7 @@ ;------------------------------------------------------------------------------ ; ; Copyright (c) 2006, Intel Corporation. All rights reserved.<BR> -; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BSD License -; which accompanies this distribution. The full text of the license may be found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. +; SPDX-License-Identifier: BSD-2-Clause-Patent ; ; Module Name: ; diff --git a/MdePkg/Library/BaseMemoryLibSse2/X64/SetMem64.S b/MdePkg/Library/BaseMemoryLibSse2/X64/SetMem64.S deleted file mode 100644 index de48ff23db75..000000000000 --- a/MdePkg/Library/BaseMemoryLibSse2/X64/SetMem64.S +++ /dev/null @@ -1,60 +0,0 @@ -# -# ConvertAsm.py: Automatically generated from SetMem64.asm -# -#------------------------------------------------------------------------------ -# -# Copyright (c) 2006 - 2009, Intel Corporation. All rights reserved.<BR> -# This program and the accompanying materials -# are licensed and made available under the terms and conditions of the BSD License -# which accompanies this distribution. The full text of the license may be found at -# http://opensource.org/licenses/bsd-license.php. -# -# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. -# -# Module Name: -# -# SetMem64.S -# -# Abstract: -# -# SetMem64 function -# -# Notes: -# -#------------------------------------------------------------------------------ - - -#------------------------------------------------------------------------------ -# VOID * -# InternalMemSetMem64 ( -# IN VOID *Buffer, -# IN UINTN Count, -# IN UINT64 Value -# ) -#------------------------------------------------------------------------------ -ASM_GLOBAL ASM_PFX(InternalMemSetMem64) -ASM_PFX(InternalMemSetMem64): - movq %rcx, %rax # rax <- Buffer - xchgq %rdx, %rcx # rcx <- Count & rdx <- Buffer - testb $8, %dl - movd %r8, %xmm0 - jz L0 - movq %r8, (%rdx) - addq $8, %rdx - decq %rcx -L0: - shrq $1, %rcx - jz L_SetQwords - movlhps %xmm0, %xmm0 -L1: - movntdq %xmm0, (%rdx) - leaq 16(%rdx), %rdx - loop L1 - mfence -L_SetQwords: - jnc L2 - movq %r8, (%rdx) -L2: - ret - diff --git a/MdePkg/Library/BaseMemoryLibSse2/X64/SetMem64.asm b/MdePkg/Library/BaseMemoryLibSse2/X64/SetMem64.asm deleted file mode 100644 index c2c413cd793e..000000000000 --- a/MdePkg/Library/BaseMemoryLibSse2/X64/SetMem64.asm +++ /dev/null @@ -1,59 +0,0 @@ -;------------------------------------------------------------------------------ -; -; Copyright (c) 2006, Intel Corporation. All rights reserved.<BR> -; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BSD License -; which accompanies this distribution. The full text of the license may be found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. -; -; Module Name: -; -; SetMem64.asm -; -; Abstract: -; -; SetMem64 function -; -; Notes: -; -;------------------------------------------------------------------------------ - - .code - -;------------------------------------------------------------------------------ -; VOID * -; InternalMemSetMem64 ( -; IN VOID *Buffer, -; IN UINTN Count, -; IN UINT64 Value -; ) -;------------------------------------------------------------------------------ -InternalMemSetMem64 PROC - mov rax, rcx ; rax <- Buffer - xchg rcx, rdx ; rcx <- Count & rdx <- Buffer - test dl, 8 - movd xmm0, r8 - jz @F - mov [rdx], r8 - add rdx, 8 - dec rcx -@@: - shr rcx, 1 - jz @SetQwords - movlhps xmm0, xmm0 -@@: - movntdq [rdx], xmm0 - lea rdx, [rdx + 16] - loop @B - mfence -@SetQwords: - jnc @F - mov [rdx], r8 -@@: - ret -InternalMemSetMem64 ENDP - - END diff --git a/MdePkg/Library/BaseMemoryLibSse2/X64/SetMem64.nasm b/MdePkg/Library/BaseMemoryLibSse2/X64/SetMem64.nasm index f543693d109e..d4f740e9d474 100644 --- a/MdePkg/Library/BaseMemoryLibSse2/X64/SetMem64.nasm +++ b/MdePkg/Library/BaseMemoryLibSse2/X64/SetMem64.nasm @@ -1,13 +1,7 @@ ;------------------------------------------------------------------------------ ; ; Copyright (c) 2006, Intel Corporation. All rights reserved.<BR> -; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BSD License -; which accompanies this distribution. The full text of the license may be found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. +; SPDX-License-Identifier: BSD-2-Clause-Patent ; ; Module Name: ; diff --git a/MdePkg/Library/BaseMemoryLibSse2/X64/ZeroMem.S b/MdePkg/Library/BaseMemoryLibSse2/X64/ZeroMem.S deleted file mode 100644 index 7cf7a267d174..000000000000 --- a/MdePkg/Library/BaseMemoryLibSse2/X64/ZeroMem.S +++ /dev/null @@ -1,65 +0,0 @@ -# -# ConvertAsm.py: Automatically generated from ZeroMem.asm -# -#------------------------------------------------------------------------------ -# -# Copyright (c) 2006 - 2009, Intel Corporation. All rights reserved.<BR> -# This program and the accompanying materials -# are licensed and made available under the terms and conditions of the BSD License -# which accompanies this distribution. The full text of the license may be found at -# http://opensource.org/licenses/bsd-license.php. -# -# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. -# -# Module Name: -# -# ZeroMem.S -# -# Abstract: -# -# ZeroMem function -# -# Notes: -# -#------------------------------------------------------------------------------ - - -#------------------------------------------------------------------------------ -# VOID * -# InternalMemZeroMem ( -# IN VOID *Buffer, -# IN UINTN Count -# ); -#------------------------------------------------------------------------------ -ASM_GLOBAL ASM_PFX(InternalMemZeroMem) -ASM_PFX(InternalMemZeroMem): - pushq %rdi - movq %rcx, %rdi - xorq %rcx, %rcx - xorl %eax, %eax - subq %rdi, %rcx - andq $15, %rcx - movq %rdi, %r8 - jz L0 - cmpq %rdx, %rcx - cmova %rdx, %rcx - subq %rcx, %rdx - rep stosb -L0: - movq %rdx, %rcx - andl $15, %edx - shrq $4, %rcx - jz L_ZeroBytes - pxor %xmm0, %xmm0 -L1: - movntdq %xmm0, (%rdi) # rdi should be 16-byte aligned - addq $16, %rdi - loop L1 - mfence -L_ZeroBytes: - movl %edx, %ecx - rep stosb - movq %r8, %rax - popq %rdi - ret diff --git a/MdePkg/Library/BaseMemoryLibSse2/X64/ZeroMem.asm b/MdePkg/Library/BaseMemoryLibSse2/X64/ZeroMem.asm deleted file mode 100644 index 4a486c9ca5a4..000000000000 --- a/MdePkg/Library/BaseMemoryLibSse2/X64/ZeroMem.asm +++ /dev/null @@ -1,63 +0,0 @@ -;------------------------------------------------------------------------------ -; -; Copyright (c) 2006, Intel Corporation. All rights reserved.<BR> -; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BSD License -; which accompanies this distribution. The full text of the license may be found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. -; -; Module Name: -; -; ZeroMem.asm -; -; Abstract: -; -; ZeroMem function -; -; Notes: -; -;------------------------------------------------------------------------------ - - .code - -;------------------------------------------------------------------------------ -; VOID * -; InternalMemZeroMem ( -; IN VOID *Buffer, -; IN UINTN Count -; ) -;------------------------------------------------------------------------------ -InternalMemZeroMem PROC USES rdi - mov rdi, rcx - xor rcx, rcx - xor eax, eax - sub rcx, rdi - and rcx, 15 - mov r8, rdi - jz @F - cmp rcx, rdx - cmova rcx, rdx - sub rdx, rcx - rep stosb -@@: - mov rcx, rdx - and edx, 15 - shr rcx, 4 - jz @ZeroBytes - pxor xmm0, xmm0 -@@: - movntdq [rdi], xmm0 ; rdi should be 16-byte aligned - add rdi, 16 - loop @B - mfence -@ZeroBytes: - mov ecx, edx - rep stosb - mov rax, r8 - ret -InternalMemZeroMem ENDP - - END diff --git a/MdePkg/Library/BaseMemoryLibSse2/X64/ZeroMem.nasm b/MdePkg/Library/BaseMemoryLibSse2/X64/ZeroMem.nasm index 1dd0a1477040..f5d263f219cd 100644 --- a/MdePkg/Library/BaseMemoryLibSse2/X64/ZeroMem.nasm +++ b/MdePkg/Library/BaseMemoryLibSse2/X64/ZeroMem.nasm @@ -1,13 +1,7 @@ ;------------------------------------------------------------------------------ ; ; Copyright (c) 2006, Intel Corporation. All rights reserved.<BR> -; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BSD License -; which accompanies this distribution. The full text of the license may be found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. +; SPDX-License-Identifier: BSD-2-Clause-Patent ; ; Module Name: ; diff --git a/MdePkg/Library/BaseMemoryLibSse2/ZeroMemWrapper.c b/MdePkg/Library/BaseMemoryLibSse2/ZeroMemWrapper.c index 067c7af84819..0b56e79f55c9 100644 --- a/MdePkg/Library/BaseMemoryLibSse2/ZeroMemWrapper.c +++ b/MdePkg/Library/BaseMemoryLibSse2/ZeroMemWrapper.c @@ -11,15 +11,9 @@ BaseMemoryLibOptPei PeiMemoryLib UefiMemoryLib - - Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR> - This program and the accompanying materials - are licensed and made available under the terms and conditions of the BSD License - which accompanies this distribution. The full text of the license may be found at - http://opensource.org/licenses/bsd-license.php. - THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, - WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. + Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR> + SPDX-License-Identifier: BSD-2-Clause-Patent **/ @@ -29,7 +23,7 @@ Fills a target buffer with zeros, and returns the target buffer. This function fills Length bytes of Buffer with zeros, and returns Buffer. - + If Length > 0 and Buffer is NULL, then ASSERT(). If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT(). |