diff mbox series

[FFmpeg-devel,1/5] x86 inline assembly compliance

Message ID 993105619.3741455.1585996333278.JavaMail.zimbra@univ-grenoble-alpes.fr
State Superseded
Headers show
Series [FFmpeg-devel,1/5] x86 inline assembly compliance
Related show

Checks

Context Check Description
andriy/ffmpeg-patchwork pending
andriy/ffmpeg-patchwork warning Failed to apply patch

Commit Message

FRÉDÉRIC RECOULES April 4, 2020, 10:32 a.m. UTC
[inline assembly] prepares for contiguous assembly statements merging 

--- 
libavcodec/x86/inline_asm.h | 29 +++++++++++++++++------------ 
1 file changed, 17 insertions(+), 12 deletions(-)

Comments

Michael Niedermayer April 22, 2020, 4:03 p.m. UTC | #1
On Sat, Apr 04, 2020 at 12:32:13PM +0200, FRÉDÉRIC RECOULES wrote:
> [inline assembly] prepares for contiguous assembly statements merging 
> 
> --- 
> libavcodec/x86/inline_asm.h | 29 +++++++++++++++++------------ 
> 1 file changed, 17 insertions(+), 12 deletions(-) 
> 
> diff --git a/libavcodec/x86/inline_asm.h b/libavcodec/x86/inline_asm.h 
> index 0198746719..6ead73ac33 100644 
> --- a/libavcodec/x86/inline_asm.h 
> +++ b/libavcodec/x86/inline_asm.h 
> @@ -23,13 +23,15 @@ 
> 
> #include "constants.h" 
> 
> -#define MOVQ_WONE(regd) \ 
> - __asm__ volatile ( \ 
> - "pcmpeqd %%" #regd ", %%" #regd " \n\t" \ 
> - "psrlw $15, %%" #regd ::) 
> +#define MOVQ_WONE_TPL(regd) \ 
> + "pcmpeqd %%"#regd", %%"#regd" \n\t" \ 
> + "psrlw $15, %%" #regd" \n\t" 
> +#define MOVQ_WONE(regd) __asm__ volatile (MOVQ_WONE_TPL(regd) ::) 
> 
> #define JUMPALIGN() __asm__ volatile (".p2align 3"::) 
> -#define MOVQ_ZERO(regd) __asm__ volatile ("pxor %%"#regd", %%"#regd ::) 
> + 
> +#define MOVQ_ZERO_TPL(regd) "pxor %%"#regd", %%"#regd" \n\t" 
> +#define MOVQ_ZERO(regd) __asm__ volatile (MOVQ_ZERO_TPL(regd) ::) 

this is not a valid patch and cannot be applied

Applying: x86 inline assembly compliance
error: corrupt patch at line 11
error: could not build fake ancestor
Patch failed at 0001 x86 inline assembly compliance
Use 'git am --show-current-patch' to see the failed patch
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".



[...]
FRÉDÉRIC RECOULES April 22, 2020, 6:12 p.m. UTC | #2
For whatever reason, something gobbles the space just before '#include "constants.h"'... 

Once again, the patches have been resubmitted (from my orange.fr address using 'git send-email', I had a hard time with the professional SMTP server).
Hope everything goes right this time, sorry for this inconvenience. 

Regards,
Frédéric Recoules

----- Mail original -----
De: "michael" <michael@niedermayer.cc>
À: "ffmpeg-devel" <ffmpeg-devel@ffmpeg.org>
Cc: "Richard Bonichon" <richard.bonichon@gmail.com>, "Sébastien Bardin" <sebastien.bardin@cea.fr>
Envoyé: Mercredi 22 Avril 2020 18:03:12
Objet: Re: [FFmpeg-devel] [PATCH 1/5] x86 inline assembly compliance

On Sat, Apr 04, 2020 at 12:32:13PM +0200, FRÉDÉRIC RECOULES wrote: 
> [inline assembly] prepares for contiguous assembly statements merging 
> 
> --- 
> libavcodec/x86/inline_asm.h | 29 +++++++++++++++++------------ 
> 1 file changed, 17 insertions(+), 12 deletions(-) 
> 
> diff --git a/libavcodec/x86/inline_asm.h b/libavcodec/x86/inline_asm.h 
> index 0198746719..6ead73ac33 100644 
> --- a/libavcodec/x86/inline_asm.h 
> +++ b/libavcodec/x86/inline_asm.h 
> @@ -23,13 +23,15 @@ 
> 
> #include "constants.h" 
> 
> -#define MOVQ_WONE(regd) \ 
> - __asm__ volatile ( \ 
> - "pcmpeqd %%" #regd ", %%" #regd " \n\t" \ 
> - "psrlw $15, %%" #regd ::) 
> +#define MOVQ_WONE_TPL(regd) \ 
> + "pcmpeqd %%"#regd", %%"#regd" \n\t" \ 
> + "psrlw $15, %%" #regd" \n\t" 
> +#define MOVQ_WONE(regd) __asm__ volatile (MOVQ_WONE_TPL(regd) ::) 
> 
> #define JUMPALIGN() __asm__ volatile (".p2align 3"::) 
> -#define MOVQ_ZERO(regd) __asm__ volatile ("pxor %%"#regd", %%"#regd ::) 
> + 
> +#define MOVQ_ZERO_TPL(regd) "pxor %%"#regd", %%"#regd" \n\t" 
> +#define MOVQ_ZERO(regd) __asm__ volatile (MOVQ_ZERO_TPL(regd) ::) 

this is not a valid patch and cannot be applied 

Applying: x86 inline assembly compliance 
error: corrupt patch at line 11 
error: could not build fake ancestor 
Patch failed at 0001 x86 inline assembly compliance 
Use 'git am --show-current-patch' to see the failed patch 
When you have resolved this problem, run "git am --continue". 
If you prefer to skip this patch, run "git am --skip" instead. 
To restore the original branch and stop patching, run "git am --abort". 



[...]
diff mbox series

Patch

diff --git a/libavcodec/x86/inline_asm.h b/libavcodec/x86/inline_asm.h 
index 0198746719..6ead73ac33 100644 
--- a/libavcodec/x86/inline_asm.h 
+++ b/libavcodec/x86/inline_asm.h 
@@ -23,13 +23,15 @@  

#include "constants.h" 

-#define MOVQ_WONE(regd) \ 
- __asm__ volatile ( \ 
- "pcmpeqd %%" #regd ", %%" #regd " \n\t" \ 
- "psrlw $15, %%" #regd ::) 
+#define MOVQ_WONE_TPL(regd) \ 
+ "pcmpeqd %%"#regd", %%"#regd" \n\t" \ 
+ "psrlw $15, %%" #regd" \n\t" 
+#define MOVQ_WONE(regd) __asm__ volatile (MOVQ_WONE_TPL(regd) ::) 

#define JUMPALIGN() __asm__ volatile (".p2align 3"::) 
-#define MOVQ_ZERO(regd) __asm__ volatile ("pxor %%"#regd", %%"#regd ::) 
+ 
+#define MOVQ_ZERO_TPL(regd) "pxor %%"#regd", %%"#regd" \n\t" 
+#define MOVQ_ZERO(regd) __asm__ volatile (MOVQ_ZERO_TPL(regd) ::) 

#define MOVQ_BFE(regd) \ 
__asm__ volatile ( \ 
@@ -37,17 +39,20 @@  
"paddb %%"#regd", %%"#regd" \n\t" ::) 

#ifndef PIC 
-#define MOVQ_WTWO(regd) __asm__ volatile ("movq %0, %%"#regd" \n\t" :: "m"(ff_pw_2)) 
+#define MOVQ_WTWO_TPL(regd) "movq %[ff_pw_2], %%"#regd" \n\t" 
+#define MOVQ_WTWO_IN [ff_pw_2] "m" (ff_pw_2) 
+#define COMMA_MOVQ_WTWO_IN , MOVQ_WTWO_IN 
#else 
// for shared library it's better to use this way for accessing constants 
// pcmpeqd -> -1 
-#define MOVQ_WTWO(regd) \ 
- __asm__ volatile ( \ 
- "pcmpeqd %%"#regd", %%"#regd" \n\t" \ 
- "psrlw $15, %%"#regd" \n\t" \ 
- "psllw $1, %%"#regd" \n\t"::) 
- 
+#define MOVQ_WTWO_TPL(regd) \ 
+ "pcmpeqd %%"#regd", %%"#regd" \n\t" \ 
+ "psrlw $15, %%"#regd" \n\t" \ 
+ "psllw $1, %%"#regd" \n\t" 
+#define MOVQ_WTWO_IN 
+#define COMMA_MOVQ_WTWO_IN 
#endif 
+#define MOVQ_WTWO(regd) __asm__ volatile (MOVQ_WTWO_TPL(regd) :: MOVQ_WTWO_IN) 

// using regr as temporary and for the output result 
// first argument is unmodified and second is trashed