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
14 14
15API changes, most recent first:15API changes, most recent first:
16 16
172021-12-21 - xxxxxxxxxx - lavu 57.12.100 - cpu.h
18 Add AV_CPU_FLAG_SLOW_GATHER.
19
172021-12-20 - xxxxxxxxxx - lavu 57.11.101 - display.h202021-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 treating22 to match its longstanding actual behaviour of treating
libavutil/cpu.h+1−0
@@ -54,6 +54,7 @@ · 53 unmodified lines
54#define AV_CPU_FLAG_BMI1 0x20000 ///< Bit Manipulation Instruction Set 154#define AV_CPU_FLAG_BMI1 0x20000 ///< Bit Manipulation Instruction Set 1
55#define AV_CPU_FLAG_BMI2 0x40000 ///< Bit Manipulation Instruction Set 255#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 used56#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 ///< standard59#define AV_CPU_FLAG_ALTIVEC 0x0001 ///< standard
59#define AV_CPU_FLAG_VSX 0x0002 ///< ISA 2.0660#define AV_CPU_FLAG_VSX 0x0002 ///< ISA 2.06
libavutil/version.h+2−2
@@ -79,8 +79,8 @@ · 78 unmodified lines
79 */79 */
80 80
81#define LIBAVUTIL_VERSION_MAJOR 5781#define LIBAVUTIL_VERSION_MAJOR 57
82#define LIBAVUTIL_VERSION_MINOR 1182#define LIBAVUTIL_VERSION_MINOR 12
83#define LIBAVUTIL_VERSION_MICRO 10183#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, \
libavutil/x86/cpu.c+14−1
@@ -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_AVX2148#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)

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