summaryrefslogtreecommitdiff
path: root/MdePkg/Library/BaseMemoryLibSse2/X64
diff options
context:
space:
mode:
authorqhuang8 <qhuang8@6f19259b-4bc3-4df7-8a09-765794883524>2008-11-03 09:25:10 +0000
committerqhuang8 <qhuang8@6f19259b-4bc3-4df7-8a09-765794883524>2008-11-03 09:25:10 +0000
commitb1ff428c96518b7f4810eff4688d60ac7c65fba5 (patch)
tree026e335affbc22d320ed9088afcec644e85d338f /MdePkg/Library/BaseMemoryLibSse2/X64
parentdb835e01d3e5d2f09c12d73d749c37fcc7c20291 (diff)
downloadedk2-platforms-b1ff428c96518b7f4810eff4688d60ac7c65fba5.tar.xz
Update to use DOS format
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@6360 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'MdePkg/Library/BaseMemoryLibSse2/X64')
-rw-r--r--MdePkg/Library/BaseMemoryLibSse2/X64/CompareMem.S120
-rw-r--r--MdePkg/Library/BaseMemoryLibSse2/X64/CopyMem.S168
-rw-r--r--MdePkg/Library/BaseMemoryLibSse2/X64/ScanMem16.S114
-rw-r--r--MdePkg/Library/BaseMemoryLibSse2/X64/ScanMem32.S114
-rw-r--r--MdePkg/Library/BaseMemoryLibSse2/X64/ScanMem64.S114
-rw-r--r--MdePkg/Library/BaseMemoryLibSse2/X64/ScanMem8.S114
-rw-r--r--MdePkg/Library/BaseMemoryLibSse2/X64/SetMem.S146
-rw-r--r--MdePkg/Library/BaseMemoryLibSse2/X64/SetMem16.S142
-rw-r--r--MdePkg/Library/BaseMemoryLibSse2/X64/SetMem32.S140
-rw-r--r--MdePkg/Library/BaseMemoryLibSse2/X64/SetMem64.S122
-rw-r--r--MdePkg/Library/BaseMemoryLibSse2/X64/ZeroMem.S132
11 files changed, 713 insertions, 713 deletions
diff --git a/MdePkg/Library/BaseMemoryLibSse2/X64/CompareMem.S b/MdePkg/Library/BaseMemoryLibSse2/X64/CompareMem.S
index 5580d6237a..61343d307d 100644
--- a/MdePkg/Library/BaseMemoryLibSse2/X64/CompareMem.S
+++ b/MdePkg/Library/BaseMemoryLibSse2/X64/CompareMem.S
@@ -1,60 +1,60 @@
-#
-# ConvertAsm.py: Automatically generated from CompareMem.asm
-#
-#------------------------------------------------------------------------------
-#
-# Copyright (c) 2006, Intel Corporation
-# All rights reserved. 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
-# );
-#------------------------------------------------------------------------------
-.intel_syntax noprefix
-.globl ASM_PFX(InternalMemCompareMem)
-ASM_PFX(InternalMemCompareMem):
- push rsi
- push 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
- pop rdi
- pop rsi
- ret
-
+#
+# ConvertAsm.py: Automatically generated from CompareMem.asm
+#
+#------------------------------------------------------------------------------
+#
+# Copyright (c) 2006, Intel Corporation
+# All rights reserved. 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
+# );
+#------------------------------------------------------------------------------
+.intel_syntax noprefix
+.globl ASM_PFX(InternalMemCompareMem)
+ASM_PFX(InternalMemCompareMem):
+ push rsi
+ push 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
+ pop rdi
+ pop rsi
+ ret
+
diff --git a/MdePkg/Library/BaseMemoryLibSse2/X64/CopyMem.S b/MdePkg/Library/BaseMemoryLibSse2/X64/CopyMem.S
index 35db797677..553f53957e 100644
--- a/MdePkg/Library/BaseMemoryLibSse2/X64/CopyMem.S
+++ b/MdePkg/Library/BaseMemoryLibSse2/X64/CopyMem.S
@@ -1,84 +1,84 @@
-#
-# ConvertAsm.py: Automatically generated from CopyMem.asm
-#
-#------------------------------------------------------------------------------
-#
-# Copyright (c) 2006, Intel Corporation
-# All rights reserved. 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
-# )
-#------------------------------------------------------------------------------
-.intel_syntax noprefix
-.globl ASM_PFX(InternalMemCopyMem)
-ASM_PFX(InternalMemCopyMem):
- push rsi
- push 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 L0 # Copy forward if Source > Destination
- cmp r9, rdi # Overlapped?
- jae L_CopyBackward # Copy backward if overlapped
-L0:
- xor rcx, rcx
- sub rcx, rdi # rcx <- -rdi
- and rcx, 15 # rcx + rsi should be 16 bytes aligned
- jz L1 # skip if rcx == 0
- cmp rcx, r8
- cmova rcx, r8
- sub r8, rcx
- rep movsb
-L1:
- mov rcx, r8
- and r8, 15
- shr rcx, 4 # rcx <- # of DQwords to copy
- jz L_CopyBytes
- movdqa [rsp + 0x18], xmm0 # save xmm0 on stack
-L2:
- 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 L2
- mfence
- movdqa xmm0, [rsp + 0x18] # restore xmm0
- jmp L_CopyBytes # copy remaining bytes
-L_CopyBackward:
- mov rsi, r9 # rsi <- Last byte of Source
- lea rdi, [rdi + r8 - 1] # rdi <- Last byte of Destination
- std
-L_CopyBytes:
- mov rcx, r8
- rep movsb
- cld
- pop rdi
- pop rsi
- ret
+#
+# ConvertAsm.py: Automatically generated from CopyMem.asm
+#
+#------------------------------------------------------------------------------
+#
+# Copyright (c) 2006, Intel Corporation
+# All rights reserved. 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
+# )
+#------------------------------------------------------------------------------
+.intel_syntax noprefix
+.globl ASM_PFX(InternalMemCopyMem)
+ASM_PFX(InternalMemCopyMem):
+ push rsi
+ push 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 L0 # Copy forward if Source > Destination
+ cmp r9, rdi # Overlapped?
+ jae L_CopyBackward # Copy backward if overlapped
+L0:
+ xor rcx, rcx
+ sub rcx, rdi # rcx <- -rdi
+ and rcx, 15 # rcx + rsi should be 16 bytes aligned
+ jz L1 # skip if rcx == 0
+ cmp rcx, r8
+ cmova rcx, r8
+ sub r8, rcx
+ rep movsb
+L1:
+ mov rcx, r8
+ and r8, 15
+ shr rcx, 4 # rcx <- # of DQwords to copy
+ jz L_CopyBytes
+ movdqa [rsp + 0x18], xmm0 # save xmm0 on stack
+L2:
+ 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 L2
+ mfence
+ movdqa xmm0, [rsp + 0x18] # restore xmm0
+ jmp L_CopyBytes # copy remaining bytes
+L_CopyBackward:
+ mov rsi, r9 # rsi <- Last byte of Source
+ lea rdi, [rdi + r8 - 1] # rdi <- Last byte of Destination
+ std
+L_CopyBytes:
+ mov rcx, r8
+ rep movsb
+ cld
+ pop rdi
+ pop rsi
+ ret
diff --git a/MdePkg/Library/BaseMemoryLibSse2/X64/ScanMem16.S b/MdePkg/Library/BaseMemoryLibSse2/X64/ScanMem16.S
index 9a94f5d936..b777aac426 100644
--- a/MdePkg/Library/BaseMemoryLibSse2/X64/ScanMem16.S
+++ b/MdePkg/Library/BaseMemoryLibSse2/X64/ScanMem16.S
@@ -1,57 +1,57 @@
-#
-# ConvertAsm.py: Automatically generated from ScanMem16.asm
-#
-#------------------------------------------------------------------------------
-#
-# Copyright (c) 2006, Intel Corporation
-# All rights reserved. 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
-# );
-#------------------------------------------------------------------------------
-.intel_syntax noprefix
-.globl ASM_PFX(InternalMemScanMem16)
-ASM_PFX(InternalMemScanMem16):
- push rdi
- mov rdi, rcx
- mov rax, r8
- mov rcx, rdx
- repne scasw
- lea rax, [rdi - 2]
- cmovnz rax, rcx
- pop rdi
- ret
-
+#
+# ConvertAsm.py: Automatically generated from ScanMem16.asm
+#
+#------------------------------------------------------------------------------
+#
+# Copyright (c) 2006, Intel Corporation
+# All rights reserved. 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
+# );
+#------------------------------------------------------------------------------
+.intel_syntax noprefix
+.globl ASM_PFX(InternalMemScanMem16)
+ASM_PFX(InternalMemScanMem16):
+ push rdi
+ mov rdi, rcx
+ mov rax, r8
+ mov rcx, rdx
+ repne scasw
+ lea rax, [rdi - 2]
+ cmovnz rax, rcx
+ pop rdi
+ ret
+
diff --git a/MdePkg/Library/BaseMemoryLibSse2/X64/ScanMem32.S b/MdePkg/Library/BaseMemoryLibSse2/X64/ScanMem32.S
index 86a6503fb3..8f1804ce06 100644
--- a/MdePkg/Library/BaseMemoryLibSse2/X64/ScanMem32.S
+++ b/MdePkg/Library/BaseMemoryLibSse2/X64/ScanMem32.S
@@ -1,57 +1,57 @@
-#
-# ConvertAsm.py: Automatically generated from ScanMem32.asm
-#
-#------------------------------------------------------------------------------
-#
-# Copyright (c) 2006, Intel Corporation
-# All rights reserved. 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
-# );
-#------------------------------------------------------------------------------
-.intel_syntax noprefix
-.globl ASM_PFX(InternalMemScanMem32)
-ASM_PFX(InternalMemScanMem32):
- push rdi
- mov rdi, rcx
- mov rax, r8
- mov rcx, rdx
- repne scasd
- lea rax, [rdi - 4]
- cmovnz rax, rcx
- pop rdi
- ret
-
+#
+# ConvertAsm.py: Automatically generated from ScanMem32.asm
+#
+#------------------------------------------------------------------------------
+#
+# Copyright (c) 2006, Intel Corporation
+# All rights reserved. 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
+# );
+#------------------------------------------------------------------------------
+.intel_syntax noprefix
+.globl ASM_PFX(InternalMemScanMem32)
+ASM_PFX(InternalMemScanMem32):
+ push rdi
+ mov rdi, rcx
+ mov rax, r8
+ mov rcx, rdx
+ repne scasd
+ lea rax, [rdi - 4]
+ cmovnz rax, rcx
+ pop rdi
+ ret
+
diff --git a/MdePkg/Library/BaseMemoryLibSse2/X64/ScanMem64.S b/MdePkg/Library/BaseMemoryLibSse2/X64/ScanMem64.S
index f05f7b2b2b..f2c4e1719a 100644
--- a/MdePkg/Library/BaseMemoryLibSse2/X64/ScanMem64.S
+++ b/MdePkg/Library/BaseMemoryLibSse2/X64/ScanMem64.S
@@ -1,57 +1,57 @@
-#
-# ConvertAsm.py: Automatically generated from ScanMem64.asm
-#
-#------------------------------------------------------------------------------
-#
-# Copyright (c) 2006, Intel Corporation
-# All rights reserved. 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
-# );
-#------------------------------------------------------------------------------
-.intel_syntax noprefix
-.globl ASM_PFX(InternalMemScanMem64)
-ASM_PFX(InternalMemScanMem64):
- push rdi
- mov rdi, rcx
- mov rax, r8
- mov rcx, rdx
- repne scasq
- lea rax, [rdi - 8]
- cmovnz rax, rcx
- pop rdi
- ret
-
+#
+# ConvertAsm.py: Automatically generated from ScanMem64.asm
+#
+#------------------------------------------------------------------------------
+#
+# Copyright (c) 2006, Intel Corporation
+# All rights reserved. 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
+# );
+#------------------------------------------------------------------------------
+.intel_syntax noprefix
+.globl ASM_PFX(InternalMemScanMem64)
+ASM_PFX(InternalMemScanMem64):
+ push rdi
+ mov rdi, rcx
+ mov rax, r8
+ mov rcx, rdx
+ repne scasq
+ lea rax, [rdi - 8]
+ cmovnz rax, rcx
+ pop rdi
+ ret
+
diff --git a/MdePkg/Library/BaseMemoryLibSse2/X64/ScanMem8.S b/MdePkg/Library/BaseMemoryLibSse2/X64/ScanMem8.S
index 1d8b4e1b23..1bd944c791 100644
--- a/MdePkg/Library/BaseMemoryLibSse2/X64/ScanMem8.S
+++ b/MdePkg/Library/BaseMemoryLibSse2/X64/ScanMem8.S
@@ -1,57 +1,57 @@
-#
-# ConvertAsm.py: Automatically generated from ScanMem8.asm
-#
-#------------------------------------------------------------------------------
-#
-# Copyright (c) 2006, Intel Corporation
-# All rights reserved. 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
-# );
-#------------------------------------------------------------------------------
-.intel_syntax noprefix
-.globl ASM_PFX(InternalMemScanMem8)
-ASM_PFX(InternalMemScanMem8):
- push 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
- pop rdi
- ret
-
+#
+# ConvertAsm.py: Automatically generated from ScanMem8.asm
+#
+#------------------------------------------------------------------------------
+#
+# Copyright (c) 2006, Intel Corporation
+# All rights reserved. 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
+# );
+#------------------------------------------------------------------------------
+.intel_syntax noprefix
+.globl ASM_PFX(InternalMemScanMem8)
+ASM_PFX(InternalMemScanMem8):
+ push 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
+ pop rdi
+ ret
+
diff --git a/MdePkg/Library/BaseMemoryLibSse2/X64/SetMem.S b/MdePkg/Library/BaseMemoryLibSse2/X64/SetMem.S
index 5d915d4a08..4410082078 100644
--- a/MdePkg/Library/BaseMemoryLibSse2/X64/SetMem.S
+++ b/MdePkg/Library/BaseMemoryLibSse2/X64/SetMem.S
@@ -1,73 +1,73 @@
-#
-# ConvertAsm.py: Automatically generated from SetMem.asm
-#
-#------------------------------------------------------------------------------
-#
-# Copyright (c) 2006, Intel Corporation
-# All rights reserved. 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
-# )
-#------------------------------------------------------------------------------
-.intel_syntax noprefix
-.globl ASM_PFX(InternalMemSetMem)
-ASM_PFX(InternalMemSetMem):
- push 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 L0
- cmp rcx, rdx
- cmova rcx, rdx
- sub rdx, rcx
- rep stosb
-L0:
- mov rcx, rdx
- and rdx, 15
- shr rcx, 4
- jz L_SetBytes
- mov ah, al # ax <- Value repeats twice
- movdqa [rsp + 0x10], 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
-L1:
- movntdq [rdi], xmm0 # rdi should be 16-byte aligned
- add rdi, 16
- loop L1
- mfence
- movdqa xmm0, [rsp + 0x10] # restore xmm0
-L_SetBytes:
- mov ecx, edx # high 32 bits of rcx are always zero
- rep stosb
- mov rax, r9 # rax <- Return value
- pop rdi
- ret
+#
+# ConvertAsm.py: Automatically generated from SetMem.asm
+#
+#------------------------------------------------------------------------------
+#
+# Copyright (c) 2006, Intel Corporation
+# All rights reserved. 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
+# )
+#------------------------------------------------------------------------------
+.intel_syntax noprefix
+.globl ASM_PFX(InternalMemSetMem)
+ASM_PFX(InternalMemSetMem):
+ push 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 L0
+ cmp rcx, rdx
+ cmova rcx, rdx
+ sub rdx, rcx
+ rep stosb
+L0:
+ mov rcx, rdx
+ and rdx, 15
+ shr rcx, 4
+ jz L_SetBytes
+ mov ah, al # ax <- Value repeats twice
+ movdqa [rsp + 0x10], 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
+L1:
+ movntdq [rdi], xmm0 # rdi should be 16-byte aligned
+ add rdi, 16
+ loop L1
+ mfence
+ movdqa xmm0, [rsp + 0x10] # restore xmm0
+L_SetBytes:
+ mov ecx, edx # high 32 bits of rcx are always zero
+ rep stosb
+ mov rax, r9 # rax <- Return value
+ pop rdi
+ ret
diff --git a/MdePkg/Library/BaseMemoryLibSse2/X64/SetMem16.S b/MdePkg/Library/BaseMemoryLibSse2/X64/SetMem16.S
index 354222c1a9..8cf0710c90 100644
--- a/MdePkg/Library/BaseMemoryLibSse2/X64/SetMem16.S
+++ b/MdePkg/Library/BaseMemoryLibSse2/X64/SetMem16.S
@@ -1,71 +1,71 @@
-#
-# ConvertAsm.py: Automatically generated from SetMem16.asm
-#
-#------------------------------------------------------------------------------
-#
-# Copyright (c) 2006, Intel Corporation
-# All rights reserved. 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
-# )
-#------------------------------------------------------------------------------
-.intel_syntax noprefix
-.globl ASM_PFX(InternalMemSetMem16)
-ASM_PFX(InternalMemSetMem16):
- push rdi
- mov rdi, rcx
- mov r9, rdi
- xor rcx, rcx
- sub rcx, rdi
- and rcx, 15
- mov rax, r8
- jz L0
- shr rcx, 1
- cmp rcx, rdx
- cmova rcx, rdx
- sub rdx, rcx
- rep stosw
-L0:
- mov rcx, rdx
- and edx, 7
- shr rcx, 3
- jz L_SetWords
- movd xmm0, eax
- pshuflw xmm0, xmm0, 0
- movlhps xmm0, xmm0
-L1:
- movntdq [rdi], xmm0
- add rdi, 16
- loop L1
- mfence
-L_SetWords:
- mov ecx, edx
- rep stosw
- mov rax, r9
- pop rdi
- ret
+#
+# ConvertAsm.py: Automatically generated from SetMem16.asm
+#
+#------------------------------------------------------------------------------
+#
+# Copyright (c) 2006, Intel Corporation
+# All rights reserved. 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
+# )
+#------------------------------------------------------------------------------
+.intel_syntax noprefix
+.globl ASM_PFX(InternalMemSetMem16)
+ASM_PFX(InternalMemSetMem16):
+ push rdi
+ mov rdi, rcx
+ mov r9, rdi
+ xor rcx, rcx
+ sub rcx, rdi
+ and rcx, 15
+ mov rax, r8
+ jz L0
+ shr rcx, 1
+ cmp rcx, rdx
+ cmova rcx, rdx
+ sub rdx, rcx
+ rep stosw
+L0:
+ mov rcx, rdx
+ and edx, 7
+ shr rcx, 3
+ jz L_SetWords
+ movd xmm0, eax
+ pshuflw xmm0, xmm0, 0
+ movlhps xmm0, xmm0
+L1:
+ movntdq [rdi], xmm0
+ add rdi, 16
+ loop L1
+ mfence
+L_SetWords:
+ mov ecx, edx
+ rep stosw
+ mov rax, r9
+ pop rdi
+ ret
diff --git a/MdePkg/Library/BaseMemoryLibSse2/X64/SetMem32.S b/MdePkg/Library/BaseMemoryLibSse2/X64/SetMem32.S
index 2ace79ad96..c8f4065ec1 100644
--- a/MdePkg/Library/BaseMemoryLibSse2/X64/SetMem32.S
+++ b/MdePkg/Library/BaseMemoryLibSse2/X64/SetMem32.S
@@ -1,70 +1,70 @@
-#
-# ConvertAsm.py: Automatically generated from SetMem32.asm
-#
-#------------------------------------------------------------------------------
-#
-# Copyright (c) 2006, Intel Corporation
-# All rights reserved. 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
-# );
-#------------------------------------------------------------------------------
-.intel_syntax noprefix
-.globl ASM_PFX(InternalMemSetMem32)
-ASM_PFX(InternalMemSetMem32):
- push rdi
- mov rdi, rcx
- mov r9, rdi
- xor rcx, rcx
- sub rcx, rdi
- and rcx, 15
- mov rax, r8
- jz L0
- shr rcx, 2
- cmp rcx, rdx
- cmova rcx, rdx
- sub rdx, rcx
- rep stosd
-L0:
- mov rcx, rdx
- and edx, 3
- shr rcx, 2
- jz L_SetDwords
- movd xmm0, eax
- pshufd xmm0, xmm0, 0
-L1:
- movntdq [rdi], xmm0
- add rdi, 16
- loop L1
- mfence
-L_SetDwords:
- mov ecx, edx
- rep stosd
- mov rax, r9
- pop rdi
- ret
+#
+# ConvertAsm.py: Automatically generated from SetMem32.asm
+#
+#------------------------------------------------------------------------------
+#
+# Copyright (c) 2006, Intel Corporation
+# All rights reserved. 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
+# );
+#------------------------------------------------------------------------------
+.intel_syntax noprefix
+.globl ASM_PFX(InternalMemSetMem32)
+ASM_PFX(InternalMemSetMem32):
+ push rdi
+ mov rdi, rcx
+ mov r9, rdi
+ xor rcx, rcx
+ sub rcx, rdi
+ and rcx, 15
+ mov rax, r8
+ jz L0
+ shr rcx, 2
+ cmp rcx, rdx
+ cmova rcx, rdx
+ sub rdx, rcx
+ rep stosd
+L0:
+ mov rcx, rdx
+ and edx, 3
+ shr rcx, 2
+ jz L_SetDwords
+ movd xmm0, eax
+ pshufd xmm0, xmm0, 0
+L1:
+ movntdq [rdi], xmm0
+ add rdi, 16
+ loop L1
+ mfence
+L_SetDwords:
+ mov ecx, edx
+ rep stosd
+ mov rax, r9
+ pop rdi
+ ret
diff --git a/MdePkg/Library/BaseMemoryLibSse2/X64/SetMem64.S b/MdePkg/Library/BaseMemoryLibSse2/X64/SetMem64.S
index 870f8c0ee9..32dce91da8 100644
--- a/MdePkg/Library/BaseMemoryLibSse2/X64/SetMem64.S
+++ b/MdePkg/Library/BaseMemoryLibSse2/X64/SetMem64.S
@@ -1,61 +1,61 @@
-#
-# ConvertAsm.py: Automatically generated from SetMem64.asm
-#
-#------------------------------------------------------------------------------
-#
-# Copyright (c) 2006, Intel Corporation
-# All rights reserved. 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
-# )
-#------------------------------------------------------------------------------
-.intel_syntax noprefix
-.globl ASM_PFX(InternalMemSetMem64)
-ASM_PFX(InternalMemSetMem64):
- mov rax, rcx # rax <- Buffer
- xchg rcx, rdx # rcx <- Count & rdx <- Buffer
- test dl, 8
- movq xmm0, r8
- jz L0
- mov [rdx], r8
- add rdx, 8
- dec rcx
-L0:
- shr rcx, 1
- jz L_SetQwords
- movlhps xmm0, xmm0
-L1:
- movntdq [rdx], xmm0
- lea rdx, [rdx + 16]
- loop L1
- mfence
-L_SetQwords:
- jnc L2
- mov [rdx], r8
-L2:
- ret
-
+#
+# ConvertAsm.py: Automatically generated from SetMem64.asm
+#
+#------------------------------------------------------------------------------
+#
+# Copyright (c) 2006, Intel Corporation
+# All rights reserved. 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
+# )
+#------------------------------------------------------------------------------
+.intel_syntax noprefix
+.globl ASM_PFX(InternalMemSetMem64)
+ASM_PFX(InternalMemSetMem64):
+ mov rax, rcx # rax <- Buffer
+ xchg rcx, rdx # rcx <- Count & rdx <- Buffer
+ test dl, 8
+ movq xmm0, r8
+ jz L0
+ mov [rdx], r8
+ add rdx, 8
+ dec rcx
+L0:
+ shr rcx, 1
+ jz L_SetQwords
+ movlhps xmm0, xmm0
+L1:
+ movntdq [rdx], xmm0
+ lea rdx, [rdx + 16]
+ loop L1
+ mfence
+L_SetQwords:
+ jnc L2
+ mov [rdx], r8
+L2:
+ ret
+
diff --git a/MdePkg/Library/BaseMemoryLibSse2/X64/ZeroMem.S b/MdePkg/Library/BaseMemoryLibSse2/X64/ZeroMem.S
index f152d98a39..4f077943ba 100644
--- a/MdePkg/Library/BaseMemoryLibSse2/X64/ZeroMem.S
+++ b/MdePkg/Library/BaseMemoryLibSse2/X64/ZeroMem.S
@@ -1,66 +1,66 @@
-#
-# ConvertAsm.py: Automatically generated from ZeroMem.asm
-#
-#------------------------------------------------------------------------------
-#
-# Copyright (c) 2006, Intel Corporation
-# All rights reserved. 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
-# );
-#------------------------------------------------------------------------------
-.intel_syntax noprefix
-.globl ASM_PFX(InternalMemZeroMem)
-ASM_PFX(InternalMemZeroMem):
- push rdi
- mov rdi, rcx
- xor rcx, rcx
- xor eax, eax
- sub rcx, rdi
- and rcx, 15
- mov r8, rdi
- jz L0
- cmp rcx, rdx
- cmova rcx, rdx
- sub rdx, rcx
- rep stosb
-L0:
- mov rcx, rdx
- and edx, 15
- shr rcx, 4
- jz L_ZeroBytes
- pxor xmm0, xmm0
-L1:
- movntdq [rdi], xmm0 # rdi should be 16-byte aligned
- add rdi, 16
- loop L1
- mfence
-L_ZeroBytes:
- mov ecx, edx
- rep stosb
- mov rax, r8
- pop rdi
- ret
+#
+# ConvertAsm.py: Automatically generated from ZeroMem.asm
+#
+#------------------------------------------------------------------------------
+#
+# Copyright (c) 2006, Intel Corporation
+# All rights reserved. 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
+# );
+#------------------------------------------------------------------------------
+.intel_syntax noprefix
+.globl ASM_PFX(InternalMemZeroMem)
+ASM_PFX(InternalMemZeroMem):
+ push rdi
+ mov rdi, rcx
+ xor rcx, rcx
+ xor eax, eax
+ sub rcx, rdi
+ and rcx, 15
+ mov r8, rdi
+ jz L0
+ cmp rcx, rdx
+ cmova rcx, rdx
+ sub rdx, rcx
+ rep stosb
+L0:
+ mov rcx, rdx
+ and edx, 15
+ shr rcx, 4
+ jz L_ZeroBytes
+ pxor xmm0, xmm0
+L1:
+ movntdq [rdi], xmm0 # rdi should be 16-byte aligned
+ add rdi, 16
+ loop L1
+ mfence
+L_ZeroBytes:
+ mov ecx, edx
+ rep stosb
+ mov rax, r8
+ pop rdi
+ ret