diff options
author | Jussi Pakkanen <jpakkane@gmail.com> | 2017-02-18 00:01:50 +0200 |
---|---|---|
committer | Jussi Pakkanen <jpakkane@gmail.com> | 2017-07-17 19:00:42 +0300 |
commit | 57729e5a782e2bb745179926cfb487b6f417b98f (patch) | |
tree | 2fab39a96f145660ed5633840a59d68f6e7048a7 /test cases | |
parent | dbe028cc17ea402883755d46e1b64abff4769cb7 (diff) | |
download | meson-57729e5a782e2bb745179926cfb487b6f417b98f.zip meson-57729e5a782e2bb745179926cfb487b6f417b98f.tar.gz meson-57729e5a782e2bb745179926cfb487b6f417b98f.tar.bz2 |
Added NEON support.
Diffstat (limited to 'test cases')
-rw-r--r-- | test cases/common/139 simd/meson.build | 1 | ||||
-rw-r--r-- | test cases/common/139 simd/simd_neon.c | 20 | ||||
-rw-r--r-- | test cases/common/139 simd/simdchecker.c | 6 | ||||
-rw-r--r-- | test cases/common/139 simd/simdfuncs.h | 6 |
4 files changed, 30 insertions, 3 deletions
diff --git a/test cases/common/139 simd/meson.build b/test cases/common/139 simd/meson.build index 6031218..4dc352d 100644 --- a/test cases/common/139 simd/meson.build +++ b/test cases/common/139 simd/meson.build @@ -31,6 +31,7 @@ simdarr = [['-mmmx', 'HAVE_MMX', 'simd_mmx', 'simd_mmx.c'], ['-msse4.2', 'HAVE_SSE42', 'simd_sse42', 'simd_sse42.c'], ['-mavx', 'HAVE_AVX', 'simd_avx', 'simd_avx.c'], ['-mavx2', 'HAVE_AVX2', 'simd_avx2', 'simd_avx2.c'], + ['-mfpu=neon', 'HAVE_NEON', 'simd_neon', 'simd_neon.c'], ] foreach ia : simdarr diff --git a/test cases/common/139 simd/simd_neon.c b/test cases/common/139 simd/simd_neon.c new file mode 100644 index 0000000..2082099 --- /dev/null +++ b/test cases/common/139 simd/simd_neon.c @@ -0,0 +1,20 @@ +#include<simdconfig.h> +#include<simdfuncs.h> + +#include<arm_neon.h> +#include<stdint.h> + +int neon_available() { + return 1; /* Incorrect, but I don't know how to check this properly. */ +} + +void increment_neon(float arr[4]) { + float32x2_t a1, a2, one; + a1 = vld1_f32(arr); + a2 = vld1_f32(&arr[2]); + one = vdup_n_f32(1.0); + a1 = vadd_f32(a1, one); + a2 = vadd_f32(a2, one); + vst1_f32(arr, a1); + vst1_f32(&arr[2], a2); +} diff --git a/test cases/common/139 simd/simdchecker.c b/test cases/common/139 simd/simdchecker.c index 1502ae7..222fbf3 100644 --- a/test cases/common/139 simd/simdchecker.c +++ b/test cases/common/139 simd/simdchecker.c @@ -17,6 +17,12 @@ int main(int argc, char **argv) { /* Add here. The first matched one is used so put "better" instruction * sets at the top. */ +#if HAVE_NEON + if(fptr == NULL && neon_available()) { + fptr = increment_neon; + type = "NEON"; + } +#endif #if HAVE_AVX2 if(fptr == NULL && avx2_available()) { fptr = increment_avx2; diff --git a/test cases/common/139 simd/simdfuncs.h b/test cases/common/139 simd/simdfuncs.h index 22781bf..dfb0560 100644 --- a/test cases/common/139 simd/simdfuncs.h +++ b/test cases/common/139 simd/simdfuncs.h @@ -54,9 +54,9 @@ int avx2_available(); void increment_avx2(float arr[4]); #endif -#if HAVE_THUMB -int thumb_available(); -void increment_thumb(float arr[4]); +#if HAVE_NEON +int neon_available(); +void increment_neon(float arr[4]); #endif #if HAVE_ALTIVEC |