]> git.proxmox.com Git - mirror_edk2.git/commitdiff
Renamed remotely
authorvanjeff <vanjeff@6f19259b-4bc3-4df7-8a09-765794883524>
Sat, 27 Sep 2008 05:27:49 +0000 (05:27 +0000)
committervanjeff <vanjeff@6f19259b-4bc3-4df7-8a09-765794883524>
Sat, 27 Sep 2008 05:27:49 +0000 (05:27 +0000)
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@6016 6f19259b-4bc3-4df7-8a09-765794883524

20 files changed:
EdkCompatibilityPkg/Foundation/Library/CompilerStub/X64/memcpy.asm [new file with mode: 0644]
EdkCompatibilityPkg/Foundation/Library/CompilerStub/X64/memcpyRep1.asm [new file with mode: 0644]
EdkCompatibilityPkg/Foundation/Library/CompilerStub/X64/memcpyRep4.asm [new file with mode: 0644]
EdkCompatibilityPkg/Foundation/Library/CompilerStub/X64/memcpyRep8.asm [new file with mode: 0644]
EdkCompatibilityPkg/Foundation/Library/CompilerStub/X64/memcpySSE2.asm [new file with mode: 0644]
EdkCompatibilityPkg/Foundation/Library/CompilerStub/X64/memset.asm [new file with mode: 0644]
EdkCompatibilityPkg/Foundation/Library/CompilerStub/X64/memsetRep1.asm [new file with mode: 0644]
EdkCompatibilityPkg/Foundation/Library/CompilerStub/X64/memsetRep4.asm [new file with mode: 0644]
EdkCompatibilityPkg/Foundation/Library/CompilerStub/X64/memsetRep8.asm [new file with mode: 0644]
EdkCompatibilityPkg/Foundation/Library/CompilerStub/X64/memsetSSE2.asm [new file with mode: 0644]
EdkCompatibilityPkg/Foundation/Library/CompilerStub/x64/memcpy.asm [deleted file]
EdkCompatibilityPkg/Foundation/Library/CompilerStub/x64/memcpyRep1.asm [deleted file]
EdkCompatibilityPkg/Foundation/Library/CompilerStub/x64/memcpyRep4.asm [deleted file]
EdkCompatibilityPkg/Foundation/Library/CompilerStub/x64/memcpyRep8.asm [deleted file]
EdkCompatibilityPkg/Foundation/Library/CompilerStub/x64/memcpySSE2.asm [deleted file]
EdkCompatibilityPkg/Foundation/Library/CompilerStub/x64/memset.asm [deleted file]
EdkCompatibilityPkg/Foundation/Library/CompilerStub/x64/memsetRep1.asm [deleted file]
EdkCompatibilityPkg/Foundation/Library/CompilerStub/x64/memsetRep4.asm [deleted file]
EdkCompatibilityPkg/Foundation/Library/CompilerStub/x64/memsetRep8.asm [deleted file]
EdkCompatibilityPkg/Foundation/Library/CompilerStub/x64/memsetSSE2.asm [deleted file]

diff --git a/EdkCompatibilityPkg/Foundation/Library/CompilerStub/X64/memcpy.asm b/EdkCompatibilityPkg/Foundation/Library/CompilerStub/X64/memcpy.asm
new file mode 100644 (file)
index 0000000..7e04431
--- /dev/null
@@ -0,0 +1,73 @@
+;------------------------------------------------------------------------------\r
+;\r
+; Copyright (c) 2007, Intel Corporation\r
+; All rights reserved. This program and the accompanying materials\r
+; are licensed and made available under the terms and conditions of the BSD License\r
+; which accompanies this distribution.  The full text of the license may be found at\r
+; http://opensource.org/licenses/bsd-license.php\r
+;\r
+; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+;\r
+; Module Name:\r
+;\r
+;   CopyMem.asm\r
+;\r
+; Abstract:\r
+;\r
+;   memcpy function\r
+;\r
+; Notes:\r
+;\r
+;------------------------------------------------------------------------------\r
+\r
+    .code\r
+\r
+;------------------------------------------------------------------------------\r
+; VOID *\r
+; memcpy (\r
+;   OUT     VOID                      *DestinationBuffer,\r
+;   IN      CONST VOID                *SourceBuffer,\r
+;   IN      UINTN                     Length\r
+;   );\r
+;------------------------------------------------------------------------------\r
+memcpy  PROC    USES    rsi rdi\r
+    mov     rax, rcx                    ; rax <- Destination as return value\r
+    cmp     rdx, rcx                    ; if Source == Destination, do nothing\r
+    je      @CopyMemDone\r
+    cmp     r8, 0                       ; if Count == 0, do nothing\r
+    je      @CopyMemDone\r
+    mov     rsi, rdx                    ; rsi <- Source\r
+    mov     rdi, rcx                    ; rdi <- Destination\r
+    lea     r9, [rsi + r8 - 1]          ; r9 <- End of Source\r
+    cmp     rsi, rdi\r
+    jae     @F\r
+    cmp     r9, rdi\r
+    jae     @CopyBackward               ; Copy backward if overlapped\r
+@@:\r
+    mov     rcx, r8\r
+    and     r8, 7\r
+    shr     rcx, 3                      ; rcx <- # of Qwords to copy\r
+    jz      @CopyBytes\r
+    DB      49h, 0fh, 7eh, 0c2h         ; movd r10, mm0 (Save mm0 in r10)\r
+@@:\r
+    DB      0fh, 6fh, 06h               ; movd mm0, [rsi]\r
+    DB      48h, 0fh, 7eh, 07h          ; movd [rdi], mm0\r
+    add     rsi, 8\r
+    add     rdi, 8\r
+    loop    @B\r
+    DB      49h, 0fh, 6eh, 0c2h         ; movd mm0, r10 (Restore mm0)\r
+    jmp     @CopyBytes\r
+@CopyBackward:\r
+    mov     rsi, r9                     ; rsi <- End of Source\r
+    lea     rdi, [rdi + r8 - 1]         ; rdi <- End of Destination\r
+    std                                 ; set direction flag\r
+@CopyBytes:\r
+    mov     rcx, r8\r
+    rep     movsb                       ; Copy bytes backward\r
+    cld\r
+@CopyMemDone:   \r
+    ret\r
+memcpy  ENDP\r
+\r
+    END\r
diff --git a/EdkCompatibilityPkg/Foundation/Library/CompilerStub/X64/memcpyRep1.asm b/EdkCompatibilityPkg/Foundation/Library/CompilerStub/X64/memcpyRep1.asm
new file mode 100644 (file)
index 0000000..72b8de3
--- /dev/null
@@ -0,0 +1,59 @@
+;------------------------------------------------------------------------------\r
+;\r
+; Copyright (c) 2007, Intel Corporation\r
+; All rights reserved. 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
+;   memcpyRep1.asm\r
+;\r
+; Abstract:\r
+;\r
+;   CopyMem function\r
+;\r
+; Notes:\r
+;\r
+;------------------------------------------------------------------------------\r
+\r
+    .code\r
+\r
+;------------------------------------------------------------------------------\r
+; VOID\r
+; memcpy (\r
+;   OUT     VOID                      *Destination,\r
+;   IN      VOID                      *Source,\r
+;   IN      UINTN                     Count\r
+;   );\r
+;------------------------------------------------------------------------------\r
+memcpy  PROC    USES    rsi rdi\r
+    mov     rax, rcx\r
+    cmp     rdx, rcx                    ; if Source == Destination, do nothing\r
+    je      @CopyMemDone\r
+    cmp     r8, 0                       ; if Count == 0, do nothing\r
+    je      @CopyMemDone\r
+    mov     rsi, rdx                    ; rsi <- Source\r
+    mov     rdi, rcx                    ; rdi <- Destination\r
+    lea     r9, [rsi + r8 - 1]          ; r9 <- End of Source\r
+    cmp     rsi, rdi\r
+    jae     @F\r
+    cmp     r9, rdi\r
+    jb      @F                          ; Copy backward if overlapped\r
+    mov     rsi, r9                     ; rsi <- End of Source\r
+    lea     rdi, [rdi + r8 - 1]         ; esi <- End of Destination\r
+    std                                 ; set direction flag\r
+@@:\r
+    mov     rcx, r8\r
+    rep     movsb                       ; Copy bytes backward\r
+    cld\r
+@CopyMemDone:\r
+    ret\r
+memcpy  ENDP\r
+\r
+    END\r
+\r
diff --git a/EdkCompatibilityPkg/Foundation/Library/CompilerStub/X64/memcpyRep4.asm b/EdkCompatibilityPkg/Foundation/Library/CompilerStub/X64/memcpyRep4.asm
new file mode 100644 (file)
index 0000000..2cca1c3
--- /dev/null
@@ -0,0 +1,65 @@
+;------------------------------------------------------------------------------\r
+;\r
+; Copyright (c) 2007, Intel Corporation\r
+; All rights reserved. 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
+;   memcpyRep8.asm\r
+;\r
+; Abstract:\r
+;\r
+;   CopyMem function\r
+;\r
+; Notes:\r
+;\r
+;------------------------------------------------------------------------------\r
+\r
+    .code\r
+\r
+;------------------------------------------------------------------------------\r
+; VOID\r
+; memcpy (\r
+;   OUT     VOID                      *Destination,\r
+;   IN      VOID                      *Source,\r
+;   IN      UINTN                     Count\r
+;   );\r
+;------------------------------------------------------------------------------\r
+memcpy  PROC    USES    rsi rdi\r
+    mov     rax, rcx\r
+    cmp     rdx, rcx                    ; if Source == Destination, do nothing\r
+    je      @CopyMemDone\r
+    cmp     r8, 0                       ; if Count == 0, do nothing\r
+    je      @CopyMemDone\r
+    mov     rsi, rdx                    ; rsi <- Source\r
+    mov     rdi, rcx                    ; rdi <- Destination\r
+    lea     r9, [rsi + r8 - 1]          ; r9 <- End of Source\r
+    cmp     rsi, rdi\r
+    jae     @F\r
+    cmp     r9, rdi\r
+    jae     @CopyBackward               ; Copy backward if overlapped\r
+@@:\r
+    mov     rcx, r8\r
+    and     r8, 3\r
+    shr     rcx, 2\r
+    rep     movsd                       ; Copy as many Dwords as possible\r
+    jmp     @CopyBytes\r
+@CopyBackward:\r
+    mov     rsi, r9                     ; rsi <- End of Source\r
+    lea     rdi, [rdi + r8 - 1]         ; esi <- End of Destination\r
+    std                                 ; set direction flag\r
+@CopyBytes:\r
+    mov     rcx, r8\r
+    rep     movsb                       ; Copy bytes backward\r
+    cld\r
+@CopyMemDone:\r
+    ret\r
+memcpy  ENDP\r
+\r
+    END\r
diff --git a/EdkCompatibilityPkg/Foundation/Library/CompilerStub/X64/memcpyRep8.asm b/EdkCompatibilityPkg/Foundation/Library/CompilerStub/X64/memcpyRep8.asm
new file mode 100644 (file)
index 0000000..27b3ca5
--- /dev/null
@@ -0,0 +1,66 @@
+;------------------------------------------------------------------------------\r
+;\r
+; Copyright (c) 2007, Intel Corporation\r
+; All rights reserved. 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
+;   memcpyRep8.asm\r
+;\r
+; Abstract:\r
+;\r
+;   CopyMem function\r
+;\r
+; Notes:\r
+;\r
+;------------------------------------------------------------------------------\r
+\r
+    .code\r
+\r
+;------------------------------------------------------------------------------\r
+; VOID\r
+; memcpy (\r
+;   OUT     VOID                      *Destination,\r
+;   IN      VOID                      *Source,\r
+;   IN      UINTN                     Count\r
+;   );\r
+;------------------------------------------------------------------------------\r
+memcpy  PROC    USES    rsi rdi\r
+    mov     rax, rcx\r
+    cmp     rdx, rcx                    ; if Source == Destination, do nothing\r
+    je      @CopyMemDone\r
+    cmp     r8, 0                       ; if Count == 0, do nothing\r
+    je      @CopyMemDone\r
+    mov     rsi, rdx                    ; rsi <- Source\r
+    mov     rdi, rcx                    ; rdi <- Destination\r
+    lea     r9, [rsi + r8 - 1]          ; r9 <- End of Source\r
+    cmp     rsi, rdi\r
+    jae     @F\r
+    cmp     r9, rdi\r
+    jae     @CopyBackward               ; Copy backward if overlapped\r
+@@:\r
+    mov     rcx, r8\r
+    and     r8, 7\r
+    shr     rcx, 3\r
+    rep     movsq                       ; Copy as many Qwords as possible\r
+    jmp     @CopyBytes\r
+@CopyBackward:\r
+    mov     rsi, r9                     ; rsi <- End of Source\r
+    lea     rdi, [rdi + r8 - 1]         ; esi <- End of Destination\r
+    std                                 ; set direction flag\r
+@CopyBytes:\r
+    mov     rcx, r8\r
+    rep     movsb                       ; Copy bytes backward\r
+    cld\r
+@CopyMemDone:\r
+    ret\r
+memcpy  ENDP\r
+\r
+    END\r
+\r
diff --git a/EdkCompatibilityPkg/Foundation/Library/CompilerStub/X64/memcpySSE2.asm b/EdkCompatibilityPkg/Foundation/Library/CompilerStub/X64/memcpySSE2.asm
new file mode 100644 (file)
index 0000000..15bdf37
--- /dev/null
@@ -0,0 +1,80 @@
+;------------------------------------------------------------------------------\r
+;\r
+; Copyright (c) 2007, Intel Corporation\r
+; All rights reserved. This program and the accompanying materials\r
+; are licensed and made available under the terms and conditions of the BSD License\r
+; which accompanies this distribution.  The full text of the license may be found at\r
+; http://opensource.org/licenses/bsd-license.php\r
+;\r
+; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+;\r
+; Module Name:\r
+;\r
+;   CopyMem.asm\r
+;\r
+; Abstract:\r
+;\r
+;   memcpy function\r
+;\r
+; Notes:\r
+;\r
+;------------------------------------------------------------------------------\r
+\r
+    .code\r
+\r
+;------------------------------------------------------------------------------\r
+; VOID *\r
+; memcpy (\r
+;   OUT     VOID                      *DestinationBuffer,\r
+;   IN      CONST VOID                *SourceBuffer,\r
+;   IN      UINTN                     Length\r
+;   );\r
+;------------------------------------------------------------------------------\r
+memcpy  PROC    USES    rsi rdi\r
+    mov     rax, rcx                    ; rax <- Destination as return value\r
+    cmp     rdx, rcx                    ; if Source == Destination, do nothing\r
+    je      @CopyMemDone\r
+    cmp     r8, 0                       ; if Count == 0, do nothing\r
+    je      @CopyMemDone\r
+    mov     rsi, rdx                    ; rsi <- Source\r
+    mov     rdi, rcx                    ; rdi <- Destination\r
+    lea     r9, [rsi + r8 - 1]          ; r9 <- Last byte of Source\r
+    cmp     rsi, rdi\r
+    jae     @F                          ; Copy forward if Source > Destination\r
+    cmp     r9, rdi                     ; Overlapped?\r
+    jae     @CopyBackward               ; Copy backward if overlapped\r
+@@:\r
+    xor     rcx, rcx\r
+    sub     rcx, rdi                    ; rcx <- -rdi\r
+    and     rcx, 15                     ; rcx + rsi should be 16 bytes aligned\r
+    jz      @F                          ; skip if rcx == 0\r
+    cmp     rcx, r8\r
+    cmova   rcx, r8\r
+    sub     r8, rcx\r
+    rep     movsb\r
+@@:\r
+    mov     rcx, r8\r
+    and     r8, 15\r
+    shr     rcx, 4                      ; rcx <- # of DQwords to copy\r
+    jz      @CopyBytes\r
+@@:\r
+    movdqu  xmm0, [rsi]                 ; rsi may not be 16-byte aligned\r
+    movdqa  [rdi], xmm0                 ; rdi should be 16-byte aligned\r
+    add     rsi, 16\r
+    add     rdi, 16\r
+    loop    @B\r
+    jmp     @CopyBytes                  ; copy remaining bytes\r
+@CopyBackward:\r
+    mov     rsi, r9                     ; rsi <- Last byte of Source\r
+    lea     rdi, [rdi + r8 - 1]         ; rdi <- Last byte of Destination\r
+    std\r
+@CopyBytes:\r
+    mov     rcx, r8\r
+    rep     movsb\r
+    cld\r
+@CopyMemDone:   \r
+    ret\r
+memcpy  ENDP\r
+\r
+    END\r
diff --git a/EdkCompatibilityPkg/Foundation/Library/CompilerStub/X64/memset.asm b/EdkCompatibilityPkg/Foundation/Library/CompilerStub/X64/memset.asm
new file mode 100644 (file)
index 0000000..134700d
--- /dev/null
@@ -0,0 +1,62 @@
+;------------------------------------------------------------------------------\r
+;\r
+; Copyright (c) 2007, Intel Corporation\r
+; All rights reserved. This program and the accompanying materials\r
+; are licensed and made available under the terms and conditions of the BSD License\r
+; which accompanies this distribution.  The full text of the license may be found at\r
+; http://opensource.org/licenses/bsd-license.php\r
+;\r
+; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+;\r
+; Module Name:\r
+;\r
+;   SetMem.asm\r
+;\r
+; Abstract:\r
+;\r
+;   memset function\r
+;\r
+; Notes:\r
+;\r
+;------------------------------------------------------------------------------\r
+\r
+    .code\r
+\r
+;------------------------------------------------------------------------------\r
+; VOID *\r
+; memset (\r
+;   OUT     VOID                      *Buffer,    --> rcx\r
+;   IN      UINT8                     Value,      --> rdx\r
+;   IN      UINTN                     Length      --> r8\r
+;   );\r
+;------------------------------------------------------------------------------\r
+memset   PROC    USES    rdi\r
+    mov     rax, rcx    \r
+    cmp     r8, 0                      ; if Size == 0, do nothing\r
+    je      @SetDone\r
+    mov     rax, rdx                   ; rdx <-> r8\r
+    mov     rdx, r8                    ; rdx <- Length\r
+    mov     r8, rax                    ; r8  <- Value\r
+    mov     ah, al\r
+    DB      48h, 0fh, 6eh, 0c0h         ; movd mm0, rax\r
+    mov     r8, rcx\r
+    mov     rdi, r8                     ; rdi <- Buffer\r
+    mov     rcx, rdx\r
+    and     edx, 7\r
+    shr     rcx, 3\r
+    jz      @SetBytes\r
+    DB      0fh, 70h, 0C0h, 00h         ; pshufw mm0, mm0, 0h\r
+@@:\r
+    DB      48h, 0fh, 7eh, 07h          ; movd [rdi], mm0\r
+    add     rdi, 8\r
+    loop    @B\r
+@SetBytes:\r
+    mov     ecx, edx\r
+    rep     stosb\r
+    mov     rax, r8\r
+@SetDone:\r
+    ret\r
+memset   ENDP\r
+\r
+    END\r
diff --git a/EdkCompatibilityPkg/Foundation/Library/CompilerStub/X64/memsetRep1.asm b/EdkCompatibilityPkg/Foundation/Library/CompilerStub/X64/memsetRep1.asm
new file mode 100644 (file)
index 0000000..9a4d673
--- /dev/null
@@ -0,0 +1,48 @@
+;------------------------------------------------------------------------------\r
+;\r
+; Copyright (c) 2007, Intel Corporation\r
+; All rights reserved. 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
+;   memsetRep1.asm\r
+;\r
+; Abstract:\r
+;\r
+;   SetMem function\r
+;\r
+; Notes:\r
+;\r
+;------------------------------------------------------------------------------\r
+\r
+    .code\r
+\r
+;------------------------------------------------------------------------------\r
+; VOID *\r
+; memset (\r
+;   OUT     VOID                      *Buffer,\r
+;   IN      UINTN                     Size,\r
+;   IN      UINT8                     Value\r
+;   );\r
+;------------------------------------------------------------------------------\r
+memset   PROC    USES    rdi\r
+    cmp     rdx, 0                      ; if Size == 0, do nothing\r
+    mov     r9,  rcx\r
+    je      @SetDone\r
+    mov     rax, r8\r
+    mov     rdi, rcx\r
+    mov     rcx, rdx\r
+    rep     stosb\r
+@SetDone:\r
+    mov     rax, r9\r
+    ret\r
+memset   ENDP\r
+\r
+    END\r
+\r
diff --git a/EdkCompatibilityPkg/Foundation/Library/CompilerStub/X64/memsetRep4.asm b/EdkCompatibilityPkg/Foundation/Library/CompilerStub/X64/memsetRep4.asm
new file mode 100644 (file)
index 0000000..6ef0036
--- /dev/null
@@ -0,0 +1,55 @@
+;------------------------------------------------------------------------------\r
+;\r
+; Copyright (c) 2007, Intel Corporation\r
+; All rights reserved. This program and the accompanying materials\r
+; are licensed and made available under the terms and conditions of the BSD License\r
+; which accompanies this distribution.  The full text of the license may be found at\r
+; http://opensource.org/licenses/bsd-license.php\r
+;\r
+; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+;\r
+; Module Name:\r
+;\r
+;   SetMem.asm\r
+;\r
+; Abstract:\r
+;\r
+;   memset function\r
+;\r
+; Notes:\r
+;\r
+;------------------------------------------------------------------------------\r
+\r
+    .code\r
+\r
+;------------------------------------------------------------------------------\r
+;  VOID *\r
+;  memset (\r
+;    OUT VOID   *Buffer,\r
+;    IN  UINT8  Value,\r
+;    IN  UINTN  Count\r
+;    )\r
+;------------------------------------------------------------------------------\r
+memset   PROC    USES    rdi\r
+    cmp     r8, 0                      ; if Size == 0, do nothing\r
+    mov     r9,  rcx\r
+    je      @SetDone\r
+    mov     al,  dl\r
+    mov     ah,  al\r
+    shrd    edx, eax, 16\r
+    shld    eax, edx, 16\r
+    mov     rdi, rcx\r
+    mov     rcx, r8\r
+    shr     rcx, 2\r
+    rep     stosd\r
+    mov     rcx, r8\r
+    and     rcx, 3\r
+    rep     stosb\r
+@SetDone:\r
+    mov     rax, r9\r
+    ret\r
+memset   ENDP\r
+\r
+    END\r
+\r
diff --git a/EdkCompatibilityPkg/Foundation/Library/CompilerStub/X64/memsetRep8.asm b/EdkCompatibilityPkg/Foundation/Library/CompilerStub/X64/memsetRep8.asm
new file mode 100644 (file)
index 0000000..16cb026
--- /dev/null
@@ -0,0 +1,60 @@
+;------------------------------------------------------------------------------\r
+;\r
+; Copyright (c) 2007, Intel Corporation\r
+; All rights reserved. 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
+;   memsetRep8.asm\r
+;\r
+; Abstract:\r
+;\r
+;   SetMem function\r
+;\r
+; Notes:\r
+;\r
+;------------------------------------------------------------------------------\r
+\r
+    .code\r
+\r
+;------------------------------------------------------------------------------\r
+; VOID\r
+; memset (\r
+;   OUT     VOID                      *Buffer,\r
+;   IN      UINT8                     Value,\r
+;   IN      UINTN                     Length\r
+;   );\r
+;------------------------------------------------------------------------------\r
+memset   PROC    USES    rdi rbx\r
+    cmp     r8, 0                      ; if Size == 0, do nothing\r
+    mov     r9,  rcx\r
+    je      @SetDone\r
+    mov     rax, rdx\r
+    mov     bl,  al\r
+    mov     bh,  bl\r
+    mov     ax,  bx\r
+    shl     rax, 10h\r
+    mov     ax,  bx\r
+    mov     ebx, eax\r
+    shl     rax, 20h\r
+    mov     eax, ebx\r
+    mov     rdi, rcx\r
+    mov     rcx, r8\r
+    shr     rcx, 3\r
+    rep     stosq\r
+    mov     rcx, rdx\r
+    and     rcx, 7\r
+    rep     stosb\r
+@SetDone:\r
+    mov     rax, r9\r
+    ret\r
+memset   ENDP\r
+\r
+    END\r
+\r
diff --git a/EdkCompatibilityPkg/Foundation/Library/CompilerStub/X64/memsetSSE2.asm b/EdkCompatibilityPkg/Foundation/Library/CompilerStub/X64/memsetSSE2.asm
new file mode 100644 (file)
index 0000000..0370c9b
--- /dev/null
@@ -0,0 +1,74 @@
+;------------------------------------------------------------------------------\r
+;\r
+; Copyright (c) 2007, Intel Corporation\r
+; All rights reserved. This program and the accompanying materials\r
+; are licensed and made available under the terms and conditions of the BSD License\r
+; which accompanies this distribution.  The full text of the license may be found at\r
+; http://opensource.org/licenses/bsd-license.php\r
+;\r
+; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+;\r
+; Module Name:\r
+;\r
+;   SetMem.asm\r
+;\r
+; Abstract:\r
+;\r
+;   memset function\r
+;\r
+; Notes:\r
+;\r
+;------------------------------------------------------------------------------\r
+\r
+    .code\r
+\r
+;------------------------------------------------------------------------------\r
+; VOID *\r
+; memset (\r
+;   OUT     VOID                      *Buffer,    --> rcx\r
+;   IN      UINT8                     Value,      --> rdx\r
+;   IN      UINTN                     Length      --> r8\r
+;   );\r
+;------------------------------------------------------------------------------\r
+memset   PROC    USES    rdi\r
+    mov     rax, rcx    \r
+    cmp     r8, 0                       ; if Size == 0, do nothing\r
+    je      @SetDone                    \r
+    mov     rax, rdx                    ; rdx <-> r8\r
+    mov     rdx, r8                     ; rdx <- Length\r
+    mov     r8, rax                     ; r8  <- Value\r
+    \r
+    mov     rdi, rcx                    ; rdi <- Buffer\r
+    mov     al, r8b                     ; al <- Value\r
+    mov     r9, rdi                     ; r9 <- Buffer as return value\r
+    xor     rcx, rcx\r
+    sub     rcx, rdi\r
+    and     rcx, 15                     ; rcx + rdi aligns on 16-byte boundary\r
+    jz      @F\r
+    cmp     rcx, rdx\r
+    cmova   rcx, rdx\r
+    sub     rdx, rcx\r
+    rep     stosb\r
+@@:\r
+    mov     rcx, rdx\r
+    and     rdx, 15\r
+    shr     rcx, 4\r
+    jz      @SetBytes\r
+    mov     ah, al                      ; ax <- Value repeats twice\r
+    movd    xmm0, eax                   ; xmm0[0..16] <- Value repeats twice\r
+    pshuflw xmm0, xmm0, 0               ; xmm0[0..63] <- Value repeats 8 times\r
+    movlhps xmm0, xmm0                  ; xmm0 <- Value repeats 16 times\r
+@@:\r
+    movdqa  [rdi], xmm0                 ; rdi should be 16-byte aligned\r
+    add     rdi, 16\r
+    loop    @B\r
+@SetBytes:\r
+    mov     ecx, edx                    ; high 32 bits of rcx are always zero\r
+    rep     stosb\r
+    mov     rax, r9                     ; rax <- Return value\r
+@SetDone:\r
+    ret\r
+memset   ENDP\r
+\r
+    END\r
diff --git a/EdkCompatibilityPkg/Foundation/Library/CompilerStub/x64/memcpy.asm b/EdkCompatibilityPkg/Foundation/Library/CompilerStub/x64/memcpy.asm
deleted file mode 100644 (file)
index 7e04431..0000000
+++ /dev/null
@@ -1,73 +0,0 @@
-;------------------------------------------------------------------------------\r
-;\r
-; Copyright (c) 2007, Intel Corporation\r
-; All rights reserved. This program and the accompanying materials\r
-; are licensed and made available under the terms and conditions of the BSD License\r
-; which accompanies this distribution.  The full text of the license may be found at\r
-; http://opensource.org/licenses/bsd-license.php\r
-;\r
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-;\r
-; Module Name:\r
-;\r
-;   CopyMem.asm\r
-;\r
-; Abstract:\r
-;\r
-;   memcpy function\r
-;\r
-; Notes:\r
-;\r
-;------------------------------------------------------------------------------\r
-\r
-    .code\r
-\r
-;------------------------------------------------------------------------------\r
-; VOID *\r
-; memcpy (\r
-;   OUT     VOID                      *DestinationBuffer,\r
-;   IN      CONST VOID                *SourceBuffer,\r
-;   IN      UINTN                     Length\r
-;   );\r
-;------------------------------------------------------------------------------\r
-memcpy  PROC    USES    rsi rdi\r
-    mov     rax, rcx                    ; rax <- Destination as return value\r
-    cmp     rdx, rcx                    ; if Source == Destination, do nothing\r
-    je      @CopyMemDone\r
-    cmp     r8, 0                       ; if Count == 0, do nothing\r
-    je      @CopyMemDone\r
-    mov     rsi, rdx                    ; rsi <- Source\r
-    mov     rdi, rcx                    ; rdi <- Destination\r
-    lea     r9, [rsi + r8 - 1]          ; r9 <- End of Source\r
-    cmp     rsi, rdi\r
-    jae     @F\r
-    cmp     r9, rdi\r
-    jae     @CopyBackward               ; Copy backward if overlapped\r
-@@:\r
-    mov     rcx, r8\r
-    and     r8, 7\r
-    shr     rcx, 3                      ; rcx <- # of Qwords to copy\r
-    jz      @CopyBytes\r
-    DB      49h, 0fh, 7eh, 0c2h         ; movd r10, mm0 (Save mm0 in r10)\r
-@@:\r
-    DB      0fh, 6fh, 06h               ; movd mm0, [rsi]\r
-    DB      48h, 0fh, 7eh, 07h          ; movd [rdi], mm0\r
-    add     rsi, 8\r
-    add     rdi, 8\r
-    loop    @B\r
-    DB      49h, 0fh, 6eh, 0c2h         ; movd mm0, r10 (Restore mm0)\r
-    jmp     @CopyBytes\r
-@CopyBackward:\r
-    mov     rsi, r9                     ; rsi <- End of Source\r
-    lea     rdi, [rdi + r8 - 1]         ; rdi <- End of Destination\r
-    std                                 ; set direction flag\r
-@CopyBytes:\r
-    mov     rcx, r8\r
-    rep     movsb                       ; Copy bytes backward\r
-    cld\r
-@CopyMemDone:   \r
-    ret\r
-memcpy  ENDP\r
-\r
-    END\r
diff --git a/EdkCompatibilityPkg/Foundation/Library/CompilerStub/x64/memcpyRep1.asm b/EdkCompatibilityPkg/Foundation/Library/CompilerStub/x64/memcpyRep1.asm
deleted file mode 100644 (file)
index 72b8de3..0000000
+++ /dev/null
@@ -1,59 +0,0 @@
-;------------------------------------------------------------------------------\r
-;\r
-; Copyright (c) 2007, Intel Corporation\r
-; All rights reserved. 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
-;   memcpyRep1.asm\r
-;\r
-; Abstract:\r
-;\r
-;   CopyMem function\r
-;\r
-; Notes:\r
-;\r
-;------------------------------------------------------------------------------\r
-\r
-    .code\r
-\r
-;------------------------------------------------------------------------------\r
-; VOID\r
-; memcpy (\r
-;   OUT     VOID                      *Destination,\r
-;   IN      VOID                      *Source,\r
-;   IN      UINTN                     Count\r
-;   );\r
-;------------------------------------------------------------------------------\r
-memcpy  PROC    USES    rsi rdi\r
-    mov     rax, rcx\r
-    cmp     rdx, rcx                    ; if Source == Destination, do nothing\r
-    je      @CopyMemDone\r
-    cmp     r8, 0                       ; if Count == 0, do nothing\r
-    je      @CopyMemDone\r
-    mov     rsi, rdx                    ; rsi <- Source\r
-    mov     rdi, rcx                    ; rdi <- Destination\r
-    lea     r9, [rsi + r8 - 1]          ; r9 <- End of Source\r
-    cmp     rsi, rdi\r
-    jae     @F\r
-    cmp     r9, rdi\r
-    jb      @F                          ; Copy backward if overlapped\r
-    mov     rsi, r9                     ; rsi <- End of Source\r
-    lea     rdi, [rdi + r8 - 1]         ; esi <- End of Destination\r
-    std                                 ; set direction flag\r
-@@:\r
-    mov     rcx, r8\r
-    rep     movsb                       ; Copy bytes backward\r
-    cld\r
-@CopyMemDone:\r
-    ret\r
-memcpy  ENDP\r
-\r
-    END\r
-\r
diff --git a/EdkCompatibilityPkg/Foundation/Library/CompilerStub/x64/memcpyRep4.asm b/EdkCompatibilityPkg/Foundation/Library/CompilerStub/x64/memcpyRep4.asm
deleted file mode 100644 (file)
index 2cca1c3..0000000
+++ /dev/null
@@ -1,65 +0,0 @@
-;------------------------------------------------------------------------------\r
-;\r
-; Copyright (c) 2007, Intel Corporation\r
-; All rights reserved. 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
-;   memcpyRep8.asm\r
-;\r
-; Abstract:\r
-;\r
-;   CopyMem function\r
-;\r
-; Notes:\r
-;\r
-;------------------------------------------------------------------------------\r
-\r
-    .code\r
-\r
-;------------------------------------------------------------------------------\r
-; VOID\r
-; memcpy (\r
-;   OUT     VOID                      *Destination,\r
-;   IN      VOID                      *Source,\r
-;   IN      UINTN                     Count\r
-;   );\r
-;------------------------------------------------------------------------------\r
-memcpy  PROC    USES    rsi rdi\r
-    mov     rax, rcx\r
-    cmp     rdx, rcx                    ; if Source == Destination, do nothing\r
-    je      @CopyMemDone\r
-    cmp     r8, 0                       ; if Count == 0, do nothing\r
-    je      @CopyMemDone\r
-    mov     rsi, rdx                    ; rsi <- Source\r
-    mov     rdi, rcx                    ; rdi <- Destination\r
-    lea     r9, [rsi + r8 - 1]          ; r9 <- End of Source\r
-    cmp     rsi, rdi\r
-    jae     @F\r
-    cmp     r9, rdi\r
-    jae     @CopyBackward               ; Copy backward if overlapped\r
-@@:\r
-    mov     rcx, r8\r
-    and     r8, 3\r
-    shr     rcx, 2\r
-    rep     movsd                       ; Copy as many Dwords as possible\r
-    jmp     @CopyBytes\r
-@CopyBackward:\r
-    mov     rsi, r9                     ; rsi <- End of Source\r
-    lea     rdi, [rdi + r8 - 1]         ; esi <- End of Destination\r
-    std                                 ; set direction flag\r
-@CopyBytes:\r
-    mov     rcx, r8\r
-    rep     movsb                       ; Copy bytes backward\r
-    cld\r
-@CopyMemDone:\r
-    ret\r
-memcpy  ENDP\r
-\r
-    END\r
diff --git a/EdkCompatibilityPkg/Foundation/Library/CompilerStub/x64/memcpyRep8.asm b/EdkCompatibilityPkg/Foundation/Library/CompilerStub/x64/memcpyRep8.asm
deleted file mode 100644 (file)
index 27b3ca5..0000000
+++ /dev/null
@@ -1,66 +0,0 @@
-;------------------------------------------------------------------------------\r
-;\r
-; Copyright (c) 2007, Intel Corporation\r
-; All rights reserved. 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
-;   memcpyRep8.asm\r
-;\r
-; Abstract:\r
-;\r
-;   CopyMem function\r
-;\r
-; Notes:\r
-;\r
-;------------------------------------------------------------------------------\r
-\r
-    .code\r
-\r
-;------------------------------------------------------------------------------\r
-; VOID\r
-; memcpy (\r
-;   OUT     VOID                      *Destination,\r
-;   IN      VOID                      *Source,\r
-;   IN      UINTN                     Count\r
-;   );\r
-;------------------------------------------------------------------------------\r
-memcpy  PROC    USES    rsi rdi\r
-    mov     rax, rcx\r
-    cmp     rdx, rcx                    ; if Source == Destination, do nothing\r
-    je      @CopyMemDone\r
-    cmp     r8, 0                       ; if Count == 0, do nothing\r
-    je      @CopyMemDone\r
-    mov     rsi, rdx                    ; rsi <- Source\r
-    mov     rdi, rcx                    ; rdi <- Destination\r
-    lea     r9, [rsi + r8 - 1]          ; r9 <- End of Source\r
-    cmp     rsi, rdi\r
-    jae     @F\r
-    cmp     r9, rdi\r
-    jae     @CopyBackward               ; Copy backward if overlapped\r
-@@:\r
-    mov     rcx, r8\r
-    and     r8, 7\r
-    shr     rcx, 3\r
-    rep     movsq                       ; Copy as many Qwords as possible\r
-    jmp     @CopyBytes\r
-@CopyBackward:\r
-    mov     rsi, r9                     ; rsi <- End of Source\r
-    lea     rdi, [rdi + r8 - 1]         ; esi <- End of Destination\r
-    std                                 ; set direction flag\r
-@CopyBytes:\r
-    mov     rcx, r8\r
-    rep     movsb                       ; Copy bytes backward\r
-    cld\r
-@CopyMemDone:\r
-    ret\r
-memcpy  ENDP\r
-\r
-    END\r
-\r
diff --git a/EdkCompatibilityPkg/Foundation/Library/CompilerStub/x64/memcpySSE2.asm b/EdkCompatibilityPkg/Foundation/Library/CompilerStub/x64/memcpySSE2.asm
deleted file mode 100644 (file)
index 15bdf37..0000000
+++ /dev/null
@@ -1,80 +0,0 @@
-;------------------------------------------------------------------------------\r
-;\r
-; Copyright (c) 2007, Intel Corporation\r
-; All rights reserved. This program and the accompanying materials\r
-; are licensed and made available under the terms and conditions of the BSD License\r
-; which accompanies this distribution.  The full text of the license may be found at\r
-; http://opensource.org/licenses/bsd-license.php\r
-;\r
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-;\r
-; Module Name:\r
-;\r
-;   CopyMem.asm\r
-;\r
-; Abstract:\r
-;\r
-;   memcpy function\r
-;\r
-; Notes:\r
-;\r
-;------------------------------------------------------------------------------\r
-\r
-    .code\r
-\r
-;------------------------------------------------------------------------------\r
-; VOID *\r
-; memcpy (\r
-;   OUT     VOID                      *DestinationBuffer,\r
-;   IN      CONST VOID                *SourceBuffer,\r
-;   IN      UINTN                     Length\r
-;   );\r
-;------------------------------------------------------------------------------\r
-memcpy  PROC    USES    rsi rdi\r
-    mov     rax, rcx                    ; rax <- Destination as return value\r
-    cmp     rdx, rcx                    ; if Source == Destination, do nothing\r
-    je      @CopyMemDone\r
-    cmp     r8, 0                       ; if Count == 0, do nothing\r
-    je      @CopyMemDone\r
-    mov     rsi, rdx                    ; rsi <- Source\r
-    mov     rdi, rcx                    ; rdi <- Destination\r
-    lea     r9, [rsi + r8 - 1]          ; r9 <- Last byte of Source\r
-    cmp     rsi, rdi\r
-    jae     @F                          ; Copy forward if Source > Destination\r
-    cmp     r9, rdi                     ; Overlapped?\r
-    jae     @CopyBackward               ; Copy backward if overlapped\r
-@@:\r
-    xor     rcx, rcx\r
-    sub     rcx, rdi                    ; rcx <- -rdi\r
-    and     rcx, 15                     ; rcx + rsi should be 16 bytes aligned\r
-    jz      @F                          ; skip if rcx == 0\r
-    cmp     rcx, r8\r
-    cmova   rcx, r8\r
-    sub     r8, rcx\r
-    rep     movsb\r
-@@:\r
-    mov     rcx, r8\r
-    and     r8, 15\r
-    shr     rcx, 4                      ; rcx <- # of DQwords to copy\r
-    jz      @CopyBytes\r
-@@:\r
-    movdqu  xmm0, [rsi]                 ; rsi may not be 16-byte aligned\r
-    movdqa  [rdi], xmm0                 ; rdi should be 16-byte aligned\r
-    add     rsi, 16\r
-    add     rdi, 16\r
-    loop    @B\r
-    jmp     @CopyBytes                  ; copy remaining bytes\r
-@CopyBackward:\r
-    mov     rsi, r9                     ; rsi <- Last byte of Source\r
-    lea     rdi, [rdi + r8 - 1]         ; rdi <- Last byte of Destination\r
-    std\r
-@CopyBytes:\r
-    mov     rcx, r8\r
-    rep     movsb\r
-    cld\r
-@CopyMemDone:   \r
-    ret\r
-memcpy  ENDP\r
-\r
-    END\r
diff --git a/EdkCompatibilityPkg/Foundation/Library/CompilerStub/x64/memset.asm b/EdkCompatibilityPkg/Foundation/Library/CompilerStub/x64/memset.asm
deleted file mode 100644 (file)
index 134700d..0000000
+++ /dev/null
@@ -1,62 +0,0 @@
-;------------------------------------------------------------------------------\r
-;\r
-; Copyright (c) 2007, Intel Corporation\r
-; All rights reserved. This program and the accompanying materials\r
-; are licensed and made available under the terms and conditions of the BSD License\r
-; which accompanies this distribution.  The full text of the license may be found at\r
-; http://opensource.org/licenses/bsd-license.php\r
-;\r
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-;\r
-; Module Name:\r
-;\r
-;   SetMem.asm\r
-;\r
-; Abstract:\r
-;\r
-;   memset function\r
-;\r
-; Notes:\r
-;\r
-;------------------------------------------------------------------------------\r
-\r
-    .code\r
-\r
-;------------------------------------------------------------------------------\r
-; VOID *\r
-; memset (\r
-;   OUT     VOID                      *Buffer,    --> rcx\r
-;   IN      UINT8                     Value,      --> rdx\r
-;   IN      UINTN                     Length      --> r8\r
-;   );\r
-;------------------------------------------------------------------------------\r
-memset   PROC    USES    rdi\r
-    mov     rax, rcx    \r
-    cmp     r8, 0                      ; if Size == 0, do nothing\r
-    je      @SetDone\r
-    mov     rax, rdx                   ; rdx <-> r8\r
-    mov     rdx, r8                    ; rdx <- Length\r
-    mov     r8, rax                    ; r8  <- Value\r
-    mov     ah, al\r
-    DB      48h, 0fh, 6eh, 0c0h         ; movd mm0, rax\r
-    mov     r8, rcx\r
-    mov     rdi, r8                     ; rdi <- Buffer\r
-    mov     rcx, rdx\r
-    and     edx, 7\r
-    shr     rcx, 3\r
-    jz      @SetBytes\r
-    DB      0fh, 70h, 0C0h, 00h         ; pshufw mm0, mm0, 0h\r
-@@:\r
-    DB      48h, 0fh, 7eh, 07h          ; movd [rdi], mm0\r
-    add     rdi, 8\r
-    loop    @B\r
-@SetBytes:\r
-    mov     ecx, edx\r
-    rep     stosb\r
-    mov     rax, r8\r
-@SetDone:\r
-    ret\r
-memset   ENDP\r
-\r
-    END\r
diff --git a/EdkCompatibilityPkg/Foundation/Library/CompilerStub/x64/memsetRep1.asm b/EdkCompatibilityPkg/Foundation/Library/CompilerStub/x64/memsetRep1.asm
deleted file mode 100644 (file)
index 9a4d673..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-;------------------------------------------------------------------------------\r
-;\r
-; Copyright (c) 2007, Intel Corporation\r
-; All rights reserved. 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
-;   memsetRep1.asm\r
-;\r
-; Abstract:\r
-;\r
-;   SetMem function\r
-;\r
-; Notes:\r
-;\r
-;------------------------------------------------------------------------------\r
-\r
-    .code\r
-\r
-;------------------------------------------------------------------------------\r
-; VOID *\r
-; memset (\r
-;   OUT     VOID                      *Buffer,\r
-;   IN      UINTN                     Size,\r
-;   IN      UINT8                     Value\r
-;   );\r
-;------------------------------------------------------------------------------\r
-memset   PROC    USES    rdi\r
-    cmp     rdx, 0                      ; if Size == 0, do nothing\r
-    mov     r9,  rcx\r
-    je      @SetDone\r
-    mov     rax, r8\r
-    mov     rdi, rcx\r
-    mov     rcx, rdx\r
-    rep     stosb\r
-@SetDone:\r
-    mov     rax, r9\r
-    ret\r
-memset   ENDP\r
-\r
-    END\r
-\r
diff --git a/EdkCompatibilityPkg/Foundation/Library/CompilerStub/x64/memsetRep4.asm b/EdkCompatibilityPkg/Foundation/Library/CompilerStub/x64/memsetRep4.asm
deleted file mode 100644 (file)
index 6ef0036..0000000
+++ /dev/null
@@ -1,55 +0,0 @@
-;------------------------------------------------------------------------------\r
-;\r
-; Copyright (c) 2007, Intel Corporation\r
-; All rights reserved. This program and the accompanying materials\r
-; are licensed and made available under the terms and conditions of the BSD License\r
-; which accompanies this distribution.  The full text of the license may be found at\r
-; http://opensource.org/licenses/bsd-license.php\r
-;\r
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-;\r
-; Module Name:\r
-;\r
-;   SetMem.asm\r
-;\r
-; Abstract:\r
-;\r
-;   memset function\r
-;\r
-; Notes:\r
-;\r
-;------------------------------------------------------------------------------\r
-\r
-    .code\r
-\r
-;------------------------------------------------------------------------------\r
-;  VOID *\r
-;  memset (\r
-;    OUT VOID   *Buffer,\r
-;    IN  UINT8  Value,\r
-;    IN  UINTN  Count\r
-;    )\r
-;------------------------------------------------------------------------------\r
-memset   PROC    USES    rdi\r
-    cmp     r8, 0                      ; if Size == 0, do nothing\r
-    mov     r9,  rcx\r
-    je      @SetDone\r
-    mov     al,  dl\r
-    mov     ah,  al\r
-    shrd    edx, eax, 16\r
-    shld    eax, edx, 16\r
-    mov     rdi, rcx\r
-    mov     rcx, r8\r
-    shr     rcx, 2\r
-    rep     stosd\r
-    mov     rcx, r8\r
-    and     rcx, 3\r
-    rep     stosb\r
-@SetDone:\r
-    mov     rax, r9\r
-    ret\r
-memset   ENDP\r
-\r
-    END\r
-\r
diff --git a/EdkCompatibilityPkg/Foundation/Library/CompilerStub/x64/memsetRep8.asm b/EdkCompatibilityPkg/Foundation/Library/CompilerStub/x64/memsetRep8.asm
deleted file mode 100644 (file)
index 16cb026..0000000
+++ /dev/null
@@ -1,60 +0,0 @@
-;------------------------------------------------------------------------------\r
-;\r
-; Copyright (c) 2007, Intel Corporation\r
-; All rights reserved. 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
-;   memsetRep8.asm\r
-;\r
-; Abstract:\r
-;\r
-;   SetMem function\r
-;\r
-; Notes:\r
-;\r
-;------------------------------------------------------------------------------\r
-\r
-    .code\r
-\r
-;------------------------------------------------------------------------------\r
-; VOID\r
-; memset (\r
-;   OUT     VOID                      *Buffer,\r
-;   IN      UINT8                     Value,\r
-;   IN      UINTN                     Length\r
-;   );\r
-;------------------------------------------------------------------------------\r
-memset   PROC    USES    rdi rbx\r
-    cmp     r8, 0                      ; if Size == 0, do nothing\r
-    mov     r9,  rcx\r
-    je      @SetDone\r
-    mov     rax, rdx\r
-    mov     bl,  al\r
-    mov     bh,  bl\r
-    mov     ax,  bx\r
-    shl     rax, 10h\r
-    mov     ax,  bx\r
-    mov     ebx, eax\r
-    shl     rax, 20h\r
-    mov     eax, ebx\r
-    mov     rdi, rcx\r
-    mov     rcx, r8\r
-    shr     rcx, 3\r
-    rep     stosq\r
-    mov     rcx, rdx\r
-    and     rcx, 7\r
-    rep     stosb\r
-@SetDone:\r
-    mov     rax, r9\r
-    ret\r
-memset   ENDP\r
-\r
-    END\r
-\r
diff --git a/EdkCompatibilityPkg/Foundation/Library/CompilerStub/x64/memsetSSE2.asm b/EdkCompatibilityPkg/Foundation/Library/CompilerStub/x64/memsetSSE2.asm
deleted file mode 100644 (file)
index 0370c9b..0000000
+++ /dev/null
@@ -1,74 +0,0 @@
-;------------------------------------------------------------------------------\r
-;\r
-; Copyright (c) 2007, Intel Corporation\r
-; All rights reserved. This program and the accompanying materials\r
-; are licensed and made available under the terms and conditions of the BSD License\r
-; which accompanies this distribution.  The full text of the license may be found at\r
-; http://opensource.org/licenses/bsd-license.php\r
-;\r
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-;\r
-; Module Name:\r
-;\r
-;   SetMem.asm\r
-;\r
-; Abstract:\r
-;\r
-;   memset function\r
-;\r
-; Notes:\r
-;\r
-;------------------------------------------------------------------------------\r
-\r
-    .code\r
-\r
-;------------------------------------------------------------------------------\r
-; VOID *\r
-; memset (\r
-;   OUT     VOID                      *Buffer,    --> rcx\r
-;   IN      UINT8                     Value,      --> rdx\r
-;   IN      UINTN                     Length      --> r8\r
-;   );\r
-;------------------------------------------------------------------------------\r
-memset   PROC    USES    rdi\r
-    mov     rax, rcx    \r
-    cmp     r8, 0                       ; if Size == 0, do nothing\r
-    je      @SetDone                    \r
-    mov     rax, rdx                    ; rdx <-> r8\r
-    mov     rdx, r8                     ; rdx <- Length\r
-    mov     r8, rax                     ; r8  <- Value\r
-    \r
-    mov     rdi, rcx                    ; rdi <- Buffer\r
-    mov     al, r8b                     ; al <- Value\r
-    mov     r9, rdi                     ; r9 <- Buffer as return value\r
-    xor     rcx, rcx\r
-    sub     rcx, rdi\r
-    and     rcx, 15                     ; rcx + rdi aligns on 16-byte boundary\r
-    jz      @F\r
-    cmp     rcx, rdx\r
-    cmova   rcx, rdx\r
-    sub     rdx, rcx\r
-    rep     stosb\r
-@@:\r
-    mov     rcx, rdx\r
-    and     rdx, 15\r
-    shr     rcx, 4\r
-    jz      @SetBytes\r
-    mov     ah, al                      ; ax <- Value repeats twice\r
-    movd    xmm0, eax                   ; xmm0[0..16] <- Value repeats twice\r
-    pshuflw xmm0, xmm0, 0               ; xmm0[0..63] <- Value repeats 8 times\r
-    movlhps xmm0, xmm0                  ; xmm0 <- Value repeats 16 times\r
-@@:\r
-    movdqa  [rdi], xmm0                 ; rdi should be 16-byte aligned\r
-    add     rdi, 16\r
-    loop    @B\r
-@SetBytes:\r
-    mov     ecx, edx                    ; high 32 bits of rcx are always zero\r
-    rep     stosb\r
-    mov     rax, r9                     ; rax <- Return value\r
-@SetDone:\r
-    ret\r
-memset   ENDP\r
-\r
-    END\r