summaryrefslogtreecommitdiff
path: root/libavutil/cpu.c
Commit message (Collapse)AuthorAge
* 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>
* | x86/cpu: add missing avx2 AVOption in av_parse_cpu_flags()James Almer2014-02-06
| | | | | | | | | | Signed-off-by: James Almer <jamrial@gmail.com> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Merge commit 'b7b17ed66e199afc7246e642bf3b35c3f8eca217'Michael Niedermayer2014-01-15
|\| | | | | | | | | | | | | * commit 'b7b17ed66e199afc7246e642bf3b35c3f8eca217': aarch64: add cpuflags support for NEON and VFP Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * aarch64: add cpuflags support for NEON and VFPJanne Grunau2014-01-15
| | | | | | | | | | | | | | NEON and VFP are currently mandatory for all ARMv8 profiles. Both are handled as extensions as far as cpuflags are concerned. This is consistent with handling x86_64 which always has SSE2, but still handles it as an extension.
* | Merge remote-tracking branch 'qatar/master'Michael Niedermayer2013-11-24
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | * qatar/master: Add missing #includes for *INT64_MAX and *INT64_C Conflicts: ffmpeg.c ffmpeg_filter.c ffplay.c libavformat/assdec.c libavformat/avidec.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * Add missing #includes for *INT64_MAX and *INT64_CDiego Biurrun2013-11-23
| |
* | Merge commit '4d6ee0725553a43ba88d6f8327ebcf8f1c5ae8d4'Michael Niedermayer2013-10-26
|\| | | | | | | | | | | | | | | | | | | | | | | | | * commit '4d6ee0725553a43ba88d6f8327ebcf8f1c5ae8d4': libavutil: x86: Add AVX2 capable CPU detection. Conflicts: libavutil/cpu.c libavutil/cpu.h libavutil/x86/cpu.c See: 865b70bc5d1cf37ec6d6cb729a69dda2cca28bd5 Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * libavutil: x86: Add AVX2 capable CPU detection.Kieran Kunhya2013-10-25
| | | | | | | | | | | | Patch based on x264's AVX2 detection Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
* | Add AVX2 capable CPU detection. Patch based on x264's AVX2 detectionKieran Kunhya2013-10-26
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avutil/cpu: remove duplicate includeMichael Niedermayer2013-09-21
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Merge commit 'b78b10c4b78b696927f2801cf2d9f193b4eff28b'Michael Niedermayer2013-08-29
|\| | | | | | | | | | | | | * commit 'b78b10c4b78b696927f2801cf2d9f193b4eff28b': avutil: Move internal CPU detection function declarations to private header Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * avutil: Move internal CPU detection function declarations to private headerDiego Biurrun2013-08-28
| |
* | Merge commit 'c011ceef78eae66039efc66d9551a7146e08838a'Michael Niedermayer2013-06-03
|\| | | | | | | | | | | | | | | | | | | | | | | * commit 'c011ceef78eae66039efc66d9551a7146e08838a': swscale: ppc: Remove commented-out define cruft nsvdec: Remove commented-out debug cruft cpu: Restructure code to avoid pointless ret variable indirection Conflicts: libavutil/cpu.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * cpu: Restructure code to avoid pointless ret variable indirectionDiego Biurrun2013-06-02
| | | | | | | | libavutil/cpu.c:133:9: warning: unused variable ‘ret’ [-Wunused-variable]
* | av_cpu_count: factorize "detected %d logical cores" messageMichael Niedermayer2013-05-26
| | | | | | | | | | | | Also print the message just once Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Merge remote-tracking branch 'qatar/master'Michael Niedermayer2013-05-24
|\| | | | | | | | | | | | | * qatar/master: cpu: Include common.h for av_popcount64 Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * cpu: Include common.h for av_popcount64Martin Storsjö2013-05-24
| | | | | | | | | | | | This fixes build failures on windows since 2a6eaeaa8. Signed-off-by: Martin Storsjö <martin@martin.st>
* | Merge commit '2a6eaeaa85d17b27ee0dd449183ec197c35c9675'Michael Niedermayer2013-05-24
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | * commit '2a6eaeaa85d17b27ee0dd449183ec197c35c9675': Move get_logical_cpus() from lavc/pthread to lavu/cpu. Conflicts: doc/APIchanges libavcodec/pthread.c libavutil/cpu.c libavutil/cpu.h libavutil/version.h Merged-by: Michael Niedermayer <michaelni@gmx.at>