> -----原始邮件-----
&gt; 发件人: "Jin Bo" <ji...@loongson.cn>
&gt; 发送时间: 2021-05-28 10:04:40 (星期五)
&gt; 收件人: ffmpeg-devel@ffmpeg.org
&gt; 抄送: "Jin Bo" <ji...@loongson.cn>
&gt; 主题: [FFmpeg-devel] [PATCH 2/3] libavcodec/mips: Fix build errors reported 
by clang
&gt; 
&gt; Clang is more strict on the type of asm operands, float or double
&gt; type variable should use constraint 'f', integer variable should
&gt; use constraint 'r'.
&gt; 
&gt; Signed-off-by: Jin Bo <ji...@loongson.cn>
&gt; ---
&gt;  libavcodec/mips/constants.c      |  89 +++++++------
&gt;  libavcodec/mips/constants.h      |  88 +++++++------
&gt;  libavcodec/mips/h264chroma_mmi.c | 157 +++++++++++------------
&gt;  libavcodec/mips/h264dsp_mmi.c    |  20 +--
&gt;  libavcodec/mips/h264pred_mmi.c   |  23 ++--
&gt;  libavcodec/mips/h264qpel_mmi.c   |  34 ++---
&gt;  libavcodec/mips/hevcdsp_mmi.c    |  59 +++++----
&gt;  libavcodec/mips/idctdsp_mmi.c    |   2 +-
&gt;  libavcodec/mips/mpegvideo_mmi.c  |  20 +--
&gt;  libavcodec/mips/vc1dsp_mmi.c     | 176 +++++++++++++-------------
&gt;  libavcodec/mips/vp8dsp_mmi.c     | 263 
+++++++++++++++++++++++++++++----------
&gt;  libavutil/mips/asmdefs.h         |   8 ++
&gt;  12 files changed, 536 insertions(+), 403 deletions(-)
&gt; 
&gt; diff --git a/libavcodec/mips/constants.c b/libavcodec/mips/constants.c
&gt; index 8c990b6..6a8f1a5 100644
&gt; --- a/libavcodec/mips/constants.c
&gt; +++ b/libavcodec/mips/constants.c
&gt; @@ -19,50 +19,49 @@
&gt;   * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 
02110-1301 USA
&gt;   */
&gt;  
&gt; -#include "config.h"
&gt; -#include "libavutil/mem_internal.h"
&gt; +#include "libavutil/intfloat.h"
&gt;  #include "constants.h"
&gt;  
&gt; -DECLARE_ALIGNED(8, const uint64_t, ff_pw_1) =       
{0x0001000100010001ULL};
&gt; -DECLARE_ALIGNED(8, const uint64_t, ff_pw_2) =       
{0x0002000200020002ULL};
&gt; -DECLARE_ALIGNED(8, const uint64_t, ff_pw_3) =       
{0x0003000300030003ULL};
&gt; -DECLARE_ALIGNED(8, const uint64_t, ff_pw_4) =       
{0x0004000400040004ULL};
&gt; -DECLARE_ALIGNED(8, const uint64_t, ff_pw_5) =       
{0x0005000500050005ULL};
&gt; -DECLARE_ALIGNED(8, const uint64_t, ff_pw_6) =       
{0x0006000600060006ULL};
&gt; -DECLARE_ALIGNED(8, const uint64_t, ff_pw_8) =       
{0x0008000800080008ULL};
&gt; -DECLARE_ALIGNED(8, const uint64_t, ff_pw_9) =       
{0x0009000900090009ULL};
&gt; -DECLARE_ALIGNED(8, const uint64_t, ff_pw_10) =      
{0x000A000A000A000AULL};
&gt; -DECLARE_ALIGNED(8, const uint64_t, ff_pw_12) =      
{0x000C000C000C000CULL};
&gt; -DECLARE_ALIGNED(8, const uint64_t, ff_pw_15) =      
{0x000F000F000F000FULL};
&gt; -DECLARE_ALIGNED(8, const uint64_t, ff_pw_16) =      
{0x0010001000100010ULL};
&gt; -DECLARE_ALIGNED(8, const uint64_t, ff_pw_17) =      
{0x0011001100110011ULL};
&gt; -DECLARE_ALIGNED(8, const uint64_t, ff_pw_18) =      
{0x0012001200120012ULL};
&gt; -DECLARE_ALIGNED(8, const uint64_t, ff_pw_20) =      
{0x0014001400140014ULL};
&gt; -DECLARE_ALIGNED(8, const uint64_t, ff_pw_22) =      
{0x0016001600160016ULL};
&gt; -DECLARE_ALIGNED(8, const uint64_t, ff_pw_28) =      
{0x001C001C001C001CULL};
&gt; -DECLARE_ALIGNED(8, const uint64_t, ff_pw_32) =      
{0x0020002000200020ULL};
&gt; -DECLARE_ALIGNED(8, const uint64_t, ff_pw_53) =      
{0x0035003500350035ULL};
&gt; -DECLARE_ALIGNED(8, const uint64_t, ff_pw_64) =      
{0x0040004000400040ULL};
&gt; -DECLARE_ALIGNED(8, const uint64_t, ff_pw_128) =     
{0x0080008000800080ULL};
&gt; -DECLARE_ALIGNED(8, const uint64_t, ff_pw_512) =     
{0x0200020002000200ULL};
&gt; -DECLARE_ALIGNED(8, const uint64_t, ff_pw_m8tom5) =  
{0xFFFBFFFAFFF9FFF8ULL};
&gt; -DECLARE_ALIGNED(8, const uint64_t, ff_pw_m4tom1) =  
{0xFFFFFFFEFFFDFFFCULL};
&gt; -DECLARE_ALIGNED(8, const uint64_t, ff_pw_1to4) =    
{0x0004000300020001ULL};
&gt; -DECLARE_ALIGNED(8, const uint64_t, ff_pw_5to8) =    
{0x0008000700060005ULL};
&gt; -DECLARE_ALIGNED(8, const uint64_t, ff_pw_0to3) =    
{0x0003000200010000ULL};
&gt; -DECLARE_ALIGNED(8, const uint64_t, ff_pw_4to7) =    
{0x0007000600050004ULL};
&gt; -DECLARE_ALIGNED(8, const uint64_t, ff_pw_8tob) =    
{0x000b000a00090008ULL};
&gt; -DECLARE_ALIGNED(8, const uint64_t, ff_pw_ctof) =    
{0x000f000e000d000cULL};
&gt; -
&gt; -DECLARE_ALIGNED(8, const uint64_t, ff_pb_1) =       
{0x0101010101010101ULL};
&gt; -DECLARE_ALIGNED(8, const uint64_t, ff_pb_3) =       
{0x0303030303030303ULL};
&gt; -DECLARE_ALIGNED(8, const uint64_t, ff_pb_80) =      
{0x8080808080808080ULL};
&gt; -DECLARE_ALIGNED(8, const uint64_t, ff_pb_A1) =      
{0xA1A1A1A1A1A1A1A1ULL};
&gt; -DECLARE_ALIGNED(8, const uint64_t, ff_pb_FE) =      
{0xFEFEFEFEFEFEFEFEULL};
&gt; -
&gt; -DECLARE_ALIGNED(8, const uint64_t, ff_rnd) =        
{0x0004000400040004ULL};
&gt; -DECLARE_ALIGNED(8, const uint64_t, ff_rnd2) =       
{0x0040004000400040ULL};
&gt; -DECLARE_ALIGNED(8, const uint64_t, ff_rnd3) =       
{0x0020002000200020ULL};
&gt; -
&gt; -DECLARE_ALIGNED(8, const uint64_t, ff_wm1010) =     
{0xFFFF0000FFFF0000ULL};
&gt; -DECLARE_ALIGNED(8, const uint64_t, ff_d40000) =     
{0x0000000000040000ULL};
&gt; +union av_intfloat64 ff_pw_1 =      {0x0001000100010001ULL};
&gt; +union av_intfloat64 ff_pw_2 =      {0x0002000200020002ULL};
&gt; +union av_intfloat64 ff_pw_3 =      {0x0003000300030003ULL};
&gt; +union av_intfloat64 ff_pw_4 =      {0x0004000400040004ULL};
&gt; +union av_intfloat64 ff_pw_5 =      {0x0005000500050005ULL};
&gt; +union av_intfloat64 ff_pw_6 =      {0x0006000600060006ULL};
&gt; +union av_intfloat64 ff_pw_8 =      {0x0008000800080008ULL};
&gt; +union av_intfloat64 ff_pw_9 =      {0x0009000900090009ULL};
&gt; +union av_intfloat64 ff_pw_10 =     {0x000A000A000A000AULL};
&gt; +union av_intfloat64 ff_pw_12 =     {0x000C000C000C000CULL};
&gt; +union av_intfloat64 ff_pw_15 =     {0x000F000F000F000FULL};
&gt; +union av_intfloat64 ff_pw_16 =     {0x0010001000100010ULL};
&gt; +union av_intfloat64 ff_pw_17 =     {0x0011001100110011ULL};
&gt; +union av_intfloat64 ff_pw_18 =     {0x0012001200120012ULL};
&gt; +union av_intfloat64 ff_pw_20 =     {0x0014001400140014ULL};
&gt; +union av_intfloat64 ff_pw_22 =     {0x0016001600160016ULL};
&gt; +union av_intfloat64 ff_pw_28 =     {0x001C001C001C001CULL};
&gt; +union av_intfloat64 ff_pw_32 =     {0x0020002000200020ULL};
&gt; +union av_intfloat64 ff_pw_53 =     {0x0035003500350035ULL};
&gt; +union av_intfloat64 ff_pw_64 =     {0x0040004000400040ULL};
&gt; +union av_intfloat64 ff_pw_128 =    {0x0080008000800080ULL};
&gt; +union av_intfloat64 ff_pw_512 =    {0x0200020002000200ULL};
&gt; +union av_intfloat64 ff_pw_m8tom5 = {0xFFFBFFFAFFF9FFF8ULL};
&gt; +union av_intfloat64 ff_pw_m4tom1 = {0xFFFFFFFEFFFDFFFCULL};
&gt; +union av_intfloat64 ff_pw_1to4 =   {0x0004000300020001ULL};
&gt; +union av_intfloat64 ff_pw_5to8 =   {0x0008000700060005ULL};
&gt; +union av_intfloat64 ff_pw_0to3 =   {0x0003000200010000ULL};
&gt; +union av_intfloat64 ff_pw_4to7 =   {0x0007000600050004ULL};
&gt; +union av_intfloat64 ff_pw_8tob =   {0x000b000a00090008ULL};
&gt; +union av_intfloat64 ff_pw_ctof =   {0x000f000e000d000cULL};
&gt; +union av_intfloat64 ff_pw_32_1 =   {0x0000000100000001ULL};
&gt; +union av_intfloat64 ff_pw_32_4 =   {0x0000000400000004ULL};
&gt; +union av_intfloat64 ff_pw_32_64 =  {0x0000004000000040ULL};
&gt; +union av_intfloat64 ff_pb_1 =      {0x0101010101010101ULL};
&gt; +union av_intfloat64 ff_pb_3 =      {0x0303030303030303ULL};
&gt; +union av_intfloat64 ff_pb_80 =     {0x8080808080808080ULL};
&gt; +union av_intfloat64 ff_pb_A1 =     {0xA1A1A1A1A1A1A1A1ULL};
&gt; +union av_intfloat64 ff_pb_FE =     {0xFEFEFEFEFEFEFEFEULL};
&gt; +union av_intfloat64 ff_rnd =       {0x0004000400040004ULL};
&gt; +union av_intfloat64 ff_rnd2 =      {0x0040004000400040ULL};
&gt; +union av_intfloat64 ff_rnd3 =      {0x0020002000200020ULL};
&gt; +union av_intfloat64 ff_ff_wm1010 = {0xFFFF0000FFFF0000ULL};
&gt; +union av_intfloat64 ff_d40000 =    {0x0000000000040000ULL};
&gt; diff --git a/libavcodec/mips/constants.h b/libavcodec/mips/constants.h
&gt; index 2604559..bd86cd1 100644
&gt; --- a/libavcodec/mips/constants.h
&gt; +++ b/libavcodec/mips/constants.h
&gt; @@ -22,50 +22,48 @@
&gt;  #ifndef AVCODEC_MIPS_CONSTANTS_H
&gt;  #define AVCODEC_MIPS_CONSTANTS_H
&gt;  
&gt; -#include <stdint.h>
&gt; -
&gt; -extern const uint64_t ff_pw_1;
&gt; -extern const uint64_t ff_pw_2;
&gt; -extern const uint64_t ff_pw_3;
&gt; -extern const uint64_t ff_pw_4;
&gt; -extern const uint64_t ff_pw_5;
&gt; -extern const uint64_t ff_pw_6;
&gt; -extern const uint64_t ff_pw_8;
&gt; -extern const uint64_t ff_pw_9;
&gt; -extern const uint64_t ff_pw_10;
&gt; -extern const uint64_t ff_pw_12;
&gt; -extern const uint64_t ff_pw_15;
&gt; -extern const uint64_t ff_pw_16;
&gt; -extern const uint64_t ff_pw_17;
&gt; -extern const uint64_t ff_pw_18;
&gt; -extern const uint64_t ff_pw_20;
&gt; -extern const uint64_t ff_pw_22;
&gt; -extern const uint64_t ff_pw_28;
&gt; -extern const uint64_t ff_pw_32;
&gt; -extern const uint64_t ff_pw_53;
&gt; -extern const uint64_t ff_pw_64;
&gt; -extern const uint64_t ff_pw_128;
&gt; -extern const uint64_t ff_pw_512;
&gt; -extern const uint64_t ff_pw_m8tom5;
&gt; -extern const uint64_t ff_pw_m4tom1;
&gt; -extern const uint64_t ff_pw_1to4;
&gt; -extern const uint64_t ff_pw_5to8;
&gt; -extern const uint64_t ff_pw_0to3;
&gt; -extern const uint64_t ff_pw_4to7;
&gt; -extern const uint64_t ff_pw_8tob;
&gt; -extern const uint64_t ff_pw_ctof;
&gt; -
&gt; -extern const uint64_t ff_pb_1;
&gt; -extern const uint64_t ff_pb_3;
&gt; -extern const uint64_t ff_pb_80;
&gt; -extern const uint64_t ff_pb_A1;
&gt; -extern const uint64_t ff_pb_FE;
&gt; -
&gt; -extern const uint64_t ff_rnd;
&gt; -extern const uint64_t ff_rnd2;
&gt; -extern const uint64_t ff_rnd3;
&gt; -
&gt; -extern const uint64_t ff_wm1010;
&gt; -extern const uint64_t ff_d40000;
&gt; +extern union av_intfloat64 ff_pw_1;
&gt; +extern union av_intfloat64 ff_pw_2;
&gt; +extern union av_intfloat64 ff_pw_3;
&gt; +extern union av_intfloat64 ff_pw_4;
&gt; +extern union av_intfloat64 ff_pw_5;
&gt; +extern union av_intfloat64 ff_pw_6;
&gt; +extern union av_intfloat64 ff_pw_8;
&gt; +extern union av_intfloat64 ff_pw_9;
&gt; +extern union av_intfloat64 ff_pw_10;
&gt; +extern union av_intfloat64 ff_pw_12;
&gt; +extern union av_intfloat64 ff_pw_15;
&gt; +extern union av_intfloat64 ff_pw_16;
&gt; +extern union av_intfloat64 ff_pw_17;
&gt; +extern union av_intfloat64 ff_pw_18;
&gt; +extern union av_intfloat64 ff_pw_20;
&gt; +extern union av_intfloat64 ff_pw_22;
&gt; +extern union av_intfloat64 ff_pw_28;
&gt; +extern union av_intfloat64 ff_pw_32;
&gt; +extern union av_intfloat64 ff_pw_53;
&gt; +extern union av_intfloat64 ff_pw_64;
&gt; +extern union av_intfloat64 ff_pw_128;
&gt; +extern union av_intfloat64 ff_pw_512;
&gt; +extern union av_intfloat64 ff_pw_m8tom5;
&gt; +extern union av_intfloat64 ff_pw_m4tom1;
&gt; +extern union av_intfloat64 ff_pw_1to4;
&gt; +extern union av_intfloat64 ff_pw_5to8;
&gt; +extern union av_intfloat64 ff_pw_0to3;
&gt; +extern union av_intfloat64 ff_pw_4to7;
&gt; +extern union av_intfloat64 ff_pw_8tob;
&gt; +extern union av_intfloat64 ff_pw_ctof;
&gt; +extern union av_intfloat64 ff_pw_32_1;
&gt; +extern union av_intfloat64 ff_pw_32_4;
&gt; +extern union av_intfloat64 ff_pw_32_64;
&gt; +extern union av_intfloat64 ff_pb_1;
&gt; +extern union av_intfloat64 ff_pb_3;
&gt; +extern union av_intfloat64 ff_pb_80;
&gt; +extern union av_intfloat64 ff_pb_A1;
&gt; +extern union av_intfloat64 ff_pb_FE;
&gt; +extern union av_intfloat64 ff_rnd;
&gt; +extern union av_intfloat64 ff_rnd2;
&gt; +extern union av_intfloat64 ff_rnd3;
&gt; +extern union av_intfloat64 ff_wm1010;
&gt; +extern union av_intfloat64 ff_d40000;
&gt;  
&gt;  #endif /* AVCODEC_MIPS_CONSTANTS_H */
……

keep these variables as const will be better. 
</stdint.h></ji...@loongson.cn></ji...@loongson.cn></ji...@loongson.cn>
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

Reply via email to