summaryrefslogtreecommitdiff
path: root/libavutil/x86
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2012-08-07 23:04:55 +0200
committerMichael Niedermayer <michaelni@gmx.at>2012-08-07 23:04:55 +0200
commit2fc7c818cb7b7bfdca69d17ab9f1b48290dbc3f6 (patch)
tree23a8f9c41f97be5cf9cdfd406575fa9ac9461b75 /libavutil/x86
parent2da5a5ce00caebbe3afbda8612588966cfeac477 (diff)
parentedd82267958fbbd34eca4f4dbfb96197b9b40ab5 (diff)
Merge remote-tracking branch 'qatar/master'
* qatar/master: x86: fix build with nasm 2.08 x86: use nop cpu directives only if supported x86: fix rNmp macros with nasm build: add trailing / to yasm/nasm -I flags x86: use 32-bit source registers with movd instruction x86: add colons after labels Conflicts: Makefile libavutil/x86/x86inc.asm Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavutil/x86')
-rw-r--r--libavutil/x86/float_dsp.asm4
-rw-r--r--libavutil/x86/x86inc.asm51
2 files changed, 18 insertions, 37 deletions
diff --git a/libavutil/x86/float_dsp.asm b/libavutil/x86/float_dsp.asm
index 7a18a20aca..ce823302f6 100644
--- a/libavutil/x86/float_dsp.asm
+++ b/libavutil/x86/float_dsp.asm
@@ -32,7 +32,7 @@ SECTION .text
cglobal vector_fmul, 4,4,2, dst, src0, src1, len
lea lenq, [lend*4 - 2*mmsize]
ALIGN 16
-.loop
+.loop:
mova m0, [src0q + lenq]
mova m1, [src0q + lenq + mmsize]
mulps m0, m0, [src1q + lenq]
@@ -74,7 +74,7 @@ cglobal vector_fmac_scalar, 4,4,3, dst, src, mul, len
%endif
%endif
lea lenq, [lend*4-2*mmsize]
-.loop
+.loop:
mulps m1, m0, [srcq+lenq ]
mulps m2, m0, [srcq+lenq+mmsize]
addps m1, m1, [dstq+lenq ]
diff --git a/libavutil/x86/x86inc.asm b/libavutil/x86/x86inc.asm
index d29740f278..01be0f8fc0 100644
--- a/libavutil/x86/x86inc.asm
+++ b/libavutil/x86/x86inc.asm
@@ -110,12 +110,14 @@
default rel
%endif
+%macro CPUNOP 1
+ %if HAVE_CPUNOP
+ CPU %1
+ %endif
+%endmacro
+
; Always use long nops (reduces 0x90 spam in disassembly on x86_32)
-; Not supported by NASM (except via smartalign package + ALIGNMODE k8,
-; however that fails when used together with the -M option)
-%ifdef __YASM_VER__
-CPU amdnop
-%endif
+CPUNOP amdnop
; Macros to eliminate most code duplication between x86_32 and x86_64:
; Currently this works only for leaf functions which load all their arguments
@@ -522,22 +524,8 @@ DECLARE_ARG 7, 8, 9, 10, 11, 12, 13, 14
; Applies any symbol mangling needed for C linkage, and sets up a define such that
; subsequent uses of the function name automatically refer to the mangled version.
; Appends cpuflags to the function name if cpuflags has been specified.
-%macro cglobal 1-2+ ; name, [PROLOGUE args]
-%if %0 == 1
- ; HACK: work around %+ broken with empty SUFFIX for nasm 2.09.10
- %ifndef cpuname
- cglobal_internal %1
- %else
- cglobal_internal %1 %+ SUFFIX
- %endif
-%else
- ; HACK: work around %+ broken with empty SUFFIX for nasm 2.09.10
- %ifndef cpuname
- cglobal_internal %1, %2
- %else
+%macro cglobal 1-2+ "" ; name, [PROLOGUE args]
cglobal_internal %1 %+ SUFFIX, %2
- %endif
-%endif
%endmacro
%macro cglobal_internal 1-2+
%ifndef cglobaled_%1
@@ -555,7 +543,7 @@ DECLARE_ARG 7, 8, 9, 10, 11, 12, 13, 14
%1:
RESET_MM_PERMUTATION ; not really needed, but makes disassembly somewhat nicer
%assign stack_offset 0
- %if %0 > 1
+ %ifnidn %2, ""
PROLOGUE %2
%endif
%endmacro
@@ -622,9 +610,7 @@ SECTION .note.GNU-stack noalloc noexec nowrite progbits
; All subsequent functions (up to the next INIT_CPUFLAGS) is built for the specified cpu.
; You shouldn't need to invoke this macro directly, it's a subroutine for INIT_MMX &co.
%macro INIT_CPUFLAGS 0-2
-%ifdef __YASM_VER__
- CPU amdnop
-%endif
+ CPUNOP amdnop
%if %0 >= 1
%xdefine cpuname %1
%assign cpuflags cpuflags_%1
@@ -648,7 +634,7 @@ SECTION .note.GNU-stack noalloc noexec nowrite progbits
%endif
%ifdef __YASM_VER__
%if notcpuflag(mmx2)
- CPU basicnop
+ CPUNOP basicnop
%endif
%endif
%else
@@ -826,18 +812,13 @@ INIT_XMM
; Append cpuflags to the callee's name iff the appended name is known and the plain name isn't
%macro call 1
- ; HACK: work around %+ broken with empty SUFFIX for nasm 2.09.10
- %ifndef cpuname
- call_internal %1, %1
- %else
- call_internal %1, %1 %+ SUFFIX
- %endif
+ call_internal %1 %+ SUFFIX, %1
%endmacro
%macro call_internal 2
- %xdefine %%i %1
- %ifndef cglobaled_%1
- %ifdef cglobaled_%2
- %xdefine %%i %2
+ %xdefine %%i %2
+ %ifndef cglobaled_%2
+ %ifdef cglobaled_%1
+ %xdefine %%i %1
%endif
%endif
call %%i