aboutsummaryrefslogtreecommitdiffstats
path: root/libavutil/cpu.c
diff options
context:
space:
mode:
authorJames Almer <jamrial@gmail.com>2014-02-22 04:54:02 +0000
committerJanne Grunau <janne-libav@jannau.net>2014-02-23 15:29:36 +0100
commitd59fcdaff36eb45307a29756c5dd1852034a3f3f (patch)
tree47304bd6d5fedfb59a866443e75e1feda7155e05 /libavutil/cpu.c
parent1b932eb1508f550fac9e911923a0383efda53aa3 (diff)
downloadffmpeg-d59fcdaff36eb45307a29756c5dd1852034a3f3f.tar.gz
x86: add detection for Bit Manipulation Instruction sets
Based on x264 code Signed-off-by: James Almer <jamrial@gmail.com>
Diffstat (limited to 'libavutil/cpu.c')
-rw-r--r--libavutil/cpu.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/libavutil/cpu.c b/libavutil/cpu.c
index 972e4eb79f..d651eb2089 100644
--- a/libavutil/cpu.c
+++ b/libavutil/cpu.c
@@ -90,6 +90,8 @@ int av_parse_cpu_flags(const char *s)
#define CPUFLAG_FMA3 (AV_CPU_FLAG_FMA3 | CPUFLAG_AVX)
#define CPUFLAG_FMA4 (AV_CPU_FLAG_FMA4 | CPUFLAG_AVX)
#define CPUFLAG_AVX2 (AV_CPU_FLAG_AVX2 | CPUFLAG_AVX)
+#define CPUFLAG_BMI1 (AV_CPU_FLAG_BMI1)
+#define CPUFLAG_BMI2 (AV_CPU_FLAG_BMI2 | CPUFLAG_BMI1)
static const AVOption cpuflags_opts[] = {
{ "flags" , NULL, 0, AV_OPT_TYPE_FLAGS, { .i64 = 0 }, INT64_MIN, INT64_MAX, .unit = "flags" },
#if ARCH_PPC
@@ -111,6 +113,8 @@ int av_parse_cpu_flags(const char *s)
{ "fma3" , NULL, 0, AV_OPT_TYPE_CONST, { .i64 = CPUFLAG_FMA3 }, .unit = "flags" },
{ "fma4" , NULL, 0, AV_OPT_TYPE_CONST, { .i64 = CPUFLAG_FMA4 }, .unit = "flags" },
{ "avx2" , NULL, 0, AV_OPT_TYPE_CONST, { .i64 = CPUFLAG_AVX2 }, .unit = "flags" },
+ { "bmi1" , NULL, 0, AV_OPT_TYPE_CONST, { .i64 = CPUFLAG_BMI1 }, .unit = "flags" },
+ { "bmi2" , NULL, 0, AV_OPT_TYPE_CONST, { .i64 = CPUFLAG_BMI2 }, .unit = "flags" },
{ "3dnow" , NULL, 0, AV_OPT_TYPE_CONST, { .i64 = CPUFLAG_3DNOW }, .unit = "flags" },
{ "3dnowext", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = CPUFLAG_3DNOWEXT }, .unit = "flags" },
{ "cmov", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = AV_CPU_FLAG_CMOV }, .unit = "flags" },
@@ -212,6 +216,8 @@ static const struct {
{ AV_CPU_FLAG_3DNOWEXT, "3dnowext" },
{ AV_CPU_FLAG_CMOV, "cmov" },
{ AV_CPU_FLAG_AVX2, "avx2" },
+ { AV_CPU_FLAG_BMI1, "bmi1" },
+ { AV_CPU_FLAG_BMI2, "bmi2" },
#endif
{ 0 }
};