#pragma once
#include "Options.h"
namespace JSC {
#if USE(JSVALUE64)
using CPURegister = int64_t;
using UCPURegister = uint64_t;
#else
using CPURegister = int32_t;
using UCPURegister = uint32_t;
#endif
constexpr bool isARMv7IDIVSupported()
{
#if HAVE(ARM_IDIV_INSTRUCTIONS)
return true;
#else
return false;
#endif
}
constexpr bool isARM64()
{
#if CPU(ARM64)
return true;
#else
return false;
#endif
}
constexpr bool isX86()
{
#if CPU(X86_64) || CPU(X86)
return true;
#else
return false;
#endif
}
constexpr bool isX86_64()
{
#if CPU(X86_64)
return true;
#else
return false;
#endif
}
constexpr bool is64Bit()
{
#if USE(JSVALUE64)
return true;
#else
return false;
#endif
}
constexpr bool is32Bit()
{
return !is64Bit();
}
constexpr bool isAddress64Bit()
{
return sizeof(void*) == 8;
}
constexpr bool isAddress32Bit()
{
return !isAddress64Bit();
}
constexpr bool isMIPS()
{
#if CPU(MIPS)
return true;
#else
return false;
#endif
}
inline bool optimizeForARMv7IDIVSupported()
{
return isARMv7IDIVSupported() && Options::useArchitectureSpecificOptimizations();
}
inline bool optimizeForARM64()
{
return isARM64() && Options::useArchitectureSpecificOptimizations();
}
inline bool optimizeForX86()
{
return isX86() && Options::useArchitectureSpecificOptimizations();
}
inline bool optimizeForX86_64()
{
return isX86_64() && Options::useArchitectureSpecificOptimizations();
}
inline bool hasSensibleDoubleToInt()
{
return optimizeForX86();
}
}