]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdePkg/Library/BaseMemoryLibMmx/Ia32/SetMem32.S
Minor grammatical work--mostly adding periods. Items with ONLY period added did...
[mirror_edk2.git] / MdePkg / Library / BaseMemoryLibMmx / Ia32 / SetMem32.S
index a1a0eaf02ec21e001c902e06b21fac4ce54fdc84..36291de5007255da27c9445e79c1d555fbdd5001 100644 (file)
@@ -1,59 +1,52 @@
-#------------------------------------------------------------------------------
-#
-# 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.asm
-#
-# Abstract:
-#
-#   SetMem32 function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-    .686: 
-    #.MODEL flat,C
-    .xmm: 
-    .code: 
-
-#------------------------------------------------------------------------------
-#  VOID *
-#  _mem_SetMem32 (
-#    IN VOID   *Buffer,
-#    IN UINTN  Count,
-#    IN UINT32 Value
-#    )
-#------------------------------------------------------------------------------
-.global _InternalMemSetMem32
-_InternalMemSetMem32:
-    push    %edi
-    movl    12(%esp), %edx
-    movl    8(%esp), %edi
-    movl    %edx, %ecx
-    shrl    %ecx
-    movd    16(%esp), %mm0
-    movl    %edi, %eax
-    jz      @SetDwords
-    pshufw  $0x44, %mm0, %mm0
-L0: 
-    movntq  %mm0, (%edi)
-    addl    $8, %edi
-    loopl   L0
-    mfence
-@SetDwords: 
-    testb   $1, %dl
-    jz      @F
-    movd    %mm0, (%edi)
-L1: 
-    pop     %edi
-    ret
+#------------------------------------------------------------------------------\r
+#\r
+# Copyright (c) 2006, Intel Corporation. All rights reserved.<BR>\r
+# This program and the accompanying materials\r
+# are licensed and made available under the terms and conditions of the BSD License\r
+# which accompanies this distribution.  The full text of the license may be found at\r
+# http://opensource.org/licenses/bsd-license.php.\r
+#\r
+# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+#\r
+# Module Name:\r
+#\r
+#   SetMem32.asm\r
+#\r
+# Abstract:\r
+#\r
+#   SetMem32 function\r
+#\r
+# Notes:\r
+#\r
+#------------------------------------------------------------------------------\r
+\r
+ASM_GLOBAL ASM_PFX(InternalMemSetMem32)\r
+\r
+#------------------------------------------------------------------------------\r
+#  VOID *\r
+#  InternalMemSetMem32 (\r
+#    IN VOID   *Buffer,\r
+#    IN UINTN  Count,\r
+#    IN UINT32 Value\r
+#    )\r
+#------------------------------------------------------------------------------\r
+ASM_PFX(InternalMemSetMem32):\r
+    movl    4(%esp), %eax\r
+    movl    8(%esp), %ecx\r
+    movd    12(%esp), %mm0\r
+    shrl    %ecx\r
+    movl    %eax, %edx\r
+    jz      L1\r
+    movq    %mm0, %mm1\r
+    psllq   $32, %mm1\r
+    por     %mm1, %mm0\r
+L0:\r
+    movq    %mm0, (%edx)\r
+    lea     8(%edx), %edx\r
+    loopl   L0\r
+L1:\r
+    jnc     L2\r
+    movd    %mm0, (%edx)\r
+L2:\r
+    ret\r