* [PATCH v4 0/9] consolidate compiler intrinsics
@ 2022-06-03 12:26 Gerd Hoffmann
2022-06-03 12:26 ` [PATCH v4 1/9] MdePkg: promote CompilerIntrinsicsLib from ArmPkg to MdePkg Gerd Hoffmann
` (8 more replies)
0 siblings, 9 replies; 14+ messages in thread
From: Gerd Hoffmann @ 2022-06-03 12:26 UTC (permalink / raw)
To: devel
Cc: Jian J Wang, Jiaxin Wu, Sean Brogan, Anthony Perard,
Leif Lindholm, Zhiguang Liu, Xiaoyu Lu, Pawel Polawski,
Sami Mujawar, Maciej Rabeda, Bob Feng, Jiewen Yao, Andrew Fish,
Bret Barkelew, Alexei Fedorov, Guo Dong, Gerd Hoffmann,
kilian_kegel, Maurice Ma, Siyuan Fu, Abner Chang, Zhichao Gao,
Wei6 Xu, Supreeth Venkatesh, Julien Grall, Daniel Schaefer,
Ard Biesheuvel, Guomin Jiang, Jordan Justen, Oliver Steffen,
Sebastien Boeuf, Benjamin You, Min Xu, Ray Ni, Rebecca Cran,
Nickle Wang, Michael D Kinney, Tom Lendacky, Sami Mujawar,
Peter Grehan, Erdem Aktas, Brijesh Singh, James Bottomley,
Yuwei Chen, Liming Gao
This is an attept to start cleaning up the messy compiler intrinsics
situation. Today we don't have a core intrinsics library, resulting
in everybody creating their own. ArmPkg has one, CryptoPkg has one.
I'm sure there are many more.
This doesn't make sense. Given we can't avoid compiler intrinsics (as
proven by the existence of those libraries) we should better have them
as core library so we have to maintain a single version only.
Given we already have BaseIoLibIntrinsic in MdePkg we can place the
compiler intrinsics there too. This little patch series does just that:
It moves over the existing ArmPkg intrinsics, fixes them to build on
non-arm too, and adds additional bits from the CryptoPkg intrinsics.
v4 changes:
- rebase to latest master, solve conflicts due to RVCT removal.
- squash commit adding the SPDX tags.
v3 changes:
- rebase to latest master, solve conflicts.
v2 changes:
- rebase to latest master.
- add review tags
- add patch moving size_t to header file (patch #3).
- add patches copying over more intrinsics from
edk2-libc repo (patches #5 -> #10).
Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=3649
take care,
Gerd
Gerd Hoffmann (9):
MdePkg: promote CompilerIntrinsicsLib from ArmPkg to MdePkg
MdePkg/CompilerIntrinsicsLib: fix msft sources for x64
MdePkg/CompilerIntrinsicsLib: move size_t typedef to header file
MdePkg/CompilerIntrinsicsLib: move ia32 intrinsics and strcmp
MdePkg/CompilerIntrinsicsLib: copy over intrinsics from edk2-libc repo
MdePkg/CompilerIntrinsicsLib: drop include from Gcc.c
MdePkg/CompilerIntrinsicsLib: drop debug logging from Gcc.c
MdePkg/CompilerIntrinsicsLib: remove duplicate functions from Gcc.c
MdePkg/CompilerIntrinsicsLib: add new sources to
CompilerIntrinsicsLib.inf
ArmVirtPkg/ArmVirt.dsc.inc | 4 +-
.../UnitTestFrameworkPkgTarget.dsc.inc | 2 +-
ArmPkg/ArmPkg.dsc | 3 +-
.../ArmCrashDumpDxe/ArmCrashDumpDxe.dsc | 2 +-
ArmPlatformPkg/ArmPlatformPkg.dsc | 2 +-
CryptoPkg/CryptoPkg.dsc | 5 +-
DynamicTablesPkg/DynamicTablesPkg.dsc | 2 +-
EmbeddedPkg/EmbeddedPkg.dsc | 2 +-
EmulatorPkg/EmulatorPkg.dsc | 2 +-
FatPkg/FatPkg.dsc | 2 +-
FmpDevicePkg/FmpDevicePkg.dsc | 4 +-
MdeModulePkg/MdeModulePkg.dsc | 2 +-
MdePkg/MdePkg.dsc | 1 +
NetworkPkg/NetworkPkg.dsc | 4 +-
OvmfPkg/AmdSev/AmdSevX64.dsc | 2 +-
OvmfPkg/Bhyve/BhyveX64.dsc | 2 +-
OvmfPkg/CloudHv/CloudHvX64.dsc | 2 +-
OvmfPkg/IntelTdx/IntelTdxX64.dsc | 2 +-
OvmfPkg/Microvm/MicrovmX64.dsc | 2 +-
OvmfPkg/OvmfPkgIa32.dsc | 2 +-
OvmfPkg/OvmfPkgIa32X64.dsc | 2 +-
OvmfPkg/OvmfPkgX64.dsc | 2 +-
OvmfPkg/OvmfXen.dsc | 2 +-
RedfishPkg/RedfishPkg.dsc | 2 +-
SecurityPkg/SecurityPkg.dsc | 12 +-
ShellPkg/ShellPkg.dsc | 2 +-
SignedCapsulePkg/SignedCapsulePkg.dsc | 14 +-
StandaloneMmPkg/StandaloneMmPkg.dsc | 2 +-
UefiPayloadPkg/UefiPayloadPkg.dsc | 2 +-
.../Library/IntrinsicLib/IntrinsicLib.inf | 69 ------
.../CompilerIntrinsicsLib.inf | 33 ++-
{ArmPkg => MdePkg}/Include/AsmMacroIoLib.h | 0
.../Library/CompilerIntrinsicsLib/types_ms.h | 14 ++
CryptoPkg/Library/IntrinsicLib/CopyMem.c | 47 ----
.../Library/IntrinsicLib/MemoryIntrinsics.c | 74 ------
.../Library/CompilerIntrinsicsLib/Ia32/Gcc.c | 215 ++++++++++++++++++
.../CompilerIntrinsicsLib}/Ia32/MathFtol.c | 0
.../Ia32/MathLShiftS64.c | 0
.../Ia32/MathRShiftU64.c | 0
.../CompilerIntrinsicsLib/Ia32/lldiv.c | 100 ++++++++
.../CompilerIntrinsicsLib/Ia32/lldvrm.c | 104 +++++++++
.../CompilerIntrinsicsLib/Ia32/llmul.c | 84 +++++++
.../CompilerIntrinsicsLib/Ia32/llrem.c | 97 ++++++++
.../CompilerIntrinsicsLib/Ia32/llshl.c | 10 +-
.../CompilerIntrinsicsLib/Ia32/llshr.c | 63 +++++
.../CompilerIntrinsicsLib/Ia32/ulldiv.c | 91 ++++++++
.../CompilerIntrinsicsLib/Ia32/ulldvrm.c | 104 +++++++++
.../CompilerIntrinsicsLib/Ia32/ullrem.c | 97 ++++++++
.../CompilerIntrinsicsLib/Ia32/ullshr.c | 10 +-
.../Library/CompilerIntrinsicsLib/memcmp_ms.c | 2 +-
.../Library/CompilerIntrinsicsLib/memcpy.c | 0
.../Library/CompilerIntrinsicsLib/memcpy_ms.c | 6 +-
.../CompilerIntrinsicsLib/memmove_ms.c | 6 +-
.../Library/CompilerIntrinsicsLib/memset.c | 0
.../Library/CompilerIntrinsicsLib/memset_ms.c | 6 +-
MdePkg/Library/CompilerIntrinsicsLib/strcmp.c | 33 +++
ArmPkg/ArmPkg.ci.yaml | 1 -
.../DEBUG_XCODE31/CompilerIntrinsicsLib.lib | Bin 36072 -> 36072 bytes
.../DEBUG_XCODE32/CompilerIntrinsicsLib.lib | Bin 36072 -> 36072 bytes
.../Library/IntrinsicLib/BaseIntrinsicLib.uni | 16 --
.../CompilerIntrinsicsLib/AArch64/Atomics.S | 0
.../CompilerIntrinsicsLib/Arm/ashldi3.S | 0
.../CompilerIntrinsicsLib/Arm/ashrdi3.S | 0
.../CompilerIntrinsicsLib/Arm/clzsi2.S | 0
.../CompilerIntrinsicsLib/Arm/ctzsi2.S | 0
.../Library/CompilerIntrinsicsLib/Arm/div.S | 0
.../Library/CompilerIntrinsicsLib/Arm/div.asm | 0
.../CompilerIntrinsicsLib/Arm/divdi3.S | 0
.../CompilerIntrinsicsLib/Arm/divsi3.S | 0
.../Library/CompilerIntrinsicsLib/Arm/lasr.S | 0
.../CompilerIntrinsicsLib/Arm/ldivmod.S | 0
.../CompilerIntrinsicsLib/Arm/ldivmod.asm | 0
.../Library/CompilerIntrinsicsLib/Arm/llsl.S | 0
.../Library/CompilerIntrinsicsLib/Arm/llsr.S | 0
.../CompilerIntrinsicsLib/Arm/llsr.asm | 0
.../CompilerIntrinsicsLib/Arm/lshrdi3.S | 0
.../CompilerIntrinsicsLib/Arm/memmove.S | 0
.../CompilerIntrinsicsLib/Arm/moddi3.S | 0
.../CompilerIntrinsicsLib/Arm/modsi3.S | 0
.../CompilerIntrinsicsLib/Arm/muldi3.S | 0
.../Library/CompilerIntrinsicsLib/Arm/mullu.S | 0
.../CompilerIntrinsicsLib/Arm/sourcery.S | 0
.../CompilerIntrinsicsLib/Arm/switch16.S | 0
.../CompilerIntrinsicsLib/Arm/switch32.S | 0
.../CompilerIntrinsicsLib/Arm/switch8.S | 0
.../CompilerIntrinsicsLib/Arm/switchu8.S | 0
.../CompilerIntrinsicsLib/Arm/ucmpdi2.S | 0
.../CompilerIntrinsicsLib/Arm/udivdi3.S | 0
.../CompilerIntrinsicsLib/Arm/udivmoddi4.S | 0
.../CompilerIntrinsicsLib/Arm/udivsi3.S | 0
.../Library/CompilerIntrinsicsLib/Arm/uldiv.S | 0
.../CompilerIntrinsicsLib/Arm/uldiv.asm | 0
.../CompilerIntrinsicsLib/Arm/umoddi3.S | 0
.../CompilerIntrinsicsLib/Arm/umodsi3.S | 0
.../Library/CompilerIntrinsicsLib/Arm/uread.S | 0
.../CompilerIntrinsicsLib/Arm/uwrite.S | 0
.../Ia32/MathLShiftS64.nasm | 0
.../CompilerIntrinsicsLib}/Ia32/MathLlmul.asm | 0
.../CompilerIntrinsicsLib}/Ia32/MathLlshr.asm | 0
.../Ia32/MathRShiftU64.nasm | 0
.../CompilerIntrinsicsLib/Ia32/ashrdi3.S | 68 ++++++
.../CompilerIntrinsicsLib/Ia32/mulll.S | 79 +++++++
.../CompilerIntrinsicsLib/Ia32/shldi3.S | 64 ++++++
.../CompilerIntrinsicsLib/Ia32/udivdi3.S | 85 +++++++
.../CompilerIntrinsicsLib/Ia32/umoddi3.S | 91 ++++++++
MdePkg/MdePkg.ci.yaml | 1 +
106 files changed, 1488 insertions(+), 271 deletions(-)
delete mode 100644 CryptoPkg/Library/IntrinsicLib/IntrinsicLib.inf
rename {ArmPkg => MdePkg}/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf (64%)
rename {ArmPkg => MdePkg}/Include/AsmMacroIoLib.h (100%)
create mode 100644 MdePkg/Library/CompilerIntrinsicsLib/types_ms.h
delete mode 100644 CryptoPkg/Library/IntrinsicLib/CopyMem.c
delete mode 100644 CryptoPkg/Library/IntrinsicLib/MemoryIntrinsics.c
create mode 100644 MdePkg/Library/CompilerIntrinsicsLib/Ia32/Gcc.c
rename {CryptoPkg/Library/IntrinsicLib => MdePkg/Library/CompilerIntrinsicsLib}/Ia32/MathFtol.c (100%)
copy {CryptoPkg/Library/IntrinsicLib => MdePkg/Library/CompilerIntrinsicsLib}/Ia32/MathLShiftS64.c (100%)
copy {CryptoPkg/Library/IntrinsicLib => MdePkg/Library/CompilerIntrinsicsLib}/Ia32/MathRShiftU64.c (100%)
create mode 100644 MdePkg/Library/CompilerIntrinsicsLib/Ia32/lldiv.c
create mode 100644 MdePkg/Library/CompilerIntrinsicsLib/Ia32/lldvrm.c
create mode 100644 MdePkg/Library/CompilerIntrinsicsLib/Ia32/llmul.c
create mode 100644 MdePkg/Library/CompilerIntrinsicsLib/Ia32/llrem.c
rename CryptoPkg/Library/IntrinsicLib/Ia32/MathLShiftS64.c => MdePkg/Library/CompilerIntrinsicsLib/Ia32/llshl.c (61%)
create mode 100644 MdePkg/Library/CompilerIntrinsicsLib/Ia32/llshr.c
create mode 100644 MdePkg/Library/CompilerIntrinsicsLib/Ia32/ulldiv.c
create mode 100644 MdePkg/Library/CompilerIntrinsicsLib/Ia32/ulldvrm.c
create mode 100644 MdePkg/Library/CompilerIntrinsicsLib/Ia32/ullrem.c
rename CryptoPkg/Library/IntrinsicLib/Ia32/MathRShiftU64.c => MdePkg/Library/CompilerIntrinsicsLib/Ia32/ullshr.c (62%)
rename {ArmPkg => MdePkg}/Library/CompilerIntrinsicsLib/memcmp_ms.c (89%)
rename {ArmPkg => MdePkg}/Library/CompilerIntrinsicsLib/memcpy.c (100%)
rename {ArmPkg => MdePkg}/Library/CompilerIntrinsicsLib/memcpy_ms.c (82%)
rename {ArmPkg => MdePkg}/Library/CompilerIntrinsicsLib/memmove_ms.c (83%)
rename {ArmPkg => MdePkg}/Library/CompilerIntrinsicsLib/memset.c (100%)
rename {ArmPkg => MdePkg}/Library/CompilerIntrinsicsLib/memset_ms.c (80%)
create mode 100644 MdePkg/Library/CompilerIntrinsicsLib/strcmp.c
delete mode 100644 CryptoPkg/Library/IntrinsicLib/BaseIntrinsicLib.uni
rename {ArmPkg => MdePkg}/Library/CompilerIntrinsicsLib/AArch64/Atomics.S (100%)
rename {ArmPkg => MdePkg}/Library/CompilerIntrinsicsLib/Arm/ashldi3.S (100%)
rename {ArmPkg => MdePkg}/Library/CompilerIntrinsicsLib/Arm/ashrdi3.S (100%)
rename {ArmPkg => MdePkg}/Library/CompilerIntrinsicsLib/Arm/clzsi2.S (100%)
rename {ArmPkg => MdePkg}/Library/CompilerIntrinsicsLib/Arm/ctzsi2.S (100%)
rename {ArmPkg => MdePkg}/Library/CompilerIntrinsicsLib/Arm/div.S (100%)
rename {ArmPkg => MdePkg}/Library/CompilerIntrinsicsLib/Arm/div.asm (100%)
rename {ArmPkg => MdePkg}/Library/CompilerIntrinsicsLib/Arm/divdi3.S (100%)
rename {ArmPkg => MdePkg}/Library/CompilerIntrinsicsLib/Arm/divsi3.S (100%)
rename {ArmPkg => MdePkg}/Library/CompilerIntrinsicsLib/Arm/lasr.S (100%)
rename {ArmPkg => MdePkg}/Library/CompilerIntrinsicsLib/Arm/ldivmod.S (100%)
rename {ArmPkg => MdePkg}/Library/CompilerIntrinsicsLib/Arm/ldivmod.asm (100%)
rename {ArmPkg => MdePkg}/Library/CompilerIntrinsicsLib/Arm/llsl.S (100%)
rename {ArmPkg => MdePkg}/Library/CompilerIntrinsicsLib/Arm/llsr.S (100%)
rename {ArmPkg => MdePkg}/Library/CompilerIntrinsicsLib/Arm/llsr.asm (100%)
rename {ArmPkg => MdePkg}/Library/CompilerIntrinsicsLib/Arm/lshrdi3.S (100%)
rename {ArmPkg => MdePkg}/Library/CompilerIntrinsicsLib/Arm/memmove.S (100%)
rename {ArmPkg => MdePkg}/Library/CompilerIntrinsicsLib/Arm/moddi3.S (100%)
rename {ArmPkg => MdePkg}/Library/CompilerIntrinsicsLib/Arm/modsi3.S (100%)
rename {ArmPkg => MdePkg}/Library/CompilerIntrinsicsLib/Arm/muldi3.S (100%)
rename {ArmPkg => MdePkg}/Library/CompilerIntrinsicsLib/Arm/mullu.S (100%)
rename {ArmPkg => MdePkg}/Library/CompilerIntrinsicsLib/Arm/sourcery.S (100%)
rename {ArmPkg => MdePkg}/Library/CompilerIntrinsicsLib/Arm/switch16.S (100%)
rename {ArmPkg => MdePkg}/Library/CompilerIntrinsicsLib/Arm/switch32.S (100%)
rename {ArmPkg => MdePkg}/Library/CompilerIntrinsicsLib/Arm/switch8.S (100%)
rename {ArmPkg => MdePkg}/Library/CompilerIntrinsicsLib/Arm/switchu8.S (100%)
rename {ArmPkg => MdePkg}/Library/CompilerIntrinsicsLib/Arm/ucmpdi2.S (100%)
rename {ArmPkg => MdePkg}/Library/CompilerIntrinsicsLib/Arm/udivdi3.S (100%)
rename {ArmPkg => MdePkg}/Library/CompilerIntrinsicsLib/Arm/udivmoddi4.S (100%)
rename {ArmPkg => MdePkg}/Library/CompilerIntrinsicsLib/Arm/udivsi3.S (100%)
rename {ArmPkg => MdePkg}/Library/CompilerIntrinsicsLib/Arm/uldiv.S (100%)
rename {ArmPkg => MdePkg}/Library/CompilerIntrinsicsLib/Arm/uldiv.asm (100%)
rename {ArmPkg => MdePkg}/Library/CompilerIntrinsicsLib/Arm/umoddi3.S (100%)
rename {ArmPkg => MdePkg}/Library/CompilerIntrinsicsLib/Arm/umodsi3.S (100%)
rename {ArmPkg => MdePkg}/Library/CompilerIntrinsicsLib/Arm/uread.S (100%)
rename {ArmPkg => MdePkg}/Library/CompilerIntrinsicsLib/Arm/uwrite.S (100%)
rename {CryptoPkg/Library/IntrinsicLib => MdePkg/Library/CompilerIntrinsicsLib}/Ia32/MathLShiftS64.nasm (100%)
rename {CryptoPkg/Library/IntrinsicLib => MdePkg/Library/CompilerIntrinsicsLib}/Ia32/MathLlmul.asm (100%)
rename {CryptoPkg/Library/IntrinsicLib => MdePkg/Library/CompilerIntrinsicsLib}/Ia32/MathLlshr.asm (100%)
rename {CryptoPkg/Library/IntrinsicLib => MdePkg/Library/CompilerIntrinsicsLib}/Ia32/MathRShiftU64.nasm (100%)
create mode 100644 MdePkg/Library/CompilerIntrinsicsLib/Ia32/ashrdi3.S
create mode 100644 MdePkg/Library/CompilerIntrinsicsLib/Ia32/mulll.S
create mode 100644 MdePkg/Library/CompilerIntrinsicsLib/Ia32/shldi3.S
create mode 100644 MdePkg/Library/CompilerIntrinsicsLib/Ia32/udivdi3.S
create mode 100644 MdePkg/Library/CompilerIntrinsicsLib/Ia32/umoddi3.S
--
2.36.1
^ permalink raw reply [flat|nested] 14+ messages in thread
* [PATCH v4 1/9] MdePkg: promote CompilerIntrinsicsLib from ArmPkg to MdePkg
2022-06-03 12:26 [PATCH v4 0/9] consolidate compiler intrinsics Gerd Hoffmann
@ 2022-06-03 12:26 ` Gerd Hoffmann
2022-06-03 12:26 ` [PATCH v4 2/9] MdePkg/CompilerIntrinsicsLib: fix msft sources for x64 Gerd Hoffmann
` (7 subsequent siblings)
8 siblings, 0 replies; 14+ messages in thread
From: Gerd Hoffmann @ 2022-06-03 12:26 UTC (permalink / raw)
To: devel
Cc: Jian J Wang, Jiaxin Wu, Sean Brogan, Anthony Perard,
Leif Lindholm, Zhiguang Liu, Xiaoyu Lu, Pawel Polawski,
Sami Mujawar, Maciej Rabeda, Bob Feng, Jiewen Yao, Andrew Fish,
Bret Barkelew, Alexei Fedorov, Guo Dong, Gerd Hoffmann,
kilian_kegel, Maurice Ma, Siyuan Fu, Abner Chang, Zhichao Gao,
Wei6 Xu, Supreeth Venkatesh, Julien Grall, Daniel Schaefer,
Ard Biesheuvel, Guomin Jiang, Jordan Justen, Oliver Steffen,
Sebastien Boeuf, Benjamin You, Min Xu, Ray Ni, Rebecca Cran,
Nickle Wang, Michael D Kinney, Tom Lendacky, Sami Mujawar,
Peter Grehan, Erdem Aktas, Brijesh Singh, James Bottomley,
Yuwei Chen, Liming Gao, Jiewen Yao, Ard Biesheuvel
First step in creating a single, common compiler intrinsics library for
everybody who needs it. Move the ArmPkg library to MdePkg, update all
references. No code changes.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Acked-by: Jiewen Yao <Jiewen.yao@intel.com>
Acked-by: Ard Biesheuvel <ardb@kernel.org>
Acked-by: Liming Gao <gaoliming@byosoft.com.cn>
---
ArmVirtPkg/ArmVirt.dsc.inc | 2 +-
.../UnitTestFrameworkPkgTarget.dsc.inc | 2 +-
ArmPkg/ArmPkg.dsc | 3 +--
.../ArmCrashDumpDxe/ArmCrashDumpDxe.dsc | 2 +-
ArmPlatformPkg/ArmPlatformPkg.dsc | 2 +-
CryptoPkg/CryptoPkg.dsc | 2 +-
DynamicTablesPkg/DynamicTablesPkg.dsc | 2 +-
EmbeddedPkg/EmbeddedPkg.dsc | 2 +-
FatPkg/FatPkg.dsc | 2 +-
FmpDevicePkg/FmpDevicePkg.dsc | 2 +-
MdeModulePkg/MdeModulePkg.dsc | 2 +-
MdePkg/MdePkg.dsc | 1 +
NetworkPkg/NetworkPkg.dsc | 2 +-
RedfishPkg/RedfishPkg.dsc | 2 +-
SecurityPkg/SecurityPkg.dsc | 2 +-
ShellPkg/ShellPkg.dsc | 2 +-
SignedCapsulePkg/SignedCapsulePkg.dsc | 2 +-
StandaloneMmPkg/StandaloneMmPkg.dsc | 2 +-
.../CompilerIntrinsicsLib.inf | 1 -
{ArmPkg => MdePkg}/Include/AsmMacroIoLib.h | 0
.../Library/CompilerIntrinsicsLib/memcmp_ms.c | 0
.../Library/CompilerIntrinsicsLib/memcpy.c | 0
.../Library/CompilerIntrinsicsLib/memcpy_ms.c | 0
.../CompilerIntrinsicsLib/memmove_ms.c | 0
.../Library/CompilerIntrinsicsLib/memset.c | 0
.../Library/CompilerIntrinsicsLib/memset_ms.c | 0
ArmPkg/ArmPkg.ci.yaml | 1 -
.../DEBUG_XCODE31/CompilerIntrinsicsLib.lib | Bin 36072 -> 36072 bytes
.../DEBUG_XCODE32/CompilerIntrinsicsLib.lib | Bin 36072 -> 36072 bytes
.../CompilerIntrinsicsLib/AArch64/Atomics.S | 0
.../CompilerIntrinsicsLib/Arm/ashldi3.S | 0
.../CompilerIntrinsicsLib/Arm/ashrdi3.S | 0
.../CompilerIntrinsicsLib/Arm/clzsi2.S | 0
.../CompilerIntrinsicsLib/Arm/ctzsi2.S | 0
.../Library/CompilerIntrinsicsLib/Arm/div.S | 0
.../Library/CompilerIntrinsicsLib/Arm/div.asm | 0
.../CompilerIntrinsicsLib/Arm/divdi3.S | 0
.../CompilerIntrinsicsLib/Arm/divsi3.S | 0
.../Library/CompilerIntrinsicsLib/Arm/lasr.S | 0
.../CompilerIntrinsicsLib/Arm/ldivmod.S | 0
.../CompilerIntrinsicsLib/Arm/ldivmod.asm | 0
.../Library/CompilerIntrinsicsLib/Arm/llsl.S | 0
.../Library/CompilerIntrinsicsLib/Arm/llsr.S | 0
.../CompilerIntrinsicsLib/Arm/llsr.asm | 0
.../CompilerIntrinsicsLib/Arm/lshrdi3.S | 0
.../CompilerIntrinsicsLib/Arm/memmove.S | 0
.../CompilerIntrinsicsLib/Arm/moddi3.S | 0
.../CompilerIntrinsicsLib/Arm/modsi3.S | 0
.../CompilerIntrinsicsLib/Arm/muldi3.S | 0
.../Library/CompilerIntrinsicsLib/Arm/mullu.S | 0
.../CompilerIntrinsicsLib/Arm/sourcery.S | 0
.../CompilerIntrinsicsLib/Arm/switch16.S | 0
.../CompilerIntrinsicsLib/Arm/switch32.S | 0
.../CompilerIntrinsicsLib/Arm/switch8.S | 0
.../CompilerIntrinsicsLib/Arm/switchu8.S | 0
.../CompilerIntrinsicsLib/Arm/ucmpdi2.S | 0
.../CompilerIntrinsicsLib/Arm/udivdi3.S | 0
.../CompilerIntrinsicsLib/Arm/udivmoddi4.S | 0
.../CompilerIntrinsicsLib/Arm/udivsi3.S | 0
.../Library/CompilerIntrinsicsLib/Arm/uldiv.S | 0
.../CompilerIntrinsicsLib/Arm/uldiv.asm | 0
.../CompilerIntrinsicsLib/Arm/umoddi3.S | 0
.../CompilerIntrinsicsLib/Arm/umodsi3.S | 0
.../Library/CompilerIntrinsicsLib/Arm/uread.S | 0
.../CompilerIntrinsicsLib/Arm/uwrite.S | 0
MdePkg/MdePkg.ci.yaml | 1 +
66 files changed, 19 insertions(+), 20 deletions(-)
rename {ArmPkg => MdePkg}/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf (95%)
rename {ArmPkg => MdePkg}/Include/AsmMacroIoLib.h (100%)
rename {ArmPkg => MdePkg}/Library/CompilerIntrinsicsLib/memcmp_ms.c (100%)
rename {ArmPkg => MdePkg}/Library/CompilerIntrinsicsLib/memcpy.c (100%)
rename {ArmPkg => MdePkg}/Library/CompilerIntrinsicsLib/memcpy_ms.c (100%)
rename {ArmPkg => MdePkg}/Library/CompilerIntrinsicsLib/memmove_ms.c (100%)
rename {ArmPkg => MdePkg}/Library/CompilerIntrinsicsLib/memset.c (100%)
rename {ArmPkg => MdePkg}/Library/CompilerIntrinsicsLib/memset_ms.c (100%)
rename {ArmPkg => MdePkg}/Library/CompilerIntrinsicsLib/AArch64/Atomics.S (100%)
rename {ArmPkg => MdePkg}/Library/CompilerIntrinsicsLib/Arm/ashldi3.S (100%)
rename {ArmPkg => MdePkg}/Library/CompilerIntrinsicsLib/Arm/ashrdi3.S (100%)
rename {ArmPkg => MdePkg}/Library/CompilerIntrinsicsLib/Arm/clzsi2.S (100%)
rename {ArmPkg => MdePkg}/Library/CompilerIntrinsicsLib/Arm/ctzsi2.S (100%)
rename {ArmPkg => MdePkg}/Library/CompilerIntrinsicsLib/Arm/div.S (100%)
rename {ArmPkg => MdePkg}/Library/CompilerIntrinsicsLib/Arm/div.asm (100%)
rename {ArmPkg => MdePkg}/Library/CompilerIntrinsicsLib/Arm/divdi3.S (100%)
rename {ArmPkg => MdePkg}/Library/CompilerIntrinsicsLib/Arm/divsi3.S (100%)
rename {ArmPkg => MdePkg}/Library/CompilerIntrinsicsLib/Arm/lasr.S (100%)
rename {ArmPkg => MdePkg}/Library/CompilerIntrinsicsLib/Arm/ldivmod.S (100%)
rename {ArmPkg => MdePkg}/Library/CompilerIntrinsicsLib/Arm/ldivmod.asm (100%)
rename {ArmPkg => MdePkg}/Library/CompilerIntrinsicsLib/Arm/llsl.S (100%)
rename {ArmPkg => MdePkg}/Library/CompilerIntrinsicsLib/Arm/llsr.S (100%)
rename {ArmPkg => MdePkg}/Library/CompilerIntrinsicsLib/Arm/llsr.asm (100%)
rename {ArmPkg => MdePkg}/Library/CompilerIntrinsicsLib/Arm/lshrdi3.S (100%)
rename {ArmPkg => MdePkg}/Library/CompilerIntrinsicsLib/Arm/memmove.S (100%)
rename {ArmPkg => MdePkg}/Library/CompilerIntrinsicsLib/Arm/moddi3.S (100%)
rename {ArmPkg => MdePkg}/Library/CompilerIntrinsicsLib/Arm/modsi3.S (100%)
rename {ArmPkg => MdePkg}/Library/CompilerIntrinsicsLib/Arm/muldi3.S (100%)
rename {ArmPkg => MdePkg}/Library/CompilerIntrinsicsLib/Arm/mullu.S (100%)
rename {ArmPkg => MdePkg}/Library/CompilerIntrinsicsLib/Arm/sourcery.S (100%)
rename {ArmPkg => MdePkg}/Library/CompilerIntrinsicsLib/Arm/switch16.S (100%)
rename {ArmPkg => MdePkg}/Library/CompilerIntrinsicsLib/Arm/switch32.S (100%)
rename {ArmPkg => MdePkg}/Library/CompilerIntrinsicsLib/Arm/switch8.S (100%)
rename {ArmPkg => MdePkg}/Library/CompilerIntrinsicsLib/Arm/switchu8.S (100%)
rename {ArmPkg => MdePkg}/Library/CompilerIntrinsicsLib/Arm/ucmpdi2.S (100%)
rename {ArmPkg => MdePkg}/Library/CompilerIntrinsicsLib/Arm/udivdi3.S (100%)
rename {ArmPkg => MdePkg}/Library/CompilerIntrinsicsLib/Arm/udivmoddi4.S (100%)
rename {ArmPkg => MdePkg}/Library/CompilerIntrinsicsLib/Arm/udivsi3.S (100%)
rename {ArmPkg => MdePkg}/Library/CompilerIntrinsicsLib/Arm/uldiv.S (100%)
rename {ArmPkg => MdePkg}/Library/CompilerIntrinsicsLib/Arm/uldiv.asm (100%)
rename {ArmPkg => MdePkg}/Library/CompilerIntrinsicsLib/Arm/umoddi3.S (100%)
rename {ArmPkg => MdePkg}/Library/CompilerIntrinsicsLib/Arm/umodsi3.S (100%)
rename {ArmPkg => MdePkg}/Library/CompilerIntrinsicsLib/Arm/uread.S (100%)
rename {ArmPkg => MdePkg}/Library/CompilerIntrinsicsLib/Arm/uwrite.S (100%)
diff --git a/ArmVirtPkg/ArmVirt.dsc.inc b/ArmVirtPkg/ArmVirt.dsc.inc
index f15a3f7f06e4..4b5687927ae8 100644
--- a/ArmVirtPkg/ArmVirt.dsc.inc
+++ b/ArmVirtPkg/ArmVirt.dsc.inc
@@ -95,7 +95,7 @@ [LibraryClasses.common]
# It is not possible to prevent the ARM compiler from inserting calls to intrinsic functions.
# This library provides the instrinsic functions such a compiler may generate calls to.
#
- NULL|ArmPkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf
+ NULL|MdePkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf
# Add support for GCC stack protector
NULL|MdePkg/Library/BaseStackCheckLib/BaseStackCheckLib.inf
diff --git a/UnitTestFrameworkPkg/UnitTestFrameworkPkgTarget.dsc.inc b/UnitTestFrameworkPkg/UnitTestFrameworkPkgTarget.dsc.inc
index 8adf690098ae..9f2b671f7c86 100644
--- a/UnitTestFrameworkPkg/UnitTestFrameworkPkgTarget.dsc.inc
+++ b/UnitTestFrameworkPkg/UnitTestFrameworkPkgTarget.dsc.inc
@@ -37,7 +37,7 @@ [LibraryClasses.ARM, LibraryClasses.AARCH64]
# This library provides the instrinsic functions generated by a given compiler.
# [LibraryClasses.ARM] and NULL mean link this library into all ARM images.
#
- NULL|ArmPkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf
+ NULL|MdePkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf
#
# Since software stack checking may be heuristically enabled by the compiler
diff --git a/ArmPkg/ArmPkg.dsc b/ArmPkg/ArmPkg.dsc
index 59fd8f295d4f..f9268de8347e 100644
--- a/ArmPkg/ArmPkg.dsc
+++ b/ArmPkg/ArmPkg.dsc
@@ -101,7 +101,7 @@ [LibraryClasses.common.PEIM]
PeiServicesTablePointerLib|MdePkg/Library/PeiServicesTablePointerLib/PeiServicesTablePointerLib.inf
[LibraryClasses.ARM, LibraryClasses.AARCH64]
- NULL|ArmPkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf
+ NULL|MdePkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf
# Add support for GCC stack protector
NULL|MdePkg/Library/BaseStackCheckLib/BaseStackCheckLib.inf
@@ -109,7 +109,6 @@ [LibraryClasses.ARM, LibraryClasses.AARCH64]
[Components.common]
ArmPkg/Library/ArmCacheMaintenanceLib/ArmCacheMaintenanceLib.inf
ArmPkg/Library/ArmDisassemblerLib/ArmDisassemblerLib.inf
- ArmPkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf
ArmPkg/Library/DebugAgentSymbolsBaseLib/DebugAgentSymbolsBaseLib.inf
ArmPkg/Library/DebugPeCoffExtraActionLib/DebugPeCoffExtraActionLib.inf
ArmPkg/Library/DefaultExceptionHandlerLib/DefaultExceptionHandlerLib.inf
diff --git a/ArmPkg/Drivers/ArmCrashDumpDxe/ArmCrashDumpDxe.dsc b/ArmPkg/Drivers/ArmCrashDumpDxe/ArmCrashDumpDxe.dsc
index 2818ce65db98..ac818f0d98a2 100644
--- a/ArmPkg/Drivers/ArmCrashDumpDxe/ArmCrashDumpDxe.dsc
+++ b/ArmPkg/Drivers/ArmCrashDumpDxe/ArmCrashDumpDxe.dsc
@@ -43,7 +43,7 @@ [LibraryClasses]
UefiLib|MdePkg/Library/UefiLib/UefiLib.inf
UefiRuntimeServicesTableLib|MdePkg/Library/UefiRuntimeServicesTableLib/UefiRuntimeServicesTableLib.inf
- NULL|ArmPkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf
+ NULL|MdePkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf
NULL|MdePkg/Library/BaseStackCheckLib/BaseStackCheckLib.inf
[Components.common]
diff --git a/ArmPlatformPkg/ArmPlatformPkg.dsc b/ArmPlatformPkg/ArmPlatformPkg.dsc
index 661a4cea220d..b146e4fe8a69 100644
--- a/ArmPlatformPkg/ArmPlatformPkg.dsc
+++ b/ArmPlatformPkg/ArmPlatformPkg.dsc
@@ -76,7 +76,7 @@ [LibraryClasses.common]
DevicePathLib|MdePkg/Library/UefiDevicePathLib/UefiDevicePathLib.inf
UefiRuntimeServicesTableLib|MdePkg/Library/UefiRuntimeServicesTableLib/UefiRuntimeServicesTableLib.inf
- NULL|ArmPkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf
+ NULL|MdePkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf
NULL|MdePkg/Library/BaseStackCheckLib/BaseStackCheckLib.inf
[LibraryClasses.common.PEIM]
diff --git a/CryptoPkg/CryptoPkg.dsc b/CryptoPkg/CryptoPkg.dsc
index 06990cb6fc79..71679687a8b1 100644
--- a/CryptoPkg/CryptoPkg.dsc
+++ b/CryptoPkg/CryptoPkg.dsc
@@ -74,7 +74,7 @@ [LibraryClasses.ARM, LibraryClasses.AARCH64]
# [LibraryClasses.ARM, LibraryClasses.AARCH64] and NULL mean link this library
# into all ARM and AARCH64 images.
#
- NULL|ArmPkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf
+ NULL|MdePkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf
# Add support for stack protector
NULL|MdePkg/Library/BaseStackCheckLib/BaseStackCheckLib.inf
diff --git a/DynamicTablesPkg/DynamicTablesPkg.dsc b/DynamicTablesPkg/DynamicTablesPkg.dsc
index 068f0bc63080..c30b0f943a60 100644
--- a/DynamicTablesPkg/DynamicTablesPkg.dsc
+++ b/DynamicTablesPkg/DynamicTablesPkg.dsc
@@ -34,7 +34,7 @@ [LibraryClasses]
UefiDriverEntryPoint|MdePkg/Library/UefiDriverEntryPoint/UefiDriverEntryPoint.inf
[LibraryClasses.ARM, LibraryClasses.AARCH64]
- NULL|ArmPkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf
+ NULL|MdePkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf
NULL|MdePkg/Library/BaseStackCheckLib/BaseStackCheckLib.inf
PL011UartLib|ArmPlatformPkg/Library/PL011UartLib/PL011UartLib.inf
diff --git a/EmbeddedPkg/EmbeddedPkg.dsc b/EmbeddedPkg/EmbeddedPkg.dsc
index e9062cacbb42..14e3cbf1c872 100644
--- a/EmbeddedPkg/EmbeddedPkg.dsc
+++ b/EmbeddedPkg/EmbeddedPkg.dsc
@@ -128,7 +128,7 @@ [LibraryClasses.ARM, LibraryClasses.AARCH64]
ArmGicLib|ArmPkg/Drivers/ArmGic/ArmGicLib.inf
ArmSmcLib|ArmPkg/Library/ArmSmcLib/ArmSmcLib.inf
SemihostLib|ArmPkg/Library/SemihostLib/SemihostLib.inf
- NULL|ArmPkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf
+ NULL|MdePkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf
# Add support for GCC stack protector
NULL|MdePkg/Library/BaseStackCheckLib/BaseStackCheckLib.inf
diff --git a/FatPkg/FatPkg.dsc b/FatPkg/FatPkg.dsc
index 6fa439e440cb..ba27e9a26173 100644
--- a/FatPkg/FatPkg.dsc
+++ b/FatPkg/FatPkg.dsc
@@ -56,7 +56,7 @@ [LibraryClasses.common.PEIM]
MemoryAllocationLib|MdePkg/Library/PeiMemoryAllocationLib/PeiMemoryAllocationLib.inf
[LibraryClasses.ARM, LibraryClasses.AARCH64]
- NULL|ArmPkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf
+ NULL|MdePkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf
NULL|MdePkg/Library/BaseStackCheckLib/BaseStackCheckLib.inf
###################################################################################################
diff --git a/FmpDevicePkg/FmpDevicePkg.dsc b/FmpDevicePkg/FmpDevicePkg.dsc
index 7b1af285dd65..258b5ce0cded 100644
--- a/FmpDevicePkg/FmpDevicePkg.dsc
+++ b/FmpDevicePkg/FmpDevicePkg.dsc
@@ -78,7 +78,7 @@ [LibraryClasses.ARM, LibraryClasses.AARCH64]
# [LibraryClasses.ARM, LibraryClasses.AARCH64] and NULL mean link this library
# into all ARM and AARCH64 images.
#
- NULL|ArmPkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf
+ NULL|MdePkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf
# Add support for stack protector
NULL|MdePkg/Library/BaseStackCheckLib/BaseStackCheckLib.inf
diff --git a/MdeModulePkg/MdeModulePkg.dsc b/MdeModulePkg/MdeModulePkg.dsc
index 90a0a7ec4a7c..314a4f543aba 100644
--- a/MdeModulePkg/MdeModulePkg.dsc
+++ b/MdeModulePkg/MdeModulePkg.dsc
@@ -184,7 +184,7 @@ [LibraryClasses.ARM, LibraryClasses.AARCH64]
# This library provides the instrinsic functions generated by a given compiler.
# [LibraryClasses.ARM] and NULL mean link this library into all ARM images.
#
- NULL|ArmPkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf
+ NULL|MdePkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf
#
# Since software stack checking may be heuristically enabled by the compiler
diff --git a/MdePkg/MdePkg.dsc b/MdePkg/MdePkg.dsc
index 3d8874e64782..7bf18af1da20 100644
--- a/MdePkg/MdePkg.dsc
+++ b/MdePkg/MdePkg.dsc
@@ -36,6 +36,7 @@ [LibraryClasses]
[Components]
MdePkg/Library/UefiFileHandleLib/UefiFileHandleLib.inf
+ MdePkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf
MdePkg/Library/BaseCacheMaintenanceLib/BaseCacheMaintenanceLib.inf
MdePkg/Library/BaseCacheMaintenanceLibNull/BaseCacheMaintenanceLibNull.inf
MdePkg/Library/BaseCpuLib/BaseCpuLib.inf
diff --git a/NetworkPkg/NetworkPkg.dsc b/NetworkPkg/NetworkPkg.dsc
index 762134023d3f..f69eb3d1d5c2 100644
--- a/NetworkPkg/NetworkPkg.dsc
+++ b/NetworkPkg/NetworkPkg.dsc
@@ -76,7 +76,7 @@ [LibraryClasses.ARM, LibraryClasses.AARCH64]
# This library provides the instrinsic functions generated by a given compiler.
# [LibraryClasses.ARM] and NULL mean link this library into all ARM images.
#
- NULL|ArmPkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf
+ NULL|MdePkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf
NULL|MdePkg/Library/BaseStackCheckLib/BaseStackCheckLib.inf
ArmSoftFloatLib|ArmPkg/Library/ArmSoftFloatLib/ArmSoftFloatLib.inf
diff --git a/RedfishPkg/RedfishPkg.dsc b/RedfishPkg/RedfishPkg.dsc
index 16139146ff83..0dc120d82699 100644
--- a/RedfishPkg/RedfishPkg.dsc
+++ b/RedfishPkg/RedfishPkg.dsc
@@ -45,7 +45,7 @@ [LibraryClasses.ARM, LibraryClasses.AARCH64]
#
# This library provides the instrinsic functions generated by a given compiler.
#
- NULL|ArmPkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf
+ NULL|MdePkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf
NULL|MdePkg/Library/BaseStackCheckLib/BaseStackCheckLib.inf
ArmSoftFloatLib|ArmPkg/Library/ArmSoftFloatLib/ArmSoftFloatLib.inf
diff --git a/SecurityPkg/SecurityPkg.dsc b/SecurityPkg/SecurityPkg.dsc
index 73a93c2285b1..2b5ef67016b8 100644
--- a/SecurityPkg/SecurityPkg.dsc
+++ b/SecurityPkg/SecurityPkg.dsc
@@ -79,7 +79,7 @@ [LibraryClasses.ARM, LibraryClasses.AARCH64]
# This library provides the intrinsic functions generate by a given compiler.
# And NULL mean link this library into all ARM images.
#
- NULL|ArmPkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf
+ NULL|MdePkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf
# Add support for GCC stack protector
NULL|MdePkg/Library/BaseStackCheckLib/BaseStackCheckLib.inf
diff --git a/ShellPkg/ShellPkg.dsc b/ShellPkg/ShellPkg.dsc
index 38fde3dc71dd..a166af0a81ae 100644
--- a/ShellPkg/ShellPkg.dsc
+++ b/ShellPkg/ShellPkg.dsc
@@ -70,7 +70,7 @@ [LibraryClasses.ARM,LibraryClasses.AARCH64]
# This library provides the instrinsic functions generate by a given compiler.
# [LibraryClasses.ARM] and NULL mean link this library into all ARM images.
#
- NULL|ArmPkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf
+ NULL|MdePkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf
# Add support for GCC stack protector
NULL|MdePkg/Library/BaseStackCheckLib/BaseStackCheckLib.inf
diff --git a/SignedCapsulePkg/SignedCapsulePkg.dsc b/SignedCapsulePkg/SignedCapsulePkg.dsc
index 8a27207a6f20..72b533cd04e8 100644
--- a/SignedCapsulePkg/SignedCapsulePkg.dsc
+++ b/SignedCapsulePkg/SignedCapsulePkg.dsc
@@ -104,7 +104,7 @@ [LibraryClasses.AARCH64, LibraryClasses.ARM]
# This library provides the instrinsic functions generate by a given compiler.
# And NULL mean link this library into all ARM images.
#
- NULL|ArmPkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf
+ NULL|MdePkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf
# Add support for GCC stack protector
NULL|MdePkg/Library/BaseStackCheckLib/BaseStackCheckLib.inf
diff --git a/StandaloneMmPkg/StandaloneMmPkg.dsc b/StandaloneMmPkg/StandaloneMmPkg.dsc
index 8012f93b7dcc..e9488538cb21 100644
--- a/StandaloneMmPkg/StandaloneMmPkg.dsc
+++ b/StandaloneMmPkg/StandaloneMmPkg.dsc
@@ -67,7 +67,7 @@ [LibraryClasses.AARCH64, LibraryClasses.ARM]
CacheMaintenanceLib|ArmPkg/Library/ArmCacheMaintenanceLib/ArmCacheMaintenanceLib.inf
PeCoffExtraActionLib|StandaloneMmPkg/Library/StandaloneMmPeCoffExtraActionLib/StandaloneMmPeCoffExtraActionLib.inf
- NULL|ArmPkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf
+ NULL|MdePkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf
NULL|MdePkg/Library/BaseStackCheckLib/BaseStackCheckLib.inf
[LibraryClasses.common.MM_CORE_STANDALONE]
diff --git a/ArmPkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf b/MdePkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf
similarity index 95%
rename from ArmPkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf
rename to MdePkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf
index 7e22e6f67bff..a1559fc40ce9 100644
--- a/ArmPkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf
+++ b/MdePkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf
@@ -69,7 +69,6 @@ [Sources.AARCH64]
[Packages]
MdePkg/MdePkg.dec
- ArmPkg/ArmPkg.dec
[BuildOptions]
MSFT:*_*_*_CC_FLAGS = /GL-
diff --git a/ArmPkg/Include/AsmMacroIoLib.h b/MdePkg/Include/AsmMacroIoLib.h
similarity index 100%
rename from ArmPkg/Include/AsmMacroIoLib.h
rename to MdePkg/Include/AsmMacroIoLib.h
diff --git a/ArmPkg/Library/CompilerIntrinsicsLib/memcmp_ms.c b/MdePkg/Library/CompilerIntrinsicsLib/memcmp_ms.c
similarity index 100%
rename from ArmPkg/Library/CompilerIntrinsicsLib/memcmp_ms.c
rename to MdePkg/Library/CompilerIntrinsicsLib/memcmp_ms.c
diff --git a/ArmPkg/Library/CompilerIntrinsicsLib/memcpy.c b/MdePkg/Library/CompilerIntrinsicsLib/memcpy.c
similarity index 100%
rename from ArmPkg/Library/CompilerIntrinsicsLib/memcpy.c
rename to MdePkg/Library/CompilerIntrinsicsLib/memcpy.c
diff --git a/ArmPkg/Library/CompilerIntrinsicsLib/memcpy_ms.c b/MdePkg/Library/CompilerIntrinsicsLib/memcpy_ms.c
similarity index 100%
rename from ArmPkg/Library/CompilerIntrinsicsLib/memcpy_ms.c
rename to MdePkg/Library/CompilerIntrinsicsLib/memcpy_ms.c
diff --git a/ArmPkg/Library/CompilerIntrinsicsLib/memmove_ms.c b/MdePkg/Library/CompilerIntrinsicsLib/memmove_ms.c
similarity index 100%
rename from ArmPkg/Library/CompilerIntrinsicsLib/memmove_ms.c
rename to MdePkg/Library/CompilerIntrinsicsLib/memmove_ms.c
diff --git a/ArmPkg/Library/CompilerIntrinsicsLib/memset.c b/MdePkg/Library/CompilerIntrinsicsLib/memset.c
similarity index 100%
rename from ArmPkg/Library/CompilerIntrinsicsLib/memset.c
rename to MdePkg/Library/CompilerIntrinsicsLib/memset.c
diff --git a/ArmPkg/Library/CompilerIntrinsicsLib/memset_ms.c b/MdePkg/Library/CompilerIntrinsicsLib/memset_ms.c
similarity index 100%
rename from ArmPkg/Library/CompilerIntrinsicsLib/memset_ms.c
rename to MdePkg/Library/CompilerIntrinsicsLib/memset_ms.c
diff --git a/ArmPkg/ArmPkg.ci.yaml b/ArmPkg/ArmPkg.ci.yaml
index b7e07aaef675..cb892894f3b8 100644
--- a/ArmPkg/ArmPkg.ci.yaml
+++ b/ArmPkg/ArmPkg.ci.yaml
@@ -21,7 +21,6 @@
"IgnoreFiles": [
"Library/ArmSoftFloatLib/berkeley-softfloat-3",
"Library/ArmSoftFloatLib/ArmSoftFloatLib.c",
- "Library/CompilerIntrinsicsLib",
"Universal/Smbios/SmbiosMiscDxe"
]
},
diff --git a/BaseTools/Bin/Darwin-i386/Arm/DEBUG_XCODE31/CompilerIntrinsicsLib.lib b/BaseTools/Bin/Darwin-i386/Arm/DEBUG_XCODE31/CompilerIntrinsicsLib.lib
index 79964fe1b65afe472af19fdb87c2733f5297d0a4..712aa917bcd0342a4d47923d208cf866992fbe5a 100644
GIT binary patch
delta 369
zcmaDclj+4wrVZcNChyH;pZru!X|p{0WhOAkR3vJ1FxP*COts)<u*_ytk-O|r^{Sig
zWCCI8!#BT``v{iV{8TL+A-YQQ4hyqyO6uf9H|Nb~^u(Fr98Du81gFsS6BAr!rG*?q
z53g+tf^*%m9n9IB=%xr0b=iE<>pM)d`(`e`e=v^AX8%A3eyFkTn{OrrLOis!P<eAm
zx;(;>7c(KA+Pt;U2_YI<G8N`krOm=MOAs=m^^7pvoj1ocZ-!auyg9V(5`vT4iQr6b
H?MVgz__B<&
delta 369
zcmaDclj+4wrVZcNm>r99CqGnE+bqw1nF-7>6p7m$%=I53Q!Tg|EVJ2A<RLp$z2;^+
znLwEO=*@5CK7wU7KUB*`h_2GS!va>H=;plnjGj0%oTF*Pgy0mKeuC%$DO+hFhtR`o
z+k)U+cWei9HYd6%!bDv*pY-|;)9k*P%kLkI<FeU5(19Onq5I~W34ss~Z7fvZ9Fi`N
zaOB0zyAY>uEObMNhL%i)c~xz*aLp2gjA%V0%y#F^G0l*mnGAAzXxk;2?arHXI}x18
Htv$&A)|`a2
diff --git a/BaseTools/Bin/Darwin-i386/Arm/DEBUG_XCODE32/CompilerIntrinsicsLib.lib b/BaseTools/Bin/Darwin-i386/Arm/DEBUG_XCODE32/CompilerIntrinsicsLib.lib
index 79964fe1b65afe472af19fdb87c2733f5297d0a4..712aa917bcd0342a4d47923d208cf866992fbe5a 100644
GIT binary patch
delta 369
zcmaDclj+4wrVZcNChyH;pZru!X|p{0WhOAkR3vJ1FxP*COts)<u*_ytk-O|r^{Sig
zWCCI8!#BT``v{iV{8TL+A-YQQ4hyqyO6uf9H|Nb~^u(Fr98Du81gFsS6BAr!rG*?q
z53g+tf^*%m9n9IB=%xr0b=iE<>pM)d`(`e`e=v^AX8%A3eyFkTn{OrrLOis!P<eAm
zx;(;>7c(KA+Pt;U2_YI<G8N`krOm=MOAs=m^^7pvoj1ocZ-!auyg9V(5`vT4iQr6b
H?MVgz__B<&
delta 369
zcmaDclj+4wrVZcNm>r99CqGnE+bqw1nF-7>6p7m$%=I53Q!Tg|EVJ2A<RLp$z2;^+
znLwEO=*@5CK7wU7KUB*`h_2GS!va>H=;plnjGj0%oTF*Pgy0mKeuC%$DO+hFhtR`o
z+k)U+cWei9HYd6%!bDv*pY-|;)9k*P%kLkI<FeU5(19Onq5I~W34ss~Z7fvZ9Fi`N
zaOB0zyAY>uEObMNhL%i)c~xz*aLp2gjA%V0%y#F^G0l*mnGAAzXxk;2?arHXI}x18
Htv$&A)|`a2
diff --git a/ArmPkg/Library/CompilerIntrinsicsLib/AArch64/Atomics.S b/MdePkg/Library/CompilerIntrinsicsLib/AArch64/Atomics.S
similarity index 100%
rename from ArmPkg/Library/CompilerIntrinsicsLib/AArch64/Atomics.S
rename to MdePkg/Library/CompilerIntrinsicsLib/AArch64/Atomics.S
diff --git a/ArmPkg/Library/CompilerIntrinsicsLib/Arm/ashldi3.S b/MdePkg/Library/CompilerIntrinsicsLib/Arm/ashldi3.S
similarity index 100%
rename from ArmPkg/Library/CompilerIntrinsicsLib/Arm/ashldi3.S
rename to MdePkg/Library/CompilerIntrinsicsLib/Arm/ashldi3.S
diff --git a/ArmPkg/Library/CompilerIntrinsicsLib/Arm/ashrdi3.S b/MdePkg/Library/CompilerIntrinsicsLib/Arm/ashrdi3.S
similarity index 100%
rename from ArmPkg/Library/CompilerIntrinsicsLib/Arm/ashrdi3.S
rename to MdePkg/Library/CompilerIntrinsicsLib/Arm/ashrdi3.S
diff --git a/ArmPkg/Library/CompilerIntrinsicsLib/Arm/clzsi2.S b/MdePkg/Library/CompilerIntrinsicsLib/Arm/clzsi2.S
similarity index 100%
rename from ArmPkg/Library/CompilerIntrinsicsLib/Arm/clzsi2.S
rename to MdePkg/Library/CompilerIntrinsicsLib/Arm/clzsi2.S
diff --git a/ArmPkg/Library/CompilerIntrinsicsLib/Arm/ctzsi2.S b/MdePkg/Library/CompilerIntrinsicsLib/Arm/ctzsi2.S
similarity index 100%
rename from ArmPkg/Library/CompilerIntrinsicsLib/Arm/ctzsi2.S
rename to MdePkg/Library/CompilerIntrinsicsLib/Arm/ctzsi2.S
diff --git a/ArmPkg/Library/CompilerIntrinsicsLib/Arm/div.S b/MdePkg/Library/CompilerIntrinsicsLib/Arm/div.S
similarity index 100%
rename from ArmPkg/Library/CompilerIntrinsicsLib/Arm/div.S
rename to MdePkg/Library/CompilerIntrinsicsLib/Arm/div.S
diff --git a/ArmPkg/Library/CompilerIntrinsicsLib/Arm/div.asm b/MdePkg/Library/CompilerIntrinsicsLib/Arm/div.asm
similarity index 100%
rename from ArmPkg/Library/CompilerIntrinsicsLib/Arm/div.asm
rename to MdePkg/Library/CompilerIntrinsicsLib/Arm/div.asm
diff --git a/ArmPkg/Library/CompilerIntrinsicsLib/Arm/divdi3.S b/MdePkg/Library/CompilerIntrinsicsLib/Arm/divdi3.S
similarity index 100%
rename from ArmPkg/Library/CompilerIntrinsicsLib/Arm/divdi3.S
rename to MdePkg/Library/CompilerIntrinsicsLib/Arm/divdi3.S
diff --git a/ArmPkg/Library/CompilerIntrinsicsLib/Arm/divsi3.S b/MdePkg/Library/CompilerIntrinsicsLib/Arm/divsi3.S
similarity index 100%
rename from ArmPkg/Library/CompilerIntrinsicsLib/Arm/divsi3.S
rename to MdePkg/Library/CompilerIntrinsicsLib/Arm/divsi3.S
diff --git a/ArmPkg/Library/CompilerIntrinsicsLib/Arm/lasr.S b/MdePkg/Library/CompilerIntrinsicsLib/Arm/lasr.S
similarity index 100%
rename from ArmPkg/Library/CompilerIntrinsicsLib/Arm/lasr.S
rename to MdePkg/Library/CompilerIntrinsicsLib/Arm/lasr.S
diff --git a/ArmPkg/Library/CompilerIntrinsicsLib/Arm/ldivmod.S b/MdePkg/Library/CompilerIntrinsicsLib/Arm/ldivmod.S
similarity index 100%
rename from ArmPkg/Library/CompilerIntrinsicsLib/Arm/ldivmod.S
rename to MdePkg/Library/CompilerIntrinsicsLib/Arm/ldivmod.S
diff --git a/ArmPkg/Library/CompilerIntrinsicsLib/Arm/ldivmod.asm b/MdePkg/Library/CompilerIntrinsicsLib/Arm/ldivmod.asm
similarity index 100%
rename from ArmPkg/Library/CompilerIntrinsicsLib/Arm/ldivmod.asm
rename to MdePkg/Library/CompilerIntrinsicsLib/Arm/ldivmod.asm
diff --git a/ArmPkg/Library/CompilerIntrinsicsLib/Arm/llsl.S b/MdePkg/Library/CompilerIntrinsicsLib/Arm/llsl.S
similarity index 100%
rename from ArmPkg/Library/CompilerIntrinsicsLib/Arm/llsl.S
rename to MdePkg/Library/CompilerIntrinsicsLib/Arm/llsl.S
diff --git a/ArmPkg/Library/CompilerIntrinsicsLib/Arm/llsr.S b/MdePkg/Library/CompilerIntrinsicsLib/Arm/llsr.S
similarity index 100%
rename from ArmPkg/Library/CompilerIntrinsicsLib/Arm/llsr.S
rename to MdePkg/Library/CompilerIntrinsicsLib/Arm/llsr.S
diff --git a/ArmPkg/Library/CompilerIntrinsicsLib/Arm/llsr.asm b/MdePkg/Library/CompilerIntrinsicsLib/Arm/llsr.asm
similarity index 100%
rename from ArmPkg/Library/CompilerIntrinsicsLib/Arm/llsr.asm
rename to MdePkg/Library/CompilerIntrinsicsLib/Arm/llsr.asm
diff --git a/ArmPkg/Library/CompilerIntrinsicsLib/Arm/lshrdi3.S b/MdePkg/Library/CompilerIntrinsicsLib/Arm/lshrdi3.S
similarity index 100%
rename from ArmPkg/Library/CompilerIntrinsicsLib/Arm/lshrdi3.S
rename to MdePkg/Library/CompilerIntrinsicsLib/Arm/lshrdi3.S
diff --git a/ArmPkg/Library/CompilerIntrinsicsLib/Arm/memmove.S b/MdePkg/Library/CompilerIntrinsicsLib/Arm/memmove.S
similarity index 100%
rename from ArmPkg/Library/CompilerIntrinsicsLib/Arm/memmove.S
rename to MdePkg/Library/CompilerIntrinsicsLib/Arm/memmove.S
diff --git a/ArmPkg/Library/CompilerIntrinsicsLib/Arm/moddi3.S b/MdePkg/Library/CompilerIntrinsicsLib/Arm/moddi3.S
similarity index 100%
rename from ArmPkg/Library/CompilerIntrinsicsLib/Arm/moddi3.S
rename to MdePkg/Library/CompilerIntrinsicsLib/Arm/moddi3.S
diff --git a/ArmPkg/Library/CompilerIntrinsicsLib/Arm/modsi3.S b/MdePkg/Library/CompilerIntrinsicsLib/Arm/modsi3.S
similarity index 100%
rename from ArmPkg/Library/CompilerIntrinsicsLib/Arm/modsi3.S
rename to MdePkg/Library/CompilerIntrinsicsLib/Arm/modsi3.S
diff --git a/ArmPkg/Library/CompilerIntrinsicsLib/Arm/muldi3.S b/MdePkg/Library/CompilerIntrinsicsLib/Arm/muldi3.S
similarity index 100%
rename from ArmPkg/Library/CompilerIntrinsicsLib/Arm/muldi3.S
rename to MdePkg/Library/CompilerIntrinsicsLib/Arm/muldi3.S
diff --git a/ArmPkg/Library/CompilerIntrinsicsLib/Arm/mullu.S b/MdePkg/Library/CompilerIntrinsicsLib/Arm/mullu.S
similarity index 100%
rename from ArmPkg/Library/CompilerIntrinsicsLib/Arm/mullu.S
rename to MdePkg/Library/CompilerIntrinsicsLib/Arm/mullu.S
diff --git a/ArmPkg/Library/CompilerIntrinsicsLib/Arm/sourcery.S b/MdePkg/Library/CompilerIntrinsicsLib/Arm/sourcery.S
similarity index 100%
rename from ArmPkg/Library/CompilerIntrinsicsLib/Arm/sourcery.S
rename to MdePkg/Library/CompilerIntrinsicsLib/Arm/sourcery.S
diff --git a/ArmPkg/Library/CompilerIntrinsicsLib/Arm/switch16.S b/MdePkg/Library/CompilerIntrinsicsLib/Arm/switch16.S
similarity index 100%
rename from ArmPkg/Library/CompilerIntrinsicsLib/Arm/switch16.S
rename to MdePkg/Library/CompilerIntrinsicsLib/Arm/switch16.S
diff --git a/ArmPkg/Library/CompilerIntrinsicsLib/Arm/switch32.S b/MdePkg/Library/CompilerIntrinsicsLib/Arm/switch32.S
similarity index 100%
rename from ArmPkg/Library/CompilerIntrinsicsLib/Arm/switch32.S
rename to MdePkg/Library/CompilerIntrinsicsLib/Arm/switch32.S
diff --git a/ArmPkg/Library/CompilerIntrinsicsLib/Arm/switch8.S b/MdePkg/Library/CompilerIntrinsicsLib/Arm/switch8.S
similarity index 100%
rename from ArmPkg/Library/CompilerIntrinsicsLib/Arm/switch8.S
rename to MdePkg/Library/CompilerIntrinsicsLib/Arm/switch8.S
diff --git a/ArmPkg/Library/CompilerIntrinsicsLib/Arm/switchu8.S b/MdePkg/Library/CompilerIntrinsicsLib/Arm/switchu8.S
similarity index 100%
rename from ArmPkg/Library/CompilerIntrinsicsLib/Arm/switchu8.S
rename to MdePkg/Library/CompilerIntrinsicsLib/Arm/switchu8.S
diff --git a/ArmPkg/Library/CompilerIntrinsicsLib/Arm/ucmpdi2.S b/MdePkg/Library/CompilerIntrinsicsLib/Arm/ucmpdi2.S
similarity index 100%
rename from ArmPkg/Library/CompilerIntrinsicsLib/Arm/ucmpdi2.S
rename to MdePkg/Library/CompilerIntrinsicsLib/Arm/ucmpdi2.S
diff --git a/ArmPkg/Library/CompilerIntrinsicsLib/Arm/udivdi3.S b/MdePkg/Library/CompilerIntrinsicsLib/Arm/udivdi3.S
similarity index 100%
rename from ArmPkg/Library/CompilerIntrinsicsLib/Arm/udivdi3.S
rename to MdePkg/Library/CompilerIntrinsicsLib/Arm/udivdi3.S
diff --git a/ArmPkg/Library/CompilerIntrinsicsLib/Arm/udivmoddi4.S b/MdePkg/Library/CompilerIntrinsicsLib/Arm/udivmoddi4.S
similarity index 100%
rename from ArmPkg/Library/CompilerIntrinsicsLib/Arm/udivmoddi4.S
rename to MdePkg/Library/CompilerIntrinsicsLib/Arm/udivmoddi4.S
diff --git a/ArmPkg/Library/CompilerIntrinsicsLib/Arm/udivsi3.S b/MdePkg/Library/CompilerIntrinsicsLib/Arm/udivsi3.S
similarity index 100%
rename from ArmPkg/Library/CompilerIntrinsicsLib/Arm/udivsi3.S
rename to MdePkg/Library/CompilerIntrinsicsLib/Arm/udivsi3.S
diff --git a/ArmPkg/Library/CompilerIntrinsicsLib/Arm/uldiv.S b/MdePkg/Library/CompilerIntrinsicsLib/Arm/uldiv.S
similarity index 100%
rename from ArmPkg/Library/CompilerIntrinsicsLib/Arm/uldiv.S
rename to MdePkg/Library/CompilerIntrinsicsLib/Arm/uldiv.S
diff --git a/ArmPkg/Library/CompilerIntrinsicsLib/Arm/uldiv.asm b/MdePkg/Library/CompilerIntrinsicsLib/Arm/uldiv.asm
similarity index 100%
rename from ArmPkg/Library/CompilerIntrinsicsLib/Arm/uldiv.asm
rename to MdePkg/Library/CompilerIntrinsicsLib/Arm/uldiv.asm
diff --git a/ArmPkg/Library/CompilerIntrinsicsLib/Arm/umoddi3.S b/MdePkg/Library/CompilerIntrinsicsLib/Arm/umoddi3.S
similarity index 100%
rename from ArmPkg/Library/CompilerIntrinsicsLib/Arm/umoddi3.S
rename to MdePkg/Library/CompilerIntrinsicsLib/Arm/umoddi3.S
diff --git a/ArmPkg/Library/CompilerIntrinsicsLib/Arm/umodsi3.S b/MdePkg/Library/CompilerIntrinsicsLib/Arm/umodsi3.S
similarity index 100%
rename from ArmPkg/Library/CompilerIntrinsicsLib/Arm/umodsi3.S
rename to MdePkg/Library/CompilerIntrinsicsLib/Arm/umodsi3.S
diff --git a/ArmPkg/Library/CompilerIntrinsicsLib/Arm/uread.S b/MdePkg/Library/CompilerIntrinsicsLib/Arm/uread.S
similarity index 100%
rename from ArmPkg/Library/CompilerIntrinsicsLib/Arm/uread.S
rename to MdePkg/Library/CompilerIntrinsicsLib/Arm/uread.S
diff --git a/ArmPkg/Library/CompilerIntrinsicsLib/Arm/uwrite.S b/MdePkg/Library/CompilerIntrinsicsLib/Arm/uwrite.S
similarity index 100%
rename from ArmPkg/Library/CompilerIntrinsicsLib/Arm/uwrite.S
rename to MdePkg/Library/CompilerIntrinsicsLib/Arm/uwrite.S
diff --git a/MdePkg/MdePkg.ci.yaml b/MdePkg/MdePkg.ci.yaml
index 054233ebc7bd..34300c06e36a 100644
--- a/MdePkg/MdePkg.ci.yaml
+++ b/MdePkg/MdePkg.ci.yaml
@@ -52,6 +52,7 @@
"Include/IndustryStandard/UefiTcgPlatform.h",
"Include/Library/PcdLib.h",
"Include/Library/SafeIntLib.h",
+ "Library/CompilerIntrinsicsLib",
"Test/UnitTest/Library/BaseSafeIntLib/TestBaseSafeIntLib.c"
]
},
--
2.36.1
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [PATCH v4 2/9] MdePkg/CompilerIntrinsicsLib: fix msft sources for x64
2022-06-03 12:26 [PATCH v4 0/9] consolidate compiler intrinsics Gerd Hoffmann
2022-06-03 12:26 ` [PATCH v4 1/9] MdePkg: promote CompilerIntrinsicsLib from ArmPkg to MdePkg Gerd Hoffmann
@ 2022-06-03 12:26 ` Gerd Hoffmann
2022-06-03 12:26 ` [PATCH v4 3/9] MdePkg/CompilerIntrinsicsLib: move size_t typedef to header file Gerd Hoffmann
` (6 subsequent siblings)
8 siblings, 0 replies; 14+ messages in thread
From: Gerd Hoffmann @ 2022-06-03 12:26 UTC (permalink / raw)
To: devel
Cc: Jian J Wang, Jiaxin Wu, Sean Brogan, Anthony Perard,
Leif Lindholm, Zhiguang Liu, Xiaoyu Lu, Pawel Polawski,
Sami Mujawar, Maciej Rabeda, Bob Feng, Jiewen Yao, Andrew Fish,
Bret Barkelew, Alexei Fedorov, Guo Dong, Gerd Hoffmann,
kilian_kegel, Maurice Ma, Siyuan Fu, Abner Chang, Zhichao Gao,
Wei6 Xu, Supreeth Venkatesh, Julien Grall, Daniel Schaefer,
Ard Biesheuvel, Guomin Jiang, Jordan Justen, Oliver Steffen,
Sebastien Boeuf, Benjamin You, Min Xu, Ray Ni, Rebecca Cran,
Nickle Wang, Michael D Kinney, Tom Lendacky, Sami Mujawar,
Peter Grehan, Erdem Aktas, Brijesh Singh, James Bottomley,
Yuwei Chen, Liming Gao, Jiewen Yao, Ard Biesheuvel
Update #if conditions so the 64bit version is picked for X64 too.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Acked-by: Jiewen Yao <Jiewen.yao@intel.com>
Acked-by: Ard Biesheuvel <ardb@kernel.org>
Acked-by: Liming Gao <gaoliming@byosoft.com.cn>
---
MdePkg/Library/CompilerIntrinsicsLib/memcmp_ms.c | 2 +-
MdePkg/Library/CompilerIntrinsicsLib/memcpy_ms.c | 2 +-
MdePkg/Library/CompilerIntrinsicsLib/memmove_ms.c | 2 +-
MdePkg/Library/CompilerIntrinsicsLib/memset_ms.c | 2 +-
4 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/MdePkg/Library/CompilerIntrinsicsLib/memcmp_ms.c b/MdePkg/Library/CompilerIntrinsicsLib/memcmp_ms.c
index cedbfca47139..2fac8f1e23e3 100644
--- a/MdePkg/Library/CompilerIntrinsicsLib/memcmp_ms.c
+++ b/MdePkg/Library/CompilerIntrinsicsLib/memcmp_ms.c
@@ -7,7 +7,7 @@
//
// ------------------------------------------------------------------------------
-#if defined (_M_ARM64)
+#if defined (_M_ARM64) || defined (_M_X64)
typedef unsigned __int64 size_t;
#else
typedef unsigned __int32 size_t;
diff --git a/MdePkg/Library/CompilerIntrinsicsLib/memcpy_ms.c b/MdePkg/Library/CompilerIntrinsicsLib/memcpy_ms.c
index 0eafa83ed476..730aa806d50b 100644
--- a/MdePkg/Library/CompilerIntrinsicsLib/memcpy_ms.c
+++ b/MdePkg/Library/CompilerIntrinsicsLib/memcpy_ms.c
@@ -7,7 +7,7 @@
//
// ------------------------------------------------------------------------------
-#if defined (_M_ARM64)
+#if defined (_M_ARM64) || defined (_M_X64)
typedef unsigned __int64 size_t;
#else
typedef unsigned __int32 size_t;
diff --git a/MdePkg/Library/CompilerIntrinsicsLib/memmove_ms.c b/MdePkg/Library/CompilerIntrinsicsLib/memmove_ms.c
index f68eb52a6ca5..3207b94a8675 100644
--- a/MdePkg/Library/CompilerIntrinsicsLib/memmove_ms.c
+++ b/MdePkg/Library/CompilerIntrinsicsLib/memmove_ms.c
@@ -7,7 +7,7 @@
//
// ------------------------------------------------------------------------------
-#if defined (_M_ARM64)
+#if defined (_M_ARM64) || defined (_M_X64)
typedef unsigned __int64 size_t;
#else
typedef unsigned __int32 size_t;
diff --git a/MdePkg/Library/CompilerIntrinsicsLib/memset_ms.c b/MdePkg/Library/CompilerIntrinsicsLib/memset_ms.c
index 5882cd28b06d..deb902c6ae88 100644
--- a/MdePkg/Library/CompilerIntrinsicsLib/memset_ms.c
+++ b/MdePkg/Library/CompilerIntrinsicsLib/memset_ms.c
@@ -7,7 +7,7 @@
//
// ------------------------------------------------------------------------------
-#if defined (_M_ARM64)
+#if defined (_M_ARM64) || defined (_M_X64)
typedef unsigned __int64 size_t;
#else
typedef unsigned __int32 size_t;
--
2.36.1
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [PATCH v4 3/9] MdePkg/CompilerIntrinsicsLib: move size_t typedef to header file
2022-06-03 12:26 [PATCH v4 0/9] consolidate compiler intrinsics Gerd Hoffmann
2022-06-03 12:26 ` [PATCH v4 1/9] MdePkg: promote CompilerIntrinsicsLib from ArmPkg to MdePkg Gerd Hoffmann
2022-06-03 12:26 ` [PATCH v4 2/9] MdePkg/CompilerIntrinsicsLib: fix msft sources for x64 Gerd Hoffmann
@ 2022-06-03 12:26 ` Gerd Hoffmann
2022-06-03 12:26 ` [PATCH v4 4/9] MdePkg/CompilerIntrinsicsLib: move ia32 intrinsics and strcmp Gerd Hoffmann
` (5 subsequent siblings)
8 siblings, 0 replies; 14+ messages in thread
From: Gerd Hoffmann @ 2022-06-03 12:26 UTC (permalink / raw)
To: devel
Cc: Jian J Wang, Jiaxin Wu, Sean Brogan, Anthony Perard,
Leif Lindholm, Zhiguang Liu, Xiaoyu Lu, Pawel Polawski,
Sami Mujawar, Maciej Rabeda, Bob Feng, Jiewen Yao, Andrew Fish,
Bret Barkelew, Alexei Fedorov, Guo Dong, Gerd Hoffmann,
kilian_kegel, Maurice Ma, Siyuan Fu, Abner Chang, Zhichao Gao,
Wei6 Xu, Supreeth Venkatesh, Julien Grall, Daniel Schaefer,
Ard Biesheuvel, Guomin Jiang, Jordan Justen, Oliver Steffen,
Sebastien Boeuf, Benjamin You, Min Xu, Ray Ni, Rebecca Cran,
Nickle Wang, Michael D Kinney, Tom Lendacky, Sami Mujawar,
Peter Grehan, Erdem Aktas, Brijesh Singh, James Bottomley,
Yuwei Chen, Liming Gao
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Acked-by: Liming Gao <gaoliming@byosoft.com.cn>
---
.../{memset_ms.c => types_ms.h} | 29 +------------------
.../Library/CompilerIntrinsicsLib/memcpy_ms.c | 6 +---
.../CompilerIntrinsicsLib/memmove_ms.c | 6 +---
.../Library/CompilerIntrinsicsLib/memset_ms.c | 6 +---
4 files changed, 4 insertions(+), 43 deletions(-)
copy MdePkg/Library/CompilerIntrinsicsLib/{memset_ms.c => types_ms.h} (52%)
diff --git a/MdePkg/Library/CompilerIntrinsicsLib/memset_ms.c b/MdePkg/Library/CompilerIntrinsicsLib/types_ms.h
similarity index 52%
copy from MdePkg/Library/CompilerIntrinsicsLib/memset_ms.c
copy to MdePkg/Library/CompilerIntrinsicsLib/types_ms.h
index deb902c6ae88..d8b578be1f46 100644
--- a/MdePkg/Library/CompilerIntrinsicsLib/memset_ms.c
+++ b/MdePkg/Library/CompilerIntrinsicsLib/types_ms.h
@@ -1,6 +1,6 @@
// ------------------------------------------------------------------------------
//
-// Copyright (c) 2017, Pete Batard. All rights reserved.<BR>
+// Copyright (c) 2019, Pete Batard. All rights reserved.
// Copyright (c) 2021, Arm Limited. All rights reserved.<BR>
//
// SPDX-License-Identifier: BSD-2-Clause-Patent
@@ -12,30 +12,3 @@ typedef unsigned __int64 size_t;
#else
typedef unsigned __int32 size_t;
#endif
-
-void *
-memset (
- void *,
- int,
- size_t
- );
-
-#pragma intrinsic(memset)
-#pragma function(memset)
-void *
-memset (
- void *s,
- int c,
- size_t n
- )
-{
- unsigned char *d;
-
- d = s;
-
- while (n-- != 0) {
- *d++ = (unsigned char)c;
- }
-
- return s;
-}
diff --git a/MdePkg/Library/CompilerIntrinsicsLib/memcpy_ms.c b/MdePkg/Library/CompilerIntrinsicsLib/memcpy_ms.c
index 730aa806d50b..d2c3d7198121 100644
--- a/MdePkg/Library/CompilerIntrinsicsLib/memcpy_ms.c
+++ b/MdePkg/Library/CompilerIntrinsicsLib/memcpy_ms.c
@@ -7,11 +7,7 @@
//
// ------------------------------------------------------------------------------
-#if defined (_M_ARM64) || defined (_M_X64)
-typedef unsigned __int64 size_t;
-#else
-typedef unsigned __int32 size_t;
-#endif
+#include "types_ms.h"
void *
memcpy (
diff --git a/MdePkg/Library/CompilerIntrinsicsLib/memmove_ms.c b/MdePkg/Library/CompilerIntrinsicsLib/memmove_ms.c
index 3207b94a8675..837744a2920c 100644
--- a/MdePkg/Library/CompilerIntrinsicsLib/memmove_ms.c
+++ b/MdePkg/Library/CompilerIntrinsicsLib/memmove_ms.c
@@ -7,11 +7,7 @@
//
// ------------------------------------------------------------------------------
-#if defined (_M_ARM64) || defined (_M_X64)
-typedef unsigned __int64 size_t;
-#else
-typedef unsigned __int32 size_t;
-#endif
+#include "types_ms.h"
void *
memmove (
diff --git a/MdePkg/Library/CompilerIntrinsicsLib/memset_ms.c b/MdePkg/Library/CompilerIntrinsicsLib/memset_ms.c
index deb902c6ae88..3569bebdf80b 100644
--- a/MdePkg/Library/CompilerIntrinsicsLib/memset_ms.c
+++ b/MdePkg/Library/CompilerIntrinsicsLib/memset_ms.c
@@ -7,11 +7,7 @@
//
// ------------------------------------------------------------------------------
-#if defined (_M_ARM64) || defined (_M_X64)
-typedef unsigned __int64 size_t;
-#else
-typedef unsigned __int32 size_t;
-#endif
+#include "types_ms.h"
void *
memset (
--
2.36.1
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [PATCH v4 4/9] MdePkg/CompilerIntrinsicsLib: move ia32 intrinsics and strcmp
2022-06-03 12:26 [PATCH v4 0/9] consolidate compiler intrinsics Gerd Hoffmann
` (2 preceding siblings ...)
2022-06-03 12:26 ` [PATCH v4 3/9] MdePkg/CompilerIntrinsicsLib: move size_t typedef to header file Gerd Hoffmann
@ 2022-06-03 12:26 ` Gerd Hoffmann
2022-06-09 3:57 ` Ni, Ray
2022-06-03 12:26 ` [PATCH v4 5/9] MdePkg/CompilerIntrinsicsLib: copy over intrinsics from edk2-libc repo Gerd Hoffmann
` (4 subsequent siblings)
8 siblings, 1 reply; 14+ messages in thread
From: Gerd Hoffmann @ 2022-06-03 12:26 UTC (permalink / raw)
To: devel
Cc: Jian J Wang, Jiaxin Wu, Sean Brogan, Anthony Perard,
Leif Lindholm, Zhiguang Liu, Xiaoyu Lu, Pawel Polawski,
Sami Mujawar, Maciej Rabeda, Bob Feng, Jiewen Yao, Andrew Fish,
Bret Barkelew, Alexei Fedorov, Guo Dong, Gerd Hoffmann,
kilian_kegel, Maurice Ma, Siyuan Fu, Abner Chang, Zhichao Gao,
Wei6 Xu, Supreeth Venkatesh, Julien Grall, Daniel Schaefer,
Ard Biesheuvel, Guomin Jiang, Jordan Justen, Oliver Steffen,
Sebastien Boeuf, Benjamin You, Min Xu, Ray Ni, Rebecca Cran,
Nickle Wang, Michael D Kinney, Tom Lendacky, Sami Mujawar,
Peter Grehan, Erdem Aktas, Brijesh Singh, James Bottomley,
Yuwei Chen, Liming Gao, Jiewen Yao, Ard Biesheuvel
Move intrinsics for ia32 from CryptoPkg/Library/IntrinsicLib
to MdePkg/Library/CompilerIntrinsicsLib. Also move strcmp.
Remove CryptoPkg/Library/IntrinsicLib.
Use MdePkg/Library/CompilerIntrinsicsLib instead.
Update all references.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Acked-by: Jiewen Yao <Jiewen.yao@intel.com>
Acked-by: Ard Biesheuvel <ardb@kernel.org>
Acked-by: Liming Gao <gaoliming@byosoft.com.cn>
---
ArmVirtPkg/ArmVirt.dsc.inc | 2 +-
CryptoPkg/CryptoPkg.dsc | 3 +-
EmulatorPkg/EmulatorPkg.dsc | 2 +-
FmpDevicePkg/FmpDevicePkg.dsc | 2 +-
NetworkPkg/NetworkPkg.dsc | 2 +-
OvmfPkg/AmdSev/AmdSevX64.dsc | 2 +-
OvmfPkg/Bhyve/BhyveX64.dsc | 2 +-
OvmfPkg/CloudHv/CloudHvX64.dsc | 2 +-
OvmfPkg/IntelTdx/IntelTdxX64.dsc | 2 +-
OvmfPkg/Microvm/MicrovmX64.dsc | 2 +-
OvmfPkg/OvmfPkgIa32.dsc | 2 +-
OvmfPkg/OvmfPkgIa32X64.dsc | 2 +-
OvmfPkg/OvmfPkgX64.dsc | 2 +-
OvmfPkg/OvmfXen.dsc | 2 +-
SecurityPkg/SecurityPkg.dsc | 10 +--
SignedCapsulePkg/SignedCapsulePkg.dsc | 12 +--
UefiPayloadPkg/UefiPayloadPkg.dsc | 2 +-
.../Library/IntrinsicLib/IntrinsicLib.inf | 69 -----------------
.../CompilerIntrinsicsLib.inf | 16 ++++
CryptoPkg/Library/IntrinsicLib/CopyMem.c | 47 ------------
.../Library/IntrinsicLib/MemoryIntrinsics.c | 74 -------------------
.../CompilerIntrinsicsLib}/Ia32/MathFtol.c | 0
.../Ia32/MathLShiftS64.c | 0
.../Ia32/MathRShiftU64.c | 0
MdePkg/Library/CompilerIntrinsicsLib/strcmp.c | 33 +++++++++
.../Library/IntrinsicLib/BaseIntrinsicLib.uni | 16 ----
.../Ia32/MathLShiftS64.nasm | 0
.../CompilerIntrinsicsLib}/Ia32/MathLlmul.asm | 0
.../CompilerIntrinsicsLib}/Ia32/MathLlshr.asm | 0
.../Ia32/MathRShiftU64.nasm | 0
30 files changed, 75 insertions(+), 233 deletions(-)
delete mode 100644 CryptoPkg/Library/IntrinsicLib/IntrinsicLib.inf
delete mode 100644 CryptoPkg/Library/IntrinsicLib/CopyMem.c
delete mode 100644 CryptoPkg/Library/IntrinsicLib/MemoryIntrinsics.c
rename {CryptoPkg/Library/IntrinsicLib => MdePkg/Library/CompilerIntrinsicsLib}/Ia32/MathFtol.c (100%)
rename {CryptoPkg/Library/IntrinsicLib => MdePkg/Library/CompilerIntrinsicsLib}/Ia32/MathLShiftS64.c (100%)
rename {CryptoPkg/Library/IntrinsicLib => MdePkg/Library/CompilerIntrinsicsLib}/Ia32/MathRShiftU64.c (100%)
create mode 100644 MdePkg/Library/CompilerIntrinsicsLib/strcmp.c
delete mode 100644 CryptoPkg/Library/IntrinsicLib/BaseIntrinsicLib.uni
rename {CryptoPkg/Library/IntrinsicLib => MdePkg/Library/CompilerIntrinsicsLib}/Ia32/MathLShiftS64.nasm (100%)
rename {CryptoPkg/Library/IntrinsicLib => MdePkg/Library/CompilerIntrinsicsLib}/Ia32/MathLlmul.asm (100%)
rename {CryptoPkg/Library/IntrinsicLib => MdePkg/Library/CompilerIntrinsicsLib}/Ia32/MathLlshr.asm (100%)
rename {CryptoPkg/Library/IntrinsicLib => MdePkg/Library/CompilerIntrinsicsLib}/Ia32/MathRShiftU64.nasm (100%)
diff --git a/ArmVirtPkg/ArmVirt.dsc.inc b/ArmVirtPkg/ArmVirt.dsc.inc
index 4b5687927ae8..cc960cf103d2 100644
--- a/ArmVirtPkg/ArmVirt.dsc.inc
+++ b/ArmVirtPkg/ArmVirt.dsc.inc
@@ -153,7 +153,7 @@ [LibraryClasses.common]
#
# CryptoPkg libraries needed by multiple firmware features
#
- IntrinsicLib|CryptoPkg/Library/IntrinsicLib/IntrinsicLib.inf
+ IntrinsicLib|MdePkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf
!if $(NETWORK_TLS_ENABLE) == TRUE
OpensslLib|CryptoPkg/Library/OpensslLib/OpensslLib.inf
!else
diff --git a/CryptoPkg/CryptoPkg.dsc b/CryptoPkg/CryptoPkg.dsc
index 71679687a8b1..4db8de2e5de8 100644
--- a/CryptoPkg/CryptoPkg.dsc
+++ b/CryptoPkg/CryptoPkg.dsc
@@ -103,7 +103,7 @@ [LibraryClasses]
UefiRuntimeServicesTableLib|MdePkg/Library/UefiRuntimeServicesTableLib/UefiRuntimeServicesTableLib.inf #???
IoLib|MdePkg/Library/BaseIoLibIntrinsic/BaseIoLibIntrinsic.inf #???
OpensslLib|CryptoPkg/Library/OpensslLib/OpensslLib.inf
- IntrinsicLib|CryptoPkg/Library/IntrinsicLib/IntrinsicLib.inf
+ IntrinsicLib|MdePkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf
SafeIntLib|MdePkg/Library/BaseSafeIntLib/BaseSafeIntLib.inf
[LibraryClasses.ARM]
@@ -240,7 +240,6 @@ [Components]
CryptoPkg/Library/BaseCryptLib/SmmCryptLib.inf
CryptoPkg/Library/BaseCryptLib/RuntimeCryptLib.inf
CryptoPkg/Library/BaseCryptLibNull/BaseCryptLibNull.inf
- CryptoPkg/Library/IntrinsicLib/IntrinsicLib.inf
CryptoPkg/Library/TlsLib/TlsLib.inf
CryptoPkg/Library/TlsLibNull/TlsLibNull.inf
CryptoPkg/Library/OpensslLib/OpensslLib.inf
diff --git a/EmulatorPkg/EmulatorPkg.dsc b/EmulatorPkg/EmulatorPkg.dsc
index 4cf886b9eac7..e460e925a988 100644
--- a/EmulatorPkg/EmulatorPkg.dsc
+++ b/EmulatorPkg/EmulatorPkg.dsc
@@ -129,7 +129,7 @@ [LibraryClasses]
!if $(SECURE_BOOT_ENABLE) == TRUE
RngLib|MdePkg/Library/BaseRngLibTimerLib/BaseRngLibTimerLib.inf
- IntrinsicLib|CryptoPkg/Library/IntrinsicLib/IntrinsicLib.inf
+ IntrinsicLib|MdePkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf
OpensslLib|CryptoPkg/Library/OpensslLib/OpensslLibCrypto.inf
PlatformSecureLib|SecurityPkg/Library/PlatformSecureLibNull/PlatformSecureLibNull.inf
AuthVariableLib|SecurityPkg/Library/AuthVariableLib/AuthVariableLib.inf
diff --git a/FmpDevicePkg/FmpDevicePkg.dsc b/FmpDevicePkg/FmpDevicePkg.dsc
index 258b5ce0cded..f314548d4066 100644
--- a/FmpDevicePkg/FmpDevicePkg.dsc
+++ b/FmpDevicePkg/FmpDevicePkg.dsc
@@ -57,7 +57,7 @@ [LibraryClasses]
!ifdef CONTINUOUS_INTEGRATION
BaseCryptLib|CryptoPkg/Library/BaseCryptLibNull/BaseCryptLibNull.inf
!else
- IntrinsicLib|CryptoPkg/Library/IntrinsicLib/IntrinsicLib.inf
+ IntrinsicLib|MdePkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf
OpensslLib|CryptoPkg/Library/OpensslLib/OpensslLib.inf
BaseCryptLib|CryptoPkg/Library/BaseCryptLib/BaseCryptLib.inf
RngLib|MdePkg/Library/BaseRngLibNull/BaseRngLibNull.inf
diff --git a/NetworkPkg/NetworkPkg.dsc b/NetworkPkg/NetworkPkg.dsc
index f69eb3d1d5c2..95dedad392fb 100644
--- a/NetworkPkg/NetworkPkg.dsc
+++ b/NetworkPkg/NetworkPkg.dsc
@@ -53,7 +53,7 @@ [LibraryClasses]
!else
BaseCryptLib|CryptoPkg/Library/BaseCryptLib/BaseCryptLib.inf
OpensslLib|CryptoPkg/Library/OpensslLib/OpensslLib.inf
- IntrinsicLib|CryptoPkg/Library/IntrinsicLib/IntrinsicLib.inf
+ IntrinsicLib|MdePkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf
TlsLib|CryptoPkg/Library/TlsLib/TlsLib.inf
!endif
DebugPrintErrorLevelLib|MdePkg/Library/BaseDebugPrintErrorLevelLib/BaseDebugPrintErrorLevelLib.inf
diff --git a/OvmfPkg/AmdSev/AmdSevX64.dsc b/OvmfPkg/AmdSev/AmdSevX64.dsc
index fc1fdb2e2297..c0bcc14c6ee6 100644
--- a/OvmfPkg/AmdSev/AmdSevX64.dsc
+++ b/OvmfPkg/AmdSev/AmdSevX64.dsc
@@ -188,7 +188,7 @@ [LibraryClasses]
LocalApicLib|UefiCpuPkg/Library/BaseXApicX2ApicLib/BaseXApicX2ApicLib.inf
DebugPrintErrorLevelLib|MdePkg/Library/BaseDebugPrintErrorLevelLib/BaseDebugPrintErrorLevelLib.inf
- IntrinsicLib|CryptoPkg/Library/IntrinsicLib/IntrinsicLib.inf
+ IntrinsicLib|MdePkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf
OpensslLib|CryptoPkg/Library/OpensslLib/OpensslLibCrypto.inf
RngLib|MdePkg/Library/BaseRngLibTimerLib/BaseRngLibTimerLib.inf
diff --git a/OvmfPkg/Bhyve/BhyveX64.dsc b/OvmfPkg/Bhyve/BhyveX64.dsc
index f0166e136cd1..e7b38222ebd6 100644
--- a/OvmfPkg/Bhyve/BhyveX64.dsc
+++ b/OvmfPkg/Bhyve/BhyveX64.dsc
@@ -187,7 +187,7 @@ [LibraryClasses]
IoApicLib|PcAtChipsetPkg/Library/BaseIoApicLib/BaseIoApicLib.inf
DebugPrintErrorLevelLib|MdePkg/Library/BaseDebugPrintErrorLevelLib/BaseDebugPrintErrorLevelLib.inf
- IntrinsicLib|CryptoPkg/Library/IntrinsicLib/IntrinsicLib.inf
+ IntrinsicLib|MdePkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf
!if $(NETWORK_TLS_ENABLE) == TRUE
OpensslLib|CryptoPkg/Library/OpensslLib/OpensslLib.inf
!else
diff --git a/OvmfPkg/CloudHv/CloudHvX64.dsc b/OvmfPkg/CloudHv/CloudHvX64.dsc
index 92664f319be2..f1d1a1e946b2 100644
--- a/OvmfPkg/CloudHv/CloudHvX64.dsc
+++ b/OvmfPkg/CloudHv/CloudHvX64.dsc
@@ -198,7 +198,7 @@ [LibraryClasses]
LocalApicLib|UefiCpuPkg/Library/BaseXApicX2ApicLib/BaseXApicX2ApicLib.inf
DebugPrintErrorLevelLib|MdePkg/Library/BaseDebugPrintErrorLevelLib/BaseDebugPrintErrorLevelLib.inf
- IntrinsicLib|CryptoPkg/Library/IntrinsicLib/IntrinsicLib.inf
+ IntrinsicLib|MdePkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf
!if $(NETWORK_TLS_ENABLE) == TRUE
OpensslLib|CryptoPkg/Library/OpensslLib/OpensslLib.inf
!else
diff --git a/OvmfPkg/IntelTdx/IntelTdxX64.dsc b/OvmfPkg/IntelTdx/IntelTdxX64.dsc
index dd8d446f4a56..daeb7cb27cbe 100644
--- a/OvmfPkg/IntelTdx/IntelTdxX64.dsc
+++ b/OvmfPkg/IntelTdx/IntelTdxX64.dsc
@@ -175,7 +175,7 @@ [LibraryClasses]
LocalApicLib|UefiCpuPkg/Library/BaseXApicX2ApicLib/BaseXApicX2ApicLib.inf
DebugPrintErrorLevelLib|MdePkg/Library/BaseDebugPrintErrorLevelLib/BaseDebugPrintErrorLevelLib.inf
- IntrinsicLib|CryptoPkg/Library/IntrinsicLib/IntrinsicLib.inf
+ IntrinsicLib|MdePkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf
OpensslLib|CryptoPkg/Library/OpensslLib/OpensslLibCrypto.inf
RngLib|MdePkg/Library/BaseRngLibTimerLib/BaseRngLibTimerLib.inf
diff --git a/OvmfPkg/Microvm/MicrovmX64.dsc b/OvmfPkg/Microvm/MicrovmX64.dsc
index f8fc977cb205..edaec5995f0e 100644
--- a/OvmfPkg/Microvm/MicrovmX64.dsc
+++ b/OvmfPkg/Microvm/MicrovmX64.dsc
@@ -195,7 +195,7 @@ [LibraryClasses]
LocalApicLib|UefiCpuPkg/Library/BaseXApicX2ApicLib/BaseXApicX2ApicLib.inf
DebugPrintErrorLevelLib|MdePkg/Library/BaseDebugPrintErrorLevelLib/BaseDebugPrintErrorLevelLib.inf
- IntrinsicLib|CryptoPkg/Library/IntrinsicLib/IntrinsicLib.inf
+ IntrinsicLib|MdePkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf
!if $(NETWORK_TLS_ENABLE) == TRUE
OpensslLib|CryptoPkg/Library/OpensslLib/OpensslLib.inf
!else
diff --git a/OvmfPkg/OvmfPkgIa32.dsc b/OvmfPkg/OvmfPkgIa32.dsc
index a9841cbfc3ca..0abcbf2c2143 100644
--- a/OvmfPkg/OvmfPkgIa32.dsc
+++ b/OvmfPkg/OvmfPkgIa32.dsc
@@ -195,7 +195,7 @@ [LibraryClasses]
LocalApicLib|UefiCpuPkg/Library/BaseXApicX2ApicLib/BaseXApicX2ApicLib.inf
DebugPrintErrorLevelLib|MdePkg/Library/BaseDebugPrintErrorLevelLib/BaseDebugPrintErrorLevelLib.inf
- IntrinsicLib|CryptoPkg/Library/IntrinsicLib/IntrinsicLib.inf
+ IntrinsicLib|MdePkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf
!if $(NETWORK_TLS_ENABLE) == TRUE
OpensslLib|CryptoPkg/Library/OpensslLib/OpensslLib.inf
!else
diff --git a/OvmfPkg/OvmfPkgIa32X64.dsc b/OvmfPkg/OvmfPkgIa32X64.dsc
index f7949780fa38..8c072eac5d4c 100644
--- a/OvmfPkg/OvmfPkgIa32X64.dsc
+++ b/OvmfPkg/OvmfPkgIa32X64.dsc
@@ -199,7 +199,7 @@ [LibraryClasses]
LocalApicLib|UefiCpuPkg/Library/BaseXApicX2ApicLib/BaseXApicX2ApicLib.inf
DebugPrintErrorLevelLib|MdePkg/Library/BaseDebugPrintErrorLevelLib/BaseDebugPrintErrorLevelLib.inf
- IntrinsicLib|CryptoPkg/Library/IntrinsicLib/IntrinsicLib.inf
+ IntrinsicLib|MdePkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf
!if $(NETWORK_TLS_ENABLE) == TRUE
OpensslLib|CryptoPkg/Library/OpensslLib/OpensslLib.inf
!else
diff --git a/OvmfPkg/OvmfPkgX64.dsc b/OvmfPkg/OvmfPkgX64.dsc
index 1448f925b782..212bdab722d5 100644
--- a/OvmfPkg/OvmfPkgX64.dsc
+++ b/OvmfPkg/OvmfPkgX64.dsc
@@ -215,7 +215,7 @@ [LibraryClasses]
LocalApicLib|UefiCpuPkg/Library/BaseXApicX2ApicLib/BaseXApicX2ApicLib.inf
DebugPrintErrorLevelLib|MdePkg/Library/BaseDebugPrintErrorLevelLib/BaseDebugPrintErrorLevelLib.inf
- IntrinsicLib|CryptoPkg/Library/IntrinsicLib/IntrinsicLib.inf
+ IntrinsicLib|MdePkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf
!if $(NETWORK_TLS_ENABLE) == TRUE
OpensslLib|CryptoPkg/Library/OpensslLib/OpensslLib.inf
!else
diff --git a/OvmfPkg/OvmfXen.dsc b/OvmfPkg/OvmfXen.dsc
index 6ba4bd729ae7..ad88ede14b26 100644
--- a/OvmfPkg/OvmfXen.dsc
+++ b/OvmfPkg/OvmfXen.dsc
@@ -184,7 +184,7 @@ [LibraryClasses]
LocalApicLib|UefiCpuPkg/Library/BaseXApicX2ApicLib/BaseXApicX2ApicLib.inf
DebugPrintErrorLevelLib|MdePkg/Library/BaseDebugPrintErrorLevelLib/BaseDebugPrintErrorLevelLib.inf
- IntrinsicLib|CryptoPkg/Library/IntrinsicLib/IntrinsicLib.inf
+ IntrinsicLib|MdePkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf
!if $(NETWORK_TLS_ENABLE) == TRUE
OpensslLib|CryptoPkg/Library/OpensslLib/OpensslLib.inf
!else
diff --git a/SecurityPkg/SecurityPkg.dsc b/SecurityPkg/SecurityPkg.dsc
index 2b5ef67016b8..b71b78f56ca5 100644
--- a/SecurityPkg/SecurityPkg.dsc
+++ b/SecurityPkg/SecurityPkg.dsc
@@ -101,7 +101,7 @@ [LibraryClasses.common.PEIM]
!ifdef CONTINUOUS_INTEGRATION
BaseCryptLib|CryptoPkg/Library/BaseCryptLibNull/BaseCryptLibNull.inf
!else
- IntrinsicLib|CryptoPkg/Library/IntrinsicLib/IntrinsicLib.inf
+ IntrinsicLib|MdePkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf
OpensslLib|CryptoPkg/Library/OpensslLib/OpensslLib.inf
BaseCryptLib|CryptoPkg/Library/BaseCryptLib/PeiCryptLib.inf
!endif
@@ -119,7 +119,7 @@ [LibraryClasses.common.DXE_DRIVER]
!ifdef CONTINUOUS_INTEGRATION
BaseCryptLib|CryptoPkg/Library/BaseCryptLibNull/BaseCryptLibNull.inf
!else
- IntrinsicLib|CryptoPkg/Library/IntrinsicLib/IntrinsicLib.inf
+ IntrinsicLib|MdePkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf
OpensslLib|CryptoPkg/Library/OpensslLib/OpensslLib.inf
BaseCryptLib|CryptoPkg/Library/BaseCryptLib/BaseCryptLib.inf
!endif
@@ -140,7 +140,7 @@ [LibraryClasses.common.DXE_RUNTIME_DRIVER]
!ifdef CONTINUOUS_INTEGRATION
BaseCryptLib|CryptoPkg/Library/BaseCryptLibNull/BaseCryptLibNull.inf
!else
- IntrinsicLib|CryptoPkg/Library/IntrinsicLib/IntrinsicLib.inf
+ IntrinsicLib|MdePkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf
OpensslLib|CryptoPkg/Library/OpensslLib/OpensslLib.inf
BaseCryptLib|CryptoPkg/Library/BaseCryptLib/RuntimeCryptLib.inf
!endif
@@ -152,7 +152,7 @@ [LibraryClasses.common.UEFI_DRIVER, LibraryClasses.common.UEFI_APPLICATION]
!ifdef CONTINUOUS_INTEGRATION
BaseCryptLib|CryptoPkg/Library/BaseCryptLibNull/BaseCryptLibNull.inf
!else
- IntrinsicLib|CryptoPkg/Library/IntrinsicLib/IntrinsicLib.inf
+ IntrinsicLib|MdePkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf
OpensslLib|CryptoPkg/Library/OpensslLib/OpensslLib.inf
BaseCryptLib|CryptoPkg/Library/BaseCryptLib/BaseCryptLib.inf
!endif
@@ -171,7 +171,7 @@ [LibraryClasses.common.DXE_SMM_DRIVER]
!ifdef CONTINUOUS_INTEGRATION
BaseCryptLib|CryptoPkg/Library/BaseCryptLibNull/BaseCryptLibNull.inf
!else
- IntrinsicLib|CryptoPkg/Library/IntrinsicLib/IntrinsicLib.inf
+ IntrinsicLib|MdePkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf
OpensslLib|CryptoPkg/Library/OpensslLib/OpensslLib.inf
BaseCryptLib|CryptoPkg/Library/BaseCryptLib/SmmCryptLib.inf
!endif
diff --git a/SignedCapsulePkg/SignedCapsulePkg.dsc b/SignedCapsulePkg/SignedCapsulePkg.dsc
index 72b533cd04e8..213e165be5d0 100644
--- a/SignedCapsulePkg/SignedCapsulePkg.dsc
+++ b/SignedCapsulePkg/SignedCapsulePkg.dsc
@@ -126,7 +126,7 @@ [LibraryClasses.common.PEIM]
!ifdef CONTINUOUS_INTEGRATION
BaseCryptLib|CryptoPkg/Library/BaseCryptLibNull/BaseCryptLibNull.inf
!else
- IntrinsicLib|CryptoPkg/Library/IntrinsicLib/IntrinsicLib.inf
+ IntrinsicLib|MdePkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf
OpensslLib|CryptoPkg/Library/OpensslLib/OpensslLib.inf
BaseCryptLib|CryptoPkg/Library/BaseCryptLib/PeiCryptLib.inf
!endif
@@ -141,7 +141,7 @@ [LibraryClasses.common.DXE_DRIVER]
!ifdef CONTINUOUS_INTEGRATION
BaseCryptLib|CryptoPkg/Library/BaseCryptLibNull/BaseCryptLibNull.inf
!else
- IntrinsicLib|CryptoPkg/Library/IntrinsicLib/IntrinsicLib.inf
+ IntrinsicLib|MdePkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf
OpensslLib|CryptoPkg/Library/OpensslLib/OpensslLib.inf
BaseCryptLib|CryptoPkg/Library/BaseCryptLib/BaseCryptLib.inf
!endif
@@ -155,7 +155,7 @@ [LibraryClasses.common.DXE_RUNTIME_DRIVER]
!ifdef CONTINUOUS_INTEGRATION
BaseCryptLib|CryptoPkg/Library/BaseCryptLibNull/BaseCryptLibNull.inf
!else
- IntrinsicLib|CryptoPkg/Library/IntrinsicLib/IntrinsicLib.inf
+ IntrinsicLib|MdePkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf
OpensslLib|CryptoPkg/Library/OpensslLib/OpensslLib.inf
BaseCryptLib|CryptoPkg/Library/BaseCryptLib/RuntimeCryptLib.inf
!endif
@@ -178,7 +178,7 @@ [LibraryClasses.common.DXE_SMM_DRIVER]
!ifdef CONTINUOUS_INTEGRATION
BaseCryptLib|CryptoPkg/Library/BaseCryptLibNull/BaseCryptLibNull.inf
!else
- IntrinsicLib|CryptoPkg/Library/IntrinsicLib/IntrinsicLib.inf
+ IntrinsicLib|MdePkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf
OpensslLib|CryptoPkg/Library/OpensslLib/OpensslLib.inf
BaseCryptLib|CryptoPkg/Library/BaseCryptLib/SmmCryptLib.inf
!endif
@@ -190,7 +190,7 @@ [LibraryClasses.common.UEFI_DRIVER]
!ifdef CONTINUOUS_INTEGRATION
BaseCryptLib|CryptoPkg/Library/BaseCryptLibNull/BaseCryptLibNull.inf
!else
- IntrinsicLib|CryptoPkg/Library/IntrinsicLib/IntrinsicLib.inf
+ IntrinsicLib|MdePkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf
OpensslLib|CryptoPkg/Library/OpensslLib/OpensslLib.inf
BaseCryptLib|CryptoPkg/Library/BaseCryptLib/BaseCryptLib.inf
!endif
@@ -202,7 +202,7 @@ [LibraryClasses.common.UEFI_APPLICATION]
!ifdef CONTINUOUS_INTEGRATION
BaseCryptLib|CryptoPkg/Library/BaseCryptLibNull/BaseCryptLibNull.inf
!else
- IntrinsicLib|CryptoPkg/Library/IntrinsicLib/IntrinsicLib.inf
+ IntrinsicLib|MdePkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf
OpensslLib|CryptoPkg/Library/OpensslLib/OpensslLib.inf
BaseCryptLib|CryptoPkg/Library/BaseCryptLib/BaseCryptLib.inf
!endif
diff --git a/UefiPayloadPkg/UefiPayloadPkg.dsc b/UefiPayloadPkg/UefiPayloadPkg.dsc
index 4d9bbc80c866..3f20d691fc6e 100644
--- a/UefiPayloadPkg/UefiPayloadPkg.dsc
+++ b/UefiPayloadPkg/UefiPayloadPkg.dsc
@@ -182,7 +182,7 @@ [LibraryClasses]
DxeHobListLib|UefiPayloadPkg/Library/DxeHobListLib/DxeHobListLib.inf
BaseCryptLib|CryptoPkg/Library/BaseCryptLib/BaseCryptLib.inf
TlsLib|CryptoPkg/Library/TlsLib/TlsLib.inf
- IntrinsicLib|CryptoPkg/Library/IntrinsicLib/IntrinsicLib.inf
+ IntrinsicLib|MdePkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf
OpensslLib|CryptoPkg/Library/OpensslLib/OpensslLib.inf
RngLib|MdePkg/Library/BaseRngLib/BaseRngLib.inf
HobLib|UefiPayloadPkg/Library/DxeHobLib/DxeHobLib.inf
diff --git a/CryptoPkg/Library/IntrinsicLib/IntrinsicLib.inf b/CryptoPkg/Library/IntrinsicLib/IntrinsicLib.inf
deleted file mode 100644
index 86e74b57b109..000000000000
--- a/CryptoPkg/Library/IntrinsicLib/IntrinsicLib.inf
+++ /dev/null
@@ -1,69 +0,0 @@
-## @file
-# Intrinsic Routines Wrapper Library Instance.
-#
-# Copyright (c) 2010 - 2019, Intel Corporation. All rights reserved.<BR>
-# SPDX-License-Identifier: BSD-2-Clause-Patent
-#
-##
-
-[Defines]
- INF_VERSION = 0x00010005
- BASE_NAME = BaseIntrinsicLib
- MODULE_UNI_FILE = BaseIntrinsicLib.uni
- FILE_GUID = 63850097-3E97-4c4f-A52D-C811A0106105
- MODULE_TYPE = BASE
- VERSION_STRING = 1.0
- LIBRARY_CLASS = IntrinsicLib
-
-#
-# The following information is for reference only and not required by the build tools.
-#
-# VALID_ARCHITECTURES = IA32 X64
-#
-
-[Sources]
- MemoryIntrinsics.c
-
-[Sources.IA32]
- CopyMem.c
-
- Ia32/MathLShiftS64.c | MSFT
- Ia32/MathRShiftU64.c | MSFT
- Ia32/MathFtol.c | MSFT
- Ia32/MathLlmul.asm | MSFT
- Ia32/MathLlshr.asm | MSFT
-
- Ia32/MathLShiftS64.c | INTEL
- Ia32/MathRShiftU64.c | INTEL
- Ia32/MathFtol.c | INTEL
-
- Ia32/MathLShiftS64.nasm | GCC
- Ia32/MathRShiftU64.nasm | GCC
-
-[Sources.X64]
- CopyMem.c
-
-[Packages]
- MdePkg/MdePkg.dec
-
-[LibraryClasses]
- BaseLib
- BaseMemoryLib
-
-[BuildOptions]
- #
- # Override MSFT build option to remove /Oi and /GL
- #
- MSFT:DEBUG_VS2003_IA32_CC_FLAGS == /nologo /c /WX /W4 /Gs32768 /Gy /D UNICODE /O1b2 /FIAutoGen.h /EHs-c- /GR- /GF /GX- /Zi /Gm
- MSFT:RELEASE_VS2003_IA32_CC_FLAGS == /nologo /c /WX /W4 /Gs32768 /Gy /D UNICODE /O1b2 /FIAutoGen.h /EHs-c- /GR- /GF /GX-
- MSFT:DEBUG_VS2003xASL_IA32_CC_FLAGS == /nologo /c /WX /W4 /Gs32768 /Gy /D UNICODE /O1b2 /FIAutoGen.h /EHs-c- /GR- /GF /GX- /Zi /Gm
- MSFT:RELEASE_VS2003xASL_IA32_CC_FLAGS == /nologo /c /WX /W4 /Gs32768 /Gy /D UNICODE /O1b2 /FIAutoGen.h /EHs-c- /GR- /GF /GX-
- MSFT:DEBUG_DDK3790_IA32_CC_FLAGS == /nologo /c /WX /Gy /Gs32768 /D UNICODE /O1b2 /FIAutoGen.h /EHs-c- /GR- /GF /Zi /Gm
- MSFT:RELEASE_DDK3790_IA32_CC_FLAGS == /nologo /c /WX /Gy /Gs32768 /D UNICODE /O1b2 /FIAutoGen.h /EHs-c- /GR- /GF
- MSFT:DEBUG_DDK3790xASL_IA32_CC_FLAGS == /nologo /c /WX /Gy /Gs32768 /D UNICODE /O1b2 /FIAutoGen.h /EHs-c- /GR- /GF /Zi /Gm
- MSFT:RELEASE_DDK3790xASL_IA32_CC_FLAGS == /nologo /c /WX /Gy /Gs32768 /D UNICODE /O1b2 /FIAutoGen.h /EHs-c- /GR- /GF
- MSFT:DEBUG_*_IA32_CC_FLAGS == /nologo /c /WX /GS- /W4 /Gs32768 /D UNICODE /O1b2 /FIAutoGen.h /EHs-c- /GR- /GF /Gy /Zi /Gm
- MSFT:RELEASE_*_IA32_CC_FLAGS == /nologo /c /WX /GS- /W4 /Gs32768 /D UNICODE /O1b2 /FIAutoGen.h /EHs-c- /GR- /GF
- MSFT:DEBUG_*_X64_CC_FLAGS == /nologo /c /WX /GS- /X /W4 /Gs32768 /D UNICODE /O1b2s /Gy /FIAutoGen.h /EHs-c- /GR- /GF /Zi /Gm
- MSFT:RELEASE_*_X64_CC_FLAGS == /nologo /c /WX /GS- /X /W4 /Gs32768 /D UNICODE /O1b2s /Gy /FIAutoGen.h /EHs-c- /GR- /GF
- INTEL:*_*_*_CC_FLAGS = /Oi-
diff --git a/MdePkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf b/MdePkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf
index a1559fc40ce9..7267d0e3154d 100644
--- a/MdePkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf
+++ b/MdePkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf
@@ -26,6 +26,8 @@ [Sources]
memcmp_ms.c | MSFT
memmove_ms.c | MSFT
+ strcmp.c
+
[Sources.ARM]
Arm/ashrdi3.S | GCC
Arm/ashldi3.S | GCC
@@ -67,6 +69,20 @@ [Sources.ARM]
[Sources.AARCH64]
AArch64/Atomics.S | GCC
+[Sources.IA32]
+ Ia32/MathLShiftS64.c | MSFT
+ Ia32/MathRShiftU64.c | MSFT
+ Ia32/MathFtol.c | MSFT
+ Ia32/MathLlmul.asm | MSFT
+ Ia32/MathLlshr.asm | MSFT
+
+ Ia32/MathLShiftS64.c | INTEL
+ Ia32/MathRShiftU64.c | INTEL
+ Ia32/MathFtol.c | INTEL
+
+ Ia32/MathLShiftS64.nasm | GCC
+ Ia32/MathRShiftU64.nasm | GCC
+
[Packages]
MdePkg/MdePkg.dec
diff --git a/CryptoPkg/Library/IntrinsicLib/CopyMem.c b/CryptoPkg/Library/IntrinsicLib/CopyMem.c
deleted file mode 100644
index 14a213d1dadf..000000000000
--- a/CryptoPkg/Library/IntrinsicLib/CopyMem.c
+++ /dev/null
@@ -1,47 +0,0 @@
-/** @file
- Intrinsic Memory Routines Wrapper Implementation for OpenSSL-based
- Cryptographic Library.
-
-Copyright (c) 2010, Intel Corporation. All rights reserved.<BR>
-SPDX-License-Identifier: BSD-2-Clause-Patent
-
-**/
-
-#include <Base.h>
-#include <Library/BaseMemoryLib.h>
-
-#if defined (__clang__) && !defined (__APPLE__)
-
-/* Copies bytes between buffers */
-static __attribute__ ((__used__))
-void *
-__memcpy (
- void *dest,
- const void *src,
- unsigned int count
- )
-{
- return CopyMem (dest, src, (UINTN)count);
-}
-
-__attribute__ ((__alias__ ("__memcpy")))
-void *
-memcpy (
- void *dest,
- const void *src,
- unsigned int count
- );
-
-#else
-/* Copies bytes between buffers */
-void *
-memcpy (
- void *dest,
- const void *src,
- unsigned int count
- )
-{
- return CopyMem (dest, src, (UINTN)count);
-}
-
-#endif
diff --git a/CryptoPkg/Library/IntrinsicLib/MemoryIntrinsics.c b/CryptoPkg/Library/IntrinsicLib/MemoryIntrinsics.c
deleted file mode 100644
index 611e9fd773b0..000000000000
--- a/CryptoPkg/Library/IntrinsicLib/MemoryIntrinsics.c
+++ /dev/null
@@ -1,74 +0,0 @@
-/** @file
- Intrinsic Memory Routines Wrapper Implementation for OpenSSL-based
- Cryptographic Library.
-
-Copyright (c) 2010 - 2019, Intel Corporation. All rights reserved.<BR>
-SPDX-License-Identifier: BSD-2-Clause-Patent
-
-**/
-
-#include <Base.h>
-#include <Library/BaseMemoryLib.h>
-#include <Library/BaseLib.h>
-
-typedef UINTN size_t;
-
-#if defined (__GNUC__) || defined (__clang__)
-#define GLOBAL_USED __attribute__((used))
-#else
-#define GLOBAL_USED
-#endif
-
-/* OpenSSL will use floating point support, and C compiler produces the _fltused
- symbol by default. Simply define this symbol here to satisfy the linker. */
-int GLOBAL_USED _fltused = 1;
-
-/* Sets buffers to a specified character */
-void *
-memset (
- void *dest,
- int ch,
- size_t count
- )
-{
- //
- // NOTE: Here we use one base implementation for memset, instead of the direct
- // optimized SetMem() wrapper. Because the IntrinsicLib has to be built
- // without whole program optimization option, and there will be some
- // potential register usage errors when calling other optimized codes.
- //
-
- //
- // Declare the local variables that actually move the data elements as
- // volatile to prevent the optimizer from replacing this function with
- // the intrinsic memset()
- //
- volatile UINT8 *Pointer;
-
- Pointer = (UINT8 *)dest;
- while (count-- != 0) {
- *(Pointer++) = (UINT8)ch;
- }
-
- return dest;
-}
-
-/* Compare bytes in two buffers. */
-int
-memcmp (
- const void *buf1,
- const void *buf2,
- size_t count
- )
-{
- return (int)CompareMem (buf1, buf2, count);
-}
-
-int
-strcmp (
- const char *s1,
- const char *s2
- )
-{
- return (int)AsciiStrCmp (s1, s2);
-}
diff --git a/CryptoPkg/Library/IntrinsicLib/Ia32/MathFtol.c b/MdePkg/Library/CompilerIntrinsicsLib/Ia32/MathFtol.c
similarity index 100%
rename from CryptoPkg/Library/IntrinsicLib/Ia32/MathFtol.c
rename to MdePkg/Library/CompilerIntrinsicsLib/Ia32/MathFtol.c
diff --git a/CryptoPkg/Library/IntrinsicLib/Ia32/MathLShiftS64.c b/MdePkg/Library/CompilerIntrinsicsLib/Ia32/MathLShiftS64.c
similarity index 100%
rename from CryptoPkg/Library/IntrinsicLib/Ia32/MathLShiftS64.c
rename to MdePkg/Library/CompilerIntrinsicsLib/Ia32/MathLShiftS64.c
diff --git a/CryptoPkg/Library/IntrinsicLib/Ia32/MathRShiftU64.c b/MdePkg/Library/CompilerIntrinsicsLib/Ia32/MathRShiftU64.c
similarity index 100%
rename from CryptoPkg/Library/IntrinsicLib/Ia32/MathRShiftU64.c
rename to MdePkg/Library/CompilerIntrinsicsLib/Ia32/MathRShiftU64.c
diff --git a/MdePkg/Library/CompilerIntrinsicsLib/strcmp.c b/MdePkg/Library/CompilerIntrinsicsLib/strcmp.c
new file mode 100644
index 000000000000..937b19a3dff7
--- /dev/null
+++ b/MdePkg/Library/CompilerIntrinsicsLib/strcmp.c
@@ -0,0 +1,33 @@
+/** @file
+ Intrinsic Memory Routines Wrapper Implementation for OpenSSL-based
+ Cryptographic Library.
+
+Copyright (c) 2010 - 2019, Intel Corporation. All rights reserved.<BR>
+SPDX-License-Identifier: BSD-2-Clause-Patent
+
+**/
+
+#include <Base.h>
+#include <Library/BaseMemoryLib.h>
+#include <Library/BaseLib.h>
+
+typedef UINTN size_t;
+
+#if defined (__GNUC__) || defined (__clang__)
+#define GLOBAL_USED __attribute__((used))
+#else
+#define GLOBAL_USED
+#endif
+
+/* OpenSSL will use floating point support, and C compiler produces the _fltused
+ symbol by default. Simply define this symbol here to satisfy the linker. */
+int GLOBAL_USED _fltused = 1;
+
+int
+strcmp (
+ const char *s1,
+ const char *s2
+ )
+{
+ return (int)AsciiStrCmp (s1, s2);
+}
diff --git a/CryptoPkg/Library/IntrinsicLib/BaseIntrinsicLib.uni b/CryptoPkg/Library/IntrinsicLib/BaseIntrinsicLib.uni
deleted file mode 100644
index 47f19d4080f7..000000000000
--- a/CryptoPkg/Library/IntrinsicLib/BaseIntrinsicLib.uni
+++ /dev/null
@@ -1,16 +0,0 @@
-// /** @file
-// Intrinsic Routines Wrapper Library Instance.
-//
-// This module is intrinsic routines wrapper library instance.
-//
-// Copyright (c) 2010 - 2018, Intel Corporation. All rights reserved.<BR>
-//
-// SPDX-License-Identifier: BSD-2-Clause-Patent
-//
-// **/
-
-
-#string STR_MODULE_ABSTRACT #language en-US "Intrinsic Routines Wrapper Library Instance"
-
-#string STR_MODULE_DESCRIPTION #language en-US "This module is intrinsic routines wrapper library instance."
-
diff --git a/CryptoPkg/Library/IntrinsicLib/Ia32/MathLShiftS64.nasm b/MdePkg/Library/CompilerIntrinsicsLib/Ia32/MathLShiftS64.nasm
similarity index 100%
rename from CryptoPkg/Library/IntrinsicLib/Ia32/MathLShiftS64.nasm
rename to MdePkg/Library/CompilerIntrinsicsLib/Ia32/MathLShiftS64.nasm
diff --git a/CryptoPkg/Library/IntrinsicLib/Ia32/MathLlmul.asm b/MdePkg/Library/CompilerIntrinsicsLib/Ia32/MathLlmul.asm
similarity index 100%
rename from CryptoPkg/Library/IntrinsicLib/Ia32/MathLlmul.asm
rename to MdePkg/Library/CompilerIntrinsicsLib/Ia32/MathLlmul.asm
diff --git a/CryptoPkg/Library/IntrinsicLib/Ia32/MathLlshr.asm b/MdePkg/Library/CompilerIntrinsicsLib/Ia32/MathLlshr.asm
similarity index 100%
rename from CryptoPkg/Library/IntrinsicLib/Ia32/MathLlshr.asm
rename to MdePkg/Library/CompilerIntrinsicsLib/Ia32/MathLlshr.asm
diff --git a/CryptoPkg/Library/IntrinsicLib/Ia32/MathRShiftU64.nasm b/MdePkg/Library/CompilerIntrinsicsLib/Ia32/MathRShiftU64.nasm
similarity index 100%
rename from CryptoPkg/Library/IntrinsicLib/Ia32/MathRShiftU64.nasm
rename to MdePkg/Library/CompilerIntrinsicsLib/Ia32/MathRShiftU64.nasm
--
2.36.1
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [PATCH v4 5/9] MdePkg/CompilerIntrinsicsLib: copy over intrinsics from edk2-libc repo
2022-06-03 12:26 [PATCH v4 0/9] consolidate compiler intrinsics Gerd Hoffmann
` (3 preceding siblings ...)
2022-06-03 12:26 ` [PATCH v4 4/9] MdePkg/CompilerIntrinsicsLib: move ia32 intrinsics and strcmp Gerd Hoffmann
@ 2022-06-03 12:26 ` Gerd Hoffmann
2022-06-03 12:26 ` [PATCH v4 6/9] MdePkg/CompilerIntrinsicsLib: drop include from Gcc.c Gerd Hoffmann
` (3 subsequent siblings)
8 siblings, 0 replies; 14+ messages in thread
From: Gerd Hoffmann @ 2022-06-03 12:26 UTC (permalink / raw)
To: devel
Cc: Jian J Wang, Jiaxin Wu, Sean Brogan, Anthony Perard,
Leif Lindholm, Zhiguang Liu, Xiaoyu Lu, Pawel Polawski,
Sami Mujawar, Maciej Rabeda, Bob Feng, Jiewen Yao, Andrew Fish,
Bret Barkelew, Alexei Fedorov, Guo Dong, Gerd Hoffmann,
kilian_kegel, Maurice Ma, Siyuan Fu, Abner Chang, Zhichao Gao,
Wei6 Xu, Supreeth Venkatesh, Julien Grall, Daniel Schaefer,
Ard Biesheuvel, Guomin Jiang, Jordan Justen, Oliver Steffen,
Sebastien Boeuf, Benjamin You, Min Xu, Ray Ni, Rebecca Cran,
Nickle Wang, Michael D Kinney, Tom Lendacky, Sami Mujawar,
Peter Grehan, Erdem Aktas, Brijesh Singh, James Bottomley,
Yuwei Chen, Liming Gao
Copy over unmodified (except for running through uncrustify and adding
SPDX licence tags), from
https://github.com/tianocore/edk2-libc/tree/master/StdLib/LibC/CRT
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Acked-by: Liming Gao <gaoliming@byosoft.com.cn>
---
.../Library/CompilerIntrinsicsLib/Ia32/Gcc.c | 285 ++++++++++++++++++
.../CompilerIntrinsicsLib/Ia32/lldiv.c | 100 ++++++
.../CompilerIntrinsicsLib/Ia32/lldvrm.c | 104 +++++++
.../CompilerIntrinsicsLib/Ia32/llmul.c | 84 ++++++
.../CompilerIntrinsicsLib/Ia32/llrem.c | 97 ++++++
.../CompilerIntrinsicsLib/Ia32/llshl.c | 59 ++++
.../CompilerIntrinsicsLib/Ia32/llshr.c | 63 ++++
.../CompilerIntrinsicsLib/Ia32/ulldiv.c | 91 ++++++
.../CompilerIntrinsicsLib/Ia32/ulldvrm.c | 104 +++++++
.../CompilerIntrinsicsLib/Ia32/ullrem.c | 97 ++++++
.../CompilerIntrinsicsLib/Ia32/ullshr.c | 62 ++++
.../CompilerIntrinsicsLib/Ia32/ashrdi3.S | 68 +++++
.../CompilerIntrinsicsLib/Ia32/mulll.S | 79 +++++
.../CompilerIntrinsicsLib/Ia32/shldi3.S | 64 ++++
.../CompilerIntrinsicsLib/Ia32/udivdi3.S | 85 ++++++
.../CompilerIntrinsicsLib/Ia32/umoddi3.S | 91 ++++++
16 files changed, 1533 insertions(+)
create mode 100644 MdePkg/Library/CompilerIntrinsicsLib/Ia32/Gcc.c
create mode 100644 MdePkg/Library/CompilerIntrinsicsLib/Ia32/lldiv.c
create mode 100644 MdePkg/Library/CompilerIntrinsicsLib/Ia32/lldvrm.c
create mode 100644 MdePkg/Library/CompilerIntrinsicsLib/Ia32/llmul.c
create mode 100644 MdePkg/Library/CompilerIntrinsicsLib/Ia32/llrem.c
create mode 100644 MdePkg/Library/CompilerIntrinsicsLib/Ia32/llshl.c
create mode 100644 MdePkg/Library/CompilerIntrinsicsLib/Ia32/llshr.c
create mode 100644 MdePkg/Library/CompilerIntrinsicsLib/Ia32/ulldiv.c
create mode 100644 MdePkg/Library/CompilerIntrinsicsLib/Ia32/ulldvrm.c
create mode 100644 MdePkg/Library/CompilerIntrinsicsLib/Ia32/ullrem.c
create mode 100644 MdePkg/Library/CompilerIntrinsicsLib/Ia32/ullshr.c
create mode 100644 MdePkg/Library/CompilerIntrinsicsLib/Ia32/ashrdi3.S
create mode 100644 MdePkg/Library/CompilerIntrinsicsLib/Ia32/mulll.S
create mode 100644 MdePkg/Library/CompilerIntrinsicsLib/Ia32/shldi3.S
create mode 100644 MdePkg/Library/CompilerIntrinsicsLib/Ia32/udivdi3.S
create mode 100644 MdePkg/Library/CompilerIntrinsicsLib/Ia32/umoddi3.S
diff --git a/MdePkg/Library/CompilerIntrinsicsLib/Ia32/Gcc.c b/MdePkg/Library/CompilerIntrinsicsLib/Ia32/Gcc.c
new file mode 100644
index 000000000000..bb211022c0e4
--- /dev/null
+++ b/MdePkg/Library/CompilerIntrinsicsLib/Ia32/Gcc.c
@@ -0,0 +1,285 @@
+/** @file
+ Integer Arithmetic Run-time support functions for GCC.
+ The integer arithmetic routines are used on platforms that don't provide
+ hardware support for arithmetic operations on some modes..
+
+ Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.<BR>
+ 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.
+
+SPDX-License-Identifier: BSD-2-Clause-Patent
+
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+#include <Uefi.h>
+#include <Library/DebugLib.h>
+#include <sys/EfiCdefs.h>
+
+#include <Library/BaseLib.h>
+
+// Shift Datum left by Count bits.
+// ===========================================================================
+int
+__ashlsi3 (
+ int Datum,
+ int Count
+ )
+{
+ DEBUG ((DEBUG_INFO, "%a:\n", __func__));
+ return (int)LShiftU64 ((UINT64)Datum, (UINTN)Count);
+}
+
+long
+__ashldi3 (
+ long Datum,
+ int Count
+ )
+{
+ DEBUG ((DEBUG_INFO, "%a:\n", __func__));
+ return (long)LShiftU64 ((UINT64)Datum, (UINTN)Count);
+}
+
+long long
+__ashlti3 (
+ long long Datum,
+ int Count
+ )
+{
+ DEBUG ((DEBUG_INFO, "%a:\n", __func__));
+ return (long long)LShiftU64 ((UINT64)Datum, (UINTN)Count);
+}
+
+// Arithmetically shift Datum right by Count bits.
+// ===========================================================================
+int
+__ashrsi3 (
+ int Datum,
+ int Count
+ )
+{
+ DEBUG ((DEBUG_INFO, "%a:\n", __func__));
+ return (int)ARShiftU64 ((UINT64)Datum, (UINTN)Count);
+}
+
+long
+__ashrdi3 (
+ long Datum,
+ int Count
+ )
+{
+ DEBUG ((DEBUG_INFO, "%a:\n", __func__));
+ return (long)ARShiftU64 ((UINT64)Datum, (UINTN)Count);
+}
+
+long long
+__ashrti3 (
+ long long Datum,
+ int Count
+ )
+{
+ DEBUG ((DEBUG_INFO, "%a:\n", __func__));
+ return (long long)ARShiftU64 ((UINT64)Datum, (UINTN)Count);
+}
+
+// Return the quotient of the signed division of Dividend and Divisor
+// ===========================================================================
+int
+__divsi3 (
+ int Dividend,
+ int Divisor
+ )
+{
+ DEBUG ((DEBUG_INFO, "%a:\n", __func__));
+ return (int)DivS64x64Remainder ((INT64)Dividend, (INT64)Divisor, NULL);
+}
+
+INT64
+__divdi3 (
+ INT64 Dividend,
+ INT64 Divisor
+ )
+{
+ INT64 Quotient;
+
+ Quotient = DivS64x64Remainder ((INT64)Dividend, (INT64)Divisor, NULL);
+ DEBUG ((DEBUG_INFO, "%a: %Ld / %Ld = %Ld\n", __func__, Dividend, Divisor, Quotient));
+
+ return Quotient;
+}
+
+long long
+__divti3 (
+ long long Dividend,
+ long long Divisor
+ )
+{
+ DEBUG ((DEBUG_INFO, "%a:\n", __func__));
+ return (long long)DivS64x64Remainder ((INT64)Dividend, (INT64)Divisor, NULL);
+}
+
+// Logically shift Datum right by Count bits
+// ===========================================================================
+int
+__lshrsi3 (
+ int Datum,
+ int Count
+ )
+{
+ DEBUG ((DEBUG_INFO, "%a:\n", __func__));
+ return (int)RShiftU64 ((UINT64)Datum, (UINTN)Count);
+}
+
+long
+__lshrdi3 (
+ int Datum,
+ int Count
+ )
+{
+ DEBUG ((DEBUG_INFO, "%a:\n", __func__));
+ return (long)RShiftU64 ((UINT64)Datum, (UINTN)Count);
+}
+
+long long
+__lshrti3 (
+ int Datum,
+ int Count
+ )
+{
+ DEBUG ((DEBUG_INFO, "%a:\n", __func__));
+ return (long long)RShiftU64 ((UINT64)Datum, (UINTN)Count);
+}
+
+// Return the remainder of the signed division of Dividend and Divisor
+// ===========================================================================
+int
+__modsi3 (
+ int Dividend,
+ int Divisor
+ )
+{
+ INT64 Remainder;
+
+ (void)DivS64x64Remainder ((INT64)Dividend, (INT64)Divisor, &Remainder);
+ DEBUG ((DEBUG_INFO, "modsi3: %d %% %d = %d\n", Dividend, Divisor, (int)Remainder));
+
+ return (int)Remainder;
+}
+
+INT64
+__moddi3 (
+ INT64 Dividend,
+ INT64 Divisor
+ )
+{
+ INT64 Remainder;
+
+ (void)DivS64x64Remainder ((INT64)Dividend, (INT64)Divisor, &Remainder);
+ DEBUG ((DEBUG_INFO, "moddi3: %Ld %% %Ld = %Ld\n", (INT64)Dividend, (INT64)Divisor, Remainder));
+
+ return Remainder;
+}
+
+long long
+__modti3 (
+ long long Dividend,
+ long long Divisor
+ )
+{
+ INT64 Remainder;
+
+ (void)DivS64x64Remainder ((INT64)Dividend, (INT64)Divisor, &Remainder);
+ DEBUG ((DEBUG_INFO, "modti3: %Ld %% %Ld = %Ld\n", (INT64)Dividend, (INT64)Divisor, Remainder));
+
+ return (long long)Remainder;
+}
+
+// These functions return the product of the Multiplicand and Multiplier.
+// ===========================================================================
+long long
+__multi3 (
+ long long Multiplicand,
+ long long Multiplier
+ )
+{
+ DEBUG ((DEBUG_INFO, "%a:\n", __func__));
+ return (long long)MultS64x64 ((INT64)Multiplicand, (INT64)Multiplier);
+}
+
+// Return the quotient of the unsigned division of a and b.
+// ===========================================================================
+unsigned int
+__udivsi3 (
+ unsigned int Dividend,
+ unsigned int Divisor
+ )
+{
+ DEBUG ((DEBUG_INFO, "%a:\n", __func__));
+ return (int)DivU64x64Remainder ((UINT64)Dividend, (UINT64)Divisor, NULL);
+}
+
+unsigned long
+__udivdi3 (
+ unsigned long Dividend,
+ unsigned long Divisor
+ )
+{
+ DEBUG ((DEBUG_INFO, "%a:\n", __func__));
+ return (long)DivU64x64Remainder ((UINT64)Dividend, (UINT64)Divisor, NULL);
+}
+
+unsigned long long
+__udivti3 (
+ unsigned long long Dividend,
+ unsigned long long Divisor
+ )
+{
+ DEBUG ((DEBUG_INFO, "%a:\n", __func__));
+ return (long long)DivU64x64Remainder ((UINT64)Dividend, (UINT64)Divisor, NULL);
+}
+
+// ===========================================================================
+unsigned int
+__umodsi3 (
+ unsigned int Dividend,
+ unsigned int Divisor
+ )
+{
+ UINT64 Remainder;
+
+ DEBUG ((DEBUG_INFO, "%a:\n", __func__));
+ (void)DivU64x64Remainder ((UINT64)Dividend, (UINT64)Divisor, &Remainder);
+
+ return (unsigned int)Remainder;
+}
+
+unsigned long
+__umoddi3 (
+ unsigned long Dividend,
+ unsigned long Divisor
+ )
+{
+ UINT64 Remainder;
+
+ DEBUG ((DEBUG_INFO, "%a:\n", __func__));
+ (void)DivU64x64Remainder ((UINT64)Dividend, (UINT64)Divisor, &Remainder);
+
+ return (unsigned long)Remainder;
+}
+
+unsigned long long
+__umodti3 (
+ unsigned long long Dividend,
+ unsigned long long Divisor
+ )
+{
+ UINT64 Remainder;
+
+ DEBUG ((DEBUG_INFO, "%a:\n", __func__));
+ (void)DivU64x64Remainder ((UINT64)Dividend, (UINT64)Divisor, &Remainder);
+
+ return (unsigned long long)Remainder;
+}
diff --git a/MdePkg/Library/CompilerIntrinsicsLib/Ia32/lldiv.c b/MdePkg/Library/CompilerIntrinsicsLib/Ia32/lldiv.c
new file mode 100644
index 000000000000..cf2eec2a70b4
--- /dev/null
+++ b/MdePkg/Library/CompilerIntrinsicsLib/Ia32/lldiv.c
@@ -0,0 +1,100 @@
+/** @file
+ 64-bit Math Worker Function.
+ The 32-bit versions of C compiler generate calls to library routines
+ to handle 64-bit math. These functions use non-standard calling conventions.
+
+ Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.<BR>
+ 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.
+
+SPDX-License-Identifier: BSD-2-Clause-Patent
+
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+
+#include <Library/BaseLib.h>
+
+/*
+ * Divides a 64-bit signed value with a 64-bit signed value and returns
+ * a 64-bit signed result.
+ */
+__declspec(naked) void __cdecl
+_alldiv (
+ void
+ )
+{
+ //
+ // Wrapper Implementation over EDKII DivS64x64Remainder() routine
+ // INT64
+ // EFIAPI
+ // DivS64x64Remainder (
+ // IN UINT64 Dividend,
+ // IN UINT64 Divisor,
+ // OUT UINT64 *Remainder OPTIONAL
+ // )
+ //
+ _asm {
+ ;Entry:
+ ; Arguments are passed on the stack:
+ ; 1st pushed: divisor (QWORD)
+ ; 2nd pushed: dividend (QWORD)
+ ;
+ ;Exit:
+ ; EDX:EAX contains the quotient (dividend/ divisor)
+ ; NOTE: this routine removes the parameters from the stack.
+ ;
+ ; Original local stack when calling _alldiv
+ ; -----------------
+ ; | |
+ ; |---------------|
+ ; | |
+ ; |-- Divisor --|
+ ; | |
+ ; |---------------|
+ ; | |
+ ; |-- Dividend --|
+ ; | |
+ ; |---------------|
+ ; | ReturnAddr** |
+ ; ESP---->|---------------|
+ ;
+
+ ;
+ ; Set up the local stack for NULL Reminder pointer
+ ;
+ xor eax, eax
+ push eax
+
+ ;
+ ; Set up the local stack for Divisor parameter
+ ;
+ mov eax, [esp + 20]
+ push eax
+ mov eax, [esp + 20]
+ push eax
+
+ ;
+ ; Set up the local stack for Dividend parameter
+ ;
+ mov eax, [esp + 20]
+ push eax
+ mov eax, [esp + 20]
+ push eax
+
+ ;
+ ; Call native DivS64x64Remainder of BaseLib
+ ;
+ call DivS64x64Remainder
+
+ ;
+ ; Adjust stack
+ ;
+ add esp, 20
+
+ ret 16
+ }
+}
diff --git a/MdePkg/Library/CompilerIntrinsicsLib/Ia32/lldvrm.c b/MdePkg/Library/CompilerIntrinsicsLib/Ia32/lldvrm.c
new file mode 100644
index 000000000000..1fbe11bea751
--- /dev/null
+++ b/MdePkg/Library/CompilerIntrinsicsLib/Ia32/lldvrm.c
@@ -0,0 +1,104 @@
+/** @file
+ 64-bit Math Worker Function.
+ The 32-bit versions of C compiler generate calls to library routines
+ to handle 64-bit math. These functions use non-standard calling conventions.
+
+ Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.<BR>
+ 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.
+
+SPDX-License-Identifier: BSD-2-Clause-Patent
+
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+
+#include <Library/BaseLib.h>
+
+/*
+ * Divides a 64-bit signed value by another 64-bit signed value and returns
+ * the 64-bit signed result and the 64-bit signed remainder.
+ */
+__declspec(naked) void __cdecl
+_alldvrm (
+ void
+ )
+{
+ //
+ // Wrapper Implementation over EDKII DivS64x64Remainder() routine
+ // INT64
+ // EFIAPI
+ // DivS64x64Remainder (
+ // IN INT64 Dividend,
+ // IN INT64 Divisor,
+ // OUT INT64 *Remainder
+ // )
+ //
+ _asm {
+ ; Original local stack when calling _alldvrm
+ ; -----------------
+ ; | |
+ ; |---------------|
+ ; | |
+ ; |-- Divisor --|
+ ; | |
+ ; |---------------|
+ ; | |
+ ; |-- Dividend --|
+ ; | |
+ ; |---------------|
+ ; | ReturnAddr** |
+ ; ESP---->|---------------|
+ ;
+ ;
+ ; On Exit:
+ ; EDX:EAX contains the quotient (dividend/ divisor)
+ ; EBX:ECX contains the remainder (divided % divisor)
+ ; NOTE: this routine removes the parameters from the stack.
+ ;
+
+ ;
+ ; Set up the local stack for Reminder pointer
+ ;
+ sub esp, 8
+ push esp
+
+ ;
+ ; Set up the local stack for Divisor parameter
+ ;
+ mov eax, [esp + 28]
+ push eax
+ mov eax, [esp + 28]
+ push eax
+
+ ;
+ ; Set up the local stack for Dividend parameter
+ ;
+ mov eax, [esp + 28]
+ push eax
+ mov eax, [esp + 28]
+ push eax
+
+ ;
+ ; Call native DivS64x64Remainder of BaseLib
+ ;
+ call DivS64x64Remainder
+
+ ;
+ ; EDX:EAX contains the quotient (dividend/ divisor)
+ ; Put the Remainder in EBX:ECX
+ ;
+ mov ecx, [esp + 20]
+ mov ebx, [esp + 24]
+
+ ;
+ ; Adjust stack
+ ;
+ add esp, 28
+
+ ret 16
+ }
+}
diff --git a/MdePkg/Library/CompilerIntrinsicsLib/Ia32/llmul.c b/MdePkg/Library/CompilerIntrinsicsLib/Ia32/llmul.c
new file mode 100644
index 000000000000..3f9c54454128
--- /dev/null
+++ b/MdePkg/Library/CompilerIntrinsicsLib/Ia32/llmul.c
@@ -0,0 +1,84 @@
+/** @file
+ 64-bit Math Worker Function.
+ The 32-bit versions of C compiler generate calls to library routines
+ to handle 64-bit math. These functions use non-standard calling conventions.
+
+ Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.<BR>
+ 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.
+
+SPDX-License-Identifier: BSD-2-Clause-Patent
+
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+
+#include <Library/BaseLib.h>
+
+/*
+ * Multiplies a 64-bit signed or unsigned value by a 64-bit signed or unsigned value
+ * and returns a 64-bit result.
+ */
+__declspec(naked) void __cdecl
+_allmul (
+ void
+ )
+{
+ //
+ // Wrapper Implementation over EDKII MultS64x64() routine
+ // INT64
+ // EFIAPI
+ // MultS64x64 (
+ // IN INT64 Multiplicand,
+ // IN INT64 Multiplier
+ // )
+ //
+ _asm {
+ ; Original local stack when calling _allmul
+ ; -----------------
+ ; | |
+ ; |---------------|
+ ; | |
+ ; |--Multiplier --|
+ ; | |
+ ; |---------------|
+ ; | |
+ ; |--Multiplicand-|
+ ; | |
+ ; |---------------|
+ ; | ReturnAddr** |
+ ; ESP---->|---------------|
+ ;
+
+ ;
+ ; Set up the local stack for Multiplicand parameter
+ ;
+ mov eax, [esp + 16]
+ push eax
+ mov eax, [esp + 16]
+ push eax
+
+ ;
+ ; Set up the local stack for Multiplier parameter
+ ;
+ mov eax, [esp + 16]
+ push eax
+ mov eax, [esp + 16]
+ push eax
+
+ ;
+ ; Call native MulS64x64 of BaseLib
+ ;
+ call MultS64x64
+
+ ;
+ ; Adjust stack
+ ;
+ add esp, 16
+
+ ret 16
+ }
+}
diff --git a/MdePkg/Library/CompilerIntrinsicsLib/Ia32/llrem.c b/MdePkg/Library/CompilerIntrinsicsLib/Ia32/llrem.c
new file mode 100644
index 000000000000..5a73d539a650
--- /dev/null
+++ b/MdePkg/Library/CompilerIntrinsicsLib/Ia32/llrem.c
@@ -0,0 +1,97 @@
+/** @file
+ 64-bit Math Worker Function.
+ The 32-bit versions of C compiler generate calls to library routines
+ to handle 64-bit math. These functions use non-standard calling conventions.
+
+ Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.<BR>
+ 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.
+
+SPDX-License-Identifier: BSD-2-Clause-Patent
+
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+
+#include <Library/BaseLib.h>
+
+/*
+ * Divides a 64-bit signed value by another 64-bit signed value and returns
+ * the 64-bit signed remainder.
+ */
+__declspec(naked) void __cdecl
+_allrem (
+ void
+ )
+{
+ //
+ // Wrapper Implementation over EDKII DivS64x64Remainder() routine
+ // UINT64
+ // EFIAPI
+ // DivS64x64Remainder (
+ // IN UINT64 Dividend,
+ // IN UINT64 Divisor,
+ // OUT UINT64 *Remainder
+ // )
+ //
+ _asm {
+ ; Original local stack when calling _allrem
+ ; -----------------
+ ; | |
+ ; |---------------|
+ ; | |
+ ; |-- Divisor --|
+ ; | |
+ ; |---------------|
+ ; | |
+ ; |-- Dividend --|
+ ; | |
+ ; |---------------|
+ ; | ReturnAddr** |
+ ; ESP---->|---------------|
+ ;
+
+ ;
+ ; Set up the local stack for Reminder pointer
+ ;
+ sub esp, 8
+ push esp
+
+ ;
+ ; Set up the local stack for Divisor parameter
+ ;
+ mov eax, [esp + 28]
+ push eax
+ mov eax, [esp + 28]
+ push eax
+
+ ;
+ ; Set up the local stack for Dividend parameter
+ ;
+ mov eax, [esp + 28]
+ push eax
+ mov eax, [esp + 28]
+ push eax
+
+ ;
+ ; Call native DivS64x64Remainder of BaseLib
+ ;
+ call DivS64x64Remainder
+
+ ;
+ ; Put the Reminder in EDX:EAX as return value
+ ;
+ mov eax, [esp + 20]
+ mov edx, [esp + 24]
+
+ ;
+ ; Adjust stack
+ ;
+ add esp, 28
+
+ ret 16
+ }
+}
diff --git a/MdePkg/Library/CompilerIntrinsicsLib/Ia32/llshl.c b/MdePkg/Library/CompilerIntrinsicsLib/Ia32/llshl.c
new file mode 100644
index 000000000000..665b628b4014
--- /dev/null
+++ b/MdePkg/Library/CompilerIntrinsicsLib/Ia32/llshl.c
@@ -0,0 +1,59 @@
+/** @file
+ 64-bit Math Worker Function.
+ The 32-bit versions of C compiler generate calls to library routines
+ to handle 64-bit math. These functions use non-standard calling conventions.
+
+ Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.<BR>
+ 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.
+
+SPDX-License-Identifier: BSD-2-Clause-Patent
+
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+
+/*
+ * Shifts a 64-bit signed value left by a particular number of bits.
+ */
+__declspec(naked) void __cdecl
+_allshl (
+ void
+ )
+{
+ _asm {
+ ;
+ ; Handle shifting of 64 or more bits (return 0)
+ ;
+
+ cmp cl, 64
+ jae short ReturnZero
+
+ ;
+ ; Handle shifting of between 0 and 31 bits
+ ;
+ cmp cl, 32
+ jae short More32
+ shld edx, eax, cl
+ shl eax, cl
+ ret
+
+ ;
+ ; Handle shifting of between 32 and 63 bits
+ ;
+More32:
+ mov edx, eax
+ xor eax, eax
+ and cl, 31
+ shl edx, cl
+ ret
+
+ReturnZero:
+ xor eax,eax
+ xor edx,edx
+ ret
+ }
+}
diff --git a/MdePkg/Library/CompilerIntrinsicsLib/Ia32/llshr.c b/MdePkg/Library/CompilerIntrinsicsLib/Ia32/llshr.c
new file mode 100644
index 000000000000..94b91d4ea3c7
--- /dev/null
+++ b/MdePkg/Library/CompilerIntrinsicsLib/Ia32/llshr.c
@@ -0,0 +1,63 @@
+/** @file
+ 64-bit Math Worker Function.
+ The 32-bit versions of C compiler generate calls to library routines
+ to handle 64-bit math. These functions use non-standard calling conventions.
+
+ Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.<BR>
+ 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.
+
+SPDX-License-Identifier: BSD-2-Clause-Patent
+
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+
+/*
+ * Shifts a 64-bit signed value right by a particular number of bits.
+ */
+__declspec(naked) void __cdecl
+_allshr (
+ void
+ )
+{
+ _asm {
+ ;
+ ; Handle shifts of 64 bits or more (if shifting 64 bits or more, the result
+ ; depends only on the high order bit of edx).
+ ;
+
+ cmp cl,64
+ jae short SIGNRETURN
+
+ ;
+ ; Handle shifts of between 0 and 31 bits
+ ;
+ cmp cl, 32
+ jae short MORE32
+ shrd eax,edx,cl
+ sar edx,cl
+ ret
+
+ ;
+ ; Handle shifts of between 32 and 63 bits
+ ;
+MORE32:
+ mov eax,edx
+ sar edx,31
+ and cl,31
+ sar eax,cl
+ ret
+
+ ;
+ ; Return double precision 0 or -1, depending on the sign of edx
+ ;
+SIGNRETURN:
+ sar edx,31
+ mov eax,edx
+ ret
+ }
+}
diff --git a/MdePkg/Library/CompilerIntrinsicsLib/Ia32/ulldiv.c b/MdePkg/Library/CompilerIntrinsicsLib/Ia32/ulldiv.c
new file mode 100644
index 000000000000..064e0e109b1d
--- /dev/null
+++ b/MdePkg/Library/CompilerIntrinsicsLib/Ia32/ulldiv.c
@@ -0,0 +1,91 @@
+/** @file
+ 64-bit Math Worker Function.
+ The 32-bit versions of C compiler generate calls to library routines
+ to handle 64-bit math. These functions use non-standard calling conventions.
+
+ Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.<BR>
+ 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.
+
+SPDX-License-Identifier: BSD-2-Clause-Patent
+
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+
+#include <Library/BaseLib.h>
+
+/*
+ * Divides a 64-bit unsigned value with a 64-bit unsigned value and returns
+ * a 64-bit unsigned result.
+ */
+__declspec(naked) void __cdecl
+_aulldiv (
+ void
+ )
+{
+ //
+ // Wrapper Implementation over EDKII DivU64x64Reminder() routine
+ // UINT64
+ // EFIAPI
+ // DivU64x64Remainder (
+ // IN UINT64 Dividend,
+ // IN UINT64 Divisor,
+ // OUT UINT64 *Remainder OPTIONAL
+ // )
+ //
+ _asm {
+ ; Original local stack when calling _aulldiv
+ ; -----------------
+ ; | |
+ ; |---------------|
+ ; | |
+ ; |-- Divisor --|
+ ; | |
+ ; |---------------|
+ ; | |
+ ; |-- Dividend --|
+ ; | |
+ ; |---------------|
+ ; | ReturnAddr** |
+ ; ESP---->|---------------|
+ ;
+
+ ;
+ ; Set up the local stack for NULL Reminder pointer
+ ;
+ xor eax, eax
+ push eax
+
+ ;
+ ; Set up the local stack for Divisor parameter
+ ;
+ mov eax, [esp + 20]
+ push eax
+ mov eax, [esp + 20]
+ push eax
+
+ ;
+ ; Set up the local stack for Dividend parameter
+ ;
+ mov eax, [esp + 20]
+ push eax
+ mov eax, [esp + 20]
+ push eax
+
+ ;
+ ; Call native DivU64x64Remainder of BaseLib
+ ;
+ call DivU64x64Remainder
+
+ ;
+ ; Adjust stack
+ ;
+ add esp, 20
+
+ ret 16
+ }
+}
diff --git a/MdePkg/Library/CompilerIntrinsicsLib/Ia32/ulldvrm.c b/MdePkg/Library/CompilerIntrinsicsLib/Ia32/ulldvrm.c
new file mode 100644
index 000000000000..37946b4edc94
--- /dev/null
+++ b/MdePkg/Library/CompilerIntrinsicsLib/Ia32/ulldvrm.c
@@ -0,0 +1,104 @@
+/** @file
+ 64-bit Math Worker Function.
+ The 32-bit versions of C compiler generate calls to library routines
+ to handle 64-bit math. These functions use non-standard calling conventions.
+
+ Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.<BR>
+ 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.
+
+SPDX-License-Identifier: BSD-2-Clause-Patent
+
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+
+#include <Library/BaseLib.h>
+
+/*
+ * Divides a 64-bit signed value by another 64-bit signed value and returns
+ * the 64-bit signed result and the 64-bit signed remainder.
+ */
+__declspec(naked) void __cdecl
+_aulldvrm (
+ void
+ )
+{
+ //
+ // Wrapper Implementation over EDKII DivU64x64Remainder() routine
+ // UINT64
+ // EFIAPI
+ // DivU64x64Remainder (
+ // IN UINT64 Dividend,
+ // IN UINT64 Divisor,
+ // OUT UINT64 *Remainder
+ // )
+ //
+ _asm {
+ ; Original local stack when calling _aulldvrm
+ ; -----------------
+ ; | |
+ ; |---------------|
+ ; | |
+ ; |-- Divisor --|
+ ; | |
+ ; |---------------|
+ ; | |
+ ; |-- Dividend --|
+ ; | |
+ ; |---------------|
+ ; | ReturnAddr** |
+ ; ESP---->|---------------|
+ ;
+ ;
+ ; On Exit:
+ ; EDX:EAX contains the quotient (dividend/ divisor)
+ ; EBX:ECX contains the remainder (divided % divisor)
+ ; NOTE: this routine removes the parameters from the stack.
+ ;
+
+ ;
+ ; Set up the local stack for Remainder pointer
+ ;
+ sub esp, 8
+ push esp
+
+ ;
+ ; Set up the local stack for Divisor parameter
+ ;
+ mov eax, [esp + 28]
+ push eax
+ mov eax, [esp + 28]
+ push eax
+
+ ;
+ ; Set up the local stack for Dividend parameter
+ ;
+ mov eax, [esp + 28]
+ push eax
+ mov eax, [esp + 28]
+ push eax
+
+ ;
+ ; Call native DivU64x64Remainder of BaseLib
+ ;
+ call DivU64x64Remainder
+
+ ;
+ ; EDX:EAX contains the quotient (dividend/ divisor)
+ ; Put the Remainder in EBX:ECX
+ ;
+ mov ecx, [esp + 20]
+ mov ebx, [esp + 24]
+
+ ;
+ ; Adjust stack
+ ;
+ add esp, 28
+
+ ret 16
+ }
+}
diff --git a/MdePkg/Library/CompilerIntrinsicsLib/Ia32/ullrem.c b/MdePkg/Library/CompilerIntrinsicsLib/Ia32/ullrem.c
new file mode 100644
index 000000000000..a5b65e600415
--- /dev/null
+++ b/MdePkg/Library/CompilerIntrinsicsLib/Ia32/ullrem.c
@@ -0,0 +1,97 @@
+/** @file
+ 64-bit Math Worker Function.
+ The 32-bit versions of C compiler generate calls to library routines
+ to handle 64-bit math. These functions use non-standard calling conventions.
+
+ Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.<BR>
+ 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.
+
+SPDX-License-Identifier: BSD-2-Clause-Patent
+
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+
+#include <Library/BaseLib.h>
+
+/*
+ * Divides a 64-bit unsigned value by another 64-bit unsigned value and returns
+ * the 64-bit unsigned remainder.
+ */
+__declspec(naked) void __cdecl
+_aullrem (
+ void
+ )
+{
+ //
+ // Wrapper Implementation over EDKII DivU64x64Remainder() routine
+ // UINT64
+ // EFIAPI
+ // DivU64x64Remainder (
+ // IN UINT64 Dividend,
+ // IN UINT64 Divisor,
+ // OUT UINT64 *Remainder OPTIONAL
+ // )
+ //
+ _asm {
+ ; Original local stack when calling _aullrem
+ ; -----------------
+ ; | |
+ ; |---------------|
+ ; | |
+ ; |-- Divisor --|
+ ; | |
+ ; |---------------|
+ ; | |
+ ; |-- Dividend --|
+ ; | |
+ ; |---------------|
+ ; | ReturnAddr** |
+ ; ESP---->|---------------|
+ ;
+
+ ;
+ ; Set up the local stack for Reminder pointer
+ ;
+ sub esp, 8
+ push esp
+
+ ;
+ ; Set up the local stack for Divisor parameter
+ ;
+ mov eax, [esp + 28]
+ push eax
+ mov eax, [esp + 28]
+ push eax
+
+ ;
+ ; Set up the local stack for Dividend parameter
+ ;
+ mov eax, [esp + 28]
+ push eax
+ mov eax, [esp + 28]
+ push eax
+
+ ;
+ ; Call native DivU64x64Remainder of BaseLib
+ ;
+ call DivU64x64Remainder
+
+ ;
+ ; Put the Reminder in EDX:EAX as return value
+ ;
+ mov eax, [esp + 20]
+ mov edx, [esp + 24]
+
+ ;
+ ; Adjust stack
+ ;
+ add esp, 28
+
+ ret 16
+ }
+}
diff --git a/MdePkg/Library/CompilerIntrinsicsLib/Ia32/ullshr.c b/MdePkg/Library/CompilerIntrinsicsLib/Ia32/ullshr.c
new file mode 100644
index 000000000000..1cfe781720ac
--- /dev/null
+++ b/MdePkg/Library/CompilerIntrinsicsLib/Ia32/ullshr.c
@@ -0,0 +1,62 @@
+/** @file
+ 64-bit Math Worker Function.
+ The 32-bit versions of C compiler generate calls to library routines
+ to handle 64-bit math. These functions use non-standard calling conventions.
+
+ Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.<BR>
+ 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.
+
+SPDX-License-Identifier: BSD-2-Clause-Patent
+
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+
+/*
+ * Shifts a 64-bit unsigned value right by a certain number of bits.
+ */
+__declspec(naked) void __cdecl
+_aullshr (
+ void
+ )
+{
+ _asm {
+ ;
+ ; Checking: Only handle 64bit shifting or more
+ ;
+ cmp cl, 64
+ jae _Exit
+
+ ;
+ ; Handle shifting between 0 and 31 bits
+ ;
+ cmp cl, 32
+ jae More32
+ shrd eax, edx, cl
+ shr edx, cl
+ ret
+
+ ;
+ ; Handle shifting of 32-63 bits
+ ;
+More32:
+ mov eax, edx
+ xor edx, edx
+ and cl, 31
+ shr eax, cl
+ ret
+
+ ;
+ ; Invalid number (less then 32bits), return 0
+ ;
+
+_Exit:
+ xor eax, eax
+ xor edx, edx
+ ret
+ }
+}
diff --git a/MdePkg/Library/CompilerIntrinsicsLib/Ia32/ashrdi3.S b/MdePkg/Library/CompilerIntrinsicsLib/Ia32/ashrdi3.S
new file mode 100644
index 000000000000..f671d419e1f9
--- /dev/null
+++ b/MdePkg/Library/CompilerIntrinsicsLib/Ia32/ashrdi3.S
@@ -0,0 +1,68 @@
+#------------------------------------------------------------------------------
+#
+# Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.<BR>
+# 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.
+#
+# SPDX-License-Identifier: BSD-2-Clause-Patent
+#
+# 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:
+#
+# MathRShiftU64.S
+#
+# Abstract:
+#
+# 64-bit Math Worker Function.
+# Shifts a 64-bit unsigned value right by a certain number of bits.
+#
+#------------------------------------------------------------------------------
+
+
+ .686:
+ .code:
+
+ASM_GLOBAL ASM_PFX(__ashrdi3)
+
+#------------------------------------------------------------------------------
+#
+# void __cdecl __ashrdi3 (void)
+#
+#------------------------------------------------------------------------------
+ASM_PFX(__ashrdi3):
+ #
+ # Checking: Only handle 64bit shifting or more
+ #
+ cmpb $64, %cl
+ jae _Exit
+
+ #
+ # Handle shifting between 0 and 31 bits
+ #
+ cmpb $32, %cl
+ jae More32
+ shrd %cl, %edx, %eax
+ shr %cl, %edx
+ ret
+
+ #
+ # Handle shifting of 32-63 bits
+ #
+More32:
+ movl %edx, %eax
+ xor %edx, %edx
+ and $32, %cl
+ shr %cl, %eax
+ ret
+
+ #
+ # Invalid number (less then 32bits), return 0
+ #
+_Exit:
+ xor %eax, %eax
+ xor %edx, %edx
+ ret
diff --git a/MdePkg/Library/CompilerIntrinsicsLib/Ia32/mulll.S b/MdePkg/Library/CompilerIntrinsicsLib/Ia32/mulll.S
new file mode 100644
index 000000000000..c46d4ab82311
--- /dev/null
+++ b/MdePkg/Library/CompilerIntrinsicsLib/Ia32/mulll.S
@@ -0,0 +1,79 @@
+#------------------------------------------------------------------------------
+#
+# Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.<BR>
+# 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.
+#
+# SPDX-License-Identifier: BSD-2-Clause-Patent
+#
+# 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:
+#
+# MathMultS64x64.S
+#
+# Abstract:
+#
+# 64-bit Math Worker Function.
+# Multiplies a 64-bit signed or unsigned value by a 64-bit signed or unsigned value
+# and returns a 64-bit result
+#
+#------------------------------------------------------------------------------
+
+ .686:
+ .code:
+
+ASM_GLOBAL ASM_PFX(_mulll), ASM_PFX(MultS64x64)
+
+#------------------------------------------------------------------------------
+#
+# void __cdecl __mulll (void)
+#
+#------------------------------------------------------------------------------
+ASM_PFX(__mulll):
+ # Original local stack when calling __mulll
+ # -----------------
+ # | |
+ # |---------------|
+ # | |
+ # |--Multiplier --|
+ # | |
+ # |---------------|
+ # | |
+ # |--Multiplicand-|
+ # | |
+ # |---------------|
+ # | ReturnAddr** |
+ # ESP---->|---------------|
+ #
+
+ #
+ # Set up the local stack for Multiplicand parameter
+ #
+ movl 16(%esp), %eax
+ push %eax
+ movl 16(%esp), %eax
+ push %eax
+
+ #
+ # Set up the local stack for Multiplier parameter
+ #
+ movl 16(%esp), %eax
+ push %eax
+ movl 16(%esp), %eax
+ push %eax
+
+ #
+ # Call native MulS64x64 of BaseLib
+ #
+ jmp ASM_PFX(MultS64x64)
+
+ #
+ # Adjust stack
+ #
+ add $16, %esp
+
+ ret $16
diff --git a/MdePkg/Library/CompilerIntrinsicsLib/Ia32/shldi3.S b/MdePkg/Library/CompilerIntrinsicsLib/Ia32/shldi3.S
new file mode 100644
index 000000000000..4e5ce03c40e6
--- /dev/null
+++ b/MdePkg/Library/CompilerIntrinsicsLib/Ia32/shldi3.S
@@ -0,0 +1,64 @@
+#------------------------------------------------------------------------------
+#
+# Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.<BR>
+# 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.
+#
+# SPDX-License-Identifier: BSD-2-Clause-Patent
+#
+# 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:
+#
+# MathLShiftS64.S
+#
+# Abstract:
+#
+# 64-bit Math Worker Function.
+# Shifts a 64-bit signed value left by a certain number of bits.
+#
+#------------------------------------------------------------------------------
+
+ .686:
+ .code:
+
+ASM_GLOBAL ASM_PFX(__ashldi3)
+
+#------------------------------------------------------------------------------
+#
+# void __cdecl __ashldi3 (void)
+#
+#------------------------------------------------------------------------------
+ASM_PFX(__ashldi3):
+ #
+ # Handle shifting of 64 or more bits (return 0)
+ #
+ cmpb $64, %cl
+ jae ReturnZero
+
+ #
+ # Handle shifting of between 0 and 31 bits
+ #
+ cmpb $32, %cl
+ jae More32
+ shld %cl, %eax, %edx
+ shl %cl, %eax
+ ret
+
+ #
+ # Handle shifting of between 32 and 63 bits
+ #
+More32:
+ movl %eax, %edx
+ xor %eax, %eax
+ and $31, %cl
+ shl %cl, %edx
+ ret
+
+ReturnZero:
+ xor %eax, %eax
+ xor %edx, %edx
+ ret
diff --git a/MdePkg/Library/CompilerIntrinsicsLib/Ia32/udivdi3.S b/MdePkg/Library/CompilerIntrinsicsLib/Ia32/udivdi3.S
new file mode 100644
index 000000000000..7dbae9c438a4
--- /dev/null
+++ b/MdePkg/Library/CompilerIntrinsicsLib/Ia32/udivdi3.S
@@ -0,0 +1,85 @@
+#------------------------------------------------------------------------------
+#
+# Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.<BR>
+# 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.
+#
+# SPDX-License-Identifier: BSD-2-Clause-Patent
+#
+# 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:
+#
+# MathDivU64x64.S
+#
+# Abstract:
+#
+# 64-bit Math Worker Function.
+# Divides a 64-bit unsigned value with a 64-bit unsigned value and returns
+# a 64-bit unsigned result.
+#
+#------------------------------------------------------------------------------
+
+ .686:
+ .code:
+
+ASM_GLOBAL ASM_PFX(__udivdi3), ASM_PFX(DivU64x64Remainder)
+
+#------------------------------------------------------------------------------
+#
+# void __cdecl __udivdi3 (void)
+#
+#------------------------------------------------------------------------------
+ASM_PFX(__udivdi3):
+ # Original local stack when calling __udivdi3
+ # -----------------
+ # | |
+ # |---------------|
+ # | |
+ # |-- Divisor --|
+ # | |
+ # |---------------|
+ # | |
+ # |-- Dividend --|
+ # | |
+ # |---------------|
+ # | ReturnAddr** |
+ # ESP---->|---------------|
+ #
+
+ #
+ # Set up the local stack for NULL Reminder pointer
+ #
+ xorl %eax, %eax
+ push %eax
+
+ #
+ # Set up the local stack for Divisor parameter
+ #
+ movl 20(%esp), %eax
+ push %eax
+ movl 20(%esp), %eax
+ push %eax
+
+ #
+ # Set up the local stack for Dividend parameter
+ #
+ movl 20(%esp), %eax
+ push %eax
+ movl 20(%esp), %eax
+ push %eax
+
+ #
+ # Call native DivU64x64Remainder of BaseLib
+ #
+ jmp ASM_PFX(DivU64x64Remainder)
+
+ #
+ # Adjust stack
+ #
+ addl $20, %esp
+
+ ret $16
diff --git a/MdePkg/Library/CompilerIntrinsicsLib/Ia32/umoddi3.S b/MdePkg/Library/CompilerIntrinsicsLib/Ia32/umoddi3.S
new file mode 100644
index 000000000000..6907eaabccc7
--- /dev/null
+++ b/MdePkg/Library/CompilerIntrinsicsLib/Ia32/umoddi3.S
@@ -0,0 +1,91 @@
+#------------------------------------------------------------------------------
+#
+# Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.<BR>
+# 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.
+#
+# SPDX-License-Identifier: BSD-2-Clause-Patent
+#
+# 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:
+#
+# MathReminderU64x64.S
+#
+# Abstract:
+#
+# 64-bit Math Worker Function.
+# Divides a 64-bit unsigned value by another 64-bit unsigned value and returns
+# the 64-bit unsigned remainder
+#
+#------------------------------------------------------------------------------
+
+ .686:
+ .code:
+
+ASM_GLOBAL ASM_PFX(__umoddi3), ASM_PFX(DivU64x64Remainder)
+
+#------------------------------------------------------------------------------
+#
+# void __cdecl __umoddi3 (void)
+#
+#------------------------------------------------------------------------------
+ASM_PFX(__umoddi3):
+ # Original local stack when calling __umoddi3
+ # -----------------
+ # | |
+ # |---------------|
+ # | |
+ # |-- Divisor --|
+ # | |
+ # |---------------|
+ # | |
+ # |-- Dividend --|
+ # | |
+ # |---------------|
+ # | ReturnAddr** |
+ # ESP---->|---------------|
+ #
+
+ #
+ # Set up the local stack for Reminder pointer
+ #
+ sub $8, %esp
+ push %esp
+
+ #
+ # Set up the local stack for Divisor parameter
+ #
+ movl 28(%esp), %eax
+ push %eax
+ movl 28(%esp), %eax
+ push %eax
+
+ #
+ # Set up the local stack for Dividend parameter
+ #
+ movl 28(%esp), %eax
+ push %eax
+ movl 28(%esp), %eax
+ push %eax
+
+ #
+ # Call native DivU64x64Remainder of BaseLib
+ #
+ jmp ASM_PFX(DivU64x64Remainder)
+
+ #
+ # Put the Reminder in EDX:EAX as return value
+ #
+ movl 20(%esp), %eax
+ movl 24(%esp), %edx
+
+ #
+ # Adjust stack
+ #
+ add $28, %esp
+
+ ret $16
--
2.36.1
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [PATCH v4 6/9] MdePkg/CompilerIntrinsicsLib: drop include from Gcc.c
2022-06-03 12:26 [PATCH v4 0/9] consolidate compiler intrinsics Gerd Hoffmann
` (4 preceding siblings ...)
2022-06-03 12:26 ` [PATCH v4 5/9] MdePkg/CompilerIntrinsicsLib: copy over intrinsics from edk2-libc repo Gerd Hoffmann
@ 2022-06-03 12:26 ` Gerd Hoffmann
2022-06-03 12:26 ` [PATCH v4 7/9] MdePkg/CompilerIntrinsicsLib: drop debug logging " Gerd Hoffmann
` (2 subsequent siblings)
8 siblings, 0 replies; 14+ messages in thread
From: Gerd Hoffmann @ 2022-06-03 12:26 UTC (permalink / raw)
To: devel
Cc: Jian J Wang, Jiaxin Wu, Sean Brogan, Anthony Perard,
Leif Lindholm, Zhiguang Liu, Xiaoyu Lu, Pawel Polawski,
Sami Mujawar, Maciej Rabeda, Bob Feng, Jiewen Yao, Andrew Fish,
Bret Barkelew, Alexei Fedorov, Guo Dong, Gerd Hoffmann,
kilian_kegel, Maurice Ma, Siyuan Fu, Abner Chang, Zhichao Gao,
Wei6 Xu, Supreeth Venkatesh, Julien Grall, Daniel Schaefer,
Ard Biesheuvel, Guomin Jiang, Jordan Justen, Oliver Steffen,
Sebastien Boeuf, Benjamin You, Min Xu, Ray Ni, Rebecca Cran,
Nickle Wang, Michael D Kinney, Tom Lendacky, Sami Mujawar,
Peter Grehan, Erdem Aktas, Brijesh Singh, James Bottomley,
Yuwei Chen, Liming Gao
Does not exist and is not needed.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Acked-by: Liming Gao <gaoliming@byosoft.com.cn>
---
MdePkg/Library/CompilerIntrinsicsLib/Ia32/Gcc.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/MdePkg/Library/CompilerIntrinsicsLib/Ia32/Gcc.c b/MdePkg/Library/CompilerIntrinsicsLib/Ia32/Gcc.c
index bb211022c0e4..d0996d6276bc 100644
--- a/MdePkg/Library/CompilerIntrinsicsLib/Ia32/Gcc.c
+++ b/MdePkg/Library/CompilerIntrinsicsLib/Ia32/Gcc.c
@@ -17,7 +17,6 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
**/
#include <Uefi.h>
#include <Library/DebugLib.h>
-#include <sys/EfiCdefs.h>
#include <Library/BaseLib.h>
--
2.36.1
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [PATCH v4 7/9] MdePkg/CompilerIntrinsicsLib: drop debug logging from Gcc.c
2022-06-03 12:26 [PATCH v4 0/9] consolidate compiler intrinsics Gerd Hoffmann
` (5 preceding siblings ...)
2022-06-03 12:26 ` [PATCH v4 6/9] MdePkg/CompilerIntrinsicsLib: drop include from Gcc.c Gerd Hoffmann
@ 2022-06-03 12:26 ` Gerd Hoffmann
2022-06-03 12:26 ` [PATCH v4 8/9] MdePkg/CompilerIntrinsicsLib: remove duplicate functions " Gerd Hoffmann
2022-06-03 12:26 ` [PATCH v4 9/9] MdePkg/CompilerIntrinsicsLib: add new sources to CompilerIntrinsicsLib.inf Gerd Hoffmann
8 siblings, 0 replies; 14+ messages in thread
From: Gerd Hoffmann @ 2022-06-03 12:26 UTC (permalink / raw)
To: devel
Cc: Jian J Wang, Jiaxin Wu, Sean Brogan, Anthony Perard,
Leif Lindholm, Zhiguang Liu, Xiaoyu Lu, Pawel Polawski,
Sami Mujawar, Maciej Rabeda, Bob Feng, Jiewen Yao, Andrew Fish,
Bret Barkelew, Alexei Fedorov, Guo Dong, Gerd Hoffmann,
kilian_kegel, Maurice Ma, Siyuan Fu, Abner Chang, Zhichao Gao,
Wei6 Xu, Supreeth Venkatesh, Julien Grall, Daniel Schaefer,
Ard Biesheuvel, Guomin Jiang, Jordan Justen, Oliver Steffen,
Sebastien Boeuf, Benjamin You, Min Xu, Ray Ni, Rebecca Cran,
Nickle Wang, Michael D Kinney, Tom Lendacky, Sami Mujawar,
Peter Grehan, Erdem Aktas, Brijesh Singh, James Bottomley,
Yuwei Chen, Liming Gao
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Acked-by: Liming Gao <gaoliming@byosoft.com.cn>
---
.../Library/CompilerIntrinsicsLib/Ia32/Gcc.c | 22 -------------------
1 file changed, 22 deletions(-)
diff --git a/MdePkg/Library/CompilerIntrinsicsLib/Ia32/Gcc.c b/MdePkg/Library/CompilerIntrinsicsLib/Ia32/Gcc.c
index d0996d6276bc..3c47bef63c4d 100644
--- a/MdePkg/Library/CompilerIntrinsicsLib/Ia32/Gcc.c
+++ b/MdePkg/Library/CompilerIntrinsicsLib/Ia32/Gcc.c
@@ -28,7 +28,6 @@ __ashlsi3 (
int Count
)
{
- DEBUG ((DEBUG_INFO, "%a:\n", __func__));
return (int)LShiftU64 ((UINT64)Datum, (UINTN)Count);
}
@@ -38,7 +37,6 @@ __ashldi3 (
int Count
)
{
- DEBUG ((DEBUG_INFO, "%a:\n", __func__));
return (long)LShiftU64 ((UINT64)Datum, (UINTN)Count);
}
@@ -48,7 +46,6 @@ __ashlti3 (
int Count
)
{
- DEBUG ((DEBUG_INFO, "%a:\n", __func__));
return (long long)LShiftU64 ((UINT64)Datum, (UINTN)Count);
}
@@ -60,7 +57,6 @@ __ashrsi3 (
int Count
)
{
- DEBUG ((DEBUG_INFO, "%a:\n", __func__));
return (int)ARShiftU64 ((UINT64)Datum, (UINTN)Count);
}
@@ -70,7 +66,6 @@ __ashrdi3 (
int Count
)
{
- DEBUG ((DEBUG_INFO, "%a:\n", __func__));
return (long)ARShiftU64 ((UINT64)Datum, (UINTN)Count);
}
@@ -80,7 +75,6 @@ __ashrti3 (
int Count
)
{
- DEBUG ((DEBUG_INFO, "%a:\n", __func__));
return (long long)ARShiftU64 ((UINT64)Datum, (UINTN)Count);
}
@@ -92,7 +86,6 @@ __divsi3 (
int Divisor
)
{
- DEBUG ((DEBUG_INFO, "%a:\n", __func__));
return (int)DivS64x64Remainder ((INT64)Dividend, (INT64)Divisor, NULL);
}
@@ -105,7 +98,6 @@ __divdi3 (
INT64 Quotient;
Quotient = DivS64x64Remainder ((INT64)Dividend, (INT64)Divisor, NULL);
- DEBUG ((DEBUG_INFO, "%a: %Ld / %Ld = %Ld\n", __func__, Dividend, Divisor, Quotient));
return Quotient;
}
@@ -116,7 +108,6 @@ __divti3 (
long long Divisor
)
{
- DEBUG ((DEBUG_INFO, "%a:\n", __func__));
return (long long)DivS64x64Remainder ((INT64)Dividend, (INT64)Divisor, NULL);
}
@@ -128,7 +119,6 @@ __lshrsi3 (
int Count
)
{
- DEBUG ((DEBUG_INFO, "%a:\n", __func__));
return (int)RShiftU64 ((UINT64)Datum, (UINTN)Count);
}
@@ -138,7 +128,6 @@ __lshrdi3 (
int Count
)
{
- DEBUG ((DEBUG_INFO, "%a:\n", __func__));
return (long)RShiftU64 ((UINT64)Datum, (UINTN)Count);
}
@@ -148,7 +137,6 @@ __lshrti3 (
int Count
)
{
- DEBUG ((DEBUG_INFO, "%a:\n", __func__));
return (long long)RShiftU64 ((UINT64)Datum, (UINTN)Count);
}
@@ -163,7 +151,6 @@ __modsi3 (
INT64 Remainder;
(void)DivS64x64Remainder ((INT64)Dividend, (INT64)Divisor, &Remainder);
- DEBUG ((DEBUG_INFO, "modsi3: %d %% %d = %d\n", Dividend, Divisor, (int)Remainder));
return (int)Remainder;
}
@@ -177,7 +164,6 @@ __moddi3 (
INT64 Remainder;
(void)DivS64x64Remainder ((INT64)Dividend, (INT64)Divisor, &Remainder);
- DEBUG ((DEBUG_INFO, "moddi3: %Ld %% %Ld = %Ld\n", (INT64)Dividend, (INT64)Divisor, Remainder));
return Remainder;
}
@@ -191,7 +177,6 @@ __modti3 (
INT64 Remainder;
(void)DivS64x64Remainder ((INT64)Dividend, (INT64)Divisor, &Remainder);
- DEBUG ((DEBUG_INFO, "modti3: %Ld %% %Ld = %Ld\n", (INT64)Dividend, (INT64)Divisor, Remainder));
return (long long)Remainder;
}
@@ -204,7 +189,6 @@ __multi3 (
long long Multiplier
)
{
- DEBUG ((DEBUG_INFO, "%a:\n", __func__));
return (long long)MultS64x64 ((INT64)Multiplicand, (INT64)Multiplier);
}
@@ -216,7 +200,6 @@ __udivsi3 (
unsigned int Divisor
)
{
- DEBUG ((DEBUG_INFO, "%a:\n", __func__));
return (int)DivU64x64Remainder ((UINT64)Dividend, (UINT64)Divisor, NULL);
}
@@ -226,7 +209,6 @@ __udivdi3 (
unsigned long Divisor
)
{
- DEBUG ((DEBUG_INFO, "%a:\n", __func__));
return (long)DivU64x64Remainder ((UINT64)Dividend, (UINT64)Divisor, NULL);
}
@@ -236,7 +218,6 @@ __udivti3 (
unsigned long long Divisor
)
{
- DEBUG ((DEBUG_INFO, "%a:\n", __func__));
return (long long)DivU64x64Remainder ((UINT64)Dividend, (UINT64)Divisor, NULL);
}
@@ -249,7 +230,6 @@ __umodsi3 (
{
UINT64 Remainder;
- DEBUG ((DEBUG_INFO, "%a:\n", __func__));
(void)DivU64x64Remainder ((UINT64)Dividend, (UINT64)Divisor, &Remainder);
return (unsigned int)Remainder;
@@ -263,7 +243,6 @@ __umoddi3 (
{
UINT64 Remainder;
- DEBUG ((DEBUG_INFO, "%a:\n", __func__));
(void)DivU64x64Remainder ((UINT64)Dividend, (UINT64)Divisor, &Remainder);
return (unsigned long)Remainder;
@@ -277,7 +256,6 @@ __umodti3 (
{
UINT64 Remainder;
- DEBUG ((DEBUG_INFO, "%a:\n", __func__));
(void)DivU64x64Remainder ((UINT64)Dividend, (UINT64)Divisor, &Remainder);
return (unsigned long long)Remainder;
--
2.36.1
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [PATCH v4 8/9] MdePkg/CompilerIntrinsicsLib: remove duplicate functions from Gcc.c
2022-06-03 12:26 [PATCH v4 0/9] consolidate compiler intrinsics Gerd Hoffmann
` (6 preceding siblings ...)
2022-06-03 12:26 ` [PATCH v4 7/9] MdePkg/CompilerIntrinsicsLib: drop debug logging " Gerd Hoffmann
@ 2022-06-03 12:26 ` Gerd Hoffmann
2022-06-03 12:26 ` [PATCH v4 9/9] MdePkg/CompilerIntrinsicsLib: add new sources to CompilerIntrinsicsLib.inf Gerd Hoffmann
8 siblings, 0 replies; 14+ messages in thread
From: Gerd Hoffmann @ 2022-06-03 12:26 UTC (permalink / raw)
To: devel
Cc: Jian J Wang, Jiaxin Wu, Sean Brogan, Anthony Perard,
Leif Lindholm, Zhiguang Liu, Xiaoyu Lu, Pawel Polawski,
Sami Mujawar, Maciej Rabeda, Bob Feng, Jiewen Yao, Andrew Fish,
Bret Barkelew, Alexei Fedorov, Guo Dong, Gerd Hoffmann,
kilian_kegel, Maurice Ma, Siyuan Fu, Abner Chang, Zhichao Gao,
Wei6 Xu, Supreeth Venkatesh, Julien Grall, Daniel Schaefer,
Ard Biesheuvel, Guomin Jiang, Jordan Justen, Oliver Steffen,
Sebastien Boeuf, Benjamin You, Min Xu, Ray Ni, Rebecca Cran,
Nickle Wang, Michael D Kinney, Tom Lendacky, Sami Mujawar,
Peter Grehan, Erdem Aktas, Brijesh Singh, James Bottomley,
Yuwei Chen, Liming Gao
Implementations for those functions already exist,
so remove them to avoid duplicate symbols.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Acked-by: Liming Gao <gaoliming@byosoft.com.cn>
---
.../Library/CompilerIntrinsicsLib/Ia32/Gcc.c | 47 -------------------
1 file changed, 47 deletions(-)
diff --git a/MdePkg/Library/CompilerIntrinsicsLib/Ia32/Gcc.c b/MdePkg/Library/CompilerIntrinsicsLib/Ia32/Gcc.c
index 3c47bef63c4d..7502d5afe65a 100644
--- a/MdePkg/Library/CompilerIntrinsicsLib/Ia32/Gcc.c
+++ b/MdePkg/Library/CompilerIntrinsicsLib/Ia32/Gcc.c
@@ -20,55 +20,8 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
#include <Library/BaseLib.h>
-// Shift Datum left by Count bits.
-// ===========================================================================
-int
-__ashlsi3 (
- int Datum,
- int Count
- )
-{
- return (int)LShiftU64 ((UINT64)Datum, (UINTN)Count);
-}
-
-long
-__ashldi3 (
- long Datum,
- int Count
- )
-{
- return (long)LShiftU64 ((UINT64)Datum, (UINTN)Count);
-}
-
-long long
-__ashlti3 (
- long long Datum,
- int Count
- )
-{
- return (long long)LShiftU64 ((UINT64)Datum, (UINTN)Count);
-}
-
// Arithmetically shift Datum right by Count bits.
// ===========================================================================
-int
-__ashrsi3 (
- int Datum,
- int Count
- )
-{
- return (int)ARShiftU64 ((UINT64)Datum, (UINTN)Count);
-}
-
-long
-__ashrdi3 (
- long Datum,
- int Count
- )
-{
- return (long)ARShiftU64 ((UINT64)Datum, (UINTN)Count);
-}
-
long long
__ashrti3 (
long long Datum,
--
2.36.1
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [PATCH v4 9/9] MdePkg/CompilerIntrinsicsLib: add new sources to CompilerIntrinsicsLib.inf
2022-06-03 12:26 [PATCH v4 0/9] consolidate compiler intrinsics Gerd Hoffmann
` (7 preceding siblings ...)
2022-06-03 12:26 ` [PATCH v4 8/9] MdePkg/CompilerIntrinsicsLib: remove duplicate functions " Gerd Hoffmann
@ 2022-06-03 12:26 ` Gerd Hoffmann
8 siblings, 0 replies; 14+ messages in thread
From: Gerd Hoffmann @ 2022-06-03 12:26 UTC (permalink / raw)
To: devel
Cc: Jian J Wang, Jiaxin Wu, Sean Brogan, Anthony Perard,
Leif Lindholm, Zhiguang Liu, Xiaoyu Lu, Pawel Polawski,
Sami Mujawar, Maciej Rabeda, Bob Feng, Jiewen Yao, Andrew Fish,
Bret Barkelew, Alexei Fedorov, Guo Dong, Gerd Hoffmann,
kilian_kegel, Maurice Ma, Siyuan Fu, Abner Chang, Zhichao Gao,
Wei6 Xu, Supreeth Venkatesh, Julien Grall, Daniel Schaefer,
Ard Biesheuvel, Guomin Jiang, Jordan Justen, Oliver Steffen,
Sebastien Boeuf, Benjamin You, Min Xu, Ray Ni, Rebecca Cran,
Nickle Wang, Michael D Kinney, Tom Lendacky, Sami Mujawar,
Peter Grehan, Erdem Aktas, Brijesh Singh, James Bottomley,
Yuwei Chen, Liming Gao
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Acked-by: Liming Gao <gaoliming@byosoft.com.cn>
---
.../CompilerIntrinsicsLib.inf | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
diff --git a/MdePkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf b/MdePkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf
index 7267d0e3154d..061dd40e6505 100644
--- a/MdePkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf
+++ b/MdePkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf
@@ -83,6 +83,22 @@ [Sources.IA32]
Ia32/MathLShiftS64.nasm | GCC
Ia32/MathRShiftU64.nasm | GCC
+ Ia32/ulldiv.c | MSFT # __aulldiv
+ Ia32/ullrem.c | MSFT # __aullrem
+ Ia32/lldiv.c | MSFT # __alldiv
+ Ia32/llrem.c | MSFT # __allrem
+ Ia32/lldvrm.c | MSFT # __alldvrm
+ Ia32/ulldvrm.c | MSFT # __aulldvrm
+
+ Ia32/ulldiv.c | INTEL
+ Ia32/ullrem.c | INTEL
+ Ia32/lldiv.c | INTEL
+ Ia32/llrem.c | INTEL
+ Ia32/lldvrm.c | INTEL
+ Ia32/ulldvrm.c | INTEL
+
+ Ia32/Gcc.c | GCC
+
[Packages]
MdePkg/MdePkg.dec
--
2.36.1
^ permalink raw reply related [flat|nested] 14+ messages in thread
* Re: [PATCH v4 4/9] MdePkg/CompilerIntrinsicsLib: move ia32 intrinsics and strcmp
2022-06-03 12:26 ` [PATCH v4 4/9] MdePkg/CompilerIntrinsicsLib: move ia32 intrinsics and strcmp Gerd Hoffmann
@ 2022-06-09 3:57 ` Ni, Ray
2022-06-09 6:33 ` Gerd Hoffmann
0 siblings, 1 reply; 14+ messages in thread
From: Ni, Ray @ 2022-06-09 3:57 UTC (permalink / raw)
To: Gerd Hoffmann, devel@edk2.groups.io
Cc: Wang, Jian J, Wu, Jiaxin, Sean Brogan, Anthony Perard,
Leif Lindholm, Liu, Zhiguang, Lu, Xiaoyu1, Pawel Polawski,
Sami Mujawar, Maciej Rabeda, Feng, Bob C, Yao, Jiewen,
Andrew Fish, Bret Barkelew, Alexei Fedorov, Dong, Guo,
kilian_kegel@hotmail.com, Maurice Ma, Siyuan Fu, Chang, Abner,
Gao, Zhichao, Xu, Wei6, Supreeth Venkatesh, Julien Grall,
Schaefer, Daniel, Ard Biesheuvel, Jiang, Guomin, Justen, Jordan L,
Oliver Steffen, Boeuf, Sebastien, You, Benjamin, Xu, Min M,
Rebecca Cran, Wang, Nickle, Kinney, Michael D, Tom Lendacky,
Sami Mujawar, Peter Grehan, Aktas, Erdem, Brijesh Singh,
James Bottomley, Chen, Christine, Gao, Liming, Yao, Jiewen,
Ard Biesheuvel
Gerd,
I am interested in this patch sets. But I have some trouble to get all the patches. Do you have a branch that contains all the changes?
Thanks,
Ray
> -----Original Message-----
> From: Gerd Hoffmann <kraxel@redhat.com>
> Sent: Friday, June 3, 2022 8:27 PM
> To: devel@edk2.groups.io
> Cc: Wang, Jian J <jian.j.wang@intel.com>; Wu, Jiaxin <jiaxin.wu@intel.com>; Sean Brogan <sean.brogan@microsoft.com>;
> Anthony Perard <anthony.perard@citrix.com>; Leif Lindholm <quic_llindhol@quicinc.com>; Liu, Zhiguang
> <zhiguang.liu@intel.com>; Lu, Xiaoyu1 <xiaoyu1.lu@intel.com>; Pawel Polawski <ppolawsk@redhat.com>; Sami Mujawar
> <sami.mujawar@arm.com>; Maciej Rabeda <maciej.rabeda@linux.intel.com>; Feng, Bob C <bob.c.feng@intel.com>; Yao,
> Jiewen <jiewen.yao@intel.com>; Andrew Fish <afish@apple.com>; Bret Barkelew <Bret.Barkelew@microsoft.com>; Alexei
> Fedorov <Alexei.Fedorov@arm.com>; Dong, Guo <guo.dong@intel.com>; Gerd Hoffmann <kraxel@redhat.com>;
> kilian_kegel@hotmail.com; Maurice Ma <maurice.ma@intel.com>; Siyuan Fu <siyuan.fu@intel.com>; Chang, Abner
> <abner.chang@hpe.com>; Gao, Zhichao <zhichao.gao@intel.com>; Xu, Wei6 <wei6.xu@intel.com>; Supreeth Venkatesh
> <supreeth.venkatesh@arm.com>; Julien Grall <julien@xen.org>; Schaefer, Daniel <daniel.schaefer@hpe.com>; Ard Biesheuvel
> <ardb+tianocore@kernel.org>; Jiang, Guomin <guomin.jiang@intel.com>; Justen, Jordan L <jordan.l.justen@intel.com>; Oliver
> Steffen <osteffen@redhat.com>; Boeuf, Sebastien <sebastien.boeuf@intel.com>; You, Benjamin <benjamin.you@intel.com>;
> Xu, Min M <min.m.xu@intel.com>; Ni, Ray <ray.ni@intel.com>; Rebecca Cran <rebecca@bsdio.com>; Wang, Nickle
> <nickle.wang@hpe.com>; Kinney, Michael D <michael.d.kinney@intel.com>; Tom Lendacky <thomas.lendacky@amd.com>;
> Sami Mujawar <Sami.Mujawar@arm.com>; Peter Grehan <grehan@freebsd.org>; Aktas, Erdem <erdemaktas@google.com>;
> Brijesh Singh <brijesh.singh@amd.com>; James Bottomley <jejb@linux.ibm.com>; Chen, Christine <yuwei.chen@intel.com>;
> Gao, Liming <gaoliming@byosoft.com.cn>; Yao, Jiewen <jiewen.yao@intel.com>; Ard Biesheuvel <ardb@kernel.org>
> Subject: [PATCH v4 4/9] MdePkg/CompilerIntrinsicsLib: move ia32 intrinsics and strcmp
>
> Move intrinsics for ia32 from CryptoPkg/Library/IntrinsicLib
> to MdePkg/Library/CompilerIntrinsicsLib. Also move strcmp.
>
> Remove CryptoPkg/Library/IntrinsicLib.
> Use MdePkg/Library/CompilerIntrinsicsLib instead.
> Update all references.
>
> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
> Acked-by: Jiewen Yao <Jiewen.yao@intel.com>
> Acked-by: Ard Biesheuvel <ardb@kernel.org>
> Acked-by: Liming Gao <gaoliming@byosoft.com.cn>
> ---
> ArmVirtPkg/ArmVirt.dsc.inc | 2 +-
> CryptoPkg/CryptoPkg.dsc | 3 +-
> EmulatorPkg/EmulatorPkg.dsc | 2 +-
> FmpDevicePkg/FmpDevicePkg.dsc | 2 +-
> NetworkPkg/NetworkPkg.dsc | 2 +-
> OvmfPkg/AmdSev/AmdSevX64.dsc | 2 +-
> OvmfPkg/Bhyve/BhyveX64.dsc | 2 +-
> OvmfPkg/CloudHv/CloudHvX64.dsc | 2 +-
> OvmfPkg/IntelTdx/IntelTdxX64.dsc | 2 +-
> OvmfPkg/Microvm/MicrovmX64.dsc | 2 +-
> OvmfPkg/OvmfPkgIa32.dsc | 2 +-
> OvmfPkg/OvmfPkgIa32X64.dsc | 2 +-
> OvmfPkg/OvmfPkgX64.dsc | 2 +-
> OvmfPkg/OvmfXen.dsc | 2 +-
> SecurityPkg/SecurityPkg.dsc | 10 +--
> SignedCapsulePkg/SignedCapsulePkg.dsc | 12 +--
> UefiPayloadPkg/UefiPayloadPkg.dsc | 2 +-
> .../Library/IntrinsicLib/IntrinsicLib.inf | 69 -----------------
> .../CompilerIntrinsicsLib.inf | 16 ++++
> CryptoPkg/Library/IntrinsicLib/CopyMem.c | 47 ------------
> .../Library/IntrinsicLib/MemoryIntrinsics.c | 74 -------------------
> .../CompilerIntrinsicsLib}/Ia32/MathFtol.c | 0
> .../Ia32/MathLShiftS64.c | 0
> .../Ia32/MathRShiftU64.c | 0
> MdePkg/Library/CompilerIntrinsicsLib/strcmp.c | 33 +++++++++
> .../Library/IntrinsicLib/BaseIntrinsicLib.uni | 16 ----
> .../Ia32/MathLShiftS64.nasm | 0
> .../CompilerIntrinsicsLib}/Ia32/MathLlmul.asm | 0
> .../CompilerIntrinsicsLib}/Ia32/MathLlshr.asm | 0
> .../Ia32/MathRShiftU64.nasm | 0
> 30 files changed, 75 insertions(+), 233 deletions(-)
> delete mode 100644 CryptoPkg/Library/IntrinsicLib/IntrinsicLib.inf
> delete mode 100644 CryptoPkg/Library/IntrinsicLib/CopyMem.c
> delete mode 100644 CryptoPkg/Library/IntrinsicLib/MemoryIntrinsics.c
> rename {CryptoPkg/Library/IntrinsicLib => MdePkg/Library/CompilerIntrinsicsLib}/Ia32/MathFtol.c (100%)
> rename {CryptoPkg/Library/IntrinsicLib => MdePkg/Library/CompilerIntrinsicsLib}/Ia32/MathLShiftS64.c (100%)
> rename {CryptoPkg/Library/IntrinsicLib => MdePkg/Library/CompilerIntrinsicsLib}/Ia32/MathRShiftU64.c (100%)
> create mode 100644 MdePkg/Library/CompilerIntrinsicsLib/strcmp.c
> delete mode 100644 CryptoPkg/Library/IntrinsicLib/BaseIntrinsicLib.uni
> rename {CryptoPkg/Library/IntrinsicLib => MdePkg/Library/CompilerIntrinsicsLib}/Ia32/MathLShiftS64.nasm (100%)
> rename {CryptoPkg/Library/IntrinsicLib => MdePkg/Library/CompilerIntrinsicsLib}/Ia32/MathLlmul.asm (100%)
> rename {CryptoPkg/Library/IntrinsicLib => MdePkg/Library/CompilerIntrinsicsLib}/Ia32/MathLlshr.asm (100%)
> rename {CryptoPkg/Library/IntrinsicLib => MdePkg/Library/CompilerIntrinsicsLib}/Ia32/MathRShiftU64.nasm (100%)
>
> diff --git a/ArmVirtPkg/ArmVirt.dsc.inc b/ArmVirtPkg/ArmVirt.dsc.inc
> index 4b5687927ae8..cc960cf103d2 100644
> --- a/ArmVirtPkg/ArmVirt.dsc.inc
> +++ b/ArmVirtPkg/ArmVirt.dsc.inc
> @@ -153,7 +153,7 @@ [LibraryClasses.common]
> #
> # CryptoPkg libraries needed by multiple firmware features
> #
> - IntrinsicLib|CryptoPkg/Library/IntrinsicLib/IntrinsicLib.inf
> + IntrinsicLib|MdePkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf
> !if $(NETWORK_TLS_ENABLE) == TRUE
> OpensslLib|CryptoPkg/Library/OpensslLib/OpensslLib.inf
> !else
> diff --git a/CryptoPkg/CryptoPkg.dsc b/CryptoPkg/CryptoPkg.dsc
> index 71679687a8b1..4db8de2e5de8 100644
> --- a/CryptoPkg/CryptoPkg.dsc
> +++ b/CryptoPkg/CryptoPkg.dsc
> @@ -103,7 +103,7 @@ [LibraryClasses]
> UefiRuntimeServicesTableLib|MdePkg/Library/UefiRuntimeServicesTableLib/UefiRuntimeServicesTableLib.inf #???
> IoLib|MdePkg/Library/BaseIoLibIntrinsic/BaseIoLibIntrinsic.inf #???
> OpensslLib|CryptoPkg/Library/OpensslLib/OpensslLib.inf
> - IntrinsicLib|CryptoPkg/Library/IntrinsicLib/IntrinsicLib.inf
> + IntrinsicLib|MdePkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf
> SafeIntLib|MdePkg/Library/BaseSafeIntLib/BaseSafeIntLib.inf
>
> [LibraryClasses.ARM]
> @@ -240,7 +240,6 @@ [Components]
> CryptoPkg/Library/BaseCryptLib/SmmCryptLib.inf
> CryptoPkg/Library/BaseCryptLib/RuntimeCryptLib.inf
> CryptoPkg/Library/BaseCryptLibNull/BaseCryptLibNull.inf
> - CryptoPkg/Library/IntrinsicLib/IntrinsicLib.inf
> CryptoPkg/Library/TlsLib/TlsLib.inf
> CryptoPkg/Library/TlsLibNull/TlsLibNull.inf
> CryptoPkg/Library/OpensslLib/OpensslLib.inf
> diff --git a/EmulatorPkg/EmulatorPkg.dsc b/EmulatorPkg/EmulatorPkg.dsc
> index 4cf886b9eac7..e460e925a988 100644
> --- a/EmulatorPkg/EmulatorPkg.dsc
> +++ b/EmulatorPkg/EmulatorPkg.dsc
> @@ -129,7 +129,7 @@ [LibraryClasses]
>
> !if $(SECURE_BOOT_ENABLE) == TRUE
> RngLib|MdePkg/Library/BaseRngLibTimerLib/BaseRngLibTimerLib.inf
> - IntrinsicLib|CryptoPkg/Library/IntrinsicLib/IntrinsicLib.inf
> + IntrinsicLib|MdePkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf
> OpensslLib|CryptoPkg/Library/OpensslLib/OpensslLibCrypto.inf
> PlatformSecureLib|SecurityPkg/Library/PlatformSecureLibNull/PlatformSecureLibNull.inf
> AuthVariableLib|SecurityPkg/Library/AuthVariableLib/AuthVariableLib.inf
> diff --git a/FmpDevicePkg/FmpDevicePkg.dsc b/FmpDevicePkg/FmpDevicePkg.dsc
> index 258b5ce0cded..f314548d4066 100644
> --- a/FmpDevicePkg/FmpDevicePkg.dsc
> +++ b/FmpDevicePkg/FmpDevicePkg.dsc
> @@ -57,7 +57,7 @@ [LibraryClasses]
> !ifdef CONTINUOUS_INTEGRATION
> BaseCryptLib|CryptoPkg/Library/BaseCryptLibNull/BaseCryptLibNull.inf
> !else
> - IntrinsicLib|CryptoPkg/Library/IntrinsicLib/IntrinsicLib.inf
> + IntrinsicLib|MdePkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf
> OpensslLib|CryptoPkg/Library/OpensslLib/OpensslLib.inf
> BaseCryptLib|CryptoPkg/Library/BaseCryptLib/BaseCryptLib.inf
> RngLib|MdePkg/Library/BaseRngLibNull/BaseRngLibNull.inf
> diff --git a/NetworkPkg/NetworkPkg.dsc b/NetworkPkg/NetworkPkg.dsc
> index f69eb3d1d5c2..95dedad392fb 100644
> --- a/NetworkPkg/NetworkPkg.dsc
> +++ b/NetworkPkg/NetworkPkg.dsc
> @@ -53,7 +53,7 @@ [LibraryClasses]
> !else
> BaseCryptLib|CryptoPkg/Library/BaseCryptLib/BaseCryptLib.inf
> OpensslLib|CryptoPkg/Library/OpensslLib/OpensslLib.inf
> - IntrinsicLib|CryptoPkg/Library/IntrinsicLib/IntrinsicLib.inf
> + IntrinsicLib|MdePkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf
> TlsLib|CryptoPkg/Library/TlsLib/TlsLib.inf
> !endif
> DebugPrintErrorLevelLib|MdePkg/Library/BaseDebugPrintErrorLevelLib/BaseDebugPrintErrorLevelLib.inf
> diff --git a/OvmfPkg/AmdSev/AmdSevX64.dsc b/OvmfPkg/AmdSev/AmdSevX64.dsc
> index fc1fdb2e2297..c0bcc14c6ee6 100644
> --- a/OvmfPkg/AmdSev/AmdSevX64.dsc
> +++ b/OvmfPkg/AmdSev/AmdSevX64.dsc
> @@ -188,7 +188,7 @@ [LibraryClasses]
> LocalApicLib|UefiCpuPkg/Library/BaseXApicX2ApicLib/BaseXApicX2ApicLib.inf
> DebugPrintErrorLevelLib|MdePkg/Library/BaseDebugPrintErrorLevelLib/BaseDebugPrintErrorLevelLib.inf
>
> - IntrinsicLib|CryptoPkg/Library/IntrinsicLib/IntrinsicLib.inf
> + IntrinsicLib|MdePkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf
> OpensslLib|CryptoPkg/Library/OpensslLib/OpensslLibCrypto.inf
> RngLib|MdePkg/Library/BaseRngLibTimerLib/BaseRngLibTimerLib.inf
>
> diff --git a/OvmfPkg/Bhyve/BhyveX64.dsc b/OvmfPkg/Bhyve/BhyveX64.dsc
> index f0166e136cd1..e7b38222ebd6 100644
> --- a/OvmfPkg/Bhyve/BhyveX64.dsc
> +++ b/OvmfPkg/Bhyve/BhyveX64.dsc
> @@ -187,7 +187,7 @@ [LibraryClasses]
> IoApicLib|PcAtChipsetPkg/Library/BaseIoApicLib/BaseIoApicLib.inf
> DebugPrintErrorLevelLib|MdePkg/Library/BaseDebugPrintErrorLevelLib/BaseDebugPrintErrorLevelLib.inf
>
> - IntrinsicLib|CryptoPkg/Library/IntrinsicLib/IntrinsicLib.inf
> + IntrinsicLib|MdePkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf
> !if $(NETWORK_TLS_ENABLE) == TRUE
> OpensslLib|CryptoPkg/Library/OpensslLib/OpensslLib.inf
> !else
> diff --git a/OvmfPkg/CloudHv/CloudHvX64.dsc b/OvmfPkg/CloudHv/CloudHvX64.dsc
> index 92664f319be2..f1d1a1e946b2 100644
> --- a/OvmfPkg/CloudHv/CloudHvX64.dsc
> +++ b/OvmfPkg/CloudHv/CloudHvX64.dsc
> @@ -198,7 +198,7 @@ [LibraryClasses]
> LocalApicLib|UefiCpuPkg/Library/BaseXApicX2ApicLib/BaseXApicX2ApicLib.inf
> DebugPrintErrorLevelLib|MdePkg/Library/BaseDebugPrintErrorLevelLib/BaseDebugPrintErrorLevelLib.inf
>
> - IntrinsicLib|CryptoPkg/Library/IntrinsicLib/IntrinsicLib.inf
> + IntrinsicLib|MdePkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf
> !if $(NETWORK_TLS_ENABLE) == TRUE
> OpensslLib|CryptoPkg/Library/OpensslLib/OpensslLib.inf
> !else
> diff --git a/OvmfPkg/IntelTdx/IntelTdxX64.dsc b/OvmfPkg/IntelTdx/IntelTdxX64.dsc
> index dd8d446f4a56..daeb7cb27cbe 100644
> --- a/OvmfPkg/IntelTdx/IntelTdxX64.dsc
> +++ b/OvmfPkg/IntelTdx/IntelTdxX64.dsc
> @@ -175,7 +175,7 @@ [LibraryClasses]
> LocalApicLib|UefiCpuPkg/Library/BaseXApicX2ApicLib/BaseXApicX2ApicLib.inf
> DebugPrintErrorLevelLib|MdePkg/Library/BaseDebugPrintErrorLevelLib/BaseDebugPrintErrorLevelLib.inf
>
> - IntrinsicLib|CryptoPkg/Library/IntrinsicLib/IntrinsicLib.inf
> + IntrinsicLib|MdePkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf
> OpensslLib|CryptoPkg/Library/OpensslLib/OpensslLibCrypto.inf
> RngLib|MdePkg/Library/BaseRngLibTimerLib/BaseRngLibTimerLib.inf
>
> diff --git a/OvmfPkg/Microvm/MicrovmX64.dsc b/OvmfPkg/Microvm/MicrovmX64.dsc
> index f8fc977cb205..edaec5995f0e 100644
> --- a/OvmfPkg/Microvm/MicrovmX64.dsc
> +++ b/OvmfPkg/Microvm/MicrovmX64.dsc
> @@ -195,7 +195,7 @@ [LibraryClasses]
> LocalApicLib|UefiCpuPkg/Library/BaseXApicX2ApicLib/BaseXApicX2ApicLib.inf
> DebugPrintErrorLevelLib|MdePkg/Library/BaseDebugPrintErrorLevelLib/BaseDebugPrintErrorLevelLib.inf
>
> - IntrinsicLib|CryptoPkg/Library/IntrinsicLib/IntrinsicLib.inf
> + IntrinsicLib|MdePkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf
> !if $(NETWORK_TLS_ENABLE) == TRUE
> OpensslLib|CryptoPkg/Library/OpensslLib/OpensslLib.inf
> !else
> diff --git a/OvmfPkg/OvmfPkgIa32.dsc b/OvmfPkg/OvmfPkgIa32.dsc
> index a9841cbfc3ca..0abcbf2c2143 100644
> --- a/OvmfPkg/OvmfPkgIa32.dsc
> +++ b/OvmfPkg/OvmfPkgIa32.dsc
> @@ -195,7 +195,7 @@ [LibraryClasses]
> LocalApicLib|UefiCpuPkg/Library/BaseXApicX2ApicLib/BaseXApicX2ApicLib.inf
> DebugPrintErrorLevelLib|MdePkg/Library/BaseDebugPrintErrorLevelLib/BaseDebugPrintErrorLevelLib.inf
>
> - IntrinsicLib|CryptoPkg/Library/IntrinsicLib/IntrinsicLib.inf
> + IntrinsicLib|MdePkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf
> !if $(NETWORK_TLS_ENABLE) == TRUE
> OpensslLib|CryptoPkg/Library/OpensslLib/OpensslLib.inf
> !else
> diff --git a/OvmfPkg/OvmfPkgIa32X64.dsc b/OvmfPkg/OvmfPkgIa32X64.dsc
> index f7949780fa38..8c072eac5d4c 100644
> --- a/OvmfPkg/OvmfPkgIa32X64.dsc
> +++ b/OvmfPkg/OvmfPkgIa32X64.dsc
> @@ -199,7 +199,7 @@ [LibraryClasses]
> LocalApicLib|UefiCpuPkg/Library/BaseXApicX2ApicLib/BaseXApicX2ApicLib.inf
> DebugPrintErrorLevelLib|MdePkg/Library/BaseDebugPrintErrorLevelLib/BaseDebugPrintErrorLevelLib.inf
>
> - IntrinsicLib|CryptoPkg/Library/IntrinsicLib/IntrinsicLib.inf
> + IntrinsicLib|MdePkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf
> !if $(NETWORK_TLS_ENABLE) == TRUE
> OpensslLib|CryptoPkg/Library/OpensslLib/OpensslLib.inf
> !else
> diff --git a/OvmfPkg/OvmfPkgX64.dsc b/OvmfPkg/OvmfPkgX64.dsc
> index 1448f925b782..212bdab722d5 100644
> --- a/OvmfPkg/OvmfPkgX64.dsc
> +++ b/OvmfPkg/OvmfPkgX64.dsc
> @@ -215,7 +215,7 @@ [LibraryClasses]
> LocalApicLib|UefiCpuPkg/Library/BaseXApicX2ApicLib/BaseXApicX2ApicLib.inf
> DebugPrintErrorLevelLib|MdePkg/Library/BaseDebugPrintErrorLevelLib/BaseDebugPrintErrorLevelLib.inf
>
> - IntrinsicLib|CryptoPkg/Library/IntrinsicLib/IntrinsicLib.inf
> + IntrinsicLib|MdePkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf
> !if $(NETWORK_TLS_ENABLE) == TRUE
> OpensslLib|CryptoPkg/Library/OpensslLib/OpensslLib.inf
> !else
> diff --git a/OvmfPkg/OvmfXen.dsc b/OvmfPkg/OvmfXen.dsc
> index 6ba4bd729ae7..ad88ede14b26 100644
> --- a/OvmfPkg/OvmfXen.dsc
> +++ b/OvmfPkg/OvmfXen.dsc
> @@ -184,7 +184,7 @@ [LibraryClasses]
> LocalApicLib|UefiCpuPkg/Library/BaseXApicX2ApicLib/BaseXApicX2ApicLib.inf
> DebugPrintErrorLevelLib|MdePkg/Library/BaseDebugPrintErrorLevelLib/BaseDebugPrintErrorLevelLib.inf
>
> - IntrinsicLib|CryptoPkg/Library/IntrinsicLib/IntrinsicLib.inf
> + IntrinsicLib|MdePkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf
> !if $(NETWORK_TLS_ENABLE) == TRUE
> OpensslLib|CryptoPkg/Library/OpensslLib/OpensslLib.inf
> !else
> diff --git a/SecurityPkg/SecurityPkg.dsc b/SecurityPkg/SecurityPkg.dsc
> index 2b5ef67016b8..b71b78f56ca5 100644
> --- a/SecurityPkg/SecurityPkg.dsc
> +++ b/SecurityPkg/SecurityPkg.dsc
> @@ -101,7 +101,7 @@ [LibraryClasses.common.PEIM]
> !ifdef CONTINUOUS_INTEGRATION
> BaseCryptLib|CryptoPkg/Library/BaseCryptLibNull/BaseCryptLibNull.inf
> !else
> - IntrinsicLib|CryptoPkg/Library/IntrinsicLib/IntrinsicLib.inf
> + IntrinsicLib|MdePkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf
> OpensslLib|CryptoPkg/Library/OpensslLib/OpensslLib.inf
> BaseCryptLib|CryptoPkg/Library/BaseCryptLib/PeiCryptLib.inf
> !endif
> @@ -119,7 +119,7 @@ [LibraryClasses.common.DXE_DRIVER]
> !ifdef CONTINUOUS_INTEGRATION
> BaseCryptLib|CryptoPkg/Library/BaseCryptLibNull/BaseCryptLibNull.inf
> !else
> - IntrinsicLib|CryptoPkg/Library/IntrinsicLib/IntrinsicLib.inf
> + IntrinsicLib|MdePkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf
> OpensslLib|CryptoPkg/Library/OpensslLib/OpensslLib.inf
> BaseCryptLib|CryptoPkg/Library/BaseCryptLib/BaseCryptLib.inf
> !endif
> @@ -140,7 +140,7 @@ [LibraryClasses.common.DXE_RUNTIME_DRIVER]
> !ifdef CONTINUOUS_INTEGRATION
> BaseCryptLib|CryptoPkg/Library/BaseCryptLibNull/BaseCryptLibNull.inf
> !else
> - IntrinsicLib|CryptoPkg/Library/IntrinsicLib/IntrinsicLib.inf
> + IntrinsicLib|MdePkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf
> OpensslLib|CryptoPkg/Library/OpensslLib/OpensslLib.inf
> BaseCryptLib|CryptoPkg/Library/BaseCryptLib/RuntimeCryptLib.inf
> !endif
> @@ -152,7 +152,7 @@ [LibraryClasses.common.UEFI_DRIVER, LibraryClasses.common.UEFI_APPLICATION]
> !ifdef CONTINUOUS_INTEGRATION
> BaseCryptLib|CryptoPkg/Library/BaseCryptLibNull/BaseCryptLibNull.inf
> !else
> - IntrinsicLib|CryptoPkg/Library/IntrinsicLib/IntrinsicLib.inf
> + IntrinsicLib|MdePkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf
> OpensslLib|CryptoPkg/Library/OpensslLib/OpensslLib.inf
> BaseCryptLib|CryptoPkg/Library/BaseCryptLib/BaseCryptLib.inf
> !endif
> @@ -171,7 +171,7 @@ [LibraryClasses.common.DXE_SMM_DRIVER]
> !ifdef CONTINUOUS_INTEGRATION
> BaseCryptLib|CryptoPkg/Library/BaseCryptLibNull/BaseCryptLibNull.inf
> !else
> - IntrinsicLib|CryptoPkg/Library/IntrinsicLib/IntrinsicLib.inf
> + IntrinsicLib|MdePkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf
> OpensslLib|CryptoPkg/Library/OpensslLib/OpensslLib.inf
> BaseCryptLib|CryptoPkg/Library/BaseCryptLib/SmmCryptLib.inf
> !endif
> diff --git a/SignedCapsulePkg/SignedCapsulePkg.dsc b/SignedCapsulePkg/SignedCapsulePkg.dsc
> index 72b533cd04e8..213e165be5d0 100644
> --- a/SignedCapsulePkg/SignedCapsulePkg.dsc
> +++ b/SignedCapsulePkg/SignedCapsulePkg.dsc
> @@ -126,7 +126,7 @@ [LibraryClasses.common.PEIM]
> !ifdef CONTINUOUS_INTEGRATION
> BaseCryptLib|CryptoPkg/Library/BaseCryptLibNull/BaseCryptLibNull.inf
> !else
> - IntrinsicLib|CryptoPkg/Library/IntrinsicLib/IntrinsicLib.inf
> + IntrinsicLib|MdePkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf
> OpensslLib|CryptoPkg/Library/OpensslLib/OpensslLib.inf
> BaseCryptLib|CryptoPkg/Library/BaseCryptLib/PeiCryptLib.inf
> !endif
> @@ -141,7 +141,7 @@ [LibraryClasses.common.DXE_DRIVER]
> !ifdef CONTINUOUS_INTEGRATION
> BaseCryptLib|CryptoPkg/Library/BaseCryptLibNull/BaseCryptLibNull.inf
> !else
> - IntrinsicLib|CryptoPkg/Library/IntrinsicLib/IntrinsicLib.inf
> + IntrinsicLib|MdePkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf
> OpensslLib|CryptoPkg/Library/OpensslLib/OpensslLib.inf
> BaseCryptLib|CryptoPkg/Library/BaseCryptLib/BaseCryptLib.inf
> !endif
> @@ -155,7 +155,7 @@ [LibraryClasses.common.DXE_RUNTIME_DRIVER]
> !ifdef CONTINUOUS_INTEGRATION
> BaseCryptLib|CryptoPkg/Library/BaseCryptLibNull/BaseCryptLibNull.inf
> !else
> - IntrinsicLib|CryptoPkg/Library/IntrinsicLib/IntrinsicLib.inf
> + IntrinsicLib|MdePkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf
> OpensslLib|CryptoPkg/Library/OpensslLib/OpensslLib.inf
> BaseCryptLib|CryptoPkg/Library/BaseCryptLib/RuntimeCryptLib.inf
> !endif
> @@ -178,7 +178,7 @@ [LibraryClasses.common.DXE_SMM_DRIVER]
> !ifdef CONTINUOUS_INTEGRATION
> BaseCryptLib|CryptoPkg/Library/BaseCryptLibNull/BaseCryptLibNull.inf
> !else
> - IntrinsicLib|CryptoPkg/Library/IntrinsicLib/IntrinsicLib.inf
> + IntrinsicLib|MdePkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf
> OpensslLib|CryptoPkg/Library/OpensslLib/OpensslLib.inf
> BaseCryptLib|CryptoPkg/Library/BaseCryptLib/SmmCryptLib.inf
> !endif
> @@ -190,7 +190,7 @@ [LibraryClasses.common.UEFI_DRIVER]
> !ifdef CONTINUOUS_INTEGRATION
> BaseCryptLib|CryptoPkg/Library/BaseCryptLibNull/BaseCryptLibNull.inf
> !else
> - IntrinsicLib|CryptoPkg/Library/IntrinsicLib/IntrinsicLib.inf
> + IntrinsicLib|MdePkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf
> OpensslLib|CryptoPkg/Library/OpensslLib/OpensslLib.inf
> BaseCryptLib|CryptoPkg/Library/BaseCryptLib/BaseCryptLib.inf
> !endif
> @@ -202,7 +202,7 @@ [LibraryClasses.common.UEFI_APPLICATION]
> !ifdef CONTINUOUS_INTEGRATION
> BaseCryptLib|CryptoPkg/Library/BaseCryptLibNull/BaseCryptLibNull.inf
> !else
> - IntrinsicLib|CryptoPkg/Library/IntrinsicLib/IntrinsicLib.inf
> + IntrinsicLib|MdePkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf
> OpensslLib|CryptoPkg/Library/OpensslLib/OpensslLib.inf
> BaseCryptLib|CryptoPkg/Library/BaseCryptLib/BaseCryptLib.inf
> !endif
> diff --git a/UefiPayloadPkg/UefiPayloadPkg.dsc b/UefiPayloadPkg/UefiPayloadPkg.dsc
> index 4d9bbc80c866..3f20d691fc6e 100644
> --- a/UefiPayloadPkg/UefiPayloadPkg.dsc
> +++ b/UefiPayloadPkg/UefiPayloadPkg.dsc
> @@ -182,7 +182,7 @@ [LibraryClasses]
> DxeHobListLib|UefiPayloadPkg/Library/DxeHobListLib/DxeHobListLib.inf
> BaseCryptLib|CryptoPkg/Library/BaseCryptLib/BaseCryptLib.inf
> TlsLib|CryptoPkg/Library/TlsLib/TlsLib.inf
> - IntrinsicLib|CryptoPkg/Library/IntrinsicLib/IntrinsicLib.inf
> + IntrinsicLib|MdePkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf
> OpensslLib|CryptoPkg/Library/OpensslLib/OpensslLib.inf
> RngLib|MdePkg/Library/BaseRngLib/BaseRngLib.inf
> HobLib|UefiPayloadPkg/Library/DxeHobLib/DxeHobLib.inf
> diff --git a/CryptoPkg/Library/IntrinsicLib/IntrinsicLib.inf b/CryptoPkg/Library/IntrinsicLib/IntrinsicLib.inf
> deleted file mode 100644
> index 86e74b57b109..000000000000
> --- a/CryptoPkg/Library/IntrinsicLib/IntrinsicLib.inf
> +++ /dev/null
> @@ -1,69 +0,0 @@
> -## @file
> -# Intrinsic Routines Wrapper Library Instance.
> -#
> -# Copyright (c) 2010 - 2019, Intel Corporation. All rights reserved.<BR>
> -# SPDX-License-Identifier: BSD-2-Clause-Patent
> -#
> -##
> -
> -[Defines]
> - INF_VERSION = 0x00010005
> - BASE_NAME = BaseIntrinsicLib
> - MODULE_UNI_FILE = BaseIntrinsicLib.uni
> - FILE_GUID = 63850097-3E97-4c4f-A52D-C811A0106105
> - MODULE_TYPE = BASE
> - VERSION_STRING = 1.0
> - LIBRARY_CLASS = IntrinsicLib
> -
> -#
> -# The following information is for reference only and not required by the build tools.
> -#
> -# VALID_ARCHITECTURES = IA32 X64
> -#
> -
> -[Sources]
> - MemoryIntrinsics.c
> -
> -[Sources.IA32]
> - CopyMem.c
> -
> - Ia32/MathLShiftS64.c | MSFT
> - Ia32/MathRShiftU64.c | MSFT
> - Ia32/MathFtol.c | MSFT
> - Ia32/MathLlmul.asm | MSFT
> - Ia32/MathLlshr.asm | MSFT
> -
> - Ia32/MathLShiftS64.c | INTEL
> - Ia32/MathRShiftU64.c | INTEL
> - Ia32/MathFtol.c | INTEL
> -
> - Ia32/MathLShiftS64.nasm | GCC
> - Ia32/MathRShiftU64.nasm | GCC
> -
> -[Sources.X64]
> - CopyMem.c
> -
> -[Packages]
> - MdePkg/MdePkg.dec
> -
> -[LibraryClasses]
> - BaseLib
> - BaseMemoryLib
> -
> -[BuildOptions]
> - #
> - # Override MSFT build option to remove /Oi and /GL
> - #
> - MSFT:DEBUG_VS2003_IA32_CC_FLAGS == /nologo /c /WX /W4 /Gs32768 /Gy /D UNICODE /O1b2 /FIAutoGen.h /EHs-c-
> /GR- /GF /GX- /Zi /Gm
> - MSFT:RELEASE_VS2003_IA32_CC_FLAGS == /nologo /c /WX /W4 /Gs32768 /Gy /D UNICODE /O1b2 /FIAutoGen.h /EHs-c-
> /GR- /GF /GX-
> - MSFT:DEBUG_VS2003xASL_IA32_CC_FLAGS == /nologo /c /WX /W4 /Gs32768 /Gy /D UNICODE /O1b2 /FIAutoGen.h /EHs-c-
> /GR- /GF /GX- /Zi /Gm
> - MSFT:RELEASE_VS2003xASL_IA32_CC_FLAGS == /nologo /c /WX /W4 /Gs32768 /Gy /D UNICODE /O1b2 /FIAutoGen.h /EHs-
> c- /GR- /GF /GX-
> - MSFT:DEBUG_DDK3790_IA32_CC_FLAGS == /nologo /c /WX /Gy /Gs32768 /D UNICODE /O1b2 /FIAutoGen.h /EHs-c- /GR-
> /GF /Zi /Gm
> - MSFT:RELEASE_DDK3790_IA32_CC_FLAGS == /nologo /c /WX /Gy /Gs32768 /D UNICODE /O1b2 /FIAutoGen.h /EHs-c- /GR-
> /GF
> - MSFT:DEBUG_DDK3790xASL_IA32_CC_FLAGS == /nologo /c /WX /Gy /Gs32768 /D UNICODE /O1b2 /FIAutoGen.h /EHs-c-
> /GR- /GF /Zi /Gm
> - MSFT:RELEASE_DDK3790xASL_IA32_CC_FLAGS == /nologo /c /WX /Gy /Gs32768 /D UNICODE /O1b2 /FIAutoGen.h /EHs-c-
> /GR- /GF
> - MSFT:DEBUG_*_IA32_CC_FLAGS == /nologo /c /WX /GS- /W4 /Gs32768 /D UNICODE /O1b2 /FIAutoGen.h /EHs-c-
> /GR- /GF /Gy /Zi /Gm
> - MSFT:RELEASE_*_IA32_CC_FLAGS == /nologo /c /WX /GS- /W4 /Gs32768 /D UNICODE /O1b2 /FIAutoGen.h /EHs-c-
> /GR- /GF
> - MSFT:DEBUG_*_X64_CC_FLAGS == /nologo /c /WX /GS- /X /W4 /Gs32768 /D UNICODE /O1b2s /Gy /FIAutoGen.h
> /EHs-c- /GR- /GF /Zi /Gm
> - MSFT:RELEASE_*_X64_CC_FLAGS == /nologo /c /WX /GS- /X /W4 /Gs32768 /D UNICODE /O1b2s /Gy /FIAutoGen.h
> /EHs-c- /GR- /GF
> - INTEL:*_*_*_CC_FLAGS = /Oi-
> diff --git a/MdePkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf
> b/MdePkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf
> index a1559fc40ce9..7267d0e3154d 100644
> --- a/MdePkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf
> +++ b/MdePkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf
> @@ -26,6 +26,8 @@ [Sources]
> memcmp_ms.c | MSFT
> memmove_ms.c | MSFT
>
> + strcmp.c
> +
> [Sources.ARM]
> Arm/ashrdi3.S | GCC
> Arm/ashldi3.S | GCC
> @@ -67,6 +69,20 @@ [Sources.ARM]
> [Sources.AARCH64]
> AArch64/Atomics.S | GCC
>
> +[Sources.IA32]
> + Ia32/MathLShiftS64.c | MSFT
> + Ia32/MathRShiftU64.c | MSFT
> + Ia32/MathFtol.c | MSFT
> + Ia32/MathLlmul.asm | MSFT
> + Ia32/MathLlshr.asm | MSFT
> +
> + Ia32/MathLShiftS64.c | INTEL
> + Ia32/MathRShiftU64.c | INTEL
> + Ia32/MathFtol.c | INTEL
> +
> + Ia32/MathLShiftS64.nasm | GCC
> + Ia32/MathRShiftU64.nasm | GCC
> +
> [Packages]
> MdePkg/MdePkg.dec
>
> diff --git a/CryptoPkg/Library/IntrinsicLib/CopyMem.c b/CryptoPkg/Library/IntrinsicLib/CopyMem.c
> deleted file mode 100644
> index 14a213d1dadf..000000000000
> --- a/CryptoPkg/Library/IntrinsicLib/CopyMem.c
> +++ /dev/null
> @@ -1,47 +0,0 @@
> -/** @file
> - Intrinsic Memory Routines Wrapper Implementation for OpenSSL-based
> - Cryptographic Library.
> -
> -Copyright (c) 2010, Intel Corporation. All rights reserved.<BR>
> -SPDX-License-Identifier: BSD-2-Clause-Patent
> -
> -**/
> -
> -#include <Base.h>
> -#include <Library/BaseMemoryLib.h>
> -
> -#if defined (__clang__) && !defined (__APPLE__)
> -
> -/* Copies bytes between buffers */
> -static __attribute__ ((__used__))
> -void *
> -__memcpy (
> - void *dest,
> - const void *src,
> - unsigned int count
> - )
> -{
> - return CopyMem (dest, src, (UINTN)count);
> -}
> -
> -__attribute__ ((__alias__ ("__memcpy")))
> -void *
> -memcpy (
> - void *dest,
> - const void *src,
> - unsigned int count
> - );
> -
> -#else
> -/* Copies bytes between buffers */
> -void *
> -memcpy (
> - void *dest,
> - const void *src,
> - unsigned int count
> - )
> -{
> - return CopyMem (dest, src, (UINTN)count);
> -}
> -
> -#endif
> diff --git a/CryptoPkg/Library/IntrinsicLib/MemoryIntrinsics.c b/CryptoPkg/Library/IntrinsicLib/MemoryIntrinsics.c
> deleted file mode 100644
> index 611e9fd773b0..000000000000
> --- a/CryptoPkg/Library/IntrinsicLib/MemoryIntrinsics.c
> +++ /dev/null
> @@ -1,74 +0,0 @@
> -/** @file
> - Intrinsic Memory Routines Wrapper Implementation for OpenSSL-based
> - Cryptographic Library.
> -
> -Copyright (c) 2010 - 2019, Intel Corporation. All rights reserved.<BR>
> -SPDX-License-Identifier: BSD-2-Clause-Patent
> -
> -**/
> -
> -#include <Base.h>
> -#include <Library/BaseMemoryLib.h>
> -#include <Library/BaseLib.h>
> -
> -typedef UINTN size_t;
> -
> -#if defined (__GNUC__) || defined (__clang__)
> -#define GLOBAL_USED __attribute__((used))
> -#else
> -#define GLOBAL_USED
> -#endif
> -
> -/* OpenSSL will use floating point support, and C compiler produces the _fltused
> - symbol by default. Simply define this symbol here to satisfy the linker. */
> -int GLOBAL_USED _fltused = 1;
> -
> -/* Sets buffers to a specified character */
> -void *
> -memset (
> - void *dest,
> - int ch,
> - size_t count
> - )
> -{
> - //
> - // NOTE: Here we use one base implementation for memset, instead of the direct
> - // optimized SetMem() wrapper. Because the IntrinsicLib has to be built
> - // without whole program optimization option, and there will be some
> - // potential register usage errors when calling other optimized codes.
> - //
> -
> - //
> - // Declare the local variables that actually move the data elements as
> - // volatile to prevent the optimizer from replacing this function with
> - // the intrinsic memset()
> - //
> - volatile UINT8 *Pointer;
> -
> - Pointer = (UINT8 *)dest;
> - while (count-- != 0) {
> - *(Pointer++) = (UINT8)ch;
> - }
> -
> - return dest;
> -}
> -
> -/* Compare bytes in two buffers. */
> -int
> -memcmp (
> - const void *buf1,
> - const void *buf2,
> - size_t count
> - )
> -{
> - return (int)CompareMem (buf1, buf2, count);
> -}
> -
> -int
> -strcmp (
> - const char *s1,
> - const char *s2
> - )
> -{
> - return (int)AsciiStrCmp (s1, s2);
> -}
> diff --git a/CryptoPkg/Library/IntrinsicLib/Ia32/MathFtol.c b/MdePkg/Library/CompilerIntrinsicsLib/Ia32/MathFtol.c
> similarity index 100%
> rename from CryptoPkg/Library/IntrinsicLib/Ia32/MathFtol.c
> rename to MdePkg/Library/CompilerIntrinsicsLib/Ia32/MathFtol.c
> diff --git a/CryptoPkg/Library/IntrinsicLib/Ia32/MathLShiftS64.c b/MdePkg/Library/CompilerIntrinsicsLib/Ia32/MathLShiftS64.c
> similarity index 100%
> rename from CryptoPkg/Library/IntrinsicLib/Ia32/MathLShiftS64.c
> rename to MdePkg/Library/CompilerIntrinsicsLib/Ia32/MathLShiftS64.c
> diff --git a/CryptoPkg/Library/IntrinsicLib/Ia32/MathRShiftU64.c b/MdePkg/Library/CompilerIntrinsicsLib/Ia32/MathRShiftU64.c
> similarity index 100%
> rename from CryptoPkg/Library/IntrinsicLib/Ia32/MathRShiftU64.c
> rename to MdePkg/Library/CompilerIntrinsicsLib/Ia32/MathRShiftU64.c
> diff --git a/MdePkg/Library/CompilerIntrinsicsLib/strcmp.c b/MdePkg/Library/CompilerIntrinsicsLib/strcmp.c
> new file mode 100644
> index 000000000000..937b19a3dff7
> --- /dev/null
> +++ b/MdePkg/Library/CompilerIntrinsicsLib/strcmp.c
> @@ -0,0 +1,33 @@
> +/** @file
> + Intrinsic Memory Routines Wrapper Implementation for OpenSSL-based
> + Cryptographic Library.
> +
> +Copyright (c) 2010 - 2019, Intel Corporation. All rights reserved.<BR>
> +SPDX-License-Identifier: BSD-2-Clause-Patent
> +
> +**/
> +
> +#include <Base.h>
> +#include <Library/BaseMemoryLib.h>
> +#include <Library/BaseLib.h>
> +
> +typedef UINTN size_t;
> +
> +#if defined (__GNUC__) || defined (__clang__)
> +#define GLOBAL_USED __attribute__((used))
> +#else
> +#define GLOBAL_USED
> +#endif
> +
> +/* OpenSSL will use floating point support, and C compiler produces the _fltused
> + symbol by default. Simply define this symbol here to satisfy the linker. */
> +int GLOBAL_USED _fltused = 1;
> +
> +int
> +strcmp (
> + const char *s1,
> + const char *s2
> + )
> +{
> + return (int)AsciiStrCmp (s1, s2);
> +}
> diff --git a/CryptoPkg/Library/IntrinsicLib/BaseIntrinsicLib.uni b/CryptoPkg/Library/IntrinsicLib/BaseIntrinsicLib.uni
> deleted file mode 100644
> index 47f19d4080f7..000000000000
> --- a/CryptoPkg/Library/IntrinsicLib/BaseIntrinsicLib.uni
> +++ /dev/null
> @@ -1,16 +0,0 @@
> -// /** @file
> -// Intrinsic Routines Wrapper Library Instance.
> -//
> -// This module is intrinsic routines wrapper library instance.
> -//
> -// Copyright (c) 2010 - 2018, Intel Corporation. All rights reserved.<BR>
> -//
> -// SPDX-License-Identifier: BSD-2-Clause-Patent
> -//
> -// **/
> -
> -
> -#string STR_MODULE_ABSTRACT #language en-US "Intrinsic Routines Wrapper Library Instance"
> -
> -#string STR_MODULE_DESCRIPTION #language en-US "This module is intrinsic routines wrapper library instance."
> -
> diff --git a/CryptoPkg/Library/IntrinsicLib/Ia32/MathLShiftS64.nasm
> b/MdePkg/Library/CompilerIntrinsicsLib/Ia32/MathLShiftS64.nasm
> similarity index 100%
> rename from CryptoPkg/Library/IntrinsicLib/Ia32/MathLShiftS64.nasm
> rename to MdePkg/Library/CompilerIntrinsicsLib/Ia32/MathLShiftS64.nasm
> diff --git a/CryptoPkg/Library/IntrinsicLib/Ia32/MathLlmul.asm b/MdePkg/Library/CompilerIntrinsicsLib/Ia32/MathLlmul.asm
> similarity index 100%
> rename from CryptoPkg/Library/IntrinsicLib/Ia32/MathLlmul.asm
> rename to MdePkg/Library/CompilerIntrinsicsLib/Ia32/MathLlmul.asm
> diff --git a/CryptoPkg/Library/IntrinsicLib/Ia32/MathLlshr.asm b/MdePkg/Library/CompilerIntrinsicsLib/Ia32/MathLlshr.asm
> similarity index 100%
> rename from CryptoPkg/Library/IntrinsicLib/Ia32/MathLlshr.asm
> rename to MdePkg/Library/CompilerIntrinsicsLib/Ia32/MathLlshr.asm
> diff --git a/CryptoPkg/Library/IntrinsicLib/Ia32/MathRShiftU64.nasm
> b/MdePkg/Library/CompilerIntrinsicsLib/Ia32/MathRShiftU64.nasm
> similarity index 100%
> rename from CryptoPkg/Library/IntrinsicLib/Ia32/MathRShiftU64.nasm
> rename to MdePkg/Library/CompilerIntrinsicsLib/Ia32/MathRShiftU64.nasm
> --
> 2.36.1
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH v4 4/9] MdePkg/CompilerIntrinsicsLib: move ia32 intrinsics and strcmp
2022-06-09 3:57 ` Ni, Ray
@ 2022-06-09 6:33 ` Gerd Hoffmann
2022-06-09 9:34 ` Ni, Ray
0 siblings, 1 reply; 14+ messages in thread
From: Gerd Hoffmann @ 2022-06-09 6:33 UTC (permalink / raw)
To: Ni, Ray
Cc: devel@edk2.groups.io, Wang, Jian J, Wu, Jiaxin, Sean Brogan,
Anthony Perard, Leif Lindholm, Liu, Zhiguang, Lu, Xiaoyu1,
Pawel Polawski, Sami Mujawar, Maciej Rabeda, Feng, Bob C,
Yao, Jiewen, Andrew Fish, Bret Barkelew, Alexei Fedorov,
Dong, Guo, kilian_kegel@hotmail.com, Maurice Ma, Siyuan Fu,
Chang, Abner, Gao, Zhichao, Xu, Wei6, Supreeth Venkatesh,
Julien Grall, Schaefer, Daniel, Ard Biesheuvel, Jiang, Guomin,
Justen, Jordan L, Oliver Steffen, Boeuf, Sebastien, You, Benjamin,
Xu, Min M, Rebecca Cran, Wang, Nickle, Kinney, Michael D,
Tom Lendacky, Peter Grehan, Aktas, Erdem, Brijesh Singh,
James Bottomley, Chen, Christine, Gao, Liming, Ard Biesheuvel
On Thu, Jun 09, 2022 at 03:57:16AM +0000, Ni, Ray wrote:
> Gerd,
> I am interested in this patch sets. But I have some trouble to get all the patches. Do you have a branch that contains all the changes?
https://github.com/kraxel/edk2/tree/intrinsics
https://github.com/tianocore/edk2/pull/2542
take care,
Gerd
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH v4 4/9] MdePkg/CompilerIntrinsicsLib: move ia32 intrinsics and strcmp
2022-06-09 6:33 ` Gerd Hoffmann
@ 2022-06-09 9:34 ` Ni, Ray
2022-06-09 10:41 ` Gerd Hoffmann
0 siblings, 1 reply; 14+ messages in thread
From: Ni, Ray @ 2022-06-09 9:34 UTC (permalink / raw)
To: Gerd Hoffmann
Cc: devel@edk2.groups.io, Wang, Jian J, Wu, Jiaxin, Sean Brogan,
Anthony Perard, Leif Lindholm, Liu, Zhiguang, Lu, Xiaoyu1,
Pawel Polawski, Sami Mujawar, Maciej Rabeda, Feng, Bob C,
Yao, Jiewen, Andrew Fish, Bret Barkelew, Alexei Fedorov,
Dong, Guo, kilian_kegel@hotmail.com, Maurice Ma, Siyuan Fu,
Chang, Abner, Gao, Zhichao, Xu, Wei6, Supreeth Venkatesh,
Julien Grall, Schaefer, Daniel, Ard Biesheuvel, Jiang, Guomin,
Justen, Jordan L, Oliver Steffen, Boeuf, Sebastien, You, Benjamin,
Xu, Min M, Rebecca Cran, Wang, Nickle, Kinney, Michael D,
Tom Lendacky, Peter Grehan, Aktas, Erdem, Brijesh Singh,
James Bottomley, Chen, Christine, Gao, Liming, Ard Biesheuvel
Do you think maybe creating a CompilerIntrinsicLib.h in MdePkg/Include/Library/ helps people understand how many intrinsic functions are provided for different ARCH?
> -----Original Message-----
> From: Gerd Hoffmann <kraxel@redhat.com>
> Sent: Thursday, June 9, 2022 2:34 PM
> To: Ni, Ray <ray.ni@intel.com>
> Cc: devel@edk2.groups.io; Wang, Jian J <jian.j.wang@intel.com>; Wu, Jiaxin <jiaxin.wu@intel.com>; Sean Brogan
> <sean.brogan@microsoft.com>; Anthony Perard <anthony.perard@citrix.com>; Leif Lindholm <quic_llindhol@quicinc.com>; Liu,
> Zhiguang <zhiguang.liu@intel.com>; Lu, Xiaoyu1 <xiaoyu1.lu@intel.com>; Pawel Polawski <ppolawsk@redhat.com>; Sami
> Mujawar <sami.mujawar@arm.com>; Maciej Rabeda <maciej.rabeda@linux.intel.com>; Feng, Bob C <bob.c.feng@intel.com>;
> Yao, Jiewen <jiewen.yao@intel.com>; Andrew Fish <afish@apple.com>; Bret Barkelew <Bret.Barkelew@microsoft.com>; Alexei
> Fedorov <Alexei.Fedorov@arm.com>; Dong, Guo <guo.dong@intel.com>; kilian_kegel@hotmail.com; Maurice Ma
> <maurice.ma@intel.com>; Siyuan Fu <siyuan.fu@intel.com>; Chang, Abner <abner.chang@hpe.com>; Gao, Zhichao
> <zhichao.gao@intel.com>; Xu, Wei6 <wei6.xu@intel.com>; Supreeth Venkatesh <supreeth.venkatesh@arm.com>; Julien Grall
> <julien@xen.org>; Schaefer, Daniel <daniel.schaefer@hpe.com>; Ard Biesheuvel <ardb+tianocore@kernel.org>; Jiang, Guomin
> <guomin.jiang@intel.com>; Justen, Jordan L <jordan.l.justen@intel.com>; Oliver Steffen <osteffen@redhat.com>; Boeuf,
> Sebastien <sebastien.boeuf@intel.com>; You, Benjamin <benjamin.you@intel.com>; Xu, Min M <min.m.xu@intel.com>;
> Rebecca Cran <rebecca@bsdio.com>; Wang, Nickle <nickle.wang@hpe.com>; Kinney, Michael D <michael.d.kinney@intel.com>;
> Tom Lendacky <thomas.lendacky@amd.com>; Peter Grehan <grehan@freebsd.org>; Aktas, Erdem <erdemaktas@google.com>;
> Brijesh Singh <brijesh.singh@amd.com>; James Bottomley <jejb@linux.ibm.com>; Chen, Christine <yuwei.chen@intel.com>;
> Gao, Liming <gaoliming@byosoft.com.cn>; Ard Biesheuvel <ardb@kernel.org>
> Subject: Re: [PATCH v4 4/9] MdePkg/CompilerIntrinsicsLib: move ia32 intrinsics and strcmp
>
> On Thu, Jun 09, 2022 at 03:57:16AM +0000, Ni, Ray wrote:
> > Gerd,
> > I am interested in this patch sets. But I have some trouble to get all the patches. Do you have a branch that contains all the
> changes?
>
> https://github.com/kraxel/edk2/tree/intrinsics
> https://github.com/tianocore/edk2/pull/2542
>
> take care,
> Gerd
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH v4 4/9] MdePkg/CompilerIntrinsicsLib: move ia32 intrinsics and strcmp
2022-06-09 9:34 ` Ni, Ray
@ 2022-06-09 10:41 ` Gerd Hoffmann
0 siblings, 0 replies; 14+ messages in thread
From: Gerd Hoffmann @ 2022-06-09 10:41 UTC (permalink / raw)
To: Ni, Ray
Cc: devel@edk2.groups.io, Wang, Jian J, Wu, Jiaxin, Sean Brogan,
Anthony Perard, Leif Lindholm, Liu, Zhiguang, Lu, Xiaoyu1,
Pawel Polawski, Sami Mujawar, Maciej Rabeda, Feng, Bob C,
Yao, Jiewen, Andrew Fish, Bret Barkelew, Alexei Fedorov,
Dong, Guo, kilian_kegel@hotmail.com, Maurice Ma, Siyuan Fu,
Chang, Abner, Gao, Zhichao, Xu, Wei6, Supreeth Venkatesh,
Julien Grall, Schaefer, Daniel, Ard Biesheuvel, Jiang, Guomin,
Justen, Jordan L, Oliver Steffen, Boeuf, Sebastien, You, Benjamin,
Xu, Min M, Rebecca Cran, Wang, Nickle, Kinney, Michael D,
Tom Lendacky, Peter Grehan, Aktas, Erdem, Brijesh Singh,
James Bottomley, Chen, Christine, Gao, Liming, Ard Biesheuvel
On Thu, Jun 09, 2022 at 09:34:10AM +0000, Ni, Ray wrote:
> Do you think maybe creating a CompilerIntrinsicLib.h in MdePkg/Include/Library/ helps people understand how many intrinsic functions are provided for different ARCH?
Documenting the intrinsics supported looks useful to me.
Not sure a header file would be the best choice for that though given
that those calls are generated by the compiler not written into source
code.
take care,
Gerd
^ permalink raw reply [flat|nested] 14+ messages in thread
end of thread, other threads:[~2022-06-09 10:41 UTC | newest]
Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-06-03 12:26 [PATCH v4 0/9] consolidate compiler intrinsics Gerd Hoffmann
2022-06-03 12:26 ` [PATCH v4 1/9] MdePkg: promote CompilerIntrinsicsLib from ArmPkg to MdePkg Gerd Hoffmann
2022-06-03 12:26 ` [PATCH v4 2/9] MdePkg/CompilerIntrinsicsLib: fix msft sources for x64 Gerd Hoffmann
2022-06-03 12:26 ` [PATCH v4 3/9] MdePkg/CompilerIntrinsicsLib: move size_t typedef to header file Gerd Hoffmann
2022-06-03 12:26 ` [PATCH v4 4/9] MdePkg/CompilerIntrinsicsLib: move ia32 intrinsics and strcmp Gerd Hoffmann
2022-06-09 3:57 ` Ni, Ray
2022-06-09 6:33 ` Gerd Hoffmann
2022-06-09 9:34 ` Ni, Ray
2022-06-09 10:41 ` Gerd Hoffmann
2022-06-03 12:26 ` [PATCH v4 5/9] MdePkg/CompilerIntrinsicsLib: copy over intrinsics from edk2-libc repo Gerd Hoffmann
2022-06-03 12:26 ` [PATCH v4 6/9] MdePkg/CompilerIntrinsicsLib: drop include from Gcc.c Gerd Hoffmann
2022-06-03 12:26 ` [PATCH v4 7/9] MdePkg/CompilerIntrinsicsLib: drop debug logging " Gerd Hoffmann
2022-06-03 12:26 ` [PATCH v4 8/9] MdePkg/CompilerIntrinsicsLib: remove duplicate functions " Gerd Hoffmann
2022-06-03 12:26 ` [PATCH v4 9/9] MdePkg/CompilerIntrinsicsLib: add new sources to CompilerIntrinsicsLib.inf Gerd Hoffmann
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox