[FFmpeg-devel] libavcodec/bswapdsp : add AVX2 for bswap_buf

James Darnley james.darnley at gmail.com
Sat Oct 28 16:47:37 EEST 2017


On 2017-10-22 19:14, Martin Vignali wrote:
> @@ -86,16 +101,20 @@ SECTION .text
>  
>  ; void ff_bswap_buf(uint32_t *dst, const uint32_t *src, int w);
>  %macro BSWAP32_BUF 0
> -%if cpuflag(ssse3)
> +%if cpuflag(ssse3)||cpuflag(avx2)
>  cglobal bswap32_buf, 3,4,3
>      mov      r3, r1
> +%if cpuflag(avx2)
> +    vbroadcasti128  m2, [pb_bswap32]
> +%else
>      mova     m2, [pb_bswap32]
> +%endif

Why don't you increase the size of the constant?  You wouldn't need a
preprocessor condition.

I do admit I have never considered using a broadact-128 instruction in
similar circumstances so I have no idea which might be "better".


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 603 bytes
Desc: OpenPGP digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20171028/2a98248c/attachment.sig>


More information about the ffmpeg-devel mailing list