-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Universal arm crossgen compiler #58279
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 11 commits
97125ca
ac4a3e1
2ba2162
77824a3
c3b175a
bd9a51c
3f4a439
05cea7a
adfc7b3
4078dc9
c90c3cd
efc7e20
a1b893f
255c1f8
5bfd6ca
75d38c2
94c30f5
6c8cb2c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1729,6 +1729,7 @@ enum CORINFO_OS | |
| { | ||
| CORINFO_WINNT, | ||
| CORINFO_UNIX, | ||
| CORINFO_MACOS, | ||
| }; | ||
|
|
||
| struct CORINFO_CPU | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -174,5 +174,3 @@ | |
| #if !defined(TARGET_UNIX) | ||
| #define FEATURE_STACK_SAMPLING | ||
| #endif // defined (ALLOW_SXS_JIT) | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,67 @@ | ||
| // Licensed to the .NET Foundation under one or more agreements. | ||
| // The .NET Foundation licenses this file to you under the MIT license. | ||
|
|
||
| #ifndef targetosarch_h | ||
| #define targetosarch_h | ||
|
|
||
| class TargetOS | ||
| { | ||
| public: | ||
| #ifdef TARGET_WINDOWS | ||
| #define TARGET_WINDOWS_POSSIBLY_SUPPORTED | ||
| static const bool IsWindows = true; | ||
| static const bool IsUnix = false; | ||
| static const bool IsMacOS = false; | ||
| #elif defined(TARGET_UNIX) | ||
| #define TARGET_UNIX_POSSIBLY_SUPPORTED | ||
| static const bool IsWindows = false; | ||
| static const bool IsUnix = true; | ||
| #if defined(TARGET_OSX) | ||
| static const bool IsMacOS = true; | ||
| #else | ||
| static const bool IsMacOS = false; | ||
| #endif | ||
| #else | ||
| #define TARGET_WINDOWS_POSSIBLY_SUPPORTED | ||
| #define TARGET_UNIX_POSSIBLY_SUPPORTED | ||
| #define TARGET_OS_RUNTIMEDETERMINED | ||
| static bool OSSettingConfigured; | ||
| static bool IsWindows; | ||
| static bool IsUnix; | ||
| static bool IsMacOS; | ||
| #endif | ||
| }; | ||
|
|
||
| class TargetArchitecture | ||
| { | ||
| public: | ||
| #ifdef TARGET_ARM | ||
| static const bool IsX86 = false; | ||
| static const bool IsX64 = false; | ||
| static const bool IsArm64 = false; | ||
| static const bool IsArm32 = true; | ||
| static const bool IsArmArch = true; | ||
| #elif defined(TARGET_ARM64) | ||
| static const bool IsX86 = false; | ||
| static const bool IsX64 = false; | ||
| static const bool IsArm64 = true; | ||
| static const bool IsArm32 = false; | ||
| static const bool IsArmArch = true; | ||
| #elif defined(TARGET_AMD64) | ||
| static const bool IsX86 = false; | ||
| static const bool IsX64 = true; | ||
| static const bool IsArm64 = false; | ||
| static const bool IsArm32 = false; | ||
| static const bool IsArmArch = false; | ||
| #elif defined(TARGET_X86) | ||
| static const bool IsX86 = true; | ||
| static const bool IsX64 = false; | ||
| static const bool IsArm64 = false; | ||
| static const bool IsArm32 = false; | ||
| static const bool IsArmArch = false; | ||
| #else | ||
| #error Unknown architecture | ||
| #endif | ||
| }; | ||
|
|
||
| #endif // targetosarch_h |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -496,16 +496,13 @@ install_clr(TARGETS clrjit DESTINATIONS . sharedFramework COMPONENT jit) | |
| add_pgo(clrjit) | ||
|
|
||
| if (CLR_CMAKE_TARGET_ARCH_ARM64 OR CLR_CMAKE_TARGET_ARCH_AMD64) | ||
| create_standalone_jit(TARGET clrjit_unix_arm64_${ARCH_HOST_NAME} OS unix ARCH arm64 DESTINATIONS .) | ||
| create_standalone_jit(TARGET clrjit_unix_osx_arm64_${ARCH_HOST_NAME} OS unix_osx ARCH arm64 DESTINATIONS .) | ||
| create_standalone_jit(TARGET clrjit_universal_arm64_${ARCH_HOST_NAME} OS universal ARCH arm64 DESTINATIONS .) | ||
| create_standalone_jit(TARGET clrjit_unix_x64_${ARCH_HOST_NAME} OS unix ARCH x64 DESTINATIONS .) | ||
| create_standalone_jit(TARGET clrjit_win_arm64_${ARCH_HOST_NAME} OS win ARCH arm64 DESTINATIONS .) | ||
| create_standalone_jit(TARGET clrjit_win_x64_${ARCH_HOST_NAME} OS win ARCH x64 DESTINATIONS .) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. are "universal" x64 and x86 also possible?
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In theory this is possible, but its quite a bit more difficult and would require a fair amount more changes. The Arm64 and Arm architecture jits produce very similar code, but the x64 ABI is quite different between Unix platforms and Windows (for instance, there are quite a lot of fields on GenTree structures that are different for Unix and Windows. |
||
| endif (CLR_CMAKE_TARGET_ARCH_ARM64 OR CLR_CMAKE_TARGET_ARCH_AMD64) | ||
|
|
||
| create_standalone_jit(TARGET clrjit_unix_arm_${ARCH_HOST_NAME} OS unix ARCH arm DESTINATIONS .) | ||
| target_compile_definitions(clrjit_unix_arm_${ARCH_HOST_NAME} PRIVATE ARM_SOFTFP CONFIGURABLE_ARM_ABI) | ||
| create_standalone_jit(TARGET clrjit_win_arm_${ARCH_HOST_NAME} OS win ARCH arm DESTINATIONS .) | ||
| create_standalone_jit(TARGET clrjit_universal_arm_${ARCH_HOST_NAME} OS universal ARCH arm DESTINATIONS .) | ||
| target_compile_definitions(clrjit_universal_arm_${ARCH_HOST_NAME} PRIVATE ARM_SOFTFP CONFIGURABLE_ARM_ABI) | ||
| create_standalone_jit(TARGET clrjit_win_x86_${ARCH_HOST_NAME} OS win ARCH x86 DESTINATIONS .) | ||
|
|
||
| if (CLR_CMAKE_TARGET_ARCH_I386 AND CLR_CMAKE_TARGET_UNIX) | ||
|
|
@@ -514,11 +511,12 @@ endif (CLR_CMAKE_TARGET_ARCH_I386 AND CLR_CMAKE_TARGET_UNIX) | |
|
|
||
| if (CLR_CMAKE_TARGET_UNIX) | ||
| if (NOT ARCH_TARGET_NAME STREQUAL s390x) | ||
| install_clr(TARGETS clrjit_unix_${ARCH_TARGET_NAME}_${ARCH_HOST_NAME} DESTINATIONS . COMPONENT jit) | ||
| if(CLR_CMAKE_TARGET_ARCH_ARM OR CLR_CMAKE_TARGET_ARCH_ARM64) | ||
| install_clr(TARGETS clrjit_universal_${ARCH_TARGET_NAME}_${ARCH_HOST_NAME} DESTINATIONS . COMPONENT jit) | ||
| else() | ||
| install_clr(TARGETS clrjit_unix_${ARCH_TARGET_NAME}_${ARCH_HOST_NAME} DESTINATIONS . COMPONENT jit) | ||
| endif() | ||
| endif(NOT ARCH_TARGET_NAME STREQUAL s390x) | ||
| if (ARCH_TARGET_NAME STREQUAL arm) | ||
| target_compile_definitions(clrjit_unix_arm_${ARCH_HOST_NAME} PRIVATE ARM_SOFTFP CONFIGURABLE_ARM_ABI) | ||
| endif (ARCH_TARGET_NAME STREQUAL arm) | ||
| endif() | ||
|
|
||
| if (CLR_CMAKE_TARGET_WIN32 AND CLR_CMAKE_PGO_INSTRUMENT) | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder why we bother with faking up EEInfo instead of blowing things up.
@BruceForstall any idea?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe the JIT (or JIT32/JIT64) only called
getEEInfo()once and reused the info for all method compiles, so only some MCs would have it? Looks like RyuJIT calls it for every compile.