summaryrefslogtreecommitdiff
path: root/libavutil/arm
diff options
context:
space:
mode:
authorJanne Grunau <janne-libav@jannau.net>2015-12-09 22:28:36 +0100
committerJanne Grunau <janne-libav@jannau.net>2015-12-14 16:42:35 +0100
commite2710e790c09e49e86baa58c6063af0097cc8cb0 (patch)
tree4bf42a3192ea353305d8409d085522100a16b350 /libavutil/arm
parent5dfe4edad63971d669ae456b0bc40ef9364cca80 (diff)
arm: add a cpu flag for the VFPv2 vector mode
The vector mode was deprecated in ARMv7-A/VFPv3 and various cpu implementations do not support it in hardware. Vector mode code will depending the OS either be emulated in software or result in an illegal instruction on cpus which does not support it. This was not really problem in practice since NEON implementations of the same functions are preferred. It will however become a problem for checkasm which tests every cpu flag separately. Since this is a cpu feature newer cpu do not support anymore the behaviour of this flag differs from the other flags. It can be only activated by runtime cpu feature selection.
Diffstat (limited to 'libavutil/arm')
-rw-r--r--libavutil/arm/cpu.c4
-rw-r--r--libavutil/arm/cpu.h5
2 files changed, 9 insertions, 0 deletions
diff --git a/libavutil/arm/cpu.c b/libavutil/arm/cpu.c
index 8bdaa88469..2effb72610 100644
--- a/libavutil/arm/cpu.c
+++ b/libavutil/arm/cpu.c
@@ -131,6 +131,10 @@ int ff_get_cpu_flags_arm(void)
if (flags & AV_CPU_FLAG_ARMV6T2)
flags |= AV_CPU_FLAG_ARMV6;
+ /* set the virtual VFPv2 vector mode flag */
+ if ((flags & AV_CPU_FLAG_VFP) && !(flags & (AV_CPU_FLAG_VFPV3 | AV_CPU_FLAG_NEON)))
+ flags |= AV_CPU_FLAG_VFP_VM;
+
return flags;
}
diff --git a/libavutil/arm/cpu.h b/libavutil/arm/cpu.h
index 224409afee..5563fc1c69 100644
--- a/libavutil/arm/cpu.h
+++ b/libavutil/arm/cpu.h
@@ -30,6 +30,11 @@
#define have_vfpv3(flags) CPUEXT(flags, VFPV3)
#define have_neon(flags) CPUEXT(flags, NEON)
+/* some functions use the VFPv2 vector mode which is deprecated in ARMv7-A
+ * and might trap on such CPU depending on the OS configuration */
+#define have_vfp_vm(flags) \
+ (have_armv6(flags) && ((flags) & AV_CPU_FLAG_VFP_VM))
+
/* Some functions use the 'setend' instruction which is deprecated on ARMv8
* and serializing on some ARMv7 cores. This macro ensures such functions
* are only enabled on ARMv6. */