Skip to content

Commit

Permalink
build: Generalize yasm/nasm-related variable names
Browse files Browse the repository at this point in the history
None of them are specific to the YASM assembler.
  • Loading branch information
DonDiego committed Mar 1, 2017
1 parent d1d6230 commit 39e208f
Show file tree
Hide file tree
Showing 25 changed files with 145 additions and 140 deletions.
12 changes: 6 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ vpath %.texi $(SRC_PATH)
ifndef V
Q = @
ECHO = printf "$(1)\t%s\n" $(2)
BRIEF = CC HOSTCC HOSTLD AS YASM AR LD
SILENT = DEPCC DEPHOSTCC DEPAS DEPYASM RANLIB RM STRIP
BRIEF = CC HOSTCC HOSTLD AS X86ASM AR LD
SILENT = DEPCC DEPHOSTCC DEPAS DEPX86ASM RANLIB RM STRIP
MSG = $@
M = @$(call ECHO,$(TAG),$@);
$(foreach VAR,$(BRIEF), \
Expand All @@ -30,7 +30,7 @@ CCFLAGS = $(CPPFLAGS) $(CFLAGS)
OBJCFLAGS += $(EOBJCFLAGS)
OBJCCFLAGS = $(CPPFLAGS) $(CFLAGS) $(OBJCFLAGS)
ASFLAGS := $(CPPFLAGS) $(ASFLAGS)
YASMFLAGS += $(IFLAGS:%=%/) -Pconfig.asm
X86ASMFLAGS += $(IFLAGS:%=%/) -Pconfig.asm
HOSTCCFLAGS = $(IFLAGS) $(HOSTCPPFLAGS) $(HOSTCFLAGS)
LDFLAGS := $(ALLFFLIBS:%=$(LD_PATH)lib%) $(LDFLAGS)

Expand All @@ -57,8 +57,8 @@ COMPILE_HOSTC = $(call COMPILE,HOSTCC)
$(COMPILE_HOSTC)

%.o: %.asm
$(DEPYASM) $(YASMFLAGS) -I $(<D)/ -M -o $@ $< > $(@:.o=.d)
$(YASM) $(YASMFLAGS) -I $(<D)/ -o $@ $<
$(DEPX86ASM) $(X86ASMFLAGS) -I $(<D)/ -M -o $@ $< > $(@:.o=.d)
$(X86ASM) $(X86ASMFLAGS) -I $(<D)/ -o $@ $<
-$(STRIP) $(STRIPFLAGS) $@

%.i: %.c
Expand Down Expand Up @@ -113,7 +113,7 @@ avbuild/.config: $(CONFIGURABLE_COMPONENTS)
SUBDIR_VARS := CLEANFILES FFLIBS HOSTPROGS TESTPROGS TOOLS \
HEADERS ARCH_HEADERS BUILT_HEADERS SKIPHEADERS \
ARMV5TE-OBJS ARMV6-OBJS ARMV8-OBJS VFP-OBJS NEON-OBJS \
ALTIVEC-OBJS VSX-OBJS MMX-OBJS YASM-OBJS \
ALTIVEC-OBJS VSX-OBJS MMX-OBJS X86ASM-OBJS \
OBJS HOSTOBJS TESTOBJS

define RESET
Expand Down
2 changes: 1 addition & 1 deletion avbuild/arch.mak
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ OBJS-$(HAVE_ALTIVEC) += $(ALTIVEC-OBJS) $(ALTIVEC-OBJS-yes)
OBJS-$(HAVE_VSX) += $(VSX-OBJS) $(VSX-OBJS-yes)

OBJS-$(HAVE_MMX) += $(MMX-OBJS) $(MMX-OBJS-yes)
OBJS-$(HAVE_YASM) += $(YASM-OBJS) $(YASM-OBJS-yes)
OBJS-$(HAVE_X86ASM) += $(X86ASM-OBJS) $(X86ASM-OBJS-yes)
65 changes: 35 additions & 30 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@ Optimization options (experts only):
--disable-vfp disable VFP optimizations
--disable-neon disable NEON optimizations
--disable-inline-asm disable use of inline assembly
--disable-yasm disable use of nasm/yasm assembly
--disable-x86asm disable use of standalone x86 assembly
Developer options (useful when working on Libav itself):
--disable-debug disable debugging symbols
Expand Down Expand Up @@ -829,12 +829,12 @@ check_insn(){
echo "$2" | check_as && enable ${1}_external || disable ${1}_external
}

check_yasm(){
log check_yasm "$@"
check_x86asm(){
log check_x86asm "$@"
echo "$1" > $TMPS
log_file $TMPS
shift 1
check_cmd $yasmexe $YASMFLAGS "$@" -o $TMPO $TMPS
check_cmd $x86asmexe $X86ASMFLAGS "$@" -o $TMPO $TMPS
}

ld_o(){
Expand Down Expand Up @@ -1533,7 +1533,7 @@ BUILTIN_LIST="
HAVE_LIST_CMDLINE="
inline_asm
symver
yasm
x86asm
"

HAVE_LIST_PUB="
Expand Down Expand Up @@ -1912,7 +1912,7 @@ fma3_deps="avx"
fma4_deps="avx"
avx2_deps="avx"

mmx_external_deps="yasm"
mmx_external_deps="x86asm"
mmx_inline_deps="inline_asm"
mmx_suggest="mmx_external mmx_inline"

Expand Down Expand Up @@ -2568,7 +2568,7 @@ pkg_config_default=pkg-config
ranlib="ranlib"
strip="strip"
version_script='--version-script'
yasmexe="yasm"
x86asmexe="yasm"

# machine
arch_default=$(uname -m)
Expand Down Expand Up @@ -2817,6 +2817,11 @@ for opt do
warn "avserver has been removed, the ${opt} option is only"\
"provided for compatibility and will be removed in the future"
;;
--enable-yasm|--disable-yasm)
warn "The ${opt} option is only provided for compatibility and will be\n"\
"removed in the future. Use --enable-x86asm / --disable-x86asm instead."
test $opt = --enable-yasm && x86asm=yes || x86asm=no
;;
--enable-?*|--disable-?*)
eval $(echo "$opt" | sed 's/--/action=/;s/-/ option=/;s/-/_/g')
if is_in $option $COMPONENT_LIST; then
Expand Down Expand Up @@ -4467,30 +4472,30 @@ EOF
enabled ssse3 && check_inline_asm ssse3_inline '"pabsw %xmm0, %xmm0"'
enabled mmxext && check_inline_asm mmxext_inline '"pmaxub %mm0, %mm1"'

if ! disabled_any asm mmx yasm; then
if check_cmd $yasmexe --version; then
enabled x86_64 && yasm_extra="-m amd64"
yasm_debug="-g dwarf2"
if ! disabled_any asm mmx x86asm; then
if check_cmd $x86asmexe --version; then
enabled x86_64 && x86asm_extra="-m amd64"
x86asm_debug="-g dwarf2"
elif check_cmd nasm -v; then
yasmexe=nasm
yasm_debug="-g -F dwarf"
x86asmexe=nasm
x86asm_debug="-g -F dwarf"
enabled x86_64 && test "$objformat" = elf && objformat=elf64
fi

YASMFLAGS="-f $objformat $yasm_extra"
enabled pic && append YASMFLAGS "-DPIC"
test -n "$extern_prefix" && append YASMFLAGS "-DPREFIX"
X86ASMFLAGS="-f $objformat $x86asm_extra"
enabled pic && append X86ASMFLAGS "-DPIC"
test -n "$extern_prefix" && append X86ASMFLAGS "-DPREFIX"
case "$objformat" in
elf*) enabled debug && append YASMFLAGS $yasm_debug ;;
elf*) enabled debug && append X86ASMFLAGS $x86asm_debug ;;
esac

