#include "cpufeatures.h"
#include "cpuid.h"
-#if TARGET_WINDOWS
+#if HOST_WINDOWS
#include <Windows.h>
-#else // TARGET_WINDOWS
+#else // HOST_WINDOWS
#include "minipalconfig.h"
#include <sys/sysctl.h>
#endif
-#endif // !TARGET_WINDOWS
+#endif // !HOST_WINDOWS
-#if defined(TARGET_UNIX)
-#if defined(TARGET_X86) || defined(TARGET_AMD64)
+#if defined(HOST_UNIX)
+#if defined(HOST_X86) || defined(HOST_AMD64)
static uint32_t xmmYmmStateSupport()
{
static uint32_t avx512StateSupport()
{
-#if defined(TARGET_APPLE)
+#if defined(HOST_APPLE)
// MacOS has specialized behavior where it reports AVX512 support but doesnt
// actually enable AVX512 until the first instruction is executed and does so
// on a per thread basis. It does this by catching the faulting instruction and
{
return true;
}
-#endif // defined(TARGET_X86) || defined(TARGET_AMD64)
-#endif // TARGET_UNIX
+#endif // defined(HOST_X86) || defined(HOST_AMD64)
+#endif // HOST_UNIX
-#if defined(TARGET_WINDOWS)
-#if defined(TARGET_X86) || defined(TARGET_AMD64)
+#if defined(HOST_WINDOWS)
+#if defined(HOST_X86) || defined(HOST_AMD64)
static uint32_t xmmYmmStateSupport()
{
// check OS has enabled both XMM and YMM state support
return ((FeatureMask & XSTATE_MASK_AVX512) != 0);
}
-#endif // defined(TARGET_X86) || defined(TARGET_AMD64)
-#endif // TARGET_WINDOWS
+#endif // defined(HOST_X86) || defined(HOST_AMD64)
+#endif // HOST_WINDOWS
int minipal_getcpufeatures(void)
{
int result = 0;
-#if defined(TARGET_X86) || defined(TARGET_AMD64)
+#if defined(HOST_X86) || defined(HOST_AMD64)
int cpuidInfo[4];
}
}
-#endif // TARGET_X86 || TARGET_AMD64
+#endif // HOST_X86 || HOST_AMD64
-#if defined(TARGET_ARM64)
-#if defined(TARGET_UNIX)
+#if defined(HOST_ARM64)
+#if defined(HOST_UNIX)
#if HAVE_AUXV_HWCAP_H
unsigned long hwCap = getauxval(AT_HWCAP);
result |= ARM64IntrinsicConstants_AdvSimd | ARM64IntrinsicConstants_VectorT128;
#endif // HAVE_AUXV_HWCAP_H
-#endif // TARGET_UNIX
+#endif // HOST_UNIX
-#if defined(TARGET_WINDOWS)
+#if defined(HOST_WINDOWS)
// FP and SIMD support are enabled by default
result |= ARM64IntrinsicConstants_AdvSimd | ARM64IntrinsicConstants_VectorT128;
{
result |= ARM64IntrinsicConstants_Rcpc;
}
-#endif // TARGET_WINDOWS
-#endif // TARGET_ARM64
+ // TODO: IsProcessorFeaturePresent doesn't support LRCPC2 yet.
+
+#endif // HOST_WINDOWS
+
+#endif // HOST_ARM64
return result;
}
// Should match the constants defined in the compiler in HardwareIntrinsicHelpers.cs
//
-#if defined(TARGET_X86) || defined(TARGET_AMD64)
+#if defined(HOST_X86) || defined(HOST_AMD64)
enum XArchIntrinsicConstants
{
XArchIntrinsicConstants_Aes = 0x0001,
XArchIntrinsicConstants_VectorT256 = 0x8000000,
XArchIntrinsicConstants_VectorT512 = 0x10000000,
};
-#endif // TARGET_X86 || TARGET_AMD64
+#endif // HOST_X86 || HOST_AMD64
-#if defined(TARGET_ARM64)
+#if defined(HOST_ARM64)
enum ARM64IntrinsicConstants
{
ARM64IntrinsicConstants_AdvSimd = 0x0001,
#define ARM64_ATOMICS_FEATURE_FLAG_BIT 7
static_assert((1 << ARM64_ATOMICS_FEATURE_FLAG_BIT) == ARM64IntrinsicConstants_Atomics, "ARM64_ATOMICS_FEATURE_FLAG_BIT must match with ARM64IntrinsicConstants_Atomics");
-#endif // TARGET_ARM64
+#endif // HOST_ARM64
#ifdef __cplusplus
extern "C"