public inbox for gcc-cvs@sourceware.org help / color / mirror / Atom feed
From: Michael Meissner <meissner@gcc.gnu.org> To: gcc-cvs@gcc.gnu.org Subject: [gcc(refs/users/meissner/heads/work124)] Update ChangeLog.meissner Date: Thu, 13 Jul 2023 22:47:47 +0000 (GMT) [thread overview] Message-ID: <20230713224747.76DB33858CDB@sourceware.org> (raw) https://gcc.gnu.org/g:7afb3137794bac53c62fbfa837751663da210048 commit 7afb3137794bac53c62fbfa837751663da210048 Author: Michael Meissner <meissner@linux.ibm.com> Date: Thu Jul 13 18:47:43 2023 -0400 Update ChangeLog.meissner Diff: --- gcc/ChangeLog.meissner | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/gcc/ChangeLog.meissner b/gcc/ChangeLog.meissner index 6de12a5c853..23edbe5b6d4 100644 --- a/gcc/ChangeLog.meissner +++ b/gcc/ChangeLog.meissner @@ -1,3 +1,41 @@ +==================== Branch work124, patch #25 ==================== + +PR target/89213 - Optimize vector shift by a constant. + +Optimize vector shifts by a constant, taking advantage that the shift +instructions only look at the bits within the element. + +The PowerPC doesn't have a VSPLTID instruction. This meant that if we are doing +a V2DI shift of 0..15, we had to do VSPLTIW and VEXTSW2D instructions to load +the constant into the vector register. + +Similarly for V4SI and V2DI, if we wanted to shift more than 15 bits, we would +generate XXSPLTIB and VEXTSB2D or VEXTSB2W instructions to load the constant +into the vector register. + +Given the vector shift instructions only look at the bottom 5 or 6 bits of the +shift value, we can load the constant via VSPLTISW or XXSPLTIB instructions and +eliminate the sign extend instructions (VEXTSW2D, VEXTSB2D, and VEXTSB2W). + +2023-07-13 Michael Meissner <meissner@linux.ibm.com> + +gcc/ + + PR target/89213 + * config/rs6000/altivec.md (UNSPEC_VECTOR_SHIFT): New unspec. + (V4SI_V2DI): New mode iterator. + (vshift_code): New code iterator. + (altivec_<code>_const_<mode): New insns. + (altivec_shift_const_<mode>): New insns. + * config/rs6000/predicates.md (vector_shift_constant): New + predicate. + +gcc/testsuite/ + + PR target/89213 + * gcc.target/powerpc/pr89213.c: New test. + * gcc.target/powerpc/vec-rlmi-rlnm.c: Update insn count. + ==================== Branch work124, patch #24 ==================== Update fold-vec-extract insn counts on 32-bit big endian
next reply other threads:[~2023-07-13 22:47 UTC|newest] Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top 2023-07-13 22:47 Michael Meissner [this message] -- strict thread matches above, loose matches on Subject: below -- 2023-07-13 6:09 Michael Meissner 2023-07-12 5:17 Michael Meissner 2023-07-12 3:09 Michael Meissner 2023-07-12 1:54 Michael Meissner 2023-07-12 1:50 Michael Meissner 2023-07-07 19:53 Michael Meissner
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=20230713224747.76DB33858CDB@sourceware.org \ --to=meissner@gcc.gnu.org \ --cc=gcc-cvs@gcc.gnu.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: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).