check_yasm "movbe ecx, [5]" && enable yasm ||
die "yasm/nasm not found or too old. Use --disable-yasm for a crippled build."
check_yasm "vextracti128 xmm0, ymm0, 0" || disable avx2_external
check_yasm "vpmacsdd xmm0, xmm1, xmm2, xmm3" || disable xop_external
check_yasm "vfmadd132ps ymm0, ymm1, ymm2" || disable fma3_external
check_yasm "vfmaddps ymm0, ymm1, ymm2, ymm3" || disable fma4_external
check_yasm "CPU amdnop" || disable cpunop
check_x86asm "movbe ecx, [5]" && enable x86asm ||
die "yasm/nasm not found or too old. Use --disable-x86asm for a crippled build."
check_x86asm "vextracti128 xmm0, ymm0, 0" || disable avx2_external
check_x86asm "vpmacsdd xmm0, xmm1, xmm2, xmm3" || disable xop_external
check_x86asm "vfmadd132ps ymm0, ymm1, ymm2" || disable fma3_external
check_x86asm "vfmaddps ymm0, ymm1, ymm2, ymm3" || disable fma4_external
check_x86asm "CPU amdnop" || disable cpunop
fi

case "$cpu" in
Expand Down Expand Up @@ -5209,7 +5214,7 @@ fi
echo "big-endian ${bigendian-no}"
echo "runtime cpu detection ${runtime_cpudetect-no}"
if enabled x86; then
echo "${yasmexe} ${yasm-no}"
echo "standalone assembly ${x86asm-no}"
echo "MMX enabled ${mmx-no}"
echo "MMXEXT enabled ${mmxext-no}"
echo "3DNow! enabled ${amd3dnow-no}"
Expand Down Expand Up @@ -5328,8 +5333,8 @@ DEPCC=$dep_cc
DEPCCFLAGS=$DEPCCFLAGS \$(CPPFLAGS)
DEPAS=$as
DEPASFLAGS=$DEPASFLAGS \$(CPPFLAGS)
YASM=$yasmexe
DEPYASM=$yasmexe
X86ASM=$x86asmexe
DEPX86ASM=$x86asmexe
AR=$ar
ARFLAGS=$arflags
AR_O=$ar_o
Expand All @@ -5356,7 +5361,7 @@ LDFLAGS=$LDFLAGS
LDEXEFLAGS=$LDEXEFLAGS
SHFLAGS=$(echo $($ldflags_filter $SHFLAGS))
STRIPFLAGS=$STRIPFLAGS
YASMFLAGS=$YASMFLAGS
X86ASMFLAGS=$X86ASMFLAGS
LIBPREF=$LIBPREF
LIBSUF=$LIBSUF
LIBNAME=$LIBNAME
Expand Down Expand Up @@ -5432,7 +5437,7 @@ EOF
test -n "$malloc_prefix" &&
echo "#define MALLOC_PREFIX $malloc_prefix" >>$TMPH

