Skip to content

Commit

Permalink
namespace ARCH_* defines
Browse files Browse the repository at this point in the history
this prevents redefinition warnings if a toolchain sets one

BUG=b/117240165

Change-Id: Ib5d8c303cd05b4dbcc8d42c71ecfcba8f6d7b90c
  • Loading branch information
jzern committed Sep 30, 2019
1 parent 4f69df9 commit fad865c
Show file tree
Hide file tree
Showing 47 changed files with 182 additions and 181 deletions.
8 changes: 4 additions & 4 deletions build/make/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -430,10 +430,10 @@ ifneq ($(call enabled,DIST-SRCS),)
DIST-SRCS-$(CONFIG_MSVS) += build/make/gen_msvs_vcxproj.sh
DIST-SRCS-$(CONFIG_MSVS) += build/make/msvs_common.sh
DIST-SRCS-$(CONFIG_RVCT) += build/make/armlink_adapter.sh
DIST-SRCS-$(ARCH_ARM) += build/make/ads2gas.pl
DIST-SRCS-$(ARCH_ARM) += build/make/ads2gas_apple.pl
DIST-SRCS-$(ARCH_ARM) += build/make/ads2armasm_ms.pl
DIST-SRCS-$(ARCH_ARM) += build/make/thumb.pm
DIST-SRCS-$(VPX_ARCH_ARM) += build/make/ads2gas.pl
DIST-SRCS-$(VPX_ARCH_ARM) += build/make/ads2gas_apple.pl
DIST-SRCS-$(VPX_ARCH_ARM) += build/make/ads2armasm_ms.pl
DIST-SRCS-$(VPX_ARCH_ARM) += build/make/thumb.pm
DIST-SRCS-yes += $(target:-$(TOOLCHAIN)=).mk
endif
INSTALL-SRCS := $(call cond_enabled,CONFIG_INSTALL_SRCS,INSTALL-SRCS)
Expand Down
16 changes: 8 additions & 8 deletions build/make/configure.sh
Original file line number Diff line number Diff line change
Expand Up @@ -518,10 +518,10 @@ fmt_deps = sed -e 's;^\([a-zA-Z0-9_]*\)\.o;\${@:.d=.o} \$@;'
EOF
fi

print_config_mk ARCH "${1}" ${ARCH_LIST}
print_config_mk HAVE "${1}" ${HAVE_LIST}
print_config_mk CONFIG "${1}" ${CONFIG_LIST}
print_config_mk HAVE "${1}" gnu_strip
print_config_mk VPX_ARCH "${1}" ${ARCH_LIST}
print_config_mk HAVE "${1}" ${HAVE_LIST}
print_config_mk CONFIG "${1}" ${CONFIG_LIST}
print_config_mk HAVE "${1}" gnu_strip

enabled msvs && echo "CONFIG_VS_VERSION=${vs_version}" >> "${1}"

