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

Kaustubh Raste kaustubh.raste at imgtec.com
Tue Mar 31 19:23:59 CEST 2015


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 \
 	| mn10200 | mn10300 \
 	| moxie \
 	| mt \
@@ -411,6 +413,8 @@ case $basic_machine in
 	| mipsisa64sb1-* | mipsisa64sb1el-* \
 	| mipsisa64sr71k-* | mipsisa64sr71kel-* \
 	| mipstx39-* | mipstx39el-* \
+	| mips32r5-* | mips32r5el-* \
+	| mips64r6-* | mips64r6el-* \
 	| 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"
 
 # 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)
         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"
+
+            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
+                LDFLAGS="$LDFLAGS -mmsa -mfp64"
+            fi
+            ;;
+        mips64r6|mips64r6el)
+            echo $CFLAGS | grep -Eq '(-mcpu|-march|-mfpu|-arch)' || CFLAGS="$CFLAGS -mmsa -mfp64 -flax-vector-conversions"
+
+            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
+                LDFLAGS="$LDFLAGS -mmsa -mfp64"
+            fi
+            ;;
+    esac
+fi
+
 [ $asm = no ] && AS=""
 [ "x$AS" = x ] && asm="no" || asm="yes"
 
-- 
2.3.2



More information about the x264-devel mailing list