if enabled yasm; then
if enabled x86asm; then
append config_files $TMPASM
printf '' >$TMPASM
fi
Expand All @@ -5451,7 +5456,7 @@ echo "#endif /* LIBAV_CONFIG_H */" >> $TMPH
cp_if_changed $TMPH config.h
touch avbuild/.config

enabled yasm && cp_if_changed $TMPASM config.asm
enabled x86asm && cp_if_changed $TMPASM config.asm

cat > $TMPH <<EOF
/* Generated by ffconf */
Expand Down
72 changes: 36 additions & 36 deletions libavcodec/x86/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -71,60 +71,60 @@ MMX-OBJS-$(CONFIG_MPEG4_DECODER) += x86/xvididct_mmx.o \
x86/xvididct_sse2.o

# subsystems
YASM-OBJS-$(CONFIG_AC3DSP) += x86/ac3dsp.o \
X86ASM-OBJS-$(CONFIG_AC3DSP) += x86/ac3dsp.o \
x86/ac3dsp_downmix.o
YASM-OBJS-$(CONFIG_AUDIODSP) += x86/audiodsp.o
YASM-OBJS-$(CONFIG_BSWAPDSP) += x86/bswapdsp.o
YASM-OBJS-$(CONFIG_DCT) += x86/dct32.o
YASM-OBJS-$(CONFIG_FFT) += x86/fft.o
YASM-OBJS-$(CONFIG_FMTCONVERT) += x86/fmtconvert.o
YASM-OBJS-$(CONFIG_H263DSP) += x86/h263_loopfilter.o
YASM-OBJS-$(CONFIG_H264CHROMA) += x86/h264_chromamc.o \
X86ASM-OBJS-$(CONFIG_AUDIODSP) += x86/audiodsp.o
X86ASM-OBJS-$(CONFIG_BSWAPDSP) += x86/bswapdsp.o
X86ASM-OBJS-$(CONFIG_DCT) += x86/dct32.o
X86ASM-OBJS-$(CONFIG_FFT) += x86/fft.o
X86ASM-OBJS-$(CONFIG_FMTCONVERT) += x86/fmtconvert.o
X86ASM-OBJS-$(CONFIG_H263DSP) += x86/h263_loopfilter.o
X86ASM-OBJS-$(CONFIG_H264CHROMA) += x86/h264_chromamc.o \
x86/h264_chromamc_10bit.o
YASM-OBJS-$(CONFIG_H264DSP) += x86/h264_deblock.o \
X86ASM-OBJS-$(CONFIG_H264DSP) += x86/h264_deblock.o \
x86/h264_deblock_10bit.o \
x86/h264_idct.o \
x86/h264_idct_10bit.o \
x86/h264_weight.o \
x86/h264_weight_10bit.o
YASM-OBJS-$(CONFIG_H264PRED) += x86/h264_intrapred.o \
X86ASM-OBJS-$(CONFIG_H264PRED) += x86/h264_intrapred.o \
x86/h264_intrapred_10bit.o
YASM-OBJS-$(CONFIG_H264QPEL) += x86/h264_qpel_8bit.o \
X86ASM-OBJS-$(CONFIG_H264QPEL) += x86/h264_qpel_8bit.o \
x86/h264_qpel_10bit.o \
x86/fpel.o \
x86/qpel.o
YASM-OBJS-$(CONFIG_HPELDSP) += x86/fpel.o \
X86ASM-OBJS-$(CONFIG_HPELDSP) += x86/fpel.o \
x86/hpeldsp.o
YASM-OBJS-$(CONFIG_HUFFYUVDSP) += x86/huffyuvdsp.o
YASM-OBJS-$(CONFIG_ME_CMP) += x86/me_cmp.o
YASM-OBJS-$(CONFIG_MPEGAUDIODSP) += x86/imdct36.o
YASM-OBJS-$(CONFIG_MPEGVIDEOENC) += x86/mpegvideoencdsp.o
YASM-OBJS-$(CONFIG_PIXBLOCKDSP) += x86/pixblockdsp.o
YASM-OBJS-$(CONFIG_QPELDSP) += x86/qpeldsp.o \
X86ASM-OBJS-$(CONFIG_HUFFYUVDSP) += x86/huffyuvdsp.o
X86ASM-OBJS-$(CONFIG_ME_CMP) += x86/me_cmp.o
X86ASM-OBJS-$(CONFIG_MPEGAUDIODSP) += x86/imdct36.o
X86ASM-OBJS-$(CONFIG_MPEGVIDEOENC) += x86/mpegvideoencdsp.o
X86ASM-OBJS-$(CONFIG_PIXBLOCKDSP) += x86/pixblockdsp.o
X86ASM-OBJS-$(CONFIG_QPELDSP) += x86/qpeldsp.o \
x86/fpel.o \
x86/qpel.o
YASM-OBJS-$(CONFIG_RV34DSP) += x86/rv34dsp.o
YASM-OBJS-$(CONFIG_VC1DSP) += x86/vc1dsp.o
YASM-OBJS-$(CONFIG_VIDEODSP) += x86/videodsp.o
YASM-OBJS-$(CONFIG_VP3DSP) += x86/vp3dsp.o
YASM-OBJS-$(CONFIG_VP8DSP) += x86/vp8dsp.o \
X86ASM-OBJS-$(CONFIG_RV34DSP) += x86/rv34dsp.o
X86ASM-OBJS-$(CONFIG_VC1DSP) += x86/vc1dsp.o
X86ASM-OBJS-$(CONFIG_VIDEODSP) += x86/videodsp.o
X86ASM-OBJS-$(CONFIG_VP3DSP) += x86/vp3dsp.o
X86ASM-OBJS-$(CONFIG_VP8DSP) += x86/vp8dsp.o \
x86/vp8dsp_loopfilter.o

