E2K: added initial support of MCST Elbrus 2000 CPU architecture
Ref: https://en.wikipedia.org/wiki/Elbrus_(computer)
This commit is contained in:
parent
f02375e4ec
commit
dcefd4f861
@ -11,6 +11,8 @@ elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "^arm*")
|
||||
set(TARGET_ARCH "ARM")
|
||||
elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "sparc")
|
||||
set(TARGET_ARCH "sparc")
|
||||
elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "e2k")
|
||||
set(TARGET_ARCH "e2k")
|
||||
endif()
|
||||
|
||||
if (NOT OPENBSD)
|
||||
@ -20,7 +22,7 @@ option(WITH_MANPAGES "Generate manpages." ${MANPAGE_DEF})
|
||||
option(WITH_PROFILER "Compile profiler." OFF)
|
||||
option(WITH_GPROF "Compile with GProf profiler." OFF)
|
||||
|
||||
if((TARGET_ARCH MATCHES "x86|x64") AND (NOT DEFINED WITH_SSE2))
|
||||
if((TARGET_ARCH MATCHES "x86|x64|e2k") AND (NOT DEFINED WITH_SSE2))
|
||||
option(WITH_SSE2 "Enable SSE2 optimization." ON)
|
||||
else()
|
||||
option(WITH_SSE2 "Enable SSE2 optimization." OFF)
|
||||
|
@ -172,6 +172,14 @@ WINPR_PRAGMA_DIAG_IGNORED_RESERVED_ID_MACRO
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/* E2K (_M_E2K) */
|
||||
|
||||
#if defined(__e2k__)
|
||||
#ifndef _M_E2K
|
||||
#define _M_E2K 1
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Operating Systems:
|
||||
* http://sourceforge.net/p/predef/wiki/OperatingSystems/
|
||||
@ -326,7 +334,7 @@ WINPR_PRAGMA_DIAG_IGNORED_RESERVED_ID_MACRO
|
||||
#else
|
||||
|
||||
#if defined(__ARMEL__) || defined(__THUMBEL__) || defined(__AARCH64EL__) || defined(_MIPSEL) || \
|
||||
defined(__MIPSEL) || defined(__MIPSEL__)
|
||||
defined(__MIPSEL) || defined(__MIPSEL__) || defined(__e2k__)
|
||||
#ifndef __LITTLE_ENDIAN__
|
||||
#define __LITTLE_ENDIAN__ 1
|
||||
#endif
|
||||
|
@ -47,6 +47,7 @@ extern "C"
|
||||
#define PROCESSOR_ARCHITECTURE_NEUTRAL 11
|
||||
#define PROCESSOR_ARCHITECTURE_ARM64 12
|
||||
#define PROCESSOR_ARCHITECTURE_MIPS64 13
|
||||
#define PROCESSOR_ARCHITECTURE_E2K 14
|
||||
#define PROCESSOR_ARCHITECTURE_UNKNOWN 0xFFFF
|
||||
|
||||
#define PROCESSOR_INTEL_386 386
|
||||
|
@ -120,6 +120,8 @@ static DWORD GetProcessorArchitecture(void)
|
||||
cpuArch = PROCESSOR_ARCHITECTURE_PPC;
|
||||
#elif defined(_M_ALPHA)
|
||||
cpuArch = PROCESSOR_ARCHITECTURE_ALPHA;
|
||||
#elif defined(_M_E2K)
|
||||
cpuArch = PROCESSOR_ARCHITECTURE_E2K;
|
||||
#endif
|
||||
return cpuArch;
|
||||
}
|
||||
@ -851,6 +853,32 @@ BOOL IsProcessorFeaturePresent(DWORD ProcessorFeature)
|
||||
}
|
||||
|
||||
#endif // __GNUC__
|
||||
#elif defined(_M_E2K)
|
||||
/* compiler flags on e2k arch determine CPU features */
|
||||
switch (ProcessorFeature)
|
||||
{
|
||||
case PF_MMX_INSTRUCTIONS_AVAILABLE:
|
||||
#ifdef __MMX__
|
||||
ret = TRUE;
|
||||
#endif
|
||||
break;
|
||||
|
||||
case PF_3DNOW_INSTRUCTIONS_AVAILABLE:
|
||||
#ifdef __3dNOW__
|
||||
ret = TRUE;
|
||||
#endif
|
||||
break;
|
||||
|
||||
case PF_SSE3_INSTRUCTIONS_AVAILABLE:
|
||||
#ifdef __SSE3__
|
||||
ret = TRUE;
|
||||
#endif
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
#endif
|
||||
return ret;
|
||||
}
|
||||
@ -1026,7 +1054,55 @@ BOOL IsProcessorFeaturePresentEx(DWORD ProcessorFeature)
|
||||
default:
|
||||
break;
|
||||
}
|
||||
#elif defined(_M_E2K)
|
||||
/* compiler flags on e2k arch determine CPU features */
|
||||
switch (ProcessorFeature)
|
||||
{
|
||||
case PF_EX_LZCNT:
|
||||
#ifdef __LZCNT__
|
||||
ret = TRUE;
|
||||
#endif
|
||||
break;
|
||||
|
||||
case PF_EX_SSSE3:
|
||||
#ifdef __SSSE3__
|
||||
ret = TRUE;
|
||||
#endif
|
||||
break;
|
||||
|
||||
case PF_EX_SSE41:
|
||||
#ifdef __SSE4_1__
|
||||
ret = TRUE;
|
||||
#endif
|
||||
break;
|
||||
|
||||
case PF_EX_SSE42:
|
||||
#ifdef __SSE4_2__
|
||||
ret = TRUE;
|
||||
#endif
|
||||
break;
|
||||
|
||||
case PF_EX_AVX:
|
||||
#ifdef __AVX__
|
||||
ret = TRUE;
|
||||
#endif
|
||||
break;
|
||||
|
||||
case PF_EX_AVX2:
|
||||
#ifdef __AVX2__
|
||||
ret = TRUE;
|
||||
#endif
|
||||
break;
|
||||
|
||||
case PF_EX_FMA:
|
||||
#ifdef __FMA__
|
||||
ret = TRUE;
|
||||
#endif
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
return ret;
|
||||
}
|
||||
|
@ -48,6 +48,17 @@ int TestCPUFeatures(int argc, char* argv[])
|
||||
TEST_FEATURE_EX(PF_EX_ARM_VFP4);
|
||||
TEST_FEATURE_EX(PF_EX_ARM_IDIVA);
|
||||
TEST_FEATURE_EX(PF_EX_ARM_IDIVT);
|
||||
#elif defined(_M_E2K)
|
||||
TEST_FEATURE(PF_MMX_INSTRUCTIONS_AVAILABLE);
|
||||
TEST_FEATURE(PF_3DNOW_INSTRUCTIONS_AVAILABLE);
|
||||
TEST_FEATURE(PF_SSE3_INSTRUCTIONS_AVAILABLE);
|
||||
printf("\n");
|
||||
printf("Extended CPU Flags (not found in windows API):\n");
|
||||
TEST_FEATURE_EX(PF_EX_SSSE3);
|
||||
TEST_FEATURE_EX(PF_EX_SSE41);
|
||||
TEST_FEATURE_EX(PF_EX_SSE42);
|
||||
TEST_FEATURE_EX(PF_EX_AVX);
|
||||
TEST_FEATURE_EX(PF_EX_FMA);
|
||||
#endif
|
||||
printf("\n");
|
||||
return 0;
|
||||
|
Loading…
Reference in New Issue
Block a user