在 2021/7/23 上午11:59, yinshiyou...@loongson.cn 写道:
> -----原始邮件-----
&gt; 发件人: "Jiaxun Yang" <jiaxun.y...@flygoat.com>
&gt; 发送时间: 2021-07-22 21:59:03 (星期四)
&gt; 收件人: ffmpeg-devel@ffmpeg.org
&gt; 抄送:
&gt; 主题: Re: [FFmpeg-devel] [PATCH v2 2/5] avutil/mips: Extract load store with 
shift C1 pair marco
&gt;
&gt;
&gt; 在 2021/7/22 下午7:55, yinshiyou...@loongson.cn 写道:
&gt; &gt; &gt; -----原始邮件-----
&gt; &gt; &gt; 发件人: "Jiaxun Yang" <jiaxun.y...@flygoat.com>
&gt; &gt; &gt; 发送时间: 2021-07-21 17:19:10 (星期三)
&gt; &gt; &gt; 收件人: ffmpeg-devel@ffmpeg.org
&gt; &gt; &gt; 抄送: yinshiyou...@loongson.cn, "Jiaxun Yang" 
<jiaxun.y...@flygoat.com>
&gt; &gt; &gt; 主题: [FFmpeg-devel] [PATCH v2 2/5] avutil/mips: Extract load 
store with shift C1 pair marco
&gt; &gt; &gt;
&gt; &gt; &gt; We're doing some fancy hacks with load store with shift C1
&gt; &gt; &gt; beside unaligned load store. Create a marco for l/r pair
&gt; &gt; &gt; to allow us use it in these places.
&gt; &gt; &gt;
&gt; &gt; &gt; Signed-off-by: Jiaxun Yang <jiaxun.y...@flygoat.com>
&gt; &gt; &gt; ---
&gt; &gt; &gt;  libavutil/mips/mmiutils.h | 49 
++++++++++++++++++++++++---------------
&gt; &gt; &gt;  1 file changed, 30 insertions(+), 19 deletions(-)
&gt; &gt; &gt;
&gt; &gt; &gt; diff --git a/libavutil/mips/mmiutils.h 
b/libavutil/mips/mmiutils.h
&gt; &gt; &gt; index 41715c6490..f5b600e50c 100644
&gt; &gt; &gt; --- a/libavutil/mips/mmiutils.h
&gt; &gt; &gt; +++ b/libavutil/mips/mmiutils.h
&gt; &gt; &gt; @@ -57,8 +57,9 @@
&gt; &gt; &gt;  #define MMI_LWC1(fp, addr, bias)                                
            \
&gt; &gt; &gt;      "lwc1       "#fp",      "#bias"("#addr")                        
\n\t"
&gt; &gt; &gt;
&gt; &gt; &gt; -#define MMI_ULWC1(fp, addr, bias)                               
            \
&gt; &gt; &gt; -    "ulw        %[low32],   "#bias"("#addr")                        
\n\t"   \
&gt; &gt; &gt; +#define MMI_LWLRC1(fp, addr, bias, off)                         
            \
&gt; &gt; &gt; +    "lwl        %[low32],   "#bias"+"#off"("#addr")                 
\n\t"   \
&gt; &gt; &gt; +    "lwr        %[low32],   "#bias"("#addr")                        
\n\t"   \
&gt; &gt; &gt;      "mtc1       %[low32],   "#fp"                                   
\n\t"
&gt; &gt; &gt;
&gt; &gt; &gt;  #define MMI_LWXC1(fp, addr, stride, bias)                       
            \
&gt; &gt; &gt; @@ -68,9 +69,10 @@
&gt; &gt; &gt;  #define MMI_SWC1(fp, addr, bias)                                
            \
&gt; &gt; &gt;      "swc1       "#fp",      "#bias"("#addr")                        
\n\t"
&gt; &gt; &gt;
&gt; &gt; &gt; -#define MMI_USWC1(fp, addr, bias)                               
            \
&gt; &gt; &gt; +#define MMI_SWLRC1(fp, addr, bias, off)                         
                  \
&gt; &gt; &gt;      "mfc1       %[low32],   "#fp"                                   
\n\t"   \
&gt; &gt; &gt; -    "usw        %[low32],   "#bias"("#addr")                        
\n\t"
&gt; &gt; &gt; +    "swl        %[low32],   "#bias"+"#off"("#addr")                 
\n\t"   \
&gt; &gt; &gt; +    "swr        %[low32],   "#bias"("#addr")                        
\n\t"
&gt; &gt; &gt;
&gt; &gt; &gt;  #define MMI_SWXC1(fp, addr, stride, bias)                       
            \
