[FFmpeg-cvslog] use mmi instead of loongson3 as simd-optimization flag

周晓勇 git at videolan.org
Tue Jul 7 04:04:12 CEST 2015


ffmpeg | branch: master | 周晓勇 <zhouxiaoyong at loongson.cn> | Fri Jul  3 18:11:27 2015 +0800| [387cbe018c87b44874a2e5dc53fe46b9695593f1] | committer: Michael Niedermayer

use mmi instead of loongson3 as simd-optimization flag

Signed-off-by: ZhouXiaoyong <zhouxiaoyong at loongson.cn>
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=387cbe018c87b44874a2e5dc53fe46b9695593f1
---

 Makefile                               |    2 +-
 arch.mak                               |    2 +-
 configure                              |   10 ++++++----
 libavcodec/mips/Makefile               |    4 ++--
 libavcodec/mips/h264chroma_init_mips.c |    8 ++++----
 libavcodec/mips/h264dsp_init_mips.c    |    8 ++++----
 6 files changed, 18 insertions(+), 16 deletions(-)

diff --git a/Makefile b/Makefile
index 69f371b..1fb1610 100644
--- a/Makefile
+++ b/Makefile
@@ -81,7 +81,7 @@ SUBDIR_VARS := CLEANFILES EXAMPLES FFLIBS HOSTPROGS TESTPROGS TOOLS      \
                ARMV5TE-OBJS ARMV6-OBJS ARMV8-OBJS VFP-OBJS NEON-OBJS     \
                ALTIVEC-OBJS MMX-OBJS YASM-OBJS                           \
                MIPSFPU-OBJS MIPSDSPR2-OBJS MIPSDSPR1-OBJS MSA-OBJS       \
-               LOONGSON3-OBJS OBJS SLIBOBJS HOSTOBJS TESTOBJS
+               MMI-OBJS OBJS SLIBOBJS HOSTOBJS TESTOBJS
 
 define RESET
 $(1) :=
diff --git a/arch.mak b/arch.mak
index 4508c2a..98fde4a 100644
--- a/arch.mak
+++ b/arch.mak
@@ -8,7 +8,7 @@ OBJS-$(HAVE_MIPSFPU)   += $(MIPSFPU-OBJS)    $(MIPSFPU-OBJS-yes)
 OBJS-$(HAVE_MIPSDSPR1) += $(MIPSDSPR1-OBJS)  $(MIPSDSPR1-OBJS-yes)
 OBJS-$(HAVE_MIPSDSPR2) += $(MIPSDSPR2-OBJS)  $(MIPSDSPR2-OBJS-yes)
 OBJS-$(HAVE_MSA)       += $(MSA-OBJS)        $(MSA-OBJS-yes)
-OBJS-$(HAVE_LOONGSON3) += $(LOONGSON3-OBJS)  $(LOONGSON3-OBJS-yes)
+OBJS-$(HAVE_MMI)   += $(MMI-OBJS)   $(MMI-OBJS-yes)
 
 OBJS-$(HAVE_ALTIVEC) += $(ALTIVEC-OBJS) $(ALTIVEC-OBJS-yes)
 OBJS-$(HAVE_VSX)     += $(VSX-OBJS) $(VSX-OBJS-yes)
diff --git a/configure b/configure
index cc23991..a292102 100755
--- a/configure
+++ b/configure
@@ -374,7 +374,7 @@ Optimization options (experts only):
   --disable-mipsdspr2      disable MIPS DSP ASE R2 optimizations
   --disable-msa            disable MSA optimizations
   --disable-mipsfpu        disable floating point MIPS optimizations
-  --disable-loongson3      disable Loongson-3 SIMD optimizations
+  --disable-mmi            disable Loongson SIMD optimizations
   --disable-fast-unaligned consider unaligned accesses slow
 
 Developer options (useful when working on FFmpeg itself):
@@ -1591,7 +1591,7 @@ ARCH_EXT_LIST_MIPS="
 "
 
 ARCH_EXT_LIST_LOONGSON="
-    loongson3
+    mmi
 "
 
 ARCH_EXT_LIST_X86_SIMD="
@@ -2046,7 +2046,7 @@ mips32r2_deps="mips"
 mips32r5_deps="mips"
 mips64r6_deps="mips"
 msa_deps="mips"
-loongson3_deps="mips"
+mmi_deps="mips"
 
 altivec_deps="ppc"
 dcbzl_deps="ppc"
@@ -4737,6 +4737,8 @@ EOF
 
 elif enabled mips; then
 
+    enabled mmi && check_inline_asm mmi '"punpcklhw $f0, $f0, $f0"'
+
     # Enable minimum ISA based on selected options
     if enabled mips64 && (enabled mipsdspr1 || enabled mipsdspr2); then
         add_cflags "-mips64r2"
