Commit fee6689c authored by Peter Seiderer's avatar Peter Seiderer
Browse files

vc4: add compile test for arm neon support



Not all toolchains are able to compile the runtime
optional vc4 neon support, so add an meson compile
test for arm neon support.
Signed-off-by: Peter Seiderer's avatarPeter Seiderer <ps.report@gmx.net>
parent 66bb314c
Pipeline #117788 passed with stages
in 20 minutes and 34 seconds
......@@ -1102,6 +1102,7 @@ dep_ws2_32 = cc.find_library('ws2_32', required : with_platform_windows)
# TODO: shared/static? Is this even worth doing?
with_asm_arch = ''
with_arm_neon_support = false
if host_machine.cpu_family() == 'x86'
if system_has_kms_drm or host_machine.system() == 'gnu'
with_asm_arch = 'x86'
......@@ -1118,6 +1119,21 @@ elif host_machine.cpu_family() == 'x86_64'
pre_args += ['-DUSE_X86_64_ASM']
endif
elif host_machine.cpu_family() == 'arm'
if cc.compiles('''
int main() {
/* taken from src/broadcom/common/v3d_cpu_tiling.h */
void *gpu;
__asm__ volatile (
"vldm %[gpu], {q0, q1, q2, q3}\n"
:
: [gpu] "r"(gpu)
: "q0", "q1", "q2", "q3");
return 0;
}''',
args : '-mfpu=neon',
name : 'ARM neon')
with_arm_neon_support = true
endif
if system_has_kms_drm
with_asm_arch = 'arm'
pre_args += ['-DUSE_ARM_ASM']
......
......@@ -84,7 +84,7 @@ files_libvc4 = files(
vc4_c_args = []
libvc4_neon = []
if host_machine.cpu_family() == 'arm'
if host_machine.cpu_family() == 'arm' and with_arm_neon_support
libvc4_neon = static_library(
'vc4_neon',
'vc4_tiling_lt_neon.c',
......@@ -93,7 +93,7 @@ if host_machine.cpu_family() == 'arm'
],
c_args : '-mfpu=neon',
)
vc4_c_args += '-DUSE_ARM_ASM'
vc4_c_args += '-DVC4_TILING_LT_NEON'
endif
if dep_simpenrose.found()
......
......@@ -89,7 +89,7 @@ vc4_load_lt_image(void *dst, uint32_t dst_stride,
void *src, uint32_t src_stride,
int cpp, const struct pipe_box *box)
{
#ifdef USE_ARM_ASM
#ifdef VC4_TILING_LT_NEON
if (util_cpu_caps.has_neon) {
vc4_load_lt_image_neon(dst, dst_stride, src, src_stride,
cpp, box);
......@@ -105,7 +105,7 @@ vc4_store_lt_image(void *dst, uint32_t dst_stride,
void *src, uint32_t src_stride,
int cpp, const struct pipe_box *box)
{
#ifdef USE_ARM_ASM
#ifdef VC4_TILING_LT_NEON
if (util_cpu_caps.has_neon) {
vc4_store_lt_image_neon(dst, dst_stride, src, src_stride,
cpp, box);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment