This flag is set on Haswell and earlier and all AMD cpus.
Unified · Split
| @@ -14,6 +14,9 @@ libavutil: 2021-04-27 · 13 unmodified lines | |||
| 14 | 14 | ||
| 15 | API changes, most recent first: | 15 | API changes, most recent first: |
| 16 | 16 | ||
| 17 | 2021-12-21 - xxxxxxxxxx - lavu 57.12.100 - cpu.h | ||
| 18 | Add AV_CPU_FLAG_SLOW_GATHER. | ||
| 19 | |||
| 17 | 2021-12-20 - xxxxxxxxxx - lavu 57.11.101 - display.h | 20 | 2021-12-20 - xxxxxxxxxx - lavu 57.11.101 - display.h |
| 18 | Modified the documentation of av_display_rotation_set() | 21 | Modified the documentation of av_display_rotation_set() |
| 19 | to match its longstanding actual behaviour of treating | 22 | to match its longstanding actual behaviour of treating |
| @@ -54,6 +54,7 @@ · 53 unmodified lines | |||
| 54 | #define AV_CPU_FLAG_BMI1 0x20000 ///< Bit Manipulation Instruction Set 1 | 54 | #define AV_CPU_FLAG_BMI1 0x20000 ///< Bit Manipulation Instruction Set 1 |
| 55 | #define AV_CPU_FLAG_BMI2 0x40000 ///< Bit Manipulation Instruction Set 2 | 55 | #define AV_CPU_FLAG_BMI2 0x40000 ///< Bit Manipulation Instruction Set 2 |
| 56 | #define AV_CPU_FLAG_AVX512 0x100000 ///< AVX-512 functions: requires OS support even if YMM/ZMM registers aren't used | 56 | #define AV_CPU_FLAG_AVX512 0x100000 ///< AVX-512 functions: requires OS support even if YMM/ZMM registers aren't used |
| 57 | #define AV_CPU_FLAG_SLOW_GATHER 0x2000000 ///< CPU has slow gathers. | ||
| 57 | 58 | ||
| 58 | #define AV_CPU_FLAG_ALTIVEC 0x0001 ///< standard | 59 | #define AV_CPU_FLAG_ALTIVEC 0x0001 ///< standard |
| 59 | #define AV_CPU_FLAG_VSX 0x0002 ///< ISA 2.06 | 60 | #define AV_CPU_FLAG_VSX 0x0002 ///< ISA 2.06 |
| @@ -79,8 +79,8 @@ · 78 unmodified lines | |||
| 79 | */ | 79 | */ |
| 80 | 80 | ||
| 81 | #define LIBAVUTIL_VERSION_MAJOR 57 | 81 | #define LIBAVUTIL_VERSION_MAJOR 57 |
| 82 | #define LIBAVUTIL_VERSION_MINOR 11 | 82 | #define LIBAVUTIL_VERSION_MINOR 12 |
| 83 | #define LIBAVUTIL_VERSION_MICRO 101 | 83 | #define LIBAVUTIL_VERSION_MICRO 100 |
| 84 | 84 | ||
| 85 | #define LIBAVUTIL_VERSION_INT AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \ | 85 | #define LIBAVUTIL_VERSION_INT AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \ |
| 86 | LIBAVUTIL_VERSION_MINOR, \ | 86 | LIBAVUTIL_VERSION_MINOR, \ |
| @@ -146,8 +146,21 @@ int ff_get_cpu_flags_x86(void) · 145 unmodified lines | |||
| 146 | if (max_std_level >= 7) { | 146 | if (max_std_level >= 7) { |
| 147 | cpuid(7, eax, ebx, ecx, edx); | 147 | cpuid(7, eax, ebx, ecx, edx); |
| 148 | #if HAVE_AVX2 | 148 | #if HAVE_AVX2 |
| 149 | if ((rval & AV_CPU_FLAG_AVX) && (ebx & 0x00000020)) | 149 | if ((rval & AV_CPU_FLAG_AVX) && (ebx & 0x00000020)) { |
| 150 | rval |= AV_CPU_FLAG_AVX2; | 150 | rval |= AV_CPU_FLAG_AVX2; |
| 151 | cpuid(1, eax, ebx, ecx, std_caps); | ||
| 152 | family = ((eax >> 8) & 0xf) + ((eax >> 20) & 0xff); | ||
| 153 | model = ((eax >> 4) & 0xf) + ((eax >> 12) & 0xf0); | ||
| 154 | /* Haswell has slow gather */ | ||
| 155 | if (!strncmp(vendor.c, "GenuineIntel", 12)) | ||
| 156 | if (family == 6 && model < 70) | ||
| 157 | rval |= AV_CPU_FLAG_SLOW_GATHER; | ||
| 158 | /* Zen 3 and earlier have slow gather */ | ||
| 159 | if (!strncmp(vendor.c, "AuthenticAMD", 12)) | ||
| 160 | if (family <= 0x19) | ||
| 161 | rval |= AV_CPU_FLAG_SLOW_GATHER; | ||
| 162 | } | ||
| 163 | |||
| 151 | #if HAVE_AVX512 /* F, CD, BW, DQ, VL */ | 164 | #if HAVE_AVX512 /* F, CD, BW, DQ, VL */ |
| 152 | if ((xcr0_lo & 0xe0) == 0xe0) { /* OPMASK/ZMM state */ | 165 | if ((xcr0_lo & 0xe0) == 0xe0) { /* OPMASK/ZMM state */ |
| 153 | if ((rval & AV_CPU_FLAG_AVX2) && (ebx & 0xd0030000) == 0xd0030000) | 166 | if ((rval & AV_CPU_FLAG_AVX2) && (ebx & 0xd0030000) == 0xd0030000) |