summaryrefslogtreecommitdiff
path: root/libavutil/cpu.c
Commit message (Collapse)AuthorAge
* avutil/cpu: #define _GNU_SOURCE before including any standard headersMarton Balint2022-04-22
| | | | | | | | Otherwise its effect might not work causing CPU_COUNT to not get defined. Fixes cpu count detection to actually use sched_getaffinity if available. Signed-off-by: Marton Balint <cus@passwd.hu>
* avutil/cpu: add AVX512 Icelake flagWu Jianhua2022-03-10
| | | | | | Signed-off-by: Wu Jianhua <jianhua.wu@intel.com> Reviewed-by: Henrik Gramner <henrik@gramner.com> Signed-off-by: James Almer <jamrial@gmail.com>
* avutil/cpu: add slowgather to av_parse_cpu_caps()James Almer2021-12-21
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* avutil: [loongarch] Add support for loongarch SIMD.Shiyou Yin2021-12-15
| | | | | | | | | | | LSX and LASX is loongarch SIMD extention. They are enabled by default if compiler support it, and can be disabled with '--disable-lsx' '--disable-lasx'. Change-Id: Ie2608ea61dbd9b7fffadbf0ec2348bad6c124476 Reviewed-by: Shiyou Yin <yinshiyou-hf@loongson.cn> Reviewed-by: guxiwei <guxiwei-hf@loongson.cn> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* lavu/cpu: Use av_cpu_ prefixThilo Borgmann2021-07-20
|
* lavu/cpu.c: Add av_force_cpu_count() to override auto-detection.Thilo Borgmann2021-07-16
|
* avutil/cpu: Remove deprecated functionsAndreas Rheinhardt2021-04-27
| | | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com> Signed-off-by: James Almer <jamrial@gmail.com>
* avutil/cpu: Schedule deprecated functions for removalAndreas Rheinhardt2021-04-19
| | | | | | | | av_set_cpu_flags_mask() has been deprecated in the commit which merged it: 6df42f98746be06c883ce683563e07c9a2af983f; av_parse_cpu_flags() has been deprecated in 4b529edff8934c258af95e5acc51f84deea66262. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avutil/cpu: Use HW_NCPUONLINE to detect # of online CPUs with OpenBSDBrad Smith2021-04-18
| | | | | Signed-off-by: Brad Smith <brad@comstyle.com> Signed-off-by: Marton Balint <cus@passwd.hu>
* avutil/cpu: Fix race condition in av_cpu_count()Andreas Rheinhardt2021-04-02
| | | | | | | | | | av_cpu_count() intends to emit a debug message containing the number of logical cores when called the first time. The check currently works with a static volatile int; yet this does not help at all in case of concurrent accesses by multiple threads. So replace this with an atomic_int. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* libavutil: Detect MMI and MSA flags for MIPSJiaxun Yang2020-07-23
| | | | | | | | | | | | | | | Add MMI & MSA runtime detection for MIPS. Basically there are two code pathes. For systems that natively support CPUCFG instruction or kernel emulated that instruction, we'll sense this feature from HWCAP and report the flags according to values grab from CPUCFG. For systems that have no CPUCFG (or not export it in HWCAP), we'll parse /proc/cpuinfo instead. Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com> Reviewed-by: Shiyou Yin <yinshiyou-hf@loongson.cn> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avutil: add AVX-512 flagsJames Darnley2017-12-24
|
* avutil/cpu: split flag checks per arch in av_cpu_max_align()James Almer2017-09-27
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* Merge commit 'e6bff23f1e11aefb16a2b5d6ee72bf7469c5a66e'James Almer2017-09-27
|\ | | | | | | | | | | | | | | | | | | * commit 'e6bff23f1e11aefb16a2b5d6ee72bf7469c5a66e': cpu: add a function for querying maximum required data alignment Adapted to work with the arbitrary runtime cpuflag changes av_force_cpu_flags() can generate. Merged-by: James Almer <jamrial@gmail.com>
| * cpu: add a function for querying maximum required data alignmentAnton Khirnov2017-02-11
| |
| * avutil: fix data race in av_get_cpu_flags()Wan-Teh Chang2016-12-08
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Make the one-time initialization in av_get_cpu_flags() thread-safe. The static variables |flags|, |cpuflags_mask|, and |checked| in libavutil/cpu.c are read and written using normal load and store operations. These are considered as data races. The fix is to use atomic load and store operations. Remove the |checked| variable because the invalid value of -1 for |flags| can be used to indicate the same condition. Rename |flags| to |cpu_flags| and move it to file scope. The fix can be verified by running the libavutil/tests/cpu_init.c test program under ThreadSanitizer: ./configure --toolchain=clang-tsan make libavutil/tests/cpu_init libavutil/tests/cpu_init There should be no warnings from ThreadSanitizer. Co-author: Dmitry Vyukov of Google, who suggested the data race fix. Signed-off-by: Wan-Teh Chang <wtc@google.com>
* | lavu/cpu: disable MMX warning on non x86 platformsClément Bœsch2017-06-29
| | | | | | | | | | We have AV_CPU_FLAG_ARMV8 == AV_CPU_FLAG_SSE3 which causes a trigger of this MMX warning on AArch64.
* | avutil: fix data race in av_get_cpu_flags()Wan-Teh Chang2016-12-13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Make the one-time initialization in av_get_cpu_flags() thread-safe. The static variable |cpu_flags| in libavutil/cpu.c is read and written using normal load and store operations. These are considered as data races. The fix is to use atomic load and store operations. The fix can be verified by running the libavutil/tests/cpu_init.c test program under ThreadSanitizer: ./configure --toolchain=clang-tsan make libavutil/tests/cpu_init libavutil/tests/cpu_init There should be no warnings from ThreadSanitizer. Co-author: Dmitry Vyukov of Google, who suggested the data race fix. Signed-off-by: Wan-Teh Chang <wtc@google.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avutil/cpu: remove the |checked| static variableWan-Teh Chang2016-11-23
| | | | | | | | | | | | | | | | | | | | | | Remove the |checked| variable because the invalid value of -1 for |flags| can be used to indicate the same condition. Also rename |flags| to |cpu_flags| because there are a local variable and a function parameter named |flags| in the same file. Co-author: Dmitry Vyukov of Google Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | Merge commit 'd12b5b2f135aade4099f4b26b0fe678656158c13'Derek Buitenhuis2016-05-11
|\| | | | | | | | | | | | | | | * commit 'd12b5b2f135aade4099f4b26b0fe678656158c13': build: Split test programs off into separate files Some conversions done by: James Almer <jamrial@gmail.com> Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
| * build: Split test programs off into separate filesDiego Biurrun2016-04-07
| | | | | | | | | | This avoids spurious library rebuilds when only the test program code is changed and simplifies the build system.
* | avutil/cpu: add missing entry for vfp_vm to av_parse_cpu_capsHendrik Leppkes2016-01-02
| |
* | Merge commit 'e2710e790c09e49e86baa58c6063af0097cc8cb0'Hendrik Leppkes2016-01-02
|\| | | | | | | | | | | | | * commit 'e2710e790c09e49e86baa58c6063af0097cc8cb0': arm: add a cpu flag for the VFPv2 vector mode Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
| * arm: add a cpu flag for the VFPv2 vector modeJanne Grunau2015-12-14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The vector mode was deprecated in ARMv7-A/VFPv3 and various cpu implementations do not support it in hardware. Vector mode code will depending the OS either be emulated in software or result in an illegal instruction on cpus which does not support it. This was not really problem in practice since NEON implementations of the same functions are preferred. It will however become a problem for checkasm which tests every cpu flag separately. Since this is a cpu feature newer cpu do not support anymore the behaviour of this flag differs from the other flags. It can be only activated by runtime cpu feature selection.
| * x86: add AV_CPU_FLAG_AVXSLOW flagJames Almer2015-05-31
| | | | | | | | | | Signed-off-by: James Almer <jamrial@gmail.com> Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
| * avutil: remove pointless bmi1 defineJames Almer2015-04-19
| | | | | | | | Signed-off-by: James Almer <jamrial@gmail.com>
| * cpu-test: Add unistd.h #include for getopt()Diego Biurrun2014-08-13
| |
* | lavu: add AESNI CPU flagRodger Combs2015-10-28
| |
* | winrt: multithreading supportwang-bin2015-10-16
| | | | | | | | | | | | _beginthreadex is for desktop only. CreateThread is available for windows store apps on windows (and phone) 8.1 and later. http://msdn.microsoft.com/en-us/library/ms682453%28VS.85%29.aspx Signed-off-by: Matt Oliver <protogonoi@gmail.com>
* | x86/cpu: add AV_CPU_FLAG_AVXSLOW flagJames Almer2015-05-27
| | | | | | | | | | Reviewed-by: Michael Niedermayer <michaelni@gmx.at> Signed-off-by: James Almer <jamrial@gmail.com>
* | avutil: remove pointless bmi1 defineJames Almer2015-04-18
| | | | | | | | | | Reviewed-by: Michael Niedermayer <michaelni@gmx.at> Signed-off-by: James Almer <jamrial@gmail.com>
* | avutil/cpu: add missing check for mmxext to av_force_cpu_flagsJames Almer2015-03-26
| | | | | | | | | | Reviewed-by: Michael Niedermayer <michaelni@gmx.at> Signed-off-by: James Almer <jamrial@gmail.com>
* | avutil: turn arm setend into a cpuflagMichael Niedermayer2014-08-13
| | | | | | | | | | | | | | | | | | | | | | 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>
* | avutil/cpu: check av_parse_cpu_caps() table during cpu-testMichael Niedermayer2014-08-06
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avutil/cpu: Make cpu flag names match between cpu-test and ↵Michael Niedermayer2014-08-06
| | | | | | | | | | | | av_parse_cpu_caps() tables Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avutil/cpu: add aarch64 entries to 2nd tableMichael Niedermayer2014-08-06
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avutil/cpu: output cpu data to stdoutMichael Niedermayer2014-08-06
| | | | | | | | | | | | | | | | | | Errors go to stderr, but the cpu stats are non error output for cputest This fixes echoing the cpu test results Reviewed-by: James Almer <jamrial@gmail.com> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avutil/cpu: fix cpu-test to work with ffmpegs cpuflags syntaxMichael Niedermayer2014-08-06
| | | | | | | | | | Found-by: jamrial Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Merge commit 'caf5ef852bf71984d3322bbeaf48cfb04ac8255f'Michael Niedermayer2014-08-04
|\| | | | | | | | | | | | | * commit 'caf5ef852bf71984d3322bbeaf48cfb04ac8255f': cpu-test: test av_cpu_count Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * cpu-test: test av_cpu_countJanne Grunau2014-08-04
| | | | | | | | Add CPU count and number threads as informative values for fate.
* | Merge commit '07d8fa58121be8fe315bd51ab760547fe209a745'Michael Niedermayer2014-08-04
|\| | | | | | | | | | | | | | | | | | | * commit '07d8fa58121be8fe315bd51ab760547fe209a745': fate: add informative cpu test Conflicts: tests/fate/libavutil.mak Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * fate: add informative cpu testJanne Grunau2014-08-04
| | | | | | | | | | | | | | | | libavutil/cpu-test prints raw and effective cpu flags to STDERR. Detected cpu flags can be useful for debugging fate errors. No comparison of the result against a expected result since that would require fate config specific references.
* | avutil/cpu: Use HAVE_UNISTD_H instead of HAVE_SYSCONF for #include <unistd.h>Michael Niedermayer2014-07-08
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avutil/cpu: force mmx on selection of higher x86 SIMD featuresMichael Niedermayer2014-05-20
| | | | | | | | | | | | | | | | | | Fixes various runtime failures with manually set flags that represent no existing CPU Fixes Ticket3653 Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Merge commit '8675bcb0addb1c7fb0b04682d1f3f95d5b8dae14'Michael Niedermayer2014-04-07
|\| | | | | | | | | | | | | * commit '8675bcb0addb1c7fb0b04682d1f3f95d5b8dae14': aarch64: add armv8 CPU flag Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * aarch64: add armv8 CPU flagJanne Grunau2014-04-06
| |
| * x86: add detection for Bit Manipulation Instruction setsJames Almer2014-02-23
| | | | | | | | | | | | Based on x264 code Signed-off-by: James Almer <jamrial@gmail.com>
| * x86: add detection for FMA3 instruction setJames Almer2014-02-23
| | | | | | | | | | | | Based on x264 code Signed-off-by: James Almer <jamrial@gmail.com>
* | x86: add detection for Bit Manipulation Instruction setsJames Almer2014-02-22
| | | | | | | | | | | | | | Based on x264 code Signed-off-by: James Almer <jamrial@gmail.com> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | x86: add detection for FMA3 instruction setJames Almer2014-02-22
| | | | | | | | | | | | | | Based on x264 code Signed-off-by: James Almer <jamrial@gmail.com> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>