Created attachment 162861 [details] Add NEON and VFP options for ARMv6 build ffmpeg package enables VFP and NEON optimization for ARMv6 build, but not all CPU support vectorized VFP operations. So to cover as many devices as possible it should be disabled by default though for custom builds people should be able to enable it.
VFP seems to work, but NEON does not. It is testing for NEON during the configure stage but after encountering this BEGIN /tmp/ffconf.VspKMTmG.c 1 #include <arm_neon.h> 2 int main(void) { int16x8_t test = vdupq_n_s16(0); return 0; } END /tmp/ffconf.VspKMTmG.c cc -D_ISOC99_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -DPIC -O -pipe -mfloat-abi=softfp -fno-strict-aliasing -I/usr/local/in clude/vorbis -I/usr/local/include -march=armv6zk -std=c99 -fomit-frame-pointer -marm -fPIC -c -o /tmp/ffconf.Q7ANNGnS.o /tmp/ffconf.V spKMTmG.c In file included from /tmp/ffconf.VspKMTmG.c:1: /usr/include/clang/3.4.1/arm_neon.h:28:2: error: "NEON support not enabled" #error "NEON support not enabled" ^ /usr/include/clang/3.4.1/arm_neon.h:47:24: error: 'neon_vector_type' attribute is not supported for this target typedef __attribute__((neon_vector_type(8))) int8_t int8x8_t; it decides to set HAVE_NEON and similar config vars to 0 in config.h I tested on 10/stable. Is this working on current?
No, I've just checked - looks like clang does not have NEON support enabled on CURRENT. I didn't test actual config.h values for NEON, only that it doesn't break configure step. Could you drop NEON option and commit only VFP part?
(In reply to Oleksandr Tymoshenko from comment #2) Sure, no worries. Thank you!
A commit references this bug: Author: riggs Date: Sun Nov 8 20:09:02 UTC 2015 New revision: 401071 URL: https://svnweb.freebsd.org/changeset/ports/401071 Log: Add non-default OPTION to support VFP on armv6 PR: 204345 Submitted by: gonzo@FreeBSD.org Changes: head/multimedia/ffmpeg/Makefile
Created attachment 163081 [details] Re-add NEON option > /usr/include/clang/3.4.1/arm_neon.h:28:2: error: "NEON support not enabled" NEON requires at least ARMv7-A which FFmpeg by default doesn't force when building for ARMv6. And FreeBSD lacks runtime CPU detection. Try the attached patch, it also exposes VFP/NEON for armv6hf.
Re-open per my followup, so it's not forgotten.
(In reply to Jan Beich from comment #6) Thanks for the patch! Just a question: Does the majority of armv6 we support actually have ARMv7-A? I was under the impression that e.g. the RPI 1 (the single core) does not. And if we don't have runtime CPU detection, I'd suggest to include a caveat in the OPTION description. What do you think?
A commit references this bug: Author: riggs Date: Sun Nov 22 07:19:55 UTC 2015 New revision: 402216 URL: https://svnweb.freebsd.org/changeset/ports/402216 Log: Add non-default OPTION to support NEON instructions on arm Include new patch from jbeich: - Add NEON OPTION on arm; no changes in default OPTIONs - Port now assumes at least armv7-a if user selects NEON PR: 204345 Submitted by: gonzo@FreeBSD.org, jbeich@FreeBSD.org Changes: head/multimedia/ffmpeg/Makefile