History

libavutil/cpu: Add AV_CPU_FLAG_SLOW_GATHER.

This flag is set on Haswell and earlier and all AMD cpus.

Alan Kelly committed 4 years ago

Commit ffbab991 parent 14b68054 files · +20 −3Browse files

Unified · Split

4 files
  1. doc/APIchanges +3 −0
  2. libavutil/cpu.h +1 −0
  3. libavutil/version.h +2 −2
  4. libavutil/x86/cpu.c +14 −1
doc/APIchanges+3−0
@@ -14,6 +14,9 @@ libavutil: 2021-04-27 · 13 unmodified lines
1414
1515 API changes, most recent first:
1616
17+2021-12-21 - xxxxxxxxxx - lavu 57.12.100 - cpu.h
18+ Add AV_CPU_FLAG_SLOW_GATHER.
19+
1720 2021-12-20 - xxxxxxxxxx - lavu 57.11.101 - display.h
1821 Modified the documentation of av_display_rotation_set()
1922 to match its longstanding actual behaviour of treating
libavutil/cpu.h+1−0
@@ -54,6 +54,7 @@ · 53 unmodified lines
5454 #define AV_CPU_FLAG_BMI1 0x20000 ///< Bit Manipulation Instruction Set 1
5555 #define AV_CPU_FLAG_BMI2 0x40000 ///< Bit Manipulation Instruction Set 2
5656 #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.
5758
5859 #define AV_CPU_FLAG_ALTIVEC 0x0001 ///< standard
5960 #define AV_CPU_FLAG_VSX 0x0002 ///< ISA 2.06
libavutil/version.h+2−2
@@ -79,8 +79,8 @@ · 78 unmodified lines
7979 */
8080
8181 #define LIBAVUTIL_VERSION_MAJOR 57
82−#define LIBAVUTIL_VERSION_MINOR 11
83−#define LIBAVUTIL_VERSION_MICRO 101
82+#define LIBAVUTIL_VERSION_MINOR 12
83+#define LIBAVUTIL_VERSION_MICRO 100
8484
8585 #define LIBAVUTIL_VERSION_INT AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \
8686 LIBAVUTIL_VERSION_MINOR, \
libavutil/x86/cpu.c+14−1
@@ -146,8 +146,21 @@ int ff_get_cpu_flags_x86(void) · 145 unmodified lines
146146 if (max_std_level >= 7) {
147147 cpuid(7, eax, ebx, ecx, edx);
148148 #if HAVE_AVX2
149− if ((rval & AV_CPU_FLAG_AVX) && (ebx & 0x00000020))
149+ if ((rval & AV_CPU_FLAG_AVX) && (ebx & 0x00000020)) {
150150 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+
151164 #if HAVE_AVX512 /* F, CD, BW, DQ, VL */
152165 if ((xcr0_lo & 0xe0) == 0xe0) { /* OPMASK/ZMM state */
153166 if ((rval & AV_CPU_FLAG_AVX2) && (ebx & 0xd0030000) == 0xd0030000)

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t