Expand All @@ -538,10 +538,10 @@ write_common_target_config_h() {
#define RESTRICT ${RESTRICT}
#define INLINE ${INLINE}
EOF
print_config_h ARCH "${TMP_H}" ${ARCH_LIST}
print_config_h HAVE "${TMP_H}" ${HAVE_LIST}
print_config_h CONFIG "${TMP_H}" ${CONFIG_LIST}
print_config_vars_h "${TMP_H}" ${VAR_LIST}
print_config_h VPX_ARCH "${TMP_H}" ${ARCH_LIST}
print_config_h HAVE "${TMP_H}" ${HAVE_LIST}
print_config_h CONFIG "${TMP_H}" ${CONFIG_LIST}
print_config_vars_h "${TMP_H}" ${VAR_LIST}
echo "#endif /* VPX_CONFIG_H */" >> ${TMP_H}
mkdir -p `dirname "$1"`
cmp "$1" ${TMP_H} >/dev/null 2>&1 || mv ${TMP_H} "$1"
Expand Down
6 changes: 3 additions & 3 deletions libs.mk
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

# ARM assembly files are written in RVCT-style. We use some make magic to
# filter those files to allow GCC compilation
ifeq ($(ARCH_ARM),yes)
ifeq ($(VPX_ARCH_ARM),yes)
ASM:=$(if $(filter yes,$(CONFIG_GCC)$(CONFIG_MSVS)),.asm.S,.asm)
else
ASM:=.asm
Expand Down Expand Up @@ -139,7 +139,7 @@ CODEC_SRCS-yes += vpx_ports/mem_ops_aligned.h
CODEC_SRCS-yes += vpx_ports/vpx_once.h
CODEC_SRCS-yes += $(BUILD_PFX)vpx_config.c
INSTALL-SRCS-no += $(BUILD_PFX)vpx_config.c
ifeq ($(ARCH_X86)$(ARCH_X86_64),yes)
ifeq ($(VPX_ARCH_X86)$(VPX_ARCH_X86_64),yes)
INSTALL-SRCS-$(CONFIG_CODEC_SRCS) += third_party/x86inc/x86inc.asm
INSTALL-SRCS-$(CONFIG_CODEC_SRCS) += vpx_dsp/x86/bitdepth_conversion_sse2.asm
endif
Expand Down Expand Up @@ -347,7 +347,7 @@ CLEAN-OBJS += libvpx.syms
#
# Rule to make assembler configuration file from C configuration file
#
ifeq ($(ARCH_X86)$(ARCH_X86_64),yes)
ifeq ($(VPX_ARCH_X86)$(VPX_ARCH_X86_64),yes)
# YASM
$(BUILD_PFX)vpx_config.asm: $(BUILD_PFX)vpx_config.h
@echo " [CREATE] $@"
Expand Down
6 changes: 3 additions & 3 deletions test/convolve_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1133,7 +1133,7 @@ using std::make_tuple;
x0_q4, x_step_q4, y0_q4, y_step_q4, w, h, bd); \
}

#if HAVE_SSE2 && ARCH_X86_64
#if HAVE_SSE2 && VPX_ARCH_X86_64
WRAP(convolve_copy_sse2, 8)
WRAP(convolve_avg_sse2, 8)
WRAP(convolve_copy_sse2, 10)
Expand All @@ -1158,7 +1158,7 @@ WRAP(convolve8_vert_sse2, 12)
WRAP(convolve8_avg_vert_sse2, 12)
WRAP(convolve8_sse2, 12)
WRAP(convolve8_avg_sse2, 12)
#endif // HAVE_SSE2 && ARCH_X86_64
#endif // HAVE_SSE2 && VPX_ARCH_X86_64

#if HAVE_AVX2
WRAP(convolve_copy_avx2, 8)
Expand Down Expand Up @@ -1278,7 +1278,7 @@ const ConvolveParam kArrayConvolve_c[] = { ALL_SIZES(convolve8_c) };
#endif
INSTANTIATE_TEST_CASE_P(C, ConvolveTest, ::testing::ValuesIn(kArrayConvolve_c));

#if HAVE_SSE2 && ARCH_X86_64
#if HAVE_SSE2 && VPX_ARCH_X86_64
#if CONFIG_VP9_HIGHBITDEPTH
const ConvolveFunctions convolve8_sse2(
wrap_convolve_copy_sse2_8, wrap_convolve_avg_sse2_8,
Expand Down
4 changes: 2 additions & 2 deletions test/dct_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -514,7 +514,7 @@ INSTANTIATE_TEST_CASE_P(
::testing::Values(VPX_BITS_8, VPX_BITS_10, VPX_BITS_12)));
#endif // HAVE_SSE2

