[x264-devel] [PATCH] Updated configure to detect MIPS platform and set flags.

BugMaster BugMaster at narod.ru
Mon Apr 6 23:42:47 CEST 2015


On Tue, 31 Mar 2015 22:53:59 +0530, Kaustubh Raste wrote:
> Signed-off-by: Kaustubh Raste <kaustubh.raste at imgtec.com>
> ---
>  config.sub |  4 ++++
>  configure  | 34 ++++++++++++++++++++++++++++++++--
>  2 files changed, 36 insertions(+), 2 deletions(-)

> diff --git a/config.sub b/config.sub
> index 8df5511..41ffb36 100755
> --- a/config.sub
> +++ b/config.sub
> @@ -294,6 +294,8 @@ case $basic_machine in
>         | mipsisa64sb1 | mipsisa64sb1el \
>         | mipsisa64sr71k | mipsisa64sr71kel \
>         | mipstx39 | mipstx39el \
> +       | mips32r5 | mips32r5el \
> +       | mips64r6 | mips64r6el \

Are you sure that it should be mips32r5/mips64r6 and not
mipsisa32r5/mipsisa64r6 like above mipsisa32r2/mipsisa64r2?
Because I could find mentions of them in google for triplets and not
for mips64r6 which is only found as option for gcc.
Also why r5 is only 32-bit and r6 is only 64-bit?

>         | mn10200 | mn10300 \
>         | moxie \
>         | mt \
> @@ -411,6 +413,8 @@ case $basic_machine in
>         | mipsisa64sb1-* | mipsisa64sb1el-* \
>         | mipsisa64sr71k-* | mipsisa64sr71kel-* \
>         | mipstx39-* | mipstx39el-* \
> +       | mips32r5-* | mips32r5el-* \
> +       | mips64r6-* | mips64r6el-* \

likewise.

>         | mmix-* \
>         | mt-* \
>         | msp430-* \
> diff --git a/configure b/configure
> index 15b1c91..d613e49 100755
> --- a/configure
> +++ b/configure
> @@ -363,7 +363,7 @@ NL="
>  "
>  
>  # list of all preprocessor HAVE values we can define
> -CONFIG_HAVE="MALLOC_H ALTIVEC ALTIVEC_H MMX ARMV6 ARMV6T2 NEON
> BEOSTHREAD POSIXTHREAD WIN32THREAD THREAD LOG2F SWSCALE \
> +CONFIG_HAVE="MALLOC_H ALTIVEC ALTIVEC_H MMX ARMV6 ARMV6T2 NEON MSA
> BEOSTHREAD POSIXTHREAD WIN32THREAD THREAD LOG2F SWSCALE \
>               LAVF FFMS GPAC AVS GPL VECTOREXT INTERLACED CPU_COUNT
> OPENCL THP LSMASH X86_INLINE_ASM AS_FUNC INTEL_DISPATCHER"

add it to the end (may be at new line) and not insert in the middle.

>  
>  # parse options
> @@ -733,7 +733,7 @@ case $host_cpu in
>      sparc)
>          ARCH="SPARC"
>          ;;
> -    mips|mipsel|mips64|mips64el)
> +   
> mips|mipsel|mips64|mips64el|mips64r6|mips64r6el|mips32r5|mips32r5el)

may be mips*)?

>          ARCH="MIPS"
>          ;;
>      arm*)
> @@ -860,6 +860,36 @@ if [ $asm = auto -a \( $ARCH = ARM -o $ARCH = AARCH64 \) ] ; then
>      as_check ".func test${NL}.endfunc" && define HAVE_AS_FUNC 1
>  fi
>  
> +if [ $asm = auto -a $ARCH = MIPS ] ; then
> +    case $host_cpu in
> +        mips|mipsel)
> +            CFLAGS="$CFLAGS -mips32r2"
> +            ;;
> +        mips64|mips64el)
> +            CFLAGS="$CFLAGS -mips64r2"
> +            ;;
> +        mips32r5|mips32r5el)
> +            echo $CFLAGS | grep -Eq '(-mcpu|-march|-mfpu|-arch)'
> || CFLAGS="$CFLAGS -mmsa -mfp64 -flax-vector-conversions"

as I said before
https://gcc.gnu.org/onlinedocs/gcc/C-Dialect-Options.html says than
-flax-vector-conversions should not be used for new code.

> +
> +            CFLAGS="$CFLAGS -mips32r5 -msched-weight
> -funroll-loops -mload-store-pairs -mhard-float"
> +            ASFLAGS="$ASFLAGS -mhard-float"
> +            if cc_check '' '' '__asm__("move.v $w5, $w11");' ; then define HAVE_MSA

define at new line.

> +                LDFLAGS="$LDFLAGS -mmsa -mfp64"
> +            fi
> +            ;;
> +        mips64r6|mips64r6el)
> +            echo $CFLAGS | grep -Eq '(-mcpu|-march|-mfpu|-arch)'
> || CFLAGS="$CFLAGS -mmsa -mfp64 -flax-vector-conversions"

likewise.

> +
> +            CFLAGS="$CFLAGS -mips64r6 -mabi=64 -msched-weight
> -funroll-loops -mload-store-pairs -mhard-float"
> +            ASFLAGS="$ASFLAGS -mips64r6 -mabi=64 -mhard-float"
> +            LDFLAGS="$LDFLAGS -mips64r6 -mabi=64"
> +            if cc_check '' '' '__asm__("move.v $w5, $w11");' ; then define HAVE_MSA

likewise.

> +                LDFLAGS="$LDFLAGS -mmsa -mfp64"
> +            fi
> +            ;;
> +    esac
> +fi
> +
>  [ $asm = no ] && AS=""
>  [ "x$AS" = x ] && asm="no" || asm="yes"
>  



More information about the x264-devel mailing list