This commit adds the setup codes for aarch64 support including meson build and aarch64 selection.
Signed-off-by: Dongju Chae <dongju.chae@samsung.com>
cdata.set('HAVE_POWERPC', true)
elif cpu_family == 'arm'
cdata.set('HAVE_ARM', true)
+elif cpu_family == 'aarch64'
+ cdata.set('HAVE_AARCH64', true)
elif cpu_family == 'mips' and host_machine.endian() == 'little'
cdata.set('HAVE_MIPSEL', true)
else
orc_sources += ['orccpu-x86.c']
elif cpu_family == 'ppc' or cpu_family == 'ppc64'
orc_sources += ['orccpu-powerpc.c']
-elif cpu_family == 'arm'
+elif cpu_family == 'arm' or cpu_family == 'aarch64'
orc_sources += ['orccpu-arm.c']
elif cpu_family == 'mips' and host_machine.endian() == 'little'
orc_sources += ['orccpu-mips.c']
#include <orc/orcarm.h>
#include <orc/orcutils.h>
-#ifdef HAVE_ARM
+#if defined(HAVE_ARM) || defined(HAVE_AARCH64)
#if defined(__APPLE__)
#include <libkern/OSCacheControl.h>
#endif
void
orc_arm_flush_cache (OrcCode *code)
{
-#ifdef HAVE_ARM
+#if defined (HAVE_ARM) || defined (HAVE_AARCH64)
#ifdef __APPLE__
sys_dcache_flush(code->code, code->code_size);
sys_icache_invalidate(code->exec, code->code_size);
/***** arm *****/
-#ifdef __arm__
+#if defined (__arm__) || defined (__aarch64__)
#if 0
static unsigned long
orc_profile_stamp_xscale(void)
}
if (aux[0] == AT_HWCAP) {
+#ifdef __arm__
/* if (aux[1] & 64) flags |= ORC_TARGET_NEON_VFP; */
/* if (aux[1] & 512) flags |= ORC_TARGET_NEON_IWMMXT; */
if (aux[1] & 4096) flags |= ORC_TARGET_NEON_NEON;
if (aux[1] & 128) flags |= ORC_TARGET_ARM_EDSP;
+#elif __aarch64__
+ /**
+ * Use HWCAP_ASIMD (1 << 1) to make sure Advanced SIMD (ASIMD) units exist in AArch64.
+ * Note that some ARMv7 features including HWCAP_NEON are always supported by ARMv8 CPUs.
+ */
+ if (aux[1] & (1 << 1))
+ flags |= ORC_TARGET_NEON_NEON | ORC_TARGET_ARM_EDSP; /** reuse 32bit flags */
+#endif
ORC_INFO("arm hwcap %08x", aux[1]);
} if (aux[0] == AT_PLATFORM) {
ORC_INFO("arm platform %s", (char *)aux[1]);
static OrcTarget neon_target = {
"neon",
-#ifdef HAVE_ARM
+#if defined(HAVE_ARM) || defined(HAVE_AARCH64)
TRUE,
#else
FALSE,
void
orc_neon_init (void)
{
-#if defined(HAVE_ARM)
+#if defined(HAVE_ARM) || defined(HAVE_AARCH64)
if (!(orc_arm_get_cpu_flags () & ORC_TARGET_NEON_NEON)) {
ORC_INFO("marking neon backend non-executable");
neon_target.executable = FALSE;
static unsigned int
orc_compiler_neon_get_default_flags (void)
{
- return ORC_TARGET_NEON_NEON;
+ unsigned int flags = 0;
+
+#if defined(HAVE_AARCH64)
+ flags |= ORC_TARGET_NEON_64BIT;
+#endif
+ flags |= ORC_TARGET_NEON_NEON;
+
+ return flags;
}
static void
enum {
ORC_TARGET_NEON_CLEAN_COMPILE = (1<<0),
ORC_TARGET_NEON_NEON = (1<<1),
- ORC_TARGET_NEON_EDSP = (1<<2)
+ ORC_TARGET_NEON_EDSP = (1<<2),
+ ORC_TARGET_NEON_64BIT = (1<<3)
};
enum {
* @short_description: Orc utility functions
*/
-#if defined(__arm__) || defined(__mips__)
+#if defined(__arm__) || defined(__aarch64__) || defined(__mips__)
char *
get_proc_cpuinfo (void)
{
#ifdef ORC_ENABLE_UNSTABLE_API
/* FIXME: remove, these are internal functions that were never exported */
-#if defined(__arm__) || defined(__mips__)
+#if defined(__arm__) || defined(__aarch64__) || defined(__mips__)
char * get_proc_cpuinfo (void);
#endif