Commit 8579d4b2 authored by Michael Niedermayer's avatar Michael Niedermayer

Merge remote-tracking branch 'qatar/master'

* qatar/master:
  build: export filtered -lz flag in config.mak
  build: add separate setting for host linker
  configure: probe_cc: use separate variable for linker output flag
  x86: Always compile files with functions that are called unconditionally
  x86: mpegvideoenc: fix linking with --disable-mmx
  x86: mpegvideoenc: Do not abuse HAVE_ variables for template instantiation

Conflicts:
	Makefile
	configure
	libavcodec/x86/Makefile
Merged-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parents 1c668076 7baa115a
......@@ -59,7 +59,7 @@ $(PROGS): %$(EXESUF): %_g$(EXESUF)
$(TOOLS): %$(EXESUF): %.o
$(LD) $(LDFLAGS) $(LD_O) $< $(ELIBS)
tools/cws2fws$(EXESUF): ELIBS = -lz
tools/cws2fws$(EXESUF): ELIBS = $(ZLIB)
config.h: .config
.config: $(wildcard $(FFLIBS:%=$(SRC_PATH)/lib%/all*.c))
......
......@@ -10,7 +10,7 @@ ifndef SUBDIR
ifndef V
Q = @
ECHO = printf "$(1)\t%s\n" $(2)
BRIEF = CC CXX HOSTCC AS YASM AR LD STRIP CP
BRIEF = CC CXX HOSTCC HOSTLD AS YASM AR LD STRIP CP
SILENT = DEPCC DEPHOSTCC DEPAS DEPYASM RANLIB RM
MSG = $@
......@@ -109,7 +109,7 @@ $(HOSTOBJS): %.o: %.c
$(call COMPILE,HOSTCC)
$(HOSTPROGS): %$(HOSTEXESUF): %.o
$(HOSTCC) $(HOSTLDFLAGS) $(HOSTCC_O) $< $(HOSTLIBS)
$(HOSTLD) $(HOSTLDFLAGS) $(HOSTLD_O) $< $(HOSTLIBS)
$(OBJS): | $(sort $(dir $(OBJS)))
$(HOSTOBJS): | $(sort $(dir $(HOSTOBJS)))
......
......@@ -242,6 +242,7 @@ Advanced options (experts only):
--ld=LD use linker LD [$ld_default]
--host-cc=HOSTCC use host C compiler HOSTCC
--host-cflags=HCFLAGS use HCFLAGS when compiling for host
--host-ld=HOSTLD use host linker HOSTLD
--host-ldflags=HLDFLAGS use HLDFLAGS when linking for host
--host-libs=HLIBS use libs HLIBS when linking for host
--host-os=OS compiler host OS [$target_os]
......@@ -1444,6 +1445,7 @@ CMDLINE_SET="
extra_version
host_cc
host_cflags
host_ld
host_ldflags
host_libs
host_os
......@@ -2050,6 +2052,7 @@ LD_O='-o $@'
FORCE_INC="-include"
HOSTCC_C='-c'
HOSTCC_O='-o $@'
HOSTLD_O='-o $@'
host_cflags='-D_ISOC99_SOURCE -D_XOPEN_SOURCE=600 -O3 -g'
host_libs='-lm'
......@@ -2408,7 +2411,7 @@ probe_cc(){
pfx=$1
_cc=$2
unset _type _ident _cc_c _cc_e _cc_o _flags _cflags _ldflags
unset _type _ident _cc_c _cc_e _cc_o _ld_o _flags _cflags _ldflags
unset _depflags _DEPCMD _DEPFLAGS
_flags_filter=echo
......@@ -2548,9 +2551,7 @@ set_ccvars CC
probe_cc hostcc "$host_cc"
host_cflags_filter=$_flags_filter
host_ldflags_filter=$_flags_filter
add_host_cflags $_flags $_cflags
add_host_ldflags $_flags $_ldflags
set_ccvars HOSTCC
test -n "$cc_type" && enable $cc_type ||
......@@ -2559,7 +2560,8 @@ test -n "$cc_type" && enable $cc_type ||
: ${as_default:=$cc}
: ${dep_cc_default:=$cc}
: ${ld_default:=$cc}
set_default ar as dep_cc ld
: ${host_ld_default:=$host_cc}
set_default ar as dep_cc ld host_ld
probe_cc as "$as"
asflags_filter=$_flags_filter
......@@ -2570,7 +2572,12 @@ probe_cc ld "$ld"
ldflags_filter=$_flags_filter
add_ldflags $_flags $_ldflags
test "$cc_type" != "$ld_type" && add_ldflags $cc_ldflags
LD_O=${_cc_o-$LD_O}
LD_O=${_ld_o-$LD_O}
probe_cc hostld "$host_ld"
host_ldflags_filter=$_flags_filter
add_host_ldflags $_flags $_ldflags
HOSTLD_O=${_ld_o-$HOSTLD_O}
if [ -z "$CC_DEPFLAGS" ] && [ "$dep_cc" != "$cc" ]; then
probe_cc depcc "$dep_cc"
......@@ -4034,6 +4041,7 @@ ASDEP_FLAGS=$ASDEP_FLAGS
CC_DEPFLAGS=$CC_DEPFLAGS
AS_DEPFLAGS=$AS_DEPFLAGS
HOSTCC=$host_cc
HOSTLD=$host_ld
HOSTCFLAGS=$host_cflags
HOSTEXESUF=$HOSTEXESUF
HOSTLDFLAGS=$host_ldflags
......@@ -4045,10 +4053,12 @@ HOSTCCDEP_FLAGS=$HOSTCCDEP_FLAGS
HOSTCC_DEPFLAGS=$HOSTCC_DEPFLAGS
HOSTCC_C=$HOSTCC_C
HOSTCC_O=$HOSTCC_O
HOSTLD_O=$HOSTLD_O
TARGET_EXEC=$target_exec
TARGET_PATH=$target_path
LIBS-ffplay=$sdl_libs
CFLAGS-ffplay=$sdl_cflags
ZLIB=$($ldflags_filter -lz)
LIB_INSTALL_EXTRA_CMD=$LIB_INSTALL_EXTRA_CMD
EXTRALIBS=$extralibs
INSTALL=$install
......
OBJS-$(CONFIG_DNXHD_ENCODER) += x86/dnxhdenc.o
OBJS-$(CONFIG_MLP_DECODER) += x86/mlpdsp.o
OBJS-$(CONFIG_MPEGVIDEO) += x86/mpegvideo.o
OBJS-$(CONFIG_MPEGVIDEOENC) += x86/mpegvideoenc.o
OBJS-$(CONFIG_TRUEHD_DECODER) += x86/mlpdsp.o
OBJS-$(CONFIG_VP3DSP) += x86/vp3dsp_init.o
OBJS-$(CONFIG_XMM_CLOBBER_TEST) += x86/w64xmmtest.o
......@@ -14,7 +17,6 @@ MMX-OBJS += x86/dsputil_mmx.o \
MMX-OBJS-$(CONFIG_AAC_DECODER) += x86/sbrdsp_init.o
MMX-OBJS-$(CONFIG_AC3DSP) += x86/ac3dsp_init.o
MMX-OBJS-$(CONFIG_CAVS_DECODER) += x86/cavsdsp.o
MMX-OBJS-$(CONFIG_DNXHD_ENCODER) += x86/dnxhdenc.o
MMX-OBJS-$(CONFIG_DWT) += x86/snowdsp.o \
x86/dwt.o
MMX-OBJS-$(CONFIG_ENCODERS) += x86/dsputilenc_mmx.o
......@@ -24,8 +26,6 @@ MMX-OBJS-$(CONFIG_H264DSP) += x86/h264dsp_init.o
MMX-OBJS-$(CONFIG_H264PRED) += x86/h264_intrapred_init.o
MMX-OBJS-$(CONFIG_LPC) += x86/lpc.o
MMX-OBJS-$(CONFIG_MPEGAUDIODSP) += x86/mpegaudiodec.o
MMX-OBJS-$(CONFIG_MPEGVIDEO) += x86/mpegvideo.o
MMX-OBJS-$(CONFIG_MPEGVIDEOENC) += x86/mpegvideoenc.o
MMX-OBJS-$(CONFIG_PNG_DECODER) += x86/pngdsp_init.o
MMX-OBJS-$(CONFIG_PRORES_DECODER) += x86/proresdsp_init.o
MMX-OBJS-$(CONFIG_PRORES_LGPL_DECODER) += x86/proresdsp_init.o
......
......@@ -30,39 +30,44 @@
extern uint16_t ff_inv_zigzag_direct16[64];
#if HAVE_SSSE3
#define HAVE_SSSE3_BAK
#endif
#undef HAVE_SSSE3
#define HAVE_SSSE3 0
#undef HAVE_SSE2
#undef HAVE_MMXEXT
#define HAVE_SSE2 0
#define HAVE_MMXEXT 0
#define COMPILE_TEMPLATE_MMXEXT 0
#define COMPILE_TEMPLATE_SSE2 0
#define COMPILE_TEMPLATE_SSSE3 0
#define RENAME(a) a ## _MMX
#define RENAMEl(a) a ## _mmx
#include "mpegvideoenc_template.c"
#undef HAVE_MMXEXT
#define HAVE_MMXEXT 1
#undef COMPILE_TEMPLATE_SSSE3
#undef COMPILE_TEMPLATE_SSE2
#undef COMPILE_TEMPLATE_MMXEXT
#define COMPILE_TEMPLATE_MMXEXT 1
#define COMPILE_TEMPLATE_SSE2 0
#define COMPILE_TEMPLATE_SSSE3 0
#undef RENAME
#undef RENAMEl
#define RENAME(a) a ## _MMX2
#define RENAMEl(a) a ## _mmx2
#include "mpegvideoenc_template.c"
#undef HAVE_SSE2
#define HAVE_SSE2 1
#undef COMPILE_TEMPLATE_MMXEXT
#undef COMPILE_TEMPLATE_SSE2
#undef COMPILE_TEMPLATE_SSSE3
#define COMPILE_TEMPLATE_MMXEXT 0
#define COMPILE_TEMPLATE_SSE2 1
#define COMPILE_TEMPLATE_SSSE3 0
#undef RENAME
#undef RENAMEl
#define RENAME(a) a ## _SSE2
#define RENAMEl(a) a ## _sse2
#include "mpegvideoenc_template.c"
#ifdef HAVE_SSSE3_BAK
#undef HAVE_SSSE3
#define HAVE_SSSE3 1
#if HAVE_SSSE3
#undef COMPILE_TEMPLATE_MMXEXT
#undef COMPILE_TEMPLATE_SSE2
#undef COMPILE_TEMPLATE_SSSE3
#define COMPILE_TEMPLATE_MMXEXT 0
#define COMPILE_TEMPLATE_SSE2 1
#define COMPILE_TEMPLATE_SSSE3 1
#undef RENAME
#undef RENAMEl
#define RENAME(a) a ## _SSSE3
......@@ -84,11 +89,11 @@ void ff_MPV_encode_init_x86(MpegEncContext *s)
s->dct_quantize = dct_quantize_SSSE3;
} else
#endif
if (mm_flags & AV_CPU_FLAG_SSE2) {
if (mm_flags & AV_CPU_FLAG_SSE2 && HAVE_SSE) {
s->dct_quantize = dct_quantize_SSE2;
} else if (mm_flags & AV_CPU_FLAG_MMXEXT) {
} else if (mm_flags & AV_CPU_FLAG_MMXEXT && HAVE_MMXEXT) {
s->dct_quantize = dct_quantize_MMX2;
} else {
} else if (mm_flags & AV_CPU_FLAG_MMX && HAVE_MMX) {
s->dct_quantize = dct_quantize_MMX;
}
}
......
......@@ -29,7 +29,7 @@
#undef SAVE_SIGN
#undef RESTORE_SIGN
#if HAVE_SSE2
#if COMPILE_TEMPLATE_SSE2
#define MMREG_WIDTH "16"
#define MM "%%xmm"
#define MOVQ "movdqa"
......@@ -48,7 +48,7 @@
#define MMREG_WIDTH "8"
#define MM "%%mm"
#define MOVQ "movq"
#if HAVE_MMXEXT
#if COMPILE_TEMPLATE_MMXEXT
#define SPREADW(a) "pshufw $0, "a", "a" \n\t"
#define PMAXW(a,b) "pmaxsw "a", "b" \n\t"
#define PMAX(a,b) \
......@@ -74,7 +74,7 @@
#endif
#endif
#if HAVE_SSSE3
#if COMPILE_TEMPLATE_SSSE3
#define SAVE_SIGN(a,b) \
"movdqa "b", "a" \n\t"\
"pabsw "b", "b" \n\t"
......@@ -215,7 +215,7 @@ static int RENAME(dct_quantize)(MpegEncContext *s,
SPREADW(MM"1")
"psubusw "MM"1, "MM"4 \n\t"
"packuswb "MM"4, "MM"4 \n\t"
#if HAVE_SSE2
#if COMPILE_TEMPLATE_SSE2
"packuswb "MM"4, "MM"4 \n\t"
#endif
"movd "MM"4, %0 \n\t" // *overflow
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment