From: James Almer <jamrial@gmail.com>
To: ffmpeg-devel@ffmpeg.org
Subject: [FFmpeg-devel] [PATCH 3/3] x86/lpc: use fused negative multiply-add instructions where useful
Date: Thu, 22 Sep 2022 17:12:05 -0300
Message-ID: <20220922201205.5880-1-jamrial@gmail.com> (raw)
In-Reply-To: <20220922185834.5700-2-jamrial@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
---
libavcodec/x86/lpc.asm | 17 +++++++++++++++--
1 file changed, 15 insertions(+), 2 deletions(-)
diff --git a/libavcodec/x86/lpc.asm b/libavcodec/x86/lpc.asm
index 61a5796e5d..a585c17ef5 100644
--- a/libavcodec/x86/lpc.asm
+++ b/libavcodec/x86/lpc.asm
@@ -79,11 +79,12 @@ cglobal lpc_apply_welch_window, 3, 5, 8, data, len, out, off1, off2
.loop_o:
movapd m1, m6
- mulpd m2, m0, m0
- subpd m1, m2
%if cpuflag(avx2)
+ fnmaddpd m1, m0, m0, m1
vpermpd m2, m1, q0123
%else
+ mulpd m2, m0, m0
+ subpd m1, m2
shufpd m2, m1, m1, 01b
%endif
@@ -116,8 +117,12 @@ cglobal lpc_apply_welch_window, 3, 5, 8, data, len, out, off1, off2
.loop_o_scalar:
movapd xm1, xm6
+%if cpuflag(avx2)
+ fnmaddpd xm1, xm0, xm0, xm1
+%else
mulpd xm2, xm0, xm0
subpd xm1, xm2
+%endif
cvtdq2pd xm3, [dataq + off1q]
cvtdq2pd xm4, [dataq + off2q]
@@ -174,8 +179,12 @@ cglobal lpc_apply_welch_window, 3, 5, 8, data, len, out, off1, off2
.loop_e:
movapd m1, m6
+%if cpuflag(avx2)
+ fnmaddpd m1, m0, m0, m1
+%else
mulpd m2, m0, m0
subpd m1, m2
+%endif
%if cpuflag(avx2)
vpermpd m2, m1, q0123
%else
@@ -210,8 +219,12 @@ cglobal lpc_apply_welch_window, 3, 5, 8, data, len, out, off1, off2
.loop_e_scalar:
movapd xm1, xm6
+%if cpuflag(avx2)
+ fnmaddpd xm1, xm0, xm0, xm1
+%else
mulpd xm2, xm0, xm0
subpd xm1, xm2
+%endif
cvtdq2pd xm3, [dataq + off1q]
cvtdq2pd xm4, [dataq + off2q]
--
2.37.3
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
prev parent reply other threads:[~2022-09-22 20:12 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-09-22 18:58 [FFmpeg-devel] [PATCH 1/2] avcodec/lpc: zero the middle odd sample in the output James Almer
2022-09-22 18:58 ` [FFmpeg-devel] [PATCH 2/2] tests/checkasm/lpc: randomize buffer length James Almer
2022-09-22 20:12 ` James Almer [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220922201205.5880-1-jamrial@gmail.com \
--to=jamrial@gmail.com \
--cc=ffmpeg-devel@ffmpeg.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
This inbox may be cloned and mirrored by anyone:
git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git
# If you have public-inbox 1.1+ installed, you may
# initialize and index your mirror using the following commands:
public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \
ffmpegdev@gitmailbox.com
public-inbox-index ffmpegdev
Example config snippet for mirrors.
AGPL code for this site: git clone https://public-inbox.org/public-inbox.git