broadcom/vc4: Build the vc4_tiling_lt_neon.c with -mfpu=neon on ARM.
authorEric Anholt <eric@anholt.net>
Mon, 31 Jul 2017 21:59:38 +0000 (14:59 -0700)
committerEric Anholt <eric@anholt.net>
Tue, 15 Aug 2017 20:23:54 +0000 (13:23 -0700)
If you don't pass this, the compiler refuses to compile the assembly for
pre-v7 CPUs.  This also keeps us from building identical, non-NEON code on
aarch64 and x86.

Fixes: a373f77662c5 ("vc4: Use a wrapper file to set VC4_BUILD_NEON instead of CFLAGS.")
v2: Fix Android build by just appending NEON_C_SOURCES when
    ARCH_ARM_HAVE_NEON.

Tested-by: Rob Herring <robh@kernel.org>
src/gallium/drivers/vc4/Android.mk
src/gallium/drivers/vc4/Makefile.am
src/gallium/drivers/vc4/Makefile.sources
src/gallium/drivers/vc4/vc4_tiling.h

index 84bfaa839f9e40af2d8d15b751fd2763180f519f..fc141de3ca8ef8a5e5f507c41bbdf04b88812555 100644 (file)
@@ -28,6 +28,10 @@ include $(CLEAR_VARS)
 LOCAL_SRC_FILES := \
        $(C_SOURCES)
 
+ifeq ($(ARCH_ARM_HAVE_NEON),true)
+LOCAL_SRC_FILES += $(NEON_C_SOURCES)
+endif
+
 LOCAL_GENERATED_SOURCES := $(MESA_GEN_NIR_H)
 LOCAL_C_INCLUDES := \
        $(MESA_TOP)/include/drm-uapi
index 9b0ef6ef790e522160db1fa1edc2a3e1c06218d8..4c2b7486c52243ce50153622af271977c33156d4 100644 (file)
@@ -44,6 +44,13 @@ libvc4_la_LIBADD = \
        $(top_builddir)/src/broadcom/cle/libbroadcom_cle.la \
        $()
 
+if HAVE_ARM_ASM
+noinst_LTLIBRARIES += libvc4_neon.la
+libvc4_la_LIBADD += libvc4_neon.la
+libvc4_neon_la_SOURCES = $(NEON_C_SOURCES)
+libvc4_neon_la_CFLAGS = $(AM_CFLAGS) -mfpu=neon
+endif
+
 libvc4_la_LDFLAGS = $(SIM_LDFLAGS)
 
 EXTRA_DIST = kernel/README
index f67dffe00636df884f09afe5704ff7261ec2fdb8..76dea7041b7250e69c5a841054983e109fda574d 100644 (file)
@@ -57,7 +57,8 @@ C_SOURCES := \
        vc4_state.c \
        vc4_tiling.c \
        vc4_tiling_lt.c \
-       vc4_tiling_lt_neon.c \
        vc4_tiling.h \
        vc4_uniforms.c \
        $()
+
+NEON_C_SOURCES := vc4_tiling_lt_neon.c
index 3168ec20a606e9f0d4cf22e7d920c95ca701f442..66767e7f1f83dac33548374bbf8caa96a5b94e05 100644 (file)
@@ -89,13 +89,15 @@ 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
         if (util_cpu_caps.has_neon) {
                 vc4_load_lt_image_neon(dst, dst_stride, src, src_stride,
                                        cpp, box);
-        } else {
-                vc4_load_lt_image_base(dst, dst_stride, src, src_stride,
-                                       cpp, box);
+                return;
         }
+#endif
+        vc4_load_lt_image_base(dst, dst_stride, src, src_stride,
+                               cpp, box);
 }
 
 static inline void
@@ -103,13 +105,16 @@ 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
         if (util_cpu_caps.has_neon) {
                 vc4_store_lt_image_neon(dst, dst_stride, src, src_stride,
                                         cpp, box);
-        } else {
-                vc4_store_lt_image_base(dst, dst_stride, src, src_stride,
-                                        cpp, box);
+                return;
         }
+#endif
+
+        vc4_store_lt_image_base(dst, dst_stride, src, src_stride,
+                                cpp, box);
 }
 
 #endif /* VC4_TILING_H */