diff options
Diffstat (limited to 'MdePkg/Library/BaseMemoryLibOptPei')
11 files changed, 41 insertions, 46 deletions
diff --git a/MdePkg/Library/BaseMemoryLibOptPei/Ia32/CompareMem.S b/MdePkg/Library/BaseMemoryLibOptPei/Ia32/CompareMem.S index 725367b2f9..2b1014ad42 100644 --- a/MdePkg/Library/BaseMemoryLibOptPei/Ia32/CompareMem.S +++ b/MdePkg/Library/BaseMemoryLibOptPei/Ia32/CompareMem.S @@ -27,7 +27,7 @@ # #------------------------------------------------------------------------------ -.globl _InternalMemCompareMem +.globl ASM_PFX(InternalMemCompareMem) #------------------------------------------------------------------------------ # INTN @@ -38,7 +38,7 @@ # IN UINTN Length # ); #------------------------------------------------------------------------------ -_InternalMemCompareMem: +ASM_PFX(InternalMemCompareMem): push %esi push %edi movl 12(%esp), %esi diff --git a/MdePkg/Library/BaseMemoryLibOptPei/Ia32/CopyMem.S b/MdePkg/Library/BaseMemoryLibOptPei/Ia32/CopyMem.S index 6f19826956..5621f7ee5b 100644 --- a/MdePkg/Library/BaseMemoryLibOptPei/Ia32/CopyMem.S +++ b/MdePkg/Library/BaseMemoryLibOptPei/Ia32/CopyMem.S @@ -21,7 +21,7 @@ # #------------------------------------------------------------------------------ -.globl _InternalMemCopyMem +.globl ASM_PFX(InternalMemCopyMem) #------------------------------------------------------------------------------ # VOID * @@ -32,30 +32,30 @@ # IN UINTN Count # ); #------------------------------------------------------------------------------ -_InternalMemCopyMem: +ASM_PFX(InternalMemCopyMem): push %esi push %edi movl 16(%esp), %esi # esi <- Source movl 12(%esp), %edi # edi <- Destination movl 20(%esp), %edx # edx <- Count - cmpl %esi, %edi
- je L_CopyDone
+ cmpl %esi, %edi + je L_CopyDone cmpl $0, %edx - je L_CopyDone
+ je L_CopyDone leal -1(%esi, %edx), %eax # eax <- End of Source - cmpl %esi, %edi
- jae L_CopyBytes
- cmpl %eax, %edi
- jb L_CopyBytes # Copy backward if overlapped
- movl %esi, %eax # esi <- End of Source
+ cmpl %edi, %esi + jae L_CopyBytes + cmpl %edi, %eax + jb L_CopyBytes # Copy backward if overlapped + movl %eax, %esi # esi <- End of Source leal -1(%edi, %edx), %edi # edi <- End of Destination - std
-L_CopyBytes:
- movl %ecx, %edx
+ std +L_CopyBytes: + movl %edx, %ecx rep movsb # Copy bytes backward cld -L_CopyDone:
+L_CopyDone: movl 12(%esp), %eax # eax <- Destination as return value pop %edi pop %esi diff --git a/MdePkg/Library/BaseMemoryLibOptPei/Ia32/ScanMem16.S b/MdePkg/Library/BaseMemoryLibOptPei/Ia32/ScanMem16.S index 5e65b9667a..e944052645 100644 --- a/MdePkg/Library/BaseMemoryLibOptPei/Ia32/ScanMem16.S +++ b/MdePkg/Library/BaseMemoryLibOptPei/Ia32/ScanMem16.S @@ -27,7 +27,7 @@ # #------------------------------------------------------------------------------ -.globl _InternalMemScanMem16 +.globl ASM_PFX(InternalMemScanMem16) #------------------------------------------------------------------------------ # CONST VOID * @@ -38,7 +38,7 @@ # IN UINT16 Value # ); #------------------------------------------------------------------------------ -_InternalMemScanMem16: +ASM_PFX(InternalMemScanMem16): push %edi movl 12(%esp), %ecx movl 8(%esp), %edi diff --git a/MdePkg/Library/BaseMemoryLibOptPei/Ia32/ScanMem32.S b/MdePkg/Library/BaseMemoryLibOptPei/Ia32/ScanMem32.S index 5d46ed2bc1..00461db1c6 100644 --- a/MdePkg/Library/BaseMemoryLibOptPei/Ia32/ScanMem32.S +++ b/MdePkg/Library/BaseMemoryLibOptPei/Ia32/ScanMem32.S @@ -27,7 +27,7 @@ # #------------------------------------------------------------------------------ -.globl _InternalMemScanMem32 +.globl ASM_PFX(InternalMemScanMem32) #------------------------------------------------------------------------------ # CONST VOID * @@ -38,7 +38,7 @@ # IN UINT32 Value # ); #------------------------------------------------------------------------------ -_InternalMemScanMem32: +ASM_PFX(InternalMemScanMem32): push %edi movl 12(%esp), %ecx movl 8(%esp), %edi diff --git a/MdePkg/Library/BaseMemoryLibOptPei/Ia32/ScanMem64.S b/MdePkg/Library/BaseMemoryLibOptPei/Ia32/ScanMem64.S index 3ba69650ab..2e5c6ee28b 100644 --- a/MdePkg/Library/BaseMemoryLibOptPei/Ia32/ScanMem64.S +++ b/MdePkg/Library/BaseMemoryLibOptPei/Ia32/ScanMem64.S @@ -27,7 +27,7 @@ # #------------------------------------------------------------------------------ -.globl _InternalMemScanMem64 +.globl ASM_PFX(InternalMemScanMem64) #------------------------------------------------------------------------------ # CONST VOID * @@ -38,7 +38,7 @@ # IN UINT64 Value # ); #------------------------------------------------------------------------------ -_InternalMemScanMem64: +ASM_PFX(InternalMemScanMem64): push %edi movl 12(%esp), %ecx movl 16(%esp), %eax diff --git a/MdePkg/Library/BaseMemoryLibOptPei/Ia32/ScanMem8.S b/MdePkg/Library/BaseMemoryLibOptPei/Ia32/ScanMem8.S index 7a834a5635..36f88bfe6f 100644 --- a/MdePkg/Library/BaseMemoryLibOptPei/Ia32/ScanMem8.S +++ b/MdePkg/Library/BaseMemoryLibOptPei/Ia32/ScanMem8.S @@ -27,7 +27,7 @@ # #------------------------------------------------------------------------------ -.globl _InternalMemScanMem8 +.globl ASM_PFX(InternalMemScanMem8) #------------------------------------------------------------------------------ # CONST VOID * @@ -38,7 +38,7 @@ # IN UINT8 Value # ); #------------------------------------------------------------------------------ -_InternalMemScanMem8: +ASM_PFX(InternalMemScanMem8): push %edi movl 12(%esp), %ecx movl 8(%esp), %edi diff --git a/MdePkg/Library/BaseMemoryLibOptPei/Ia32/SetMem.S b/MdePkg/Library/BaseMemoryLibOptPei/Ia32/SetMem.S index aa803ca580..64fdfaff5d 100644 --- a/MdePkg/Library/BaseMemoryLibOptPei/Ia32/SetMem.S +++ b/MdePkg/Library/BaseMemoryLibOptPei/Ia32/SetMem.S @@ -21,10 +21,7 @@ # #------------------------------------------------------------------------------ - .386: - .code: - -.globl _InternalMemSetMem +.globl ASM_PFX(InternalMemSetMem) #------------------------------------------------------------------------------ # VOID * @@ -34,22 +31,20 @@ # IN UINT8 Value # ) #------------------------------------------------------------------------------ -_InternalMemSetMem: +ASM_PFX(InternalMemSetMem): push %edi movl 12(%esp),%ecx movb 16(%esp),%al - movb %ah, %al
+ movb %al, %ah shrd $16, %eax, %edx shld $16, %edx, %eax - movl %edx, %ecx
+ movl %ecx, %edx movl 8(%esp),%edi - shrd $2, %ecx, %ecx
- rep
- stosl
- movl %ecx, %edx
- andl $3, %ecx
- rep - stosb + shr $2, %ecx + rep stosl + movl %edx, %ecx + andl $3, %ecx + rep stosb movl 8(%esp),%eax pop %edi ret diff --git a/MdePkg/Library/BaseMemoryLibOptPei/Ia32/SetMem16.S b/MdePkg/Library/BaseMemoryLibOptPei/Ia32/SetMem16.S index 6e7c136222..86000519ac 100644 --- a/MdePkg/Library/BaseMemoryLibOptPei/Ia32/SetMem16.S +++ b/MdePkg/Library/BaseMemoryLibOptPei/Ia32/SetMem16.S @@ -21,7 +21,7 @@ # #------------------------------------------------------------------------------ -.globl _InternalMemSetMem16 +.globl ASM_PFX(InternalMemSetMem16) #------------------------------------------------------------------------------ # VOID * @@ -31,7 +31,7 @@ # IN UINT16 Value # ) #------------------------------------------------------------------------------ -_InternalMemSetMem16: +ASM_PFX(InternalMemSetMem16): push %edi movl 16(%esp), %eax movl 8(%esp), %edi diff --git a/MdePkg/Library/BaseMemoryLibOptPei/Ia32/SetMem32.S b/MdePkg/Library/BaseMemoryLibOptPei/Ia32/SetMem32.S index 455af20573..e75bf4d9e6 100644 --- a/MdePkg/Library/BaseMemoryLibOptPei/Ia32/SetMem32.S +++ b/MdePkg/Library/BaseMemoryLibOptPei/Ia32/SetMem32.S @@ -21,7 +21,7 @@ # #------------------------------------------------------------------------------ -.globl _InternalMemSetMem32 +.globl ASM_PFX(InternalMemSetMem32) #------------------------------------------------------------------------------ # VOID * @@ -31,7 +31,7 @@ # IN UINT32 Value # ) #------------------------------------------------------------------------------ -_InternalMemSetMem32: +ASM_PFX(InternalMemSetMem32): push %edi movl 16(%esp),%eax movl 8(%esp),%edi diff --git a/MdePkg/Library/BaseMemoryLibOptPei/Ia32/SetMem64.S b/MdePkg/Library/BaseMemoryLibOptPei/Ia32/SetMem64.S index b4afff0fd4..3405819d48 100644 --- a/MdePkg/Library/BaseMemoryLibOptPei/Ia32/SetMem64.S +++ b/MdePkg/Library/BaseMemoryLibOptPei/Ia32/SetMem64.S @@ -21,7 +21,7 @@ # #------------------------------------------------------------------------------ -.globl _InternalMemSetMem64 +.globl ASM_PFX(InternalMemSetMem64) #------------------------------------------------------------------------------ # VOID * @@ -31,7 +31,7 @@ # IN UINT64 Value # ) #------------------------------------------------------------------------------ -_InternalMemSetMem64: +ASM_PFX(InternalMemSetMem64): push %edi movl 12(%esp), %ecx movl 16(%esp), %eax diff --git a/MdePkg/Library/BaseMemoryLibOptPei/Ia32/ZeroMem.S b/MdePkg/Library/BaseMemoryLibOptPei/Ia32/ZeroMem.S index 8465d7cf65..d5e6b2f53c 100644 --- a/MdePkg/Library/BaseMemoryLibOptPei/Ia32/ZeroMem.S +++ b/MdePkg/Library/BaseMemoryLibOptPei/Ia32/ZeroMem.S @@ -21,7 +21,7 @@ # #------------------------------------------------------------------------------ -.globl _InternalMemZeroMem +.globl ASM_PFX(InternalMemZeroMem) #------------------------------------------------------------------------------ # VOID * @@ -30,7 +30,7 @@ # IN UINTN Count # ); #------------------------------------------------------------------------------ -_InternalMemZeroMem: +ASM_PFX(InternalMemZeroMem): push %edi xorl %eax,%eax movl 8(%esp),%edi |