Skip to content

Commit d3c300e

Browse files
committed
Reflect PR feedback
1 parent 9f66790 commit d3c300e

File tree

4 files changed

+26
-34
lines changed

4 files changed

+26
-34
lines changed

src/coreclr/tools/aot/jitinterface/CMakeLists.txt

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,9 @@ set(NATIVE_SOURCES
55
jitinterface.cpp
66
jitwrapper.cpp
77
corinfoexception.cpp
8-
)
98

10-
if(NOT CLR_CROSS_COMPONENTS_BUILD)
11-
list(APPEND NATIVE_SOURCES
12-
${CLR_SRC_NATIVE_DIR}/minipal/cpufeatures.c
13-
)
14-
endif()
9+
${CLR_SRC_NATIVE_DIR}/minipal/cpufeatures.c
10+
)
1511

1612
if(CLR_CMAKE_TARGET_WIN32)
1713
set(JITINTERFACE_RESOURCES Native.rc)

src/coreclr/tools/aot/jitinterface/jitwrapper.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,5 @@ DLL_EXPORT void JitProcessShutdownWork(ICorJitCompiler * pJit)
5555

5656
DLL_EXPORT int JitGetProcessorFeatures()
5757
{
58-
#ifndef CROSS_COMPILE
5958
return minipal_getcpufeatures();
60-
#else
61-
return 0;
62-
#endif
6359
}

src/native/minipal/cpufeatures.c

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@
88
#include "cpufeatures.h"
99
#include "cpuid.h"
1010

11-
#if TARGET_WINDOWS
11+
#if HOST_WINDOWS
1212

1313
#include <Windows.h>
1414

15-
#else // TARGET_WINDOWS
15+
#else // HOST_WINDOWS
1616

1717
#include "minipalconfig.h"
1818

@@ -41,10 +41,10 @@
4141
#include <sys/sysctl.h>
4242
#endif
4343

44-
#endif // !TARGET_WINDOWS
44+
#endif // !HOST_WINDOWS
4545

46-
#if defined(TARGET_UNIX)
47-
#if defined(TARGET_X86) || defined(TARGET_AMD64)
46+
#if defined(HOST_UNIX)
47+
#if defined(HOST_X86) || defined(HOST_AMD64)
4848

4949
static uint32_t xmmYmmStateSupport()
5050
{
@@ -64,7 +64,7 @@ static uint32_t xmmYmmStateSupport()
6464

6565
static uint32_t avx512StateSupport()
6666
{
67-
#if defined(TARGET_APPLE)
67+
#if defined(HOST_APPLE)
6868
// MacOS has specialized behavior where it reports AVX512 support but doesnt
6969
// actually enable AVX512 until the first instruction is executed and does so
7070
// on a per thread basis. It does this by catching the faulting instruction and
@@ -98,11 +98,11 @@ static bool IsAvx512Enabled()
9898
{
9999
return true;
100100
}
101-
#endif // defined(TARGET_X86) || defined(TARGET_AMD64)
102-
#endif // TARGET_UNIX
101+
#endif // defined(HOST_X86) || defined(HOST_AMD64)
102+
#endif // HOST_UNIX
103103

104-
#if defined(TARGET_WINDOWS)
105-
#if defined(TARGET_X86) || defined(TARGET_AMD64)
104+
#if defined(HOST_WINDOWS)
105+
#if defined(HOST_X86) || defined(HOST_AMD64)
106106
static uint32_t xmmYmmStateSupport()
107107
{
108108
// check OS has enabled both XMM and YMM state support
@@ -127,14 +127,14 @@ static bool IsAvx512Enabled()
127127
return ((FeatureMask & XSTATE_MASK_AVX512) != 0);
128128
}
129129

130-
#endif // defined(TARGET_X86) || defined(TARGET_AMD64)
131-
#endif // TARGET_WINDOWS
130+
#endif // defined(HOST_X86) || defined(HOST_AMD64)
131+
#endif // HOST_WINDOWS
132132

133133
int minipal_getcpufeatures(void)
134134
{
135135
int result = 0;
136136

137-
#if defined(TARGET_X86) || defined(TARGET_AMD64)
137+
#if defined(HOST_X86) || defined(HOST_AMD64)
138138

139139
int cpuidInfo[4];
140140

@@ -318,10 +318,10 @@ int minipal_getcpufeatures(void)
318318
}
319319

320320
}
321-
#endif // TARGET_X86 || TARGET_AMD64
321+
#endif // HOST_X86 || HOST_AMD64
322322

323-
#if defined(TARGET_ARM64)
324-
#if defined(TARGET_UNIX)
323+
#if defined(HOST_ARM64)
324+
#if defined(HOST_UNIX)
325325

326326
#if HAVE_AUXV_HWCAP_H
327327
unsigned long hwCap = getauxval(AT_HWCAP);
@@ -395,9 +395,9 @@ int minipal_getcpufeatures(void)
395395

396396
result |= ARM64IntrinsicConstants_AdvSimd | ARM64IntrinsicConstants_VectorT128;
397397
#endif // HAVE_AUXV_HWCAP_H
398-
#endif // TARGET_UNIX
398+
#endif // HOST_UNIX
399399

400-
#if defined(TARGET_WINDOWS)
400+
#if defined(HOST_WINDOWS)
401401
// FP and SIMD support are enabled by default
402402
result |= ARM64IntrinsicConstants_AdvSimd | ARM64IntrinsicConstants_VectorT128;
403403

@@ -430,9 +430,9 @@ int minipal_getcpufeatures(void)
430430

431431
// TODO: IsProcessorFeaturePresent doesn't support LRCPC2 yet.
432432

433-
#endif // TARGET_WINDOWS
433+
#endif // HOST_WINDOWS
434434

435-
#endif // TARGET_ARM64
435+
#endif // HOST_ARM64
436436

437437
return result;
438438
}

src/native/minipal/cpufeatures.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
// Should match the constants defined in the compiler in HardwareIntrinsicHelpers.cs
99
//
1010

11-
#if defined(TARGET_X86) || defined(TARGET_AMD64)
11+
#if defined(HOST_X86) || defined(HOST_AMD64)
1212
enum XArchIntrinsicConstants
1313
{
1414
XArchIntrinsicConstants_Aes = 0x0001,
@@ -41,9 +41,9 @@ enum XArchIntrinsicConstants
4141
XArchIntrinsicConstants_VectorT256 = 0x8000000,
4242
XArchIntrinsicConstants_VectorT512 = 0x10000000,
4343
};
44-
#endif // TARGET_X86 || TARGET_AMD64
44+
#endif // HOST_X86 || HOST_AMD64
4545

46-
#if defined(TARGET_ARM64)
46+
#if defined(HOST_ARM64)
4747
enum ARM64IntrinsicConstants
4848
{
4949
ARM64IntrinsicConstants_AdvSimd = 0x0001,
@@ -65,7 +65,7 @@ enum ARM64IntrinsicConstants
6565
#define ARM64_ATOMICS_FEATURE_FLAG_BIT 7
6666
static_assert((1 << ARM64_ATOMICS_FEATURE_FLAG_BIT) == ARM64IntrinsicConstants_Atomics, "ARM64_ATOMICS_FEATURE_FLAG_BIT must match with ARM64IntrinsicConstants_Atomics");
6767

68-
#endif // TARGET_ARM64
68+
#endif // HOST_ARM64
6969

7070
#ifdef __cplusplus
7171
extern "C"

0 commit comments

Comments
 (0)