[FFmpeg-devel] [PATCH 2/3] avcodec/mips: loongson fix bugs in mathops optimization

Michael Niedermayer michaelni at gmx.at
Wed May 20 17:34:18 CEST 2015


On Wed, May 20, 2015 at 06:16:48PM +0800, 周晓勇 wrote:
> From d0ad6c2fbb57fb16e5507149a7378022329820f8 Mon Sep 17 00:00:00 2001
> From: ZhouXiaoyong <zhouxiaoyong at loongson.cn>
> Date: Tue, 19 May 2015 15:43:09 +0800
> Subject: [PATCH 2/3] avcodec/mips: loongson fix bugs in mathops optimization
> 
> 
> The mathops bugs impact passing fate test.
> 
> 
> Signed-off-by: ZhouXiaoyong <zhouxiaoyong at loongson.cn>
> ---
>  libavcodec/mips/mathops.h | 41 +++++++----------------------------------
>  1 file changed, 7 insertions(+), 34 deletions(-)
> 
> 
> diff --git a/libavcodec/mips/mathops.h b/libavcodec/mips/mathops.h
> index cdc7705..d6b0706 100644
> --- a/libavcodec/mips/mathops.h
> +++ b/libavcodec/mips/mathops.h
> @@ -43,19 +43,6 @@ static inline av_const int MULH(int a, int b)
>      return c;
>  }
>  
> -#define UMULH UMULH
> -static inline av_const unsigned UMULH(unsigned a, unsigned b)
> -{
> -    unsigned c;
> -    __asm__ ("dmultu %1, %2     \n\t"
> -             "mflo %0           \n\t"
> -             "dsrl %0, %0, 32   \n\t"
> -             : "=r"(c)
> -             : "r"(a),"r"(b)
> -             : "hi", "lo");
> -    return c;
> -}
> -
>  #define mid_pred mid_pred
>  static inline av_const int mid_pred(int a, int b, int c)
>  {
    
> @@ -77,40 +64,26 @@ static inline av_const int mid_pred(int a, int b, int c)
>  static inline av_const unsigned int ff_sqrt(unsigned int a)
>  {
>      unsigned int b;
> -
> -    __asm__ ("ctc1 %1, $f0      \n\t"
> -             "sqrt.s $f2, $f0   \n\t"
> -             "cvt.w.s $f0, $f2  \n\t"
> -             "cfc1 %0, $f0      \n\t"
> +    __asm__ ("sqrt.s $f0, %1     \n\t"
> +             "trunc.w.s $f0, $f0 \n\t"
> +             "mfc1 %0, $f0       \n\t"
>               : "=r"(b)
> -             : "r"(a));
> +             : "f"((float)a));
>      return b;
>  }

fails fate-mathops

[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

DNS cache poisoning attacks, popular search engine, Google internet authority
dont be evil, please
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 181 bytes
Desc: Digital signature
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20150520/6664df2e/attachment.asc>


More information about the ffmpeg-devel mailing list