&gt; &gt; &gt;      PTR_ADDU    "%[addrt],  "#addr",    "#stride"                   
\n\t"   \
&gt; &gt; &gt; @@ -79,8 +81,9 @@
&gt; &gt; &gt;  #define MMI_LDC1(fp, addr, bias)                                
            \
&gt; &gt; &gt;      "ldc1       "#fp",      "#bias"("#addr")                        
\n\t"
&gt; &gt; &gt;
&gt; &gt; &gt; -#define MMI_ULDC1(fp, addr, bias)                               
            \
&gt; &gt; &gt; -    "uld        %[all64],   "#bias"("#addr")                        
\n\t"   \
&gt; &gt; &gt; +#define MMI_LDLRC1(fp, addr, bias, off)                         
            \
&gt; &gt; &gt; +    "ldl        %[all64],   "#bias"+"#off"("#addr")                 
\n\t"   \
&gt; &gt; &gt; +    "ldr        %[all64],   "#bias"("#addr")                        
\n\t"   \
&gt; &gt; &gt;      "dmtc1      %[all64],   "#fp"                                   
\n\t"
&gt; &gt; &gt;
&gt; &gt; &gt;  #define MMI_LDXC1(fp, addr, stride, bias)                       
            \
&gt; &gt; &gt; @@ -90,9 +93,10 @@
&gt; &gt; &gt;  #define MMI_SDC1(fp, addr, bias)                                
            \
&gt; &gt; &gt;      "sdc1       "#fp",      "#bias"("#addr")                        
\n\t"
&gt; &gt; &gt;
&gt; &gt; &gt; -#define MMI_USDC1(fp, addr, bias)                               
            \
&gt; &gt; &gt; +#define MMI_SDLRC1(fp, addr, bias, off)                         
                  \
&gt; &gt; &gt;      "dmfc1      %[all64],   "#fp"                                   
\n\t"   \
&gt; &gt; &gt; -    "usd        %[all64],   "#bias"("#addr")                        
\n\t"
&gt; &gt; &gt; +    "sdl        %[all64],   "#bias"+"#off"("#addr")                 
\n\t"   \
&gt; &gt; &gt; +    "sdr        %[all64],   "#bias"("#addr")                        
\n\t"
&gt; &gt; &gt;
&gt; &gt; &gt;  #define MMI_SDXC1(fp, addr, stride, bias)                       
            \
&gt; &gt; &gt;      PTR_ADDU    "%[addrt],  "#addr",    "#stride"                   
\n\t"   \
&gt; &gt; &gt; @@ -141,17 +145,18 @@
&gt; &gt; &gt;  #define DECLARE_VAR_LOW32       int32_t low32
&gt; &gt; &gt;  #define RESTRICT_ASM_LOW32      [low32]"=&amp;r"(low32),
&gt; &gt; &gt;
&gt; &gt; &gt; -#define MMI_ULWC1(fp, addr, bias)                               
            \
&gt; &gt; &gt; -    "ulw        %[low32],   "#bias"("#addr")                        
\n\t"   \
&gt; &gt; &gt; -    "mtc1       %[low32],   "#fp"                                   
\n\t"
&gt; &gt; &gt; +#define MMI_LWLRC1(fp, addr, bias, off)                         
            \
&gt; &gt; &gt; +    "lwl        %[low32],   "#bias"+"#off"("#addr")                 
\n\t"   \
&gt; &gt; &gt; +    "lwr        %[low32],   "#bias"("#addr")                        
\n\t"   \
&gt; &gt; &gt; +    "mtc1       %[low32],   "#fp"                                    
  \n\t"
&gt; &gt; &gt;
&gt; &gt; &gt;  #else /* _MIPS_SIM != _ABIO32 */
&gt; &gt; &gt;
&gt; &gt; &gt;  #define DECLARE_VAR_LOW32
&gt; &gt; &gt;  #define RESTRICT_ASM_LOW32
&gt; &gt; &gt;
&gt; &gt; &gt; -#define MMI_ULWC1(fp, addr, bias)                               
            \
&gt; &gt; &gt; -    "gslwlc1    "#fp",    3+"#bias"("#addr")                        
\n\t"   \
&gt; &gt; &gt; +#define MMI_LWLRC1(fp, addr, bias, off)                         
            \
&gt; &gt; &gt; +    "gslwlc1    "#fp",      "#off"+"#bias"("#addr")                 
\n\t"   \
&gt; &gt; &gt;      "gslwrc1    "#fp",      "#bias"("#addr")                        
\n\t"
&gt; &gt; &gt;
&gt; &gt; &gt;  #endif /* _MIPS_SIM != _ABIO32 */
&gt; &gt; &gt; @@ -162,8 +167,8 @@
&gt; &gt; &gt;  #define MMI_SWC1(fp, addr, bias)                                
            \