# decoders/encoders
YASM-OBJS-$(CONFIG_AAC_DECODER) += x86/sbrdsp.o
YASM-OBJS-$(CONFIG_APE_DECODER) += x86/apedsp.o
YASM-OBJS-$(CONFIG_DCA_DECODER) += x86/dcadsp.o
YASM-OBJS-$(CONFIG_DNXHD_ENCODER) += x86/dnxhdenc.o
YASM-OBJS-$(CONFIG_HEVC_DECODER) += x86/hevc_add_res.o \
X86ASM-OBJS-$(CONFIG_AAC_DECODER) += x86/sbrdsp.o
X86ASM-OBJS-$(CONFIG_APE_DECODER) += x86/apedsp.o
X86ASM-OBJS-$(CONFIG_DCA_DECODER) += x86/dcadsp.o
X86ASM-OBJS-$(CONFIG_DNXHD_ENCODER) += x86/dnxhdenc.o
X86ASM-OBJS-$(CONFIG_HEVC_DECODER) += x86/hevc_add_res.o \
x86/hevc_deblock.o \
x86/hevc_idct.o \
x86/hevc_mc.o
YASM-OBJS-$(CONFIG_PNG_DECODER) += x86/pngdsp.o
YASM-OBJS-$(CONFIG_PRORES_DECODER) += x86/proresdsp.o
YASM-OBJS-$(CONFIG_RV40_DECODER) += x86/rv40dsp.o
YASM-OBJS-$(CONFIG_V210_ENCODER) += x86/v210enc.o
YASM-OBJS-$(CONFIG_VORBIS_DECODER) += x86/vorbisdsp.o
YASM-OBJS-$(CONFIG_VP3_DECODER) += x86/hpeldsp_vp3.o
YASM-OBJS-$(CONFIG_VP6_DECODER) += x86/vp6dsp.o
YASM-OBJS-$(CONFIG_VP9_DECODER) += x86/vp9mc.o \
X86ASM-OBJS-$(CONFIG_PNG_DECODER) += x86/pngdsp.o
X86ASM-OBJS-$(CONFIG_PRORES_DECODER) += x86/proresdsp.o
X86ASM-OBJS-$(CONFIG_RV40_DECODER) += x86/rv40dsp.o
X86ASM-OBJS-$(CONFIG_V210_ENCODER) += x86/v210enc.o
X86ASM-OBJS-$(CONFIG_VORBIS_DECODER) += x86/vorbisdsp.o
X86ASM-OBJS-$(CONFIG_VP3_DECODER) += x86/hpeldsp_vp3.o
X86ASM-OBJS-$(CONFIG_VP6_DECODER) += x86/vp6dsp.o
X86ASM-OBJS-$(CONFIG_VP9_DECODER) += x86/vp9mc.o \
x86/vp9lpf.o
8 changes: 4 additions & 4 deletions libavcodec/x86/dcadsp_init.c
Original file line number Diff line number Diff line change
Expand Up @@ -56,18 +56,18 @@ static void synth_filter_##opt(FFTContext *imdct, \
*synth_buf_offset = (*synth_buf_offset - 32) & 511; \
} \