#if HAVE_SSSE3 && !CONFIG_VP9_HIGHBITDEPTH && ARCH_X86_64
#if HAVE_SSSE3 && !CONFIG_VP9_HIGHBITDEPTH && VPX_ARCH_X86_64
// vpx_fdct8x8_ssse3 is only available in 64 bit builds.
static const FuncInfo dct_ssse3_func_info = {
&fdct_wrapper<vpx_fdct8x8_ssse3>, &idct_wrapper<vpx_idct8x8_64_add_sse2>, 8, 1
Expand All @@ -524,7 +524,7 @@ static const FuncInfo dct_ssse3_func_info = {
INSTANTIATE_TEST_CASE_P(SSSE3, TransDCT,
::testing::Values(make_tuple(0, &dct_ssse3_func_info, 0,
VPX_BITS_8)));
#endif // HAVE_SSSE3 && !CONFIG_VP9_HIGHBITDEPTH && ARCH_X86_64
#endif // HAVE_SSSE3 && !CONFIG_VP9_HIGHBITDEPTH && VPX_ARCH_X86_64

#if HAVE_AVX2 && !CONFIG_VP9_HIGHBITDEPTH
static const FuncInfo dct_avx2_func_info = {
Expand Down
2 changes: 1 addition & 1 deletion test/fdct8x8_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -737,7 +737,7 @@ INSTANTIATE_TEST_CASE_P(
make_tuple(&idct8x8_12, &idct8x8_64_add_12_sse2, 6225, VPX_BITS_12)));
#endif // HAVE_SSE2 && CONFIG_VP9_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE

#if HAVE_SSSE3 && ARCH_X86_64 && !CONFIG_VP9_HIGHBITDEPTH && \
#if HAVE_SSSE3 && VPX_ARCH_X86_64 && !CONFIG_VP9_HIGHBITDEPTH && \
!CONFIG_EMULATE_HARDWARE
INSTANTIATE_TEST_CASE_P(SSSE3, FwdTrans8x8DCT,
::testing::Values(make_tuple(&vpx_fdct8x8_ssse3,
Expand Down
4 changes: 2 additions & 2 deletions test/hadamard_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -254,11 +254,11 @@ INSTANTIATE_TEST_CASE_P(
HadamardFuncWithSize(&vpx_hadamard_32x32_avx2, 32)));
#endif // HAVE_AVX2

#if HAVE_SSSE3 && ARCH_X86_64
#if HAVE_SSSE3 && VPX_ARCH_X86_64
INSTANTIATE_TEST_CASE_P(
SSSE3, HadamardLowbdTest,
::testing::Values(HadamardFuncWithSize(&vpx_hadamard_8x8_ssse3, 8)));
#endif // HAVE_SSSE3 && ARCH_X86_64
#endif // HAVE_SSSE3 && VPX_ARCH_X86_64

#if HAVE_NEON
INSTANTIATE_TEST_CASE_P(
Expand Down
2 changes: 1 addition & 1 deletion test/invalid_file_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ const DecodeParam kVP9InvalidFileTests[] = {
// This file will cause a large allocation which is expected to fail in 32-bit
// environments. Test x86 for coverage purposes as the allocation failure will
// be in platform agnostic code.
#if ARCH_X86
#if VPX_ARCH_X86
{ 1, "invalid-vp90-2-00-quantizer-63.ivf.kf_65527x61446.ivf" },
#endif
{ 1, "invalid-vp90-2-12-droppable_1.ivf.s3676_r01-05_b6-.ivf" },
Expand Down
8 changes: 4 additions & 4 deletions test/register_state_check.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
// See platform implementations of RegisterStateCheckXXX for details.
//

#if defined(_WIN64) && ARCH_X86_64
#if defined(_WIN64) && VPX_ARCH_X86_64

#undef NOMINMAX
#define NOMINMAX
Expand Down Expand Up @@ -138,9 +138,9 @@ class RegisterStateCheck {};

} // namespace libvpx_test

#endif // _WIN64 && ARCH_X86_64
#endif // _WIN64 && VPX_ARCH_X86_64

#if ARCH_X86 || ARCH_X86_64
#if VPX_ARCH_X86 || VPX_ARCH_X86_64
#if defined(__GNUC__)

namespace libvpx_test {
Expand Down Expand Up @@ -178,7 +178,7 @@ class RegisterStateCheckMMX {
} // namespace libvpx_test

#endif // __GNUC__
#endif // ARCH_X86 || ARCH_X86_64
#endif // VPX_ARCH_X86 || VPX_ARCH_X86_64

#ifndef API_REGISTER_STATE_CHECK
#define API_REGISTER_STATE_CHECK ASM_REGISTER_STATE_CHECK
Expand Down
10 changes: 5 additions & 5 deletions test/test_libvpx.cc
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
#include "third_party/googletest/src/include/gtest/gtest.h"

#include "./vpx_config.h"
#if ARCH_X86 || ARCH_X86_64
#if VPX_ARCH_X86 || VPX_ARCH_X86_64
#include "vpx_ports/x86.h"
#endif
extern "C" {
Expand All @@ -26,20 +26,20 @@ extern void vpx_dsp_rtcd();
extern void vpx_scale_rtcd();
}

#if ARCH_X86 || ARCH_X86_64
#if VPX_ARCH_X86 || VPX_ARCH_X86_64
static void append_negative_gtest_filter(const char *str) {
std::string filter = ::testing::FLAGS_gtest_filter;
// Negative patterns begin with one '-' followed by a ':' separated list.
if (filter.find('-') == std::string::npos) filter += '-';
filter += str;
::testing::FLAGS_gtest_filter = filter;
}
#endif // ARCH_X86 || ARCH_X86_64
#endif // VPX_ARCH_X86 || VPX_ARCH_X86_64

int main(int argc, char **argv) {
::testing::InitGoogleTest(&argc, argv);

#if ARCH_X86 || ARCH_X86_64
#if VPX_ARCH_X86 || VPX_ARCH_X86_64
const int simd_caps = x86_simd_caps();
if (!(simd_caps & HAS_MMX)) append_negative_gtest_filter(":MMX.*:MMX/*");
if (!(simd_caps & HAS_SSE)) append_negative_gtest_filter(":SSE.*:SSE/*");
Expand All @@ -56,7 +56,7 @@ int main(int argc, char **argv) {
if (!(simd_caps & HAS_AVX512)) {
append_negative_gtest_filter(":AVX512.*:AVX512/*");
}
#endif // ARCH_X86 || ARCH_X86_64
#endif // VPX_ARCH_X86 || VPX_ARCH_X86_64

#if !CONFIG_SHARED
// Shared library builds don't support whitebox tests
Expand Down
6 changes: 3 additions & 3 deletions test/vp9_quantize_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -505,7 +505,7 @@ INSTANTIATE_TEST_CASE_P(
#endif // HAVE_SSE2

#if HAVE_SSSE3
#if ARCH_X86_64
#if VPX_ARCH_X86_64
INSTANTIATE_TEST_CASE_P(
SSSE3, VP9QuantizeTest,
::testing::Values(make_tuple(&vpx_quantize_b_ssse3, &vpx_quantize_b_c,
Expand All @@ -528,7 +528,7 @@ INSTANTIATE_TEST_CASE_P(
&vpx_quantize_b_32x32_c, VPX_BITS_8, 32,
false)));

#endif // ARCH_X86_64
#endif // VPX_ARCH_X86_64
#endif // HAVE_SSSE3

#if HAVE_AVX
Expand All @@ -541,7 +541,7 @@ INSTANTIATE_TEST_CASE_P(AVX, VP9QuantizeTest,
VPX_BITS_8, 32, false)));
#endif // HAVE_AVX

#if ARCH_X86_64 && HAVE_AVX2
#if VPX_ARCH_X86_64 && HAVE_AVX2
INSTANTIATE_TEST_CASE_P(
AVX2, VP9QuantizeTest,
::testing::Values(make_tuple(&QuantFPWrapper<vp9_quantize_fp_avx2>,
Expand Down
2 changes: 1 addition & 1 deletion test/vpx_scale_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
namespace libvpx_test {
namespace {

#if ARCH_ARM || (ARCH_MIPS && !HAVE_MIPS64) || ARCH_X86
#if VPX_ARCH_ARM || (VPX_ARCH_MIPS && !HAVE_MIPS64) || VPX_ARCH_X86
// Avoid OOM failures on 32-bit platforms.
const int kNumSizesToTest = 7;
#else
Expand Down
1 change: 1 addition & 0 deletions third_party/x86inc/README.libvpx
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,4 @@ Copy PIC 'GLOBAL' macros from x86_abi_support.asm
Use .text instead of .rodata on macho to avoid broken tables in PIC mode.
Use .text with no alignment for aout
Only use 'hidden' visibility with Chromium
Prefix ARCH_* with VPX_.
24 changes: 12 additions & 12 deletions third_party/x86inc/x86inc.asm
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
%endif

%ifndef STACK_ALIGNMENT
%if ARCH_X86_64
%if VPX_ARCH_X86_64
%define STACK_ALIGNMENT 16
%else
%define STACK_ALIGNMENT 4
Expand All @@ -54,7 +54,7 @@

%define WIN64 0
%define UNIX64 0
%if ARCH_X86_64
%if VPX_ARCH_X86_64
%ifidn __OUTPUT_FORMAT__,win32
%define WIN64 1
%elifidn __OUTPUT_FORMAT__,win64
Expand Down Expand Up @@ -165,7 +165,7 @@
%endif
%endif

%if ARCH_X86_64 == 0
%if VPX_ARCH_X86_64 == 0
%undef PIC
%endif

Expand Down Expand Up @@ -260,7 +260,7 @@
%if %0 == 2
%define r%1m %2d
%define r%1mp %2
%elif ARCH_X86_64 ; memory
%elif VPX_ARCH_X86_64 ; memory
%define r%1m [rstk + stack_offset + %3]
%define r%1mp qword r %+ %1 %+ m
%else
Expand All @@ -281,7 +281,7 @@
%define e%1h %3
%define r%1b %2
%define e%1b %2
%if ARCH_X86_64 == 0
%if VPX_ARCH_X86_64 == 0
%define r%1 e%1
%endif
%endmacro
Expand Down Expand Up @@ -318,7 +318,7 @@ DECLARE_REG_SIZE bp, bpl, null

DECLARE_REG_TMP_SIZE 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14

%if ARCH_X86_64
%if VPX_ARCH_X86_64
%define gprsize 8
%else
%define gprsize 4
Expand Down Expand Up @@ -485,7 +485,7 @@ DECLARE_REG_TMP_SIZE 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14
%if %1 > 0
%assign regs_used (regs_used + 1)
%endif
%if ARCH_X86_64 && regs_used < 5 + UNIX64 * 3
%if VPX_ARCH_X86_64 && regs_used < 5 + UNIX64 * 3
; Ensure that we don't clobber any registers containing arguments
%assign regs_used 5 + UNIX64 * 3
%endif
Expand Down Expand Up @@ -607,7 +607,7 @@ DECLARE_REG 14, R15, 120
AUTO_REP_RET
%endmacro

%elif ARCH_X86_64 ; *nix x64 ;=============================================
%elif VPX_ARCH_X86_64 ; *nix x64 ;=============================================

DECLARE_REG 0, rdi
DECLARE_REG 1, rsi
Expand Down Expand Up @@ -948,7 +948,7 @@ BRANCH_INSTR jz, je, jnz, jne, jl, jle, jnl, jnle, jg, jge, jng, jnge, ja, jae,
%endif
%endif

%if ARCH_X86_64 || cpuflag(sse2)
%if VPX_ARCH_X86_64 || cpuflag(sse2)
%ifdef __NASM_VER__
ALIGNMODE k8
%else
Expand Down Expand Up @@ -1005,7 +1005,7 @@ BRANCH_INSTR jz, je, jnz, jne, jl, jle, jnl, jnle, jg, jge, jng, jnge, ja, jae,
%define RESET_MM_PERMUTATION INIT_XMM %1
%define mmsize 16
%define num_mmregs 8
%if ARCH_X86_64
%if VPX_ARCH_X86_64
%define num_mmregs 16
%endif
%define mova movdqa
Expand All @@ -1026,7 +1026,7 @@ BRANCH_INSTR jz, je, jnz, jne, jl, jle, jnl, jnle, jg, jge, jng, jnge, ja, jae,
%define RESET_MM_PERMUTATION INIT_YMM %1
%define mmsize 32
%define num_mmregs 8
%if ARCH_X86_64
%if VPX_ARCH_X86_64
%define num_mmregs 16
%endif
%define mova movdqa
Expand Down Expand Up @@ -1637,7 +1637,7 @@ FMA4_INSTR fnmsub, pd, ps, sd, ss

; workaround: vpbroadcastq is broken in x86_32 due to a yasm bug (fixed in 1.3.0)
%ifdef __YASM_VER__
%if __YASM_VERSION_ID__ < 0x01030000 && ARCH_X86_64 == 0
%if __YASM_VERSION_ID__ < 0x01030000 && VPX_ARCH_X86_64 == 0
%macro vpbroadcastq 2
%if sizeof%1 == 16
movddup %1, %2
Expand Down
2 changes: 1 addition & 1 deletion vp8/common/blockd.h
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ typedef struct macroblockd {

struct vpx_internal_error_info error_info;

#if ARCH_X86 || ARCH_X86_64
#if VPX_ARCH_X86 || VPX_ARCH_X86_64
/* This is an intermediate buffer currently used in sub-pixel motion search
* to keep a copy of the reference area. This buffer can be used for other
* purpose.
Expand Down
Loading

0 comments on commit fad865c

Please sign in to comment.