Bring Symbian to the JIT party. Hardcode CPU features (must be ARMv6 single-core).

This commit is contained in:
Sacha 2013-01-11 19:57:23 +10:00
parent 81c6c4805d
commit aab792ea0b

View File

@ -20,7 +20,7 @@
#include "StringUtil.h" #include "StringUtil.h"
// Only Linux platforms have /proc/cpuinfo // Only Linux platforms have /proc/cpuinfo
#if !defined(BLACKBERRY) && !defined(IOS) #if !defined(BLACKBERRY) && !defined(IOS) && !defined(__SYMBIAN32__)
const char procfile[] = "/proc/cpuinfo"; const char procfile[] = "/proc/cpuinfo";
char *GetCPUString() char *GetCPUString()
@ -73,7 +73,9 @@ bool CheckCPUFeature(const char *feature)
#endif #endif
int GetCoreCount() int GetCoreCount()
{ {
#if defined(BLACKBERRY) || defined(IOS) #ifdef __SYMBIAN32__
return 1;
#elif defined(BLACKBERRY) || defined(IOS)
return 2; return 2;
#else #else
const char marker[] = "processor\t: "; const char marker[] = "processor\t: ";
@ -114,8 +116,7 @@ void CPUInfo::Detect()
// Get the information about the CPU // Get the information about the CPU
num_cores = GetCoreCount(); num_cores = GetCoreCount();
// Hardcode this for now #if !defined(BLACKBERRY) && !defined(IOS) && !defined(__SYMBIAN32__)
#if !defined(BLACKBERRY) && !defined(IOS)
strncpy(cpu_string, GetCPUString(), sizeof(cpu_string)); strncpy(cpu_string, GetCPUString(), sizeof(cpu_string));
bSwp = CheckCPUFeature("swp"); bSwp = CheckCPUFeature("swp");
bHalf = CheckCPUFeature("half"); bHalf = CheckCPUFeature("half");
@ -130,18 +131,24 @@ void CPUInfo::Detect()
bVFPv4 = CheckCPUFeature("vfpv4"); bVFPv4 = CheckCPUFeature("vfpv4");
bIDIVa = CheckCPUFeature("idiva"); bIDIVa = CheckCPUFeature("idiva");
bIDIVt = CheckCPUFeature("idivt"); bIDIVt = CheckCPUFeature("idivt");
// These two are ARMv8 specific. // These two require ARMv8 or higher
bFP = CheckCPUFeature("fp"); bFP = CheckCPUFeature("fp");
bASIMD = CheckCPUFeature("asimd"); bASIMD = CheckCPUFeature("asimd");
#else #else
// Hardcode this for now
bSwp = true; bSwp = true;
bHalf = true; bHalf = true;
bThumb = false; bThumb = false;
bFastMult = true; bFastMult = true;
bVFP = true; bVFP = true;
bEDSP = true; bEDSP = true;
#ifdef __SYMBIAN32__
bThumbEE = false;
bNEON = false;
#else
bThumbEE = true; bThumbEE = true;
bNEON = true; bNEON = true;
#endif
bVFPv3 = true; bVFPv3 = true;
bTLS = true; bTLS = true;
bVFPv4 = false; bVFPv4 = false;
@ -156,7 +163,7 @@ void CPUInfo::Detect()
std::string CPUInfo::Summarize() std::string CPUInfo::Summarize()
{ {
std::string sum; std::string sum;
#if defined(BLACKBERRY) || defined(IOS) #if defined(BLACKBERRY) || defined(IOS) || defined(__SYMBIAN32__)
sum = StringFromFormat("%i cores", num_cores); sum = StringFromFormat("%i cores", num_cores);
#else #else
if (num_cores == 1) if (num_cores == 1)