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

Kaustubh Raste Kaustubh.Raste at imgtec.com
Mon May 4 12:52:43 CEST 2015


May I request somebody from maintainers to have a look at this patch please?

Regards,
Kaustubh

-----Original Message-----
From: x264-devel [mailto:x264-devel-bounces at videolan.org] On Behalf Of Kaustubh Raste
Sent: Friday, April 17, 2015 5:39 PM
To: x264-devel at videolan.org
Subject: [x264-devel] [PATCH] Updated configure to detect MIPS platform and set flags.

Added make check for MSA support only and removed cpu specific flag addition.
All other gcc options are expected through --extra-cflags --extra-ldflags.

Sample commandline for mips32r5 look like ./configure --host=mipsel-linux-gnu --cross-prefix=<TOOLCHAIN>/mips-mti-linux-gnu- \ --extra-cflags="-EL -mips32r5 -msched-weight -funroll-loops -mload-store-pairs -mhard-float -mfp64 -O3" \ --extra-ldflags="-EL -mips32r5 -msched-weight -funroll-loops -mload-store-pairs -mhard-float -mfp64 -O3"

Signed-off-by: Kaustubh Raste <kaustubh.raste at imgtec.com>
---
 config.sub |  8 ++++++++
 configure  | 14 ++++++++++++--
 2 files changed, 20 insertions(+), 2 deletions(-)

diff --git a/config.sub b/config.sub
index 8df5511..9b67804 100755
--- a/config.sub
+++ b/config.sub
@@ -294,6 +294,10 @@ case $basic_machine in
 	| mipsisa64sb1 | mipsisa64sb1el \
 	| mipsisa64sr71k | mipsisa64sr71kel \
 	| mipstx39 | mipstx39el \
+	| mips32r5 | mips32r5el \
+	| mips32r6 | mips32r6el \
+	| mips64r5 | mips64r5el \
+	| mips64r6 | mips64r6el \
 	| mn10200 | mn10300 \
 	| moxie \
 	| mt \
@@ -411,6 +415,10 @@ case $basic_machine in
 	| mipsisa64sb1-* | mipsisa64sb1el-* \
 	| mipsisa64sr71k-* | mipsisa64sr71kel-* \
 	| mipstx39-* | mipstx39el-* \
+	| mips32r5-* | mips32r5el-* \
+	| mips32r6-* | mips32r6el-* \
+	| mips64r5-* | mips64r5el-* \
+	| mips64r6-* | mips64r6el-* \
 	| mmix-* \
 	| mt-* \
 	| msp430-* \
diff --git a/configure b/configure
index 15b1c91..6316ce9 100755
--- a/configure
+++ b/configure
@@ -364,7 +364,8 @@ 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 \
-             LAVF FFMS GPAC AVS GPL VECTOREXT INTERLACED CPU_COUNT OPENCL THP LSMASH X86_INLINE_ASM AS_FUNC INTEL_DISPATCHER"
+             LAVF FFMS GPAC AVS GPL VECTOREXT INTERLACED CPU_COUNT OPENCL THP LSMASH X86_INLINE_ASM AS_FUNC INTEL_DISPATCHER \
+             MSA"
 
 # parse options
 
@@ -733,7 +734,7 @@ case $host_cpu in
     sparc)
         ARCH="SPARC"
         ;;
-    mips|mipsel|mips64|mips64el)
+    mips*)
         ARCH="MIPS"
         ;;
     arm*)
@@ -860,6 +861,15 @@ 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
+    echo $CFLAGS | grep -Eq '(-mcpu|-march|-mfpu|-arch)' || CFLAGS="$CFLAGS -mmsa"
+
+    if cc_check '' '' '__asm__("move.v $w5, $w11");' ; then
+        define HAVE_MSA
+        LDFLAGS="$LDFLAGS -mmsa"
+    fi
+fi
+
 [ $asm = no ] && AS=""
 [ "x$AS" = x ] && asm="no" || asm="yes"
 
--
2.3.2

_______________________________________________
x264-devel mailing list
x264-devel at videolan.org
https://mailman.videolan.org/listinfo/x264-devel


More information about the x264-devel mailing list