@@ -5779,7 +5781,7 @@ if enabled mips; then
     echo "MIPS DSP R1 enabled       ${mipsdspr1-no}"
     echo "MIPS DSP R2 enabled       ${mipsdspr2-no}"
     echo "MIPS MSA enabled          ${msa-no}"
-    echo "LOONGSON3 enabled         ${loongson3-no}"
+    echo "LOONGSON MMI enabled      ${mmi-no}"
 fi
 if enabled ppc; then
     echo "AltiVec enabled           ${altivec-no}"
diff --git a/libavcodec/mips/Makefile b/libavcodec/mips/Makefile
index 2993891..695ee36 100644
--- a/libavcodec/mips/Makefile
+++ b/libavcodec/mips/Makefile
@@ -53,5 +53,5 @@ MSA-OBJS-$(CONFIG_PIXBLOCKDSP)            += mips/pixblockdsp_msa.o
 MSA-OBJS-$(CONFIG_MPEGVIDEO)              += mips/mpegvideo_msa.o
 MSA-OBJS-$(CONFIG_MPEGVIDEOENC)           += mips/mpegvideoencdsp_msa.o
 MSA-OBJS-$(CONFIG_ME_CMP)                 += mips/me_cmp_msa.o
-LOONGSON3-OBJS-$(CONFIG_H264DSP)          += mips/h264dsp_mmi.o
-LOONGSON3-OBJS-$(CONFIG_H264CHROMA)       += mips/h264chroma_mmi.o
+MMI-OBJS-$(CONFIG_H264DSP)                += mips/h264dsp_mmi.o
+MMI-OBJS-$(CONFIG_H264CHROMA)             += mips/h264chroma_mmi.o
diff --git a/libavcodec/mips/h264chroma_init_mips.c b/libavcodec/mips/h264chroma_init_mips.c
index 1cc5767..122148d 100644
--- a/libavcodec/mips/h264chroma_init_mips.c
+++ b/libavcodec/mips/h264chroma_init_mips.c
@@ -38,7 +38,7 @@ static av_cold void h264chroma_init_msa(H264ChromaContext *c, int bit_depth)
 }
 #endif  // #if HAVE_MSA
 
-#if HAVE_LOONGSON3
+#if HAVE_MMI
 static av_cold void h264chroma_init_mmi(H264ChromaContext *c, int bit_depth)
 {
     int high_bit_depth = bit_depth > 8;
@@ -50,14 +50,14 @@ static av_cold void h264chroma_init_mmi(H264ChromaContext *c, int bit_depth)
         c->avg_h264_chroma_pixels_tab[1] = ff_avg_h264_chroma_mc4_mmi;
     }
 }
-#endif /* HAVE_LOONGSON3 */
+#endif /* HAVE_MMI */
 
 av_cold void ff_h264chroma_init_mips(H264ChromaContext *c, int bit_depth)
 {
 #if HAVE_MSA
     h264chroma_init_msa(c, bit_depth);
 #endif  // #if HAVE_MSA
-#if HAVE_LOONGSON3
+#if HAVE_MMI
     h264chroma_init_mmi(c, bit_depth);
-#endif /* HAVE_LOONGSON3 */
+#endif /* HAVE_MMI */
 }
diff --git a/libavcodec/mips/h264dsp_init_mips.c b/libavcodec/mips/h264dsp_init_mips.c
index 7f74adf..3694621 100644
--- a/libavcodec/mips/h264dsp_init_mips.c
+++ b/libavcodec/mips/h264dsp_init_mips.c
@@ -81,7 +81,7 @@ static av_cold void h264dsp_init_msa(H264DSPContext *c,
 }
 #endif  // #if HAVE_MSA
 
-#if HAVE_LOONGSON3
+#if HAVE_MMI
 static av_cold void h264dsp_init_mmi(H264DSPContext * c,
                                      const int bit_depth,
                                      const int chroma_format_idc)
@@ -96,7 +96,7 @@ static av_cold void h264dsp_init_mmi(H264DSPContext * c,
         c->biweight_h264_pixels_tab[2] = ff_h264_biweight_pixels4_8_mmi;
     }
 }
-#endif /* HAVE_LOONGSON3 */
+#endif /* HAVE_MMI */
 
 av_cold void ff_h264dsp_init_mips(H264DSPContext *c, const int bit_depth,
                                   const int chroma_format_idc)
@@ -104,7 +104,7 @@ av_cold void ff_h264dsp_init_mips(H264DSPContext *c, const int bit_depth,
 #if HAVE_MSA
     h264dsp_init_msa(c, bit_depth, chroma_format_idc);
 #endif  // #if HAVE_MSA
-#if HAVE_LOONGSON3
+#if HAVE_MMI
     h264dsp_init_mmi(c, bit_depth, chroma_format_idc);
-#endif /* HAVE_LOONGSON3 */
+#endif /* HAVE_MMI */
 }



More information about the ffmpeg-cvslog mailing list