shithub: mp3dec

Download patch

ref: d8d3506de6946fd0cea29f0fc6e69b45f024a811
parent: 1be357c884712b7861012e726831d7a87ab07619
author: lieff <lieff@users.noreply.github.com>
date: Wed Feb 14 20:25:22 EST 2018

add aarch64 test

--- a/.travis.yml
+++ b/.travis.yml
@@ -1,4 +1,16 @@
 language: c
+addons:
+  apt:
+    packages:
+      - libc6-dev-i386
+      - gcc-arm-none-eabi
+      - libnewlib-arm-none-eabi
+      - gcc-4.8-multilib
+      - gcc-4.8-aarch64-linux-gnu
+      - gcc-aarch64-linux-gnu
+      - libc6-arm64-cross
+      - libc6-dev-arm64-cross
+      - qemu
 
 os:
     - linux
@@ -5,9 +17,6 @@
 
 compiler:
     - gcc
-
-before_install:
-    - if [ $TRAVIS_OS_NAME == linux ]; then sudo apt-get install -y libc6-dev-i386 g++-multilib gcc-arm-none-eabi qemu; fi
 
 script:
     - scripts/build.sh
--- a/minimp3.h
+++ b/minimp3.h
@@ -155,7 +155,7 @@
     return 0;
 #endif
 }
-#elif defined(__ARM_NEON)
+#elif defined(__ARM_NEON) || defined(__aarch64__)
 #   include <arm_neon.h>
 #   define HAVE_SIMD 1
 #   define VSTORE vst1q_f32
--- a/minimp3_test.c
+++ b/minimp3_test.c
@@ -116,7 +116,7 @@
 }
 #else
 
-#ifdef __arm__
+#if defined(__arm__) || defined(__aarch64__)
 int main2(int argc, char *argv[]);
 int main2(int argc, char *argv[])
 #else
@@ -172,7 +172,7 @@
     return 0;
 }
 
-#ifdef __arm__
+#if defined(__arm__) || defined(__aarch64__)
 static const char *g_files[] = {
     "vectors/ILL2_center2.bit",
     "vectors/ILL2_dual.bit",
--- a/scripts/build.sh
+++ b/scripts/build.sh
@@ -32,6 +32,11 @@
 -ffunction-sections -fdata-sections -Wl,--gc-sections -o minimp3_arm minimp3_test.c --specs=rdimon.specs -lm
 qemu-arm ./minimp3_arm
 
+aarch64-linux-gnu-gcc -O2 -std=c89 -Wall -Wextra -Wmissing-prototypes -Werror -fno-asynchronous-unwind-tables -fno-stack-protector \
+-static -march=armv8-a \
+-ffunction-sections -fdata-sections -Wl,--gc-sections -o minimp3_arm minimp3_test.c -lm
+qemu-aarch64 ./minimp3_arm
+
 if [ ! "$TRAVIS" = "true" ]; then
 rm emmintrin.h.gcov minimp3_arm minimp3_test.gcda minimp3_test.gcno minimp3_test.c.gcov xmmintrin.h.gcov
 fi