Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/GStreamer/orc.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/orc
diff options
context:
space:
mode:
authorDongju Chae <dongju.chae@samsung.com>2019-10-21 13:31:14 +0300
committerMarek Vasut <marex@denx.de>2020-09-16 15:27:27 +0300
commite10915230855c59f80fbe667b00d8f9ca6565d8b (patch)
treea38396cb616445132042d3e769202d9949d222b5 /orc
parent1e9bf08551b91cbac5033b5a19e22f100e9b2682 (diff)
aarch64: make some setups for aarch64 support
This commit adds the setup codes for aarch64 support including meson build and aarch64 selection. Signed-off-by: Dongju Chae <dongju.chae@samsung.com>
Diffstat (limited to 'orc')
-rw-r--r--orc/meson.build2
-rw-r--r--orc/orcarm.c4
-rw-r--r--orc/orccpu-arm.c11
-rw-r--r--orc/orcprogram-neon.c13
-rw-r--r--orc/orctarget.h3
-rw-r--r--orc/orcutils.c2
-rw-r--r--orc/orcutils.h2
7 files changed, 27 insertions, 10 deletions
diff --git a/orc/meson.build b/orc/meson.build
index 1995f36..0213ed8 100644
--- a/orc/meson.build
+++ b/orc/meson.build
@@ -91,7 +91,7 @@ if cpu_family.startswith('x86')
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']
diff --git a/orc/orcarm.c b/orc/orcarm.c
index d3452d4..424597e 100644
--- a/orc/orcarm.c
+++ b/orc/orcarm.c
@@ -14,7 +14,7 @@
#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
@@ -775,7 +775,7 @@ orc_arm_emit_rv (OrcCompiler *p, int op, OrcArmCond cond,
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);
diff --git a/orc/orccpu-arm.c b/orc/orccpu-arm.c
index 5431e0d..d1d436e 100644
--- a/orc/orccpu-arm.c
+++ b/orc/orccpu-arm.c
@@ -45,7 +45,7 @@
/***** arm *****/
-#ifdef __arm__
+#if defined (__arm__) || defined (__aarch64__)
#if 0
static unsigned long
orc_profile_stamp_xscale(void)
@@ -80,10 +80,19 @@ orc_check_neon_proc_auxv (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]);
diff --git a/orc/orcprogram-neon.c b/orc/orcprogram-neon.c
index cecbcc0..cf87249 100644
--- a/orc/orcprogram-neon.c
+++ b/orc/orcprogram-neon.c
@@ -107,7 +107,7 @@ orc_neon_emit_epilogue (OrcCompiler *compiler)
static OrcTarget neon_target = {
"neon",
-#ifdef HAVE_ARM
+#if defined(HAVE_ARM) || defined(HAVE_AARCH64)
TRUE,
#else
FALSE,
@@ -126,7 +126,7 @@ static OrcTarget neon_target = {
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;
@@ -141,7 +141,14 @@ orc_neon_init (void)
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
diff --git a/orc/orctarget.h b/orc/orctarget.h
index 53000b3..49f6cad 100644
--- a/orc/orctarget.h
+++ b/orc/orctarget.h
@@ -30,7 +30,8 @@ typedef enum {
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 {
diff --git a/orc/orcutils.c b/orc/orcutils.c
index 5b58c60..f0b77f6 100644
--- a/orc/orcutils.c
+++ b/orc/orcutils.c
@@ -45,7 +45,7 @@
* @short_description: Orc utility functions
*/
-#if defined(__arm__) || defined(__mips__)
+#if defined(__arm__) || defined(__aarch64__) || defined(__mips__)
char *
get_proc_cpuinfo (void)
{
diff --git a/orc/orcutils.h b/orc/orcutils.h
index 59c2c9e..c20e27f 100644
--- a/orc/orcutils.h
+++ b/orc/orcutils.h
@@ -227,7 +227,7 @@ ORC_BEGIN_DECLS
#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