MdePkg/BaseMemoryLibOptDxe ARM|AARCH64: implement accelerated GUID functions

As reported by Vishal, CompareGuid() is a hotspot, and switching from
BaseMemoryLibStm in ArmPkg/ to BaseMemoryLibOptDxe causes a noticeable
performance regression due to the fact that BaseMemoryLibOptDxe uses
unaligned accessors explicitly to implement CompareGuid() and the related
functions.

Since BaseMemoryLibOptDxe on ARM and AARCH64 can only be used in contexts
where unaligned accesses are allowed, reimplement these functions for ARM
and AARCH64 specifically, using wide accessors that can tolerate any
misalignment.

Reported-by: "Oliyil Kunnil, Vishal" <vishalo@qti.qualcomm.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Liming Gao <liming.gao@intel.com>
This commit is contained in:
Ard Biesheuvel
2016-09-16 11:25:52 +01:00
parent 60fe5e8a9c
commit 217b3ac093
5 changed files with 333 additions and 1 deletions

View File

@@ -79,6 +79,7 @@
Ia32/CopyMem.nasm
Ia32/CopyMem.asm
Ia32/IsZeroBuffer.nasm
MemLibGuid.c
[Sources.X64]
X64/ScanMem64.nasm
@@ -115,6 +116,7 @@
X64/CopyMem.asm
X64/CopyMem.S
X64/IsZeroBuffer.nasm
MemLibGuid.c
[Defines.ARM, Defines.AARCH64]
#
@@ -130,20 +132,24 @@
Arm/SetMem.S |GCC
Arm/CopyMem.S |GCC
Arm/CompareMem.S |GCC
Arm/CompareGuid.S |GCC
Arm/ScanMem.asm |RVCT
Arm/SetMem.asm |RVCT
Arm/CopyMem.asm |RVCT
Arm/CompareMem.asm |RVCT
Arm/CompareGuid.asm |RVCT
[Sources.AARCH64]
AArch64/ScanMem.S
AArch64/SetMem.S
AArch64/CopyMem.S
AArch64/CompareMem.S
AArch64/CompareGuid.S
[Sources.ARM, Sources.AARCH64]
Arm/ScanMemGeneric.c
Arm/MemLibGuid.c
[Sources]
ScanMem64Wrapper.c
@@ -158,7 +164,6 @@
SetMemWrapper.c
CopyMemWrapper.c
IsZeroBufferWrapper.c
MemLibGuid.c
[Packages]
MdePkg/MdePkg.dec