summaryrefslogtreecommitdiff
path: root/libavutil/cpu_internal.h
Commit message (Collapse)AuthorAgeFilesLines
* lavu/cpu: detect RISC-V base extensionsRĂ©mi Denis-Courmont2022-09-271-0/+1
| | | | | | | | | | This introduces compile-time and run-time CPU detection on RISC-V. In practice, I doubt that FFmpeg will ever see a RISC-V CPU without all of I, F and D extensions, and if it does, it probably won't have run-time detection. So the flags are essentially always set. But as things stand, checkasm wants them that way. Compare the ARMV8 flag on AArch64. We are nowhere near running short on CPU flag bits.
* avutil/cpu_internal: Fix check for SSE2SLOWAndreas Rheinhardt2022-06-181-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For SSE2 and SSE3, there are four states that the two flags involved (AV_CPU_FLAG_SSE[23] and AV_CPU_FLAG_SSE[23]SLOW) can convey. When ordered from worst to best they are: 1. both flags unset (SSE[23] unavailable) 2. the slow flag set, the ordinary flag unset (this is designed for cases where SSE2 is available, but so slow that MMX(EXT)/SSE code is usually faster) 3. both flags set (SSE2 is available, but there might be scenarios where MMX(EXT)/SSE code is faster) 4. the ordinary flag set, the slow flag unset (this is the normal case) The ordinary macros for checking cpuflags return true in the latter two cases; the fast macros only return true for the latter case. Yet the macros to check for slow currently only return true in case three. This seems unintended. In fact, the only uses of the slow macros are all of the form if (EXTERNAL_SSE2(cpu_flags) || EXTERNAL_SSE2_SLOW(cpu_flags)) where the check for EXTERNAL_SSE2_SLOW is completely redundant. Even more importantly, it is not what was intended. Before 6369ba3c9cc74becfaad2a8882dff3dd3e7ae3c0, the checks passed in cases 2 to 4. Said commit changed this to something that only passes for the third case. Commits 7fb758cd8ed08e4a37f10e25003953d13c68b8cd and c1913064e38cb338039f29c280a0dacc3fd1e451 restored the old behaviour, yet merging 4efab89332ea39a77145e8b15562b981d9dbde68 (in commit ac774cfa571734c49c26e2d3387adccff8957ff8) broke this again by changing it to what it is now.* This commit changes the macros to make the slow macros check whether a specific instruction is supported, even if slow. This restores the intended meaning to all uses of the SLOW macros and is generally more natural. *: Libav only checks for EXTERNAL_SSE2_SLOW, i.e. for the third case only. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avutil: [loongarch] Add support for loongarch SIMD.Shiyou Yin2021-12-151-0/+2
| | | | | | | | | | | 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>
* libavutil: Detect MMI and MSA flags for MIPSJiaxun Yang2020-07-231-0/+2
| | | | | | | | | | | | | | | 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>
* Merge commit '4cf84e254ae75b524e1cacae499a97d7cc9e5906'James Almer2018-02-111-0/+2
|\ | | | | | | | | | | | | * commit '4cf84e254ae75b524e1cacae499a97d7cc9e5906': Drop some unnecessary config.h #includes Merged-by: James Almer <jamrial@gmail.com>
| * Drop some unnecessary config.h #includesDiego Biurrun2018-02-061-0/+2
| |
| * cpu: split flag checks per arch in av_cpu_max_align()James Almer2017-10-091-0/+5
| | | | | | | | | | Signed-off-by: James Almer <jamrial@gmail.com> Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
* | avutil/cpu: split flag checks per arch in av_cpu_max_align()James Almer2017-09-271-0/+5
| | | | | | | | Signed-off-by: James Almer <jamrial@gmail.com>
* | x86: add some more helper macros to check for slow cpuflagsJames Almer2016-02-141-4/+7
| | | | | | | | | | Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: James Almer <jamrial@gmail.com>
* | Merge commit 'cae39851201b7781f1262e1c23627b45e6e80bb4'Michael Niedermayer2015-05-311-0/+10
|\ \ | |/ | | | | | | | | | | * commit 'cae39851201b7781f1262e1c23627b45e6e80bb4': x86: Add helper macros to check for slow cpuflags Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * x86: Add helper macros to check for slow cpuflagsJames Almer2015-05-311-0/+10
| | | | | | | | | | Signed-off-by: James Almer <jamrial@gmail.com> Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
* | Merge commit 'b7b17ed66e199afc7246e642bf3b35c3f8eca217'Michael Niedermayer2014-01-151-0/+1
|\ \ | |/ | | | | | | | | | | * 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-151-0/+1
| | | | | | | | | | | | | | 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 commit '8410d6e93c2e074881f1c7b7e4cdefd2e497d52e'Michael Niedermayer2013-08-291-0/+7
|\ \ | |/ | | | | | | | | | | * commit '8410d6e93c2e074881f1c7b7e4cdefd2e497d52e': avutil: Refactor CPU extension availability macros Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * avutil: Refactor CPU extension availability macrosDiego Biurrun2013-08-281-0/+7
| |
* | Merge commit 'b78b10c4b78b696927f2801cf2d9f193b4eff28b'Michael Niedermayer2013-08-291-4/+4
|/ | | | | | | * 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-281-0/+26