Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2014-08-07 20:34:35 +0400
committerMichael Niedermayer <michaelni@gmx.at>2014-08-13 16:50:15 +0400
commit1e519b9d407fd35538b8d4dfdc723448355e9fe1 (patch)
tree6b0389e282867cc19c9cd32a2af7030e10d4c081 /libavutil/arm
parent9f61d6d8fb658ec5156f323d5c2264de5383b951 (diff)
avutil: turn arm setend into a cpuflag
this allows disabling and enabling it it also prevents crashes if vfpv3 and neon are disabled which previously would have enabled the flag And last but not least one can enable setend on cpus like cortex-a8 where its fast but disabled by default Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavutil/arm')
-rw-r--r--libavutil/arm/cpu.c9
-rw-r--r--libavutil/arm/cpu.h7
2 files changed, 9 insertions, 7 deletions
diff --git a/libavutil/arm/cpu.c b/libavutil/arm/cpu.c
index f6cf338591..f1683e8d76 100644
--- a/libavutil/arm/cpu.c
+++ b/libavutil/arm/cpu.c
@@ -128,6 +128,12 @@ int ff_get_cpu_flags_arm(void)
trickle down. */
if (flags & (AV_CPU_FLAG_VFPV3 | AV_CPU_FLAG_NEON))
flags |= AV_CPU_FLAG_ARMV6T2;
+ else
+ /* Some functions use the 'setend' instruction which is deprecated on ARMv8
+ * and serializing on some ARMv7 cores. This ensures such functions
+ * are only enabled on ARMv6. */
+ flags |= AV_CPU_FLAG_SETEND;
+
if (flags & AV_CPU_FLAG_ARMV6T2)
flags |= AV_CPU_FLAG_ARMV6;
@@ -143,7 +149,8 @@ int ff_get_cpu_flags_arm(void)
AV_CPU_FLAG_ARMV6T2 * HAVE_ARMV6T2 |
AV_CPU_FLAG_VFP * HAVE_VFP |
AV_CPU_FLAG_VFPV3 * HAVE_VFPV3 |
- AV_CPU_FLAG_NEON * HAVE_NEON;
+ AV_CPU_FLAG_NEON * HAVE_NEON |
+ AV_CPU_FLAG_SETEND * !(HAVE_NEON | HAVE_VFPV3);
}
#endif
diff --git a/libavutil/arm/cpu.h b/libavutil/arm/cpu.h
index f056a91ca5..9b3b6ff58b 100644
--- a/libavutil/arm/cpu.h
+++ b/libavutil/arm/cpu.h
@@ -29,11 +29,6 @@
#define have_vfp(flags) CPUEXT(flags, VFP)
#define have_vfpv3(flags) CPUEXT(flags, VFPV3)
#define have_neon(flags) CPUEXT(flags, NEON)
-
-/* 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. */
-#define have_setend(flags) \
- (have_armv6(flags) && !(have_vfpv3(flags) || have_neon(flags)))
+#define have_setend(flags) CPUEXT(flags, SETEND)
#endif /* AVUTIL_ARM_CPU_H */