Commit 8b370b6e authored by Tom Finegan's avatar Tom Finegan
Browse files

Add mips64 support to the cmake build.

Requires use of new cmake toolchain file:
$ cmake path/to/aom -DCMAKE_TOOLCHAIN_FILE=path/to/aom/build/cmake/toolchains/mips64-linux-gcc.cmake

MSA is supported via addition of -DENABLE_MSA=1. Support for i6400
and p6600 targets can be enabled by passing -DMIPS_CPU=i6400 and
-DMIPS_CPU=p6600 respectively.

BUG=https://bugs.chromium.org/p/aomedia/issues/detail?id=76

Change-Id: I7b8949a07e9be63cd6177e4ff4dbc02180f12a60
parent f1880e1c
##
## Copyright (c) 2017, Alliance for Open Media. All rights reserved
##
## This source code is subject to the terms of the BSD 2 Clause License and
## the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License
## was not distributed with this source code in the LICENSE file, you can
## obtain it at www.aomedia.org/license/software. If the Alliance for Open
## Media Patent License 1.0 was not distributed with this source code in the
## PATENTS file, you can obtain it at www.aomedia.org/license/patent.
##
set(AOM_ARCH "mips64")
set(ARCH_MIPS 1)
# Assembly flavors available for the target.
set(HAVE_MIPS64 1)
# RTCD versions of assembly flavor flags ("yes" means on in rtcd.pl, not 1).
set(RTCD_ARCH_MIPS "yes")
if (HAVE_MSA)
set(RTCD_HAVE_MSA "yes")
endif ()
foreach (config_var ${AOM_CONFIG_VARS})
if (${${config_var}})
set(RTCD_${config_var} yes)
endif ()
endforeach ()
##
## Copyright (c) 2017, Alliance for Open Media. All rights reserved
##
## This source code is subject to the terms of the BSD 2 Clause License and
## the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License
## was not distributed with this source code in the LICENSE file, you can
## obtain it at www.aomedia.org/license/software. If the Alliance for Open
## Media Patent License 1.0 was not distributed with this source code in the
## PATENTS file, you can obtain it at www.aomedia.org/license/patent.
##
ARCH_MIPS=${RTCD_ARCH_MIPS}
HAVE_MIPS64=${RTCD_HAVE_MIPS64}
HAVE_MSA=${RTCD_HAVE_MSA}
CONFIG_ACCOUNTING=${RTCD_CONFIG_ACCOUNTING}
CONFIG_INSPECTION=${RTCD_CONFIG_INSPECTION}
CONFIG_ADAPT_SCAN=${RTCD_CONFIG_ADAPT_SCAN}
CONFIG_ALT_INTRA=${RTCD_CONFIG_ALT_INTRA}
CONFIG_ANS=${RTCD_CONFIG_ANS}
CONFIG_AOM_HIGHBITDEPTH=${RTCD_CONFIG_AOM_HIGHBITDEPTH}
CONFIG_AOM_QM=${RTCD_CONFIG_AOM_QM}
CONFIG_AV1=${RTCD_CONFIG_AV1}
CONFIG_AV1_DECODER=${RTCD_CONFIG_AV1_DECODER}
CONFIG_AV1_ENCODER=${RTCD_CONFIG_AV1_ENCODER}
CONFIG_BIG_ENDIAN=${RTCD_CONFIG_BIG_ENDIAN}
CONFIG_BITSTREAM_DEBUG=${RTCD_CONFIG_BITSTREAM_DEBUG}
CONFIG_CB4X4=${RTCD_CONFIG_CB4X4}
CONFIG_CDEF=${RTCD_CONFIG_CDEF}
CONFIG_CHROMA_2X2=${RTCD_CONFIG_CHROMA_2X2}
CONFIG_CODEC_SRCS=${RTCD_CONFIG_CODEC_SRCS}
CONFIG_COEFFICIENT_RANGE_CHECKING=${RTCD_CONFIG_COEFFICIENT_RANGE_CHECKING}
CONFIG_COEF_INTERLEAVE=${RTCD_CONFIG_COEF_INTERLEAVE}
CONFIG_COMPOUND_SEGMENT=${RTCD_CONFIG_COMPOUND_SEGMENT}
CONFIG_CONVOLVE_ROUND=${RTCD_CONFIG_CONVOLVE_ROUND}
CONFIG_DAALA_DIST=${RTCD_CONFIG_DAALA_DIST}
CONFIG_DAALA_EC=${RTCD_CONFIG_DAALA_EC}
CONFIG_DEBUG=${RTCD_CONFIG_DEBUG}
CONFIG_DEBUG_LIBS=${RTCD_CONFIG_DEBUG_LIBS}
CONFIG_DECODERS=${RTCD_CONFIG_DECODERS}
CONFIG_DECODE_PERF_TESTS=${RTCD_CONFIG_DECODE_PERF_TESTS}
CONFIG_DELTA_Q=${RTCD_CONFIG_DELTA_Q}
CONFIG_DEPENDENCY_TRACKING=${RTCD_CONFIG_DEPENDENCY_TRACKING}
CONFIG_DEPENDENT_HORZTILES=${RTCD_CONFIG_DEPENDENT_HORZTILES}
CONFIG_DUAL_FILTER=${RTCD_CONFIG_DUAL_FILTER}
CONFIG_EC_ADAPT=${RTCD_CONFIG_EC_ADAPT}
CONFIG_EC_MULTISYMBOL=${RTCD_CONFIG_EC_MULTISYMBOL}
CONFIG_EMULATE_HARDWARE=${RTCD_CONFIG_EMULATE_HARDWARE}
CONFIG_ENCODERS=${RTCD_CONFIG_ENCODERS}
CONFIG_ENCODE_PERF_TESTS=${RTCD_CONFIG_ENCODE_PERF_TESTS}
CONFIG_ENTROPY=${RTCD_CONFIG_ENTROPY}
CONFIG_ENTROPY_STATS=${RTCD_CONFIG_ENTROPY_STATS}
CONFIG_ERROR_CONCEALMENT=${RTCD_CONFIG_ERROR_CONCEALMENT}
CONFIG_EXPERIMENTAL=${RTCD_CONFIG_EXPERIMENTAL}
CONFIG_EXTERNAL_BUILD=${RTCD_CONFIG_EXTERNAL_BUILD}
CONFIG_EXT_INTER=${RTCD_CONFIG_EXT_INTER}
CONFIG_EXT_INTRA=${RTCD_CONFIG_EXT_INTRA}
CONFIG_EXT_PARTITION=${RTCD_CONFIG_EXT_PARTITION}
CONFIG_EXT_PARTITION_TYPES=${RTCD_CONFIG_EXT_PARTITION_TYPES}
CONFIG_EXT_REFS=${RTCD_CONFIG_EXT_REFS}
CONFIG_EXT_TILE=${RTCD_CONFIG_EXT_TILE}
CONFIG_EXT_TX=${RTCD_CONFIG_EXT_TX}
CONFIG_FILTER_7BIT=${RTCD_CONFIG_FILTER_7BIT}
CONFIG_FILTER_INTRA=${RTCD_CONFIG_FILTER_INTRA}
CONFIG_FP_MB_STATS=${RTCD_CONFIG_FP_MB_STATS}
CONFIG_FRAME_SIZE=${RTCD_CONFIG_FRAME_SIZE}
CONFIG_GCC=${RTCD_CONFIG_GCC}
CONFIG_GCOV=${RTCD_CONFIG_GCOV}
CONFIG_GLOBAL_MOTION=${RTCD_CONFIG_GLOBAL_MOTION}
CONFIG_GPROF=${RTCD_CONFIG_GPROF}
CONFIG_INSTALL_BINS=${RTCD_CONFIG_INSTALL_BINS}
CONFIG_INSTALL_DOCS=${RTCD_CONFIG_INSTALL_DOCS}
CONFIG_INSTALL_LIBS=${RTCD_CONFIG_INSTALL_LIBS}
CONFIG_INSTALL_SRCS=${RTCD_CONFIG_INSTALL_SRCS}
CONFIG_INTERNAL_STATS=${RTCD_CONFIG_INTERNAL_STATS}
CONFIG_INTRA_INTERP=${RTCD_CONFIG_INTRA_INTERP}
CONFIG_LIBYUV=${RTCD_CONFIG_LIBYUV}
CONFIG_LOOPFILTERING_ACROSS_TILES=${RTCD_CONFIG_LOOPFILTERING_ACROSS_TILES}
CONFIG_LOOP_RESTORATION=${RTCD_CONFIG_LOOP_RESTORATION}
CONFIG_LOWBITDEPTH=${RTCD_CONFIG_LOWBITDEPTH}
CONFIG_LV_MAP=${RTCD_CONFIG_LV_MAP}
CONFIG_MASKED_TX=${RTCD_CONFIG_MASKED_TX}
CONFIG_MOTION_VAR=${RTCD_CONFIG_MOTION_VAR}
CONFIG_MSVS=${RTCD_CONFIG_MSVS}
CONFIG_MULTITHREAD=${RTCD_CONFIG_MULTITHREAD}
CONFIG_MV_COMPRESS=${RTCD_CONFIG_MV_COMPRESS}
CONFIG_NCOBMC=${RTCD_CONFIG_NCOBMC}
CONFIG_NEW_QUANT=${RTCD_CONFIG_NEW_QUANT}
CONFIG_NEW_TOKENSET=${RTCD_CONFIG_NEW_TOKENSET}
CONFIG_ONTHEFLY_BITPACKING=${RTCD_CONFIG_ONTHEFLY_BITPACKING}
CONFIG_OS_SUPPORT=${RTCD_CONFIG_OS_SUPPORT}
CONFIG_PALETTE=${RTCD_CONFIG_PALETTE}
CONFIG_PALETTE_THROUGHPUT=${RTCD_CONFIG_PALETTE_THROUGHPUT}
CONFIG_PARALLEL_DEBLOCKING=${RTCD_CONFIG_PARALLEL_DEBLOCKING}
CONFIG_PIC=${RTCD_CONFIG_PIC}
CONFIG_POSTPROC=${RTCD_CONFIG_POSTPROC}
CONFIG_POSTPROC_VISUALIZER=${RTCD_CONFIG_POSTPROC_VISUALIZER}
CONFIG_PVQ=${RTCD_CONFIG_PVQ}
CONFIG_RAWBITS=${RTCD_CONFIG_RAWBITS}
CONFIG_RD_DEBUG=${RTCD_CONFIG_RD_DEBUG}
CONFIG_REALTIME_ONLY=${RTCD_CONFIG_REALTIME_ONLY}
CONFIG_RECT_TX=${RTCD_CONFIG_RECT_TX}
CONFIG_REFERENCE_BUFFER=${RTCD_CONFIG_REFERENCE_BUFFER}
CONFIG_REF_ADAPT=${RTCD_CONFIG_REF_ADAPT}
CONFIG_REF_MV=${RTCD_CONFIG_REF_MV}
CONFIG_RUNTIME_CPU_DETECT=${RTCD_CONFIG_RUNTIME_CPU_DETECT}
CONFIG_RVCT=${RTCD_CONFIG_RVCT}
CONFIG_SHARED=${RTCD_CONFIG_SHARED}
CONFIG_SIZE_LIMIT=${RTCD_CONFIG_SIZE_LIMIT}
CONFIG_SMALL=${RTCD_CONFIG_SMALL}
CONFIG_SPATIAL_RESAMPLING=${RTCD_CONFIG_SPATIAL_RESAMPLING}
CONFIG_STATIC=${RTCD_CONFIG_STATIC}
CONFIG_STATIC_MSVCRT=${RTCD_CONFIG_STATIC_MSVCRT}
CONFIG_SUB8X8_MC=${RTCD_CONFIG_SUB8X8_MC}
CONFIG_SUPERTX=${RTCD_CONFIG_SUPERTX}
CONFIG_TEMPMV_SIGNALING=${RTCD_CONFIG_TEMPMV_SIGNALING}
CONFIG_TILE_GROUPS=${RTCD_CONFIG_TILE_GROUPS}
CONFIG_TPL_MV=${RTCD_CONFIG_TPL_MV}
CONFIG_TRIPRED=${RTCD_CONFIG_TRIPRED}
CONFIG_TX64X64=${RTCD_CONFIG_TX64X64}
CONFIG_UNIT_TESTS=${RTCD_CONFIG_UNIT_TESTS}
CONFIG_UNPOISON_PARTITION_CTX=${RTCD_CONFIG_UNPOISON_PARTITION_CTX}
CONFIG_VAR_TX=${RTCD_CONFIG_VAR_TX}
CONFIG_WARPED_MOTION=${RTCD_CONFIG_WARPED_MOTION}
CONFIG_WEBM_IO=${RTCD_CONFIG_WEBM_IO}
CONFIG_XIPHRC=${RTCD_CONFIG_XIPHRC}
......@@ -40,6 +40,8 @@ elseif (ENABLE_MSA)
endif ()
if ("${CROSS}" STREQUAL "")
# TODO(tomfinegan): Make it possible to turn this off. The $CROSS prefix
# won't be desired on a mips host.
# Default cross compiler prefix to something that might work for an
# unoptimized build.
set(CROSS mips-linux-gnu-)
......
##
## Copyright (c) 2017, Alliance for Open Media. All rights reserved
##
## This source code is subject to the terms of the BSD 2 Clause License and
## the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License
## was not distributed with this source code in the LICENSE file, you can
## obtain it at www.aomedia.org/license/software. If the Alliance for Open
## Media Patent License 1.0 was not distributed with this source code in the
## PATENTS file, you can obtain it at www.aomedia.org/license/patent.
##
if (NOT AOM_BUILD_CMAKE_TOOLCHAINS_MIPS64_LINUX_GCC_CMAKE_)
set(AOM_BUILD_CMAKE_TOOLCHAINS_MIPS64_LINUX_GCC_CMAKE_ 1)
set(CMAKE_SYSTEM_NAME "Linux")
if ("${CROSS}" STREQUAL "")
# TODO(tomfinegan): Make it possible to turn this off. The $CROSS prefix
# won't be desired on a mips host.
# Default the cross compiler prefix to something known to work.
set(CROSS mips-img-linux-gnu-)
endif ()
if (ENABLE_MSA)
set(HAVE_MSA 1 CACHE BOOL "" FORCE)
set(MIPS_CFLAGS "-mmsa")
set(MIPS_CXXFLAGS "-mmsa")
endif ()
if ("${MIPS_CPU}" STREQUAL "i6400" OR "${MIPS_CPU}" STREQUAL "p6600")
set(MIPS_CPU_FLAGS "-mips64r6 -mabi=64 -mload-store-pairs -msched-weight")
set(MIPS_CPU_FLAGS "${MIPS_CPU_FLAGS} -mhard-float -mfp64")
set(MIPS_CFLAGS "${MIPS_CFLAGS} ${MIPS_CPU_FLAGS}")
set(MIPS_CXXFLAGS "${MIPS_CXXFLAGS} ${MIPS_CPU_FLAGS}")
set(CMAKE_EXE_LINKER_FLAGS
"-mips64r6 -mabi64 -mfp64 ${CMAKE_EXE_LINKER_FLAGS}")
endif ()
set(CMAKE_C_COMPILER ${CROSS}gcc)
set(CMAKE_CXX_COMPILER ${CROSS}g++)
set(AS_EXECUTABLE ${CROSS}as)
set(CMAKE_C_COMPILER_ARG1 "-EL ${MIPS_CFLAGS}")
set(CMAKE_CXX_COMPILER_ARG1 "-EL ${MIPS_CXXFLAGS}")
set(CMAKE_SYSTEM_PROCESSOR "mips64")
# No runtime cpu detect for mips64-linux-gcc.
set(CONFIG_RUNTIME_CPU_DETECT 0 CACHE BOOL "")
endif () # AOM_BUILD_CMAKE_TOOLCHAINS_MIPS64_LINUX_GCC_CMAKE_
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