&gt; &gt; &gt;      "swc1       "#fp",      "#bias"("#addr")                        
\n\t"
&gt; &gt; &gt;
&gt; &gt; &gt; -#define MMI_USWC1(fp, addr, bias)                               
            \
&gt; &gt; &gt; -    "gsswlc1    "#fp",    3+"#bias"("#addr")                        
\n\t"   \
&gt; &gt; &gt; +#define MMI_SWLRC1(fp, addr, bias, off)                         
            \
&gt; &gt; &gt; +    "gsswlc1    "#fp",      "#off"+"#bias"("#addr")                 
\n\t"   \
&gt; &gt; &gt;      "gsswrc1    "#fp",      "#bias"("#addr")                        
\n\t"
&gt; &gt; &gt;
&gt; &gt; &gt;  #define MMI_SWXC1(fp, addr, stride, bias)                       
            \
&gt; &gt; &gt; @@ -172,8 +177,8 @@
&gt; &gt; &gt;  #define MMI_LDC1(fp, addr, bias)                                
            \
&gt; &gt; &gt;      "ldc1       "#fp",      "#bias"("#addr")                        
\n\t"
&gt; &gt; &gt;
&gt; &gt; &gt; -#define MMI_ULDC1(fp, addr, bias)                               
            \
&gt; &gt; &gt; -    "gsldlc1    "#fp",    7+"#bias"("#addr")                        
\n\t"   \
&gt; &gt; &gt; +#define MMI_LDLRC1(fp, addr, bias, off)                         
            \
&gt; &gt; &gt; +    "gsldlc1    "#fp",      "#off"+"#bias"("#addr")                 
\n\t"   \
&gt; &gt; &gt;      "gsldrc1    "#fp",      "#bias"("#addr")                        
\n\t"
&gt; &gt; &gt;
&gt; &gt; &gt;  #define MMI_LDXC1(fp, addr, stride, bias)                       
            \
&gt; &gt; &gt; @@ -182,8 +187,8 @@
&gt; &gt; &gt;  #define MMI_SDC1(fp, addr, bias)                                
            \
&gt; &gt; &gt;      "sdc1       "#fp",      "#bias"("#addr")                        
\n\t"
&gt; &gt; &gt;
&gt; &gt; &gt; -#define MMI_USDC1(fp, addr, bias)                               
            \
&gt; &gt; &gt; -    "gssdlc1    "#fp",    7+"#bias"("#addr")                        
\n\t"   \
&gt; &gt; &gt; +#define MMI_SDLRC1(fp, addr, bias, off)                         
                  \
&gt; &gt; &gt; +    "gssdlc1    "#fp",      "#off"+"#bias"("#addr")                 
\n\t"   \
&gt; &gt; &gt;      "gssdrc1    "#fp",      "#bias"("#addr")                        
\n\t"
&gt; &gt; &gt;
&gt; &gt; &gt;  #define MMI_SDXC1(fp, addr, stride, bias)                       
            \
&gt; &gt; &gt; @@ -203,6 +208,12 @@
&gt; &gt; &gt;
&gt; &gt; &gt;  #endif /* HAVE_LOONGSON2 */
&gt; &gt; &gt;
&gt; &gt; &gt; +#define MMI_ULWC1(fp, addr, bias) MMI_LWLRC1(fp, addr, bias, 3)
&gt; &gt; &gt; +#define MMI_USWC1(fp, addr, bias) MMI_SWLRC1(fp, addr, bias, 3)
&gt; &gt; &gt; +
&gt; &gt; &gt; +#define MMI_ULDC1(fp, addr, bias) MMI_LDLRC1(fp, addr, bias, 7)
&gt; &gt; &gt; +#define MMI_USDC1(fp, addr, bias) MMI_SDLRC1(fp, addr, bias, 7)
&gt; &gt; &gt; +
&gt; &gt; &gt;  /**
&gt; &gt; &gt;   * Backup saved registers
&gt; &gt; &gt;   * We're not using compiler's clobber list as it's not smart 
enough
&gt; &gt; &gt; --
&gt; &gt; &gt; 2.32.0
&gt; &gt; &gt;
&gt; &gt;
&gt; &gt; 1. Use l/r pair is a good choice.
&gt; &gt; 2. Suggest keep the macro name unchanged, it's easier to use and 
associated with unaligned access.
&gt;
&gt; Hmm, the name of {MMI_ULDC1, MMI_USDC1} is actually unchanged, what do
&gt; you meant by macro name?
&gt;
&gt; Thanks.
&gt;
&gt;
For your reference.

Thanks for your advice!

However I found that the issue I was trying to resolve with this patch was resolved in binutils. So I can simply drop this patch.

I'm going to resend the series with your review tag.

Thanks.

- Jiaxun

_______________________________________________
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