#if HAVE_YASM
#if HAVE_X86ASM
#if ARCH_X86_32
SYNTH_FILTER_FUNC(sse)
#endif
SYNTH_FILTER_FUNC(sse2)
SYNTH_FILTER_FUNC(avx)
SYNTH_FILTER_FUNC(fma3)
#endif /* HAVE_YASM */
#endif /* HAVE_X86ASM */

av_cold void ff_synth_filter_init_x86(SynthFilterContext *s)
{
#if HAVE_YASM
#if HAVE_X86ASM
int cpu_flags = av_get_cpu_flags();

#if ARCH_X86_32
Expand All @@ -84,5 +84,5 @@ av_cold void ff_synth_filter_init_x86(SynthFilterContext *s)
if (EXTERNAL_FMA3(cpu_flags) && !(cpu_flags & AV_CPU_FLAG_AVXSLOW)) {
s->synth_filter_float = synth_filter_fma3;
}
#endif /* HAVE_YASM */
#endif /* HAVE_X86ASM */
}
8 changes: 4 additions & 4 deletions libavcodec/x86/fmtconvert_init.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,16 @@
#include "libavutil/x86/cpu.h"
#include "libavcodec/fmtconvert.h"

#if HAVE_YASM
#if HAVE_X86ASM

void ff_int32_to_float_fmul_scalar_sse (float *dst, const int32_t *src, float mul, int len);
void ff_int32_to_float_fmul_scalar_sse2(float *dst, const int32_t *src, float mul, int len);

