diff mbox

[FFmpeg-devel] Disable MSA optimization for big endian arch

Message ID 1493035402-20023-1-git-send-email-shivraj.patil@imgtec.com
State Accepted
Commit 6f35c21659f7802a5533dea04b24958502886d7a
Headers show

Commit Message

shivraj.patil@imgtec.com April 24, 2017, 12:03 p.m. UTC
From: Shivraj Patil <shivraj.patil@imgtec.com>

Signed-off-by: Shivraj Patil <shivraj.patil@imgtec.com>
---
 configure |    4 ++++
 1 file changed, 4 insertions(+)

Comments

Michael Niedermayer May 16, 2017, 2:52 p.m. UTC | #1
On Mon, Apr 24, 2017 at 05:33:22PM +0530, shivraj.patil@imgtec.com wrote:
> From: Shivraj Patil <shivraj.patil@imgtec.com>
> 
> Signed-off-by: Shivraj Patil <shivraj.patil@imgtec.com>
> ---
>  configure |    4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/configure b/configure
> index 1e3463c..c63a48a 100755
> --- a/configure
> +++ b/configure
> @@ -5357,6 +5357,10 @@ elif enabled mips; then
>      enabled mipsdsp && check_inline_asm_flags mipsdsp '"addu.qb $t0, $t1, $t2"' '-mdsp'
>      enabled mipsdspr2 && check_inline_asm_flags mipsdspr2 '"absq_s.qb $t0, $t1"' '-mdspr2'
>  
> +    if enabled bigendian && enabled msa; then
> +        disable msa
> +    fi


the order of this looks a bit odd
for example there is above:
enabled mipsfpu && enabled msa && check_inline_asm_flags msa '"addvi.b $w0, $w1, 1"' '-mmsa' && check_header msa.h || disable msa

I think this would add -mmsa to the flags or disable msa already

with the code you add msa is disabled but -mmsa is left in the flags

Please correct me if iam wrong.

[...]
shivraj.patil@imgtec.com May 18, 2017, 12:36 p.m. UTC | #2
Shivraj: yes, -mmsa flag will be added and should not be an issue for big endian mips builds.

> +    if enabled bigendian && enabled msa; then
> +        disable msa
> +    fi

As currently, MSA optimizations does not support big endian, above code will disable MSA and switch to default C functions.




-----Original Message-----
From: ffmpeg-devel [mailto:ffmpeg-devel-bounces@ffmpeg.org] On Behalf Of Michael Niedermayer
Sent: 16 May 2017 20:22
To: FFmpeg development discussions and patches
Subject: Re: [FFmpeg-devel] [PATCH] Disable MSA optimization for big endian arch

On Mon, Apr 24, 2017 at 05:33:22PM +0530, shivraj.patil@imgtec.com wrote:
> From: Shivraj Patil <shivraj.patil@imgtec.com>
> 
> Signed-off-by: Shivraj Patil <shivraj.patil@imgtec.com>
> ---
>  configure |    4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/configure b/configure
> index 1e3463c..c63a48a 100755
> --- a/configure
> +++ b/configure
> @@ -5357,6 +5357,10 @@ elif enabled mips; then
>      enabled mipsdsp && check_inline_asm_flags mipsdsp '"addu.qb $t0, $t1, $t2"' '-mdsp'
>      enabled mipsdspr2 && check_inline_asm_flags mipsdspr2 '"absq_s.qb $t0, $t1"' '-mdspr2'
>  
> +    if enabled bigendian && enabled msa; then
> +        disable msa
> +    fi


the order of this looks a bit odd
for example there is above:
enabled mipsfpu && enabled msa && check_inline_asm_flags msa '"addvi.b $w0, $w1, 1"' '-mmsa' && check_header msa.h || disable msa

I think this would add -mmsa to the flags or disable msa already

with the code you add msa is disabled but -mmsa is left in the flags

Please correct me if iam wrong.

[...]
Michael Niedermayer May 19, 2017, 7:26 p.m. UTC | #3
On Thu, May 18, 2017 at 12:36:51PM +0000, Shivraj Patil wrote:
> Shivraj: yes, -mmsa flag will be added and should not be an issue for big endian mips builds.
> 
> > +    if enabled bigendian && enabled msa; then
> > +        disable msa
> > +    fi
> 
> As currently, MSA optimizations does not support big endian, above code will disable MSA and switch to default C functions.

So IIUC the CPU that is build for supports MSA but its not big endian
and our hand written MSA code depends on the cpu being big endian ?

then i think its more correct to leave MSA enabled and put the code
under #if HAVE_BIGENDIAN (or some other solution)

using MSA to mean MSA on either endianness in some part of configure
and otherwise have MSA mean MSA only on big endian in other parts is
a recipe for alot of confusion

[...]
diff mbox

Patch

diff --git a/configure b/configure
index 1e3463c..c63a48a 100755
--- a/configure
+++ b/configure
@@ -5357,6 +5357,10 @@  elif enabled mips; then
     enabled mipsdsp && check_inline_asm_flags mipsdsp '"addu.qb $t0, $t1, $t2"' '-mdsp'
     enabled mipsdspr2 && check_inline_asm_flags mipsdspr2 '"absq_s.qb $t0, $t1"' '-mdspr2'
 
+    if enabled bigendian && enabled msa; then
+        disable msa
+    fi
+
 elif enabled parisc; then
 
     if enabled gcc; then