[FFmpeg-devel] [PATCH 1/2] configure: build fix for mips cpu p5600

shivraj.patil at imgtec.com shivraj.patil at imgtec.com
Thu Mar 3 14:56:56 CET 2016


From: Shivraj Patil <shivraj.patil at imgtec.com>

Signed-off-by: Shivraj Patil <shivraj.patil at imgtec.com>
---
 configure |  217 ++++++++++++++++++++++++++++---------------------------------
 1 file changed, 101 insertions(+), 116 deletions(-)

diff --git a/configure b/configure
index 81769ee..45d527a 100755
--- a/configure
+++ b/configure
@@ -1662,6 +1662,7 @@ ARCH_EXT_LIST_ARM="
 ARCH_EXT_LIST_MIPS="
     mipsfpu
     mips32r2
+    mips32r5
     mips64r2
     mips32r6
     mips64r6
@@ -2160,6 +2161,7 @@ mipsfpu_deps="mips"
 mipsdsp_deps="mips"
 mipsdspr2_deps="mips"
 mips32r2_deps="mips"
+mips32r5_deps="mips"
 mips32r6_deps="mips"
 mips64r2_deps="mips"
 mips64r6_deps="mips"
@@ -4183,119 +4185,95 @@ elif enabled mips; then
 
     cpuflags="-march=$cpu"
 
-    case $cpu in
-        24kc)
-            disable mips32r6
-            disable mips64r2
-            disable mips64r6
-            disable mipsfpu
-            disable mipsdsp
-            disable mipsdspr2
-            disable msa
-        ;;
-        24kf*)
-            disable mips32r6
-            disable mips64r2
-            disable mips64r6
-            disable mipsdsp
-            disable mipsdspr2
-            disable msa
-        ;;
-        24kec|34kc|1004kc)
-            disable mips32r6
-            disable mips64r2
-            disable mips64r6
-            disable mipsfpu
-            disable mipsdspr2
-            disable msa
-        ;;
-        24kef*|34kf*|1004kf*)
-            disable mips32r6
-            disable mips64r2
-            disable mips64r6
-            disable mipsdspr2
-            disable msa
-        ;;
-        74kc)
-            disable mips32r6
-            disable mips64r2
-            disable mips64r6
-            disable mipsfpu
-            disable msa
-        ;;
-        74kf)
-            disable mips32r6
-            disable mips64r2
-            disable mips64r6
-            disable msa
-        ;;
-        p5600)
-            disable mips32r6
-            disable mips64r2
-            disable mips64r6
-            disable mipsdsp
-            disable mipsdspr2
-            check_cflags "-mtune=p5600" &&
-            check_cflags "-mfp64 -msched-weight -mload-store-pairs -funroll-loops" &&
-            add_asflags "-mfp64"
-        ;;
-        i6400)
-            disable mips32r2
-            disable mips32r6
-            disable mips64r2
-            disable mipsdsp
-            disable mipsdspr2
-            check_cflags "-mtune=i6400 -mabi=64" &&
-            check_cflags "-mfp64 -msched-weight -mload-store-pairs -funroll-loops" &&
-            check_ldflags "-mabi=64" &&
-            add_asflags "-mfp64"
-        ;;
-        loongson*)
-            disable mips32r2
-            disable mips32r6
-            disable mips64r2
-            disable mips64r6
-            disable mipsfpu
-            disable mipsdsp
-            disable mipsdspr2
-            disable msa
-            enable local_aligned_8 local_aligned_16 local_aligned_32
-            enable simd_align_16
-            enable fast_64bit
-            enable fast_clz
-            enable fast_cmov
-            enable fast_unaligned
-            disable aligned_stack
-            case $cpu in
-                loongson3*)
-                    cpuflags="-march=loongson3a -mhard-float -fno-expensive-optimizations"
-                ;;
-                loongson2e)
-                    cpuflags="-march=loongson2e -mhard-float -fno-expensive-optimizations"
-                ;;
-                loongson2f)
-                    cpuflags="-march=loongson2f -mhard-float -fno-expensive-optimizations"
-                ;;
-            esac
-        ;;
-        generic)
-            # We do not disable anything. Is up to the user to disable
-            # the unwanted features.
-        ;;
-        *)
-            # Unknown CPU. Disable everything.
-            warn "unknown CPU. Disabling all MIPS optimizations."
-            disable mipsfpu
-            disable mips32r2
-            disable mips32r6
-            disable mips64r2
-            disable mips64r6
-            disable mipsdsp
-            disable mipsdspr2
-            disable msa
-        ;;
-    esac
-
+    if [ "$cpu" == "generic" ]; then
+        # We do not disable anything. Is up to the user to disable
+        # the unwanted features.
+        echo 'generic CPU selected'
+    else
+        disable mipsfpu
+        disable mips32r2
+        disable mips32r5
+        disable mips64r2
+        disable mips32r6
+        disable mips64r6
+        disable mipsdsp
+        disable mipsdspr2
+        disable msa
+        disable loongson2
+        disable loongson3
+        disable mmi
+
+        case $cpu in
+            24kc)
+                enable mips32r2
+            ;;
+            24kf*)
+                enable mips32r2
+                enable mipsfpu
+            ;;
+            24kec|34kc|1004kc)
+                enable mips32r2
+                enable mipsdsp
+            ;;
+            24kef*|34kf*|1004kf*)
+                enable mips32r2
+                enable mipsfpu
+                enable mipsdsp
+            ;;
+            74kc)
+                enable mips32r2
+                enable mipsdsp
+                enable mipsdspr2
+            ;;
+            74kf)
+                enable mips32r2
+                enable mipsfpu
+                enable mipsdsp
+                enable mipsdspr2
+            ;;
+            p5600)
+                enable mips32r5
+                enable mipsfpu
+                enable msa
+                check_cflags "-mtune=p5600" &&
+                check_cflags "-mfp64 -msched-weight -mload-store-pairs -funroll-loops" &&
+                add_asflags "-mfp64"
+            ;;
+            i6400)
+                enable mips64r6
+                enable mipsfpu
+                enable msa
+                check_cflags "-mtune=i6400 -mabi=64" &&
+                check_cflags "-mfp64 -msched-weight -mload-store-pairs -funroll-loops" &&
+                check_ldflags "-mabi=64" &&
+                add_asflags "-mfp64"
+            ;;
+            loongson*)
+                enable local_aligned_8 local_aligned_16 local_aligned_32
+                enable simd_align_16
+                enable fast_64bit
+                enable fast_clz
+                enable fast_cmov
+                enable fast_unaligned
+                disable aligned_stack
+                case $cpu in
+                    loongson3*)
+                        cpuflags="-march=loongson3a -mhard-float -fno-expensive-optimizations"
+                    ;;
+                    loongson2e)
+                        cpuflags="-march=loongson2e -mhard-float -fno-expensive-optimizations"
+                    ;;
+                    loongson2f)
+                        cpuflags="-march=loongson2f -mhard-float -fno-expensive-optimizations"
+                    ;;
+                esac
+            ;;
+            *)
+                # Unknown CPU. Disable everything.
+                warn "unknown CPU. Disabling all MIPS optimizations."
+            ;;
+        esac
+    fi
 elif enabled ppc; then
 
     disable ldbrx