#endif /* HAVE_YASM */
#endif /* HAVE_X86ASM */

av_cold void ff_fmt_convert_init_x86(FmtConvertContext *c, AVCodecContext *avctx)
{
#if HAVE_YASM
#if HAVE_X86ASM
int cpu_flags = av_get_cpu_flags();

if (EXTERNAL_SSE(cpu_flags)) {
Expand All @@ -45,5 +45,5 @@ av_cold void ff_fmt_convert_init_x86(FmtConvertContext *c, AVCodecContext *avctx
if (EXTERNAL_SSE2(cpu_flags)) {
c->int32_to_float_fmul_scalar = ff_int32_to_float_fmul_scalar_sse2;
}
#endif /* HAVE_YASM */
#endif /* HAVE_X86ASM */
}
6 changes: 3 additions & 3 deletions libavcodec/x86/h264_qpel.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
#include "libavcodec/pixels.h"
#include "fpel.h"

#if HAVE_YASM
#if HAVE_X86ASM
void ff_put_pixels4_mmxext(uint8_t *block, const uint8_t *pixels,
ptrdiff_t line_size, int h);
void ff_avg_pixels4_mmxext(uint8_t *block, const uint8_t *pixels,
Expand Down Expand Up @@ -503,7 +503,7 @@ QPEL16_OP(mc33, MMX)
QPEL16(mmxext)
#endif

#endif /* HAVE_YASM */
#endif /* HAVE_X86ASM */

#define SET_QPEL_FUNCS(PFX, IDX, SIZE, CPU, PREFIX) \
do { \
Expand Down Expand Up @@ -543,7 +543,7 @@ QPEL16(mmxext)

av_cold void ff_h264qpel_init_x86(H264QpelContext *c, int bit_depth)
{
#if HAVE_YASM
#if HAVE_X86ASM
int high_bit_depth = bit_depth > 8;
int cpu_flags = av_get_cpu_flags();

Expand Down
Loading

0 comments on commit 39e208f

Please sign in to comment.