summaryrefslogtreecommitdiff
path: root/libavutil/x86/intmath.h
Commit message (Collapse)AuthorAge
* x86/intmath: add VEX encoded versions of av_clipf() and av_clipd()James Almer2021-11-19
| | | | | | | Prevents mixing inlined SSE instructions and AVX instructions when the compiler generates the latter. Signed-off-by: James Almer <jamrial@gmail.com>
* libavutil/common: clip nan value to aminMark Reid2021-11-15
| | | | | | | | | | | | Changes av_clipf to return amin if a is nan. Before if a is nan av_clipf_c returned nan and av_clipf_sse would return amax. Now the both should behave the same. This works because nan > amin is false. The max(nan, amin) will be amin. Signed-off-by: James Almer <jamrial@gmail.com>
* Don't use _tzcnt instrinics with clang for windows w/o BMI.Dale Curtis2017-10-25
| | | | | | | | | | | | | | | | | | | Technically _tzcnt* intrinsics are only available when the BMI instruction set is present. However the instruction encoding degrades to "rep bsf" on older processors. Clang for Windows debatably restricts the _tzcnt* instrinics behind the __BMI__ architecture define, so check for its presence or exclude the usage of these intrinics when clang is present. See also: https://ffmpeg.org/pipermail/ffmpeg-devel/2015-November/183404.html https://bugs.llvm.org/show_bug.cgi?id=30506 http://lists.llvm.org/pipermail/cfe-dev/2016-October/051034.html Signed-off-by: Dale Curtis <dalecurtis@chromium.org> Reviewed-by: Matt Oliver <protogonoi@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* lavu/intmath.h: fix compilation with msvc10.Matt Oliver2016-06-13
| | | | Signed-off-by: Matt Oliver <protogonoi@gmail.com>
* x86/intmath: disable sse av_clip functions when using ICCJames Almer2016-01-21
| | | | | | | | | It seems to miscompile them Should fix fate-ra-288 and fate-twinvq Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: James Almer <jamrial@gmail.com>
* x86/intmath: add missing early clobber to output operandsJames Almer2016-01-15
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* x86/intmath: add sse optimized av_clipf and av_clipdJames Almer2016-01-07
| | | | | | Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Reviewed-by: Ronald S. Bultje <rsbultje@gmail.com> Signed-off-by: James Almer <jamrial@gmail.com>
* avutil/x86/intmath: Fix intrinsic header include when using newer gcc with ↵Matt Oliver2015-11-12
| | | | | | older icc. Signed-off-by: Matt Oliver <protogonoi@gmail.com>
* avutil/x86/intmath: Disable use of tzcnt on older intel compilers.Matt Oliver2015-11-11
| | | | | | | ICC versions older than atleast 12.1.6 dont have the tzcnt intrinsics. Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: Matt Oliver <protogonoi@gmail.com>
* avutil/x86/intmath: Correct intrinsic headers for older compilers.Matt Oliver2015-11-09
| | | | Signed-off-by: Matt Oliver <protogonoi@gmail.com>
* avutil/x86/intmath: Add missing header.Matt Oliver2015-11-01
| | | | Signed-off-by: Matt Oliver <protogonoi@gmail.com>
* avutil/x86/intmath: Use tzcnt in place of bsf.Matt Oliver2015-10-31
| | | | Signed-off-by: Matt Oliver <protogonoi@gmail.com>
* lavu/intmath.h: Move x86 only msvc/icl functions to x86 specific header.Matt Oliver2015-10-19
| | | | Signed-off-by: Matt Oliver <protogonoi@gmail.com>
* lavu/intmath.h: Add msvc/icl ctzll optimisations.Matt Oliver2015-10-19
| | | | Signed-off-by: Matt Oliver <protogonoi@gmail.com>
* avutil/x86/intmath: add missing check for inline assemblyJames Almer2015-06-27
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* avutil/x86/intmath: use bzhi gcc builtin in av_mod_uintp2()James Almer2015-06-27
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* libavutil: add bmi2 optimized av_mod_uintp2James Almer2015-03-20
| | | | | Reviewed-by: Michael Niedermayer <michaelni@gmx.at> Signed-off-by: James Almer <jamrial@gmail.com>
* libavutil: add x86 optimized av_popcountJames Almer2015-02-25
| | | | | Reviewed-by: Ronald S. Bultje <rsbultje@gmail.com> Signed-off-by: James Almer <jamrial@gmail.com>
* x86: remove FASTDIV inline asmMans Rullgard2012-08-22
| | | | | | | | | | | | | | | | | | | GCC 4.3 and later do the right thing with the plain C code. Earlier versions in 32-bit mode generate one extra instruction, needlessly zeroing what would be the high half of the shifted value. At least two gcc configurations miscompile the inline asm in some situations. In 64-bit mode, all gcc versions generate imul r64, r64 followed by shr. On Intel i7 and later, this imul is faster 32-bit mul. On older Intel and all AMD, it is slightly slower. On Atom it is much slower. Considering where the FASTDIV macro is used, any overall negative performance impact of this change should be negligible. If anyone cares, they should file a bug against gcc and get the instruction selection fixed. Signed-off-by: Mans Rullgard <mans@mansr.com>
* x86: place some inline asm under #if HAVE_INLINE_ASMRonald S. Bultje2012-06-25
| | | | Signed-off-by: Mans Rullgard <mans@mansr.com>
* Replace FFmpeg with Libav in licence headersMans Rullgard2011-03-19
| | | | Signed-off-by: Mans Rullgard <mans@mansr.com>
* Replace many includes of libavutil/common.h with what is actually neededMåns Rullgård2010-03-09
| | | | | | | This reduces the number of false dependencies on header files and speeds up compilation. Originally committed as revision 22407 to svn://svn.ffmpeg.org/ffmpeg/trunk
* Move FASTDIV macro to intmath.hMåns Rullgård2010-01-19
Originally committed as revision 21335 to svn://svn.ffmpeg.org/ffmpeg/trunk