Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2017-09-27Merge commit '7abdd026df6a9a52d07d8174505b33cc89db7bf6'James Almer
* commit '7abdd026df6a9a52d07d8174505b33cc89db7bf6': asm: Consistently uppercase SECTION markers Merged-by: James Almer <jamrial@gmail.com>
2017-06-27x86inc: don't use read-only data sections on COFF targetsJames Almer
Yasm: src/libavfilter/x86/af_volume.asm:24: warning: Standard COFF does not support read-only data sections src/libavfilter/x86/af_volume.asm:24: warning: Unrecognized qualifier `align' Nasm: src/libavfilter/x86/af_volume.asm:24: error: standard COFF does not support section alignment specification src/libavutil/x86/x86inc.asm:92: ... from macro `SECTION_RODATA' defined here Tested-by: Clément Bœsch <u@pkh.me> Signed-off-by: James Almer <jamrial@gmail.com>
2017-06-12x86inc: Add some additional cpuflag relationsHenrik Gramner
Simplifies writing assembly code that depends on available instructions. LZCNT implies SSE2 BMI1 implies AVX+LZCNT AVX2 implies BMI2
2017-06-09x86inc: Remove argument from WIN64_RESTORE_XMMAnton Mitrofanov
The use of rsp was pretty much hardcoded there and probably didn't work otherwise with stack_size > 0.
2017-06-09x86inc: Prefer r14/r15 over r12/r13 on x86-64Henrik Gramner
Due to a peculiarity in the ModR/M addressing encoding, the r12 and r13 registers sometimes requires an additional byte when used as a base register. r14 and r15 doesn't have that issue, so prefer using them.
2017-06-09x86inc: Make REP_RET identical to RET in SSSE3+ functionsHenrik Gramner
There's no point in emitting a rep prefix before ret on modern CPUs.
2017-06-09x86inc: Fix call with memory operandsHenrik Gramner
We overload the `call` instruction with a macro, but it would misbehave when the macro argument wasn't a valid identifier. Fix it by explicitly checking if the argument is an identifier.
2017-02-03asm: Consistently uppercase SECTION markersDiego Biurrun
2017-01-09x86inc: Avoid using eax/rax for storing the stack pointerHenrik Gramner
When allocating stack space with an alignment requirement that is larger than the current stack alignment we need to store a copy of the original stack pointer in order to be able to restore it later. If we chose to use another register for this purpose we should not pick eax/rax since it can be overwritten as a return value.
2017-01-09x86inc: Avoid using eax/rax for storing the stack pointerHenrik Gramner
When allocating stack space with an alignment requirement that is larger than the current stack alignment we need to store a copy of the original stack pointer in order to be able to restore it later. If we chose to use another register for this purpose we should not pick eax/rax since it can be overwritten as a return value. Signed-off-by: Anton Khirnov <anton@khirnov.net>
2016-05-16x86inc: Enable AVX emulation in additional casesAnton Mitrofanov
Allows emulation to work when dst is equal to src2 as long as the instruction is commutative, e.g. `addps m0, m1, m0`. Signed-off-by: Anton Khirnov <anton@khirnov.net>
2016-05-16x86inc: Improve handling of %ifid with multi-token parametersAnton Mitrofanov
The yasm/nasm preprocessor only checks the first token, which means that parameters such as `dword [rax]` are treated as identifiers, which is generally not what we want. Signed-off-by: Anton Khirnov <anton@khirnov.net>
2016-05-16x86inc: Fix AVX emulation of some instructionsAnton Mitrofanov
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2016-05-16x86inc: Fix AVX emulation of scalar float instructionsHenrik Gramner
Those instructions are not commutative since they only change the first element in the vector and leave the rest unmodified. Signed-off-by: Anton Khirnov <anton@khirnov.net>
2016-04-20x86inc: Enable AVX emulation in additional casesAnton Mitrofanov
Allows emulation to work when dst is equal to src2 as long as the instruction is commutative, e.g. `addps m0, m1, m0`.
2016-04-20x86inc: Improve handling of %ifid with multi-token parametersAnton Mitrofanov
The yasm/nasm preprocessor only checks the first token, which means that parameters such as `dword [rax]` are treated as identifiers, which is generally not what we want.
2016-04-20x86inc: Fix AVX emulation of some instructionsAnton Mitrofanov
2016-04-20x86inc: Fix AVX emulation of scalar float instructionsHenrik Gramner
Those instructions are not commutative since they only change the first element in the vector and leave the rest unmodified.
2016-01-23x86inc: Add debug symbols indicating sizes of compiled functionsGeza Lore
Some debuggers/profilers use this metadata to determine which function a given instruction is in; without it they get can confused by local labels (if you haven't stripped those). On the other hand, some tools are still confused even with this metadata. e.g. this fixes `gdb`, but not `perf`. Currently only implemented for ELF. Signed-off-by: Anton Khirnov <anton@khirnov.net>
2016-01-23x86inc: Avoid creating unnecessary local labelsHenrik Gramner
The REP_RET workaround is only needed on old AMD cpus, and the labels clutter up the symbol table and confuse debugging/profiling tools, so use EQU to create SHN_ABS symbols instead of creating local labels. Furthermore, skip the workaround completely in functions that definitely won't run on such cpus. Note that EQU is just creating a local label when using nasm instead of yasm. This is probably a bug, but at least it doesn't break anything. Signed-off-by: Anton Khirnov <anton@khirnov.net>
2016-01-23x86inc: Simplify AUTO_REP_RETHenrik Gramner
cpuflags is never undefined any more, it's set to 0 instead. Also fix an incorrect comment. Signed-off-by: Anton Khirnov <anton@khirnov.net>
2016-01-23x86inc: Use more consistent indentationHenrik Gramner
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2016-01-23x86inc: Preserve arguments when allocating stack spaceHenrik Gramner
When allocating stack space with a larger alignment than the known stack alignment a temporary register is used for storing the stack pointer. Ensure that this isn't one of the registers used for passing arguments. Signed-off-by: Anton Khirnov <anton@khirnov.net>
2016-01-23x86inc: Improve FMA instruction handlingHenrik Gramner
* Correctly handle FMA instructions with memory operands. * Print a warning if FMA instructions are used without the correct cpuflag. * Simplify the instantiation code. * Clarify documentation. Only the last operand in FMA3 instructions can be a memory operand. When converting FMA4 instructions to FMA3 instructions we can utilize the fact that multiply is a commutative operation and reorder operands if necessary to ensure that a memory operand is used only as the last operand. Signed-off-by: Anton Khirnov <anton@khirnov.net>
2016-01-23x86inc: Be more verbose in assertion failuresHenrik Gramner
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2016-01-23x86inc: Make cpuflag() and notcpuflag() return 0 or 1Henrik Gramner
Makes it possible to use them in arithmetic expressions. Signed-off-by: Anton Khirnov <anton@khirnov.net>
2016-01-22x86inc: Add debug symbols indicating sizes of compiled functionsGeza Lore
Some debuggers/profilers use this metadata to determine which function a given instruction is in; without it they get can confused by local labels (if you haven't stripped those). On the other hand, some tools are still confused even with this metadata. e.g. this fixes `gdb`, but not `perf`. Currently only implemented for ELF.
2016-01-22x86inc: Avoid creating unnecessary local labelsHenrik Gramner
The REP_RET workaround is only needed on old AMD cpus, and the labels clutter up the symbol table and confuse debugging/profiling tools, so use EQU to create SHN_ABS symbols instead of creating local labels. Furthermore, skip the workaround completely in functions that definitely won't run on such cpus. Note that EQU is just creating a local label when using nasm instead of yasm. This is probably a bug, but at least it doesn't break anything.
2016-01-22x86inc: Simplify AUTO_REP_RETHenrik Gramner
cpuflags is never undefined any more, it's set to 0 instead. Also fix an incorrect comment.
2016-01-22x86inc: Use more consistent indentationHenrik Gramner
2016-01-22x86inc: Preserve arguments when allocating stack spaceHenrik Gramner
When allocating stack space with a larger alignment than the known stack alignment a temporary register is used for storing the stack pointer. Ensure that this isn't one of the registers used for passing arguments.
2016-01-22x86inc: Improve FMA instruction handlingHenrik Gramner
* Correctly handle FMA instructions with memory operands. * Print a warning if FMA instructions are used without the correct cpuflag. * Simplify the instantiation code. * Clarify documentation. Only the last operand in FMA3 instructions can be a memory operand. When converting FMA4 instructions to FMA3 instructions we can utilize the fact that multiply is a commutative operation and reorder operands if necessary to ensure that a memory operand is used only as the last operand.
2016-01-22x86inc: Be more verbose in assertion failuresHenrik Gramner
2015-10-28lavu: add AESNI CPU flagRodger Combs
2015-10-01x86inc: Make cpuflag() and notcpuflag() return 0 or 1Henrik Gramner
Makes it possible to use them in arithmetic expressions.
2015-08-13x86inc: Various minor backports from x264Henrik Gramner
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2015-08-11x86inc: Drop SECTION_TEXT macroHenrik Gramner
The .text section is already 16-byte aligned by default on all supported platforms so `SECTION_TEXT` isn't any different from `SECTION .text`. Signed-off-by: Anton Khirnov <anton@khirnov.net>
2015-08-11x86inc: Disable vpbroadcastq workaround in newer yasm versionsHenrik Gramner
The bug was fixed in 1.3.0, so only perform the workaround in earlier versions. Signed-off-by: Anton Khirnov <anton@khirnov.net>
2015-08-11x86inc: Fix instantiation of YMM registersChristophe Gisquet
Signed-off-by: Henrik Gramner <henrik@gramner.com> Signed-off-by: Anton Khirnov <anton@khirnov.net>
2015-08-11x86inc: warn when instructions incompatible with current cpuflags are usedAnton Mitrofanov
Signed-off-by: Henrik Gramner <henrik@gramner.com> Signed-off-by: Anton Khirnov <anton@khirnov.net>
2015-08-11x86inc: Support arbitrary stack alignmentsHenrik Gramner
Change ALLOC_STACK to always align the stack before allocating stack space for consistency. Previously alignment would occur either before or after allocating stack space depending on whether manual alignment was required or not. Signed-off-by: Anton Khirnov <anton@khirnov.net>
2015-08-11x86inc: warn if XOP integer FMA instruction emulation is impossibleAnton Mitrofanov
Emulation requires a temporary register if arguments 1 and 4 are the same; this doesn't obey the semantics of the original instruction, so we can't emulate that in x86inc. Also add pmacsdql emulation. Signed-off-by: Henrik Gramner <henrik@gramner.com> Signed-off-by: Anton Khirnov <anton@khirnov.net>
2015-08-05x86inc: warn if XOP integer FMA instruction emulation is impossibleAnton Mitrofanov
Signed-off-by: Henrik Gramner <henrik@gramner.com>
2015-08-04x86inc: Drop SECTION_TEXT macroHenrik Gramner
The .text section is already 16-byte aligned by default on all supported platforms so `SECTION_TEXT` isn't any different from `SECTION .text`.
2015-08-04x86inc: Support arbitrary stack alignmentsHenrik Gramner
Change ALLOC_STACK to always align the stack before allocating stack space for consistency. Previously alignment would occur either before or after allocating stack space depending on whether manual alignment was required or not.
2015-08-03x86: move XOP emulation code back to x86incJames Almer
Only two functions that use xop multiply-accumulate instructions where the first operand is the same as the fourth actually took advantage of the macros. This further reduces differences with x264's x86inc. Reviewed-by: Ronald S. Bultje <rsbultje@gmail.com> Signed-off-by: James Almer <jamrial@gmail.com>
2015-08-03x86inc: Various minor backports from x264Henrik Gramner
Reviewed-by: "Ronald S. Bultje" <rsbultje@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-08-03x86inc: Disable vpbroadcastq workaround in newer yasm versionsHenrik Gramner
The bug was fixed in 1.3.0, so only perform the workaround in earlier versions. Reviewed-by: "Ronald S. Bultje" <rsbultje@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-05-28x86inc: Clear __SECT__Timothy Gu
Silences warning(s) like: libavcodec/x86/fft.asm:93: warning: section flags ignored on section redeclaration The cause of this warning is that because `struc` and `endstruc` attempts to revert to the previous section state [1]. The section state is stored in the macro __SECT__, defined by x86inc.asm to be `.note.GNU-stack ...`, through the `SECTION` directive [2]. Thus, the `.note.GNU-stack` section is defined twice (once in x86inc.asm, once during `endstruc`), causing the warning. That is the first part of the commit: using the primitive `[section]` format for .note.GNU-stack etc., which does not update `__SECT__` [2]. That fixes only half of the problem. Even without any `SECTION` directives, `__SECT__` is predefined as `.text`, which conflicting with the later `SECTION_TEXT` (which expands to `.text align=16`). [1]: http://www.nasm.us/doc/nasmdoc6.html#section-6.4 [2]: http://www.nasm.us/doc/nasmdoc6.html#section-6.3 Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2015-05-28x86inc: Clear __SECT__Timothy Gu
This commit silences warning(s) like: libavcodec/x86/fft.asm:93: warning: section flags ignored on section redeclaration The cause of this warning is that because `struc` and `endstruc` attempts to revert to the previous section state [1]. The section state is stored in the macro __SECT__, defined by x86inc.asm to be `.note.GNU-stack ...`, through the `SECTION` directive [2]. Thus, the `.note.GNU-stack` section is defined twice (once in x86inc.asm, once during `endstruc`), causing the warning. That is the first part of the commit: using the primitive `[section]` format for .note.GNU-stack etc., which does not update `__SECT__` [2]. That fixes only half of the problem. Even without any `SECTION` directives, `__SECT__` is predefined as `.text`, which conflicting with the later `SECTION_TEXT` (which expands to `.text align=16`). [1]: http://www.nasm.us/doc/nasmdoc6.html#section-6.4 [2]: http://www.nasm.us/doc/nasmdoc6.html#section-6.3 Signed-off-by: Michael Niedermayer <michaelni@gmx.at>