@@ -5136,14 +5114,21 @@ elif enabled mips; then
             check_inline_asm mips32r6 '"aui $0, $0, 0"' ||
             disable mips32r6
         fi
-        if disabled mips32r6 && enabled mips32r2; then
+        if disabled mips32r6 && enabled mips32r5; then
+            check_ldflags "-mips32r5" &&
+            add_cflags "-mips32r5" &&
+            add_asflags "-mips32r5" &&
+            check_inline_asm mips32r5 '"eretnc"' ||
+            disable mips32r5
+        fi
+        if disabled mips32r6 && disabled mips32r5 && enabled mips32r2; then
             check_ldflags "-mips32r2" &&
             add_cflags "-mips32r2" &&
             add_asflags "-mips32r2" &&
             check_inline_asm mips32r2 '"ext $0, $0, 0, 1"' ||
             disable mips32r2
         fi
-        if disabled mips32r6 && disabled mips32r2; then
+        if disabled mips32r6 && disabled mips32r5 && disabled mips32r2; then
             check_ldflags "-mips32" &&
             add_cflags "-mips32" &&
             add_asflags "-mips32" &&
@@ -5162,7 +5147,7 @@ elif enabled mips; then
     fi
 
     # MSA and DSP support require ISA revision level 2 or greater
-    if enabled mips32r2 || enabled mips64r2 || enabled mips32r6 || enabled mips64r6; then
+    if enabled mips32r2 || enabled mips64r2 || enabled mips32r5 || enabled mips32r6 || enabled mips64r6; then
         # MSA must be used with -mfp64 and -mhard-float
         if enabled mipsfpu; then
             if enabled msa; then
-- 
1.7.9.5



More information about the ffmpeg-devel mailing list