public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "cvs-commit at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug target/101611] AVX2 vector arithmetic shift lowered to scalar unnecessarily Date: Wed, 28 Jul 2021 08:53:36 +0000 [thread overview] Message-ID: <bug-101611-4-0SrwTDxNFC@http.gcc.gnu.org/bugzilla/> (raw) In-Reply-To: <bug-101611-4@http.gcc.gnu.org/bugzilla/> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101611 --- Comment #9 from CVS Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Jakub Jelinek <jakub@gcc.gnu.org>: https://gcc.gnu.org/g:88d0f70a326eeb42b479aa537f8a81bf5a199346 commit r12-2557-g88d0f70a326eeb42b479aa537f8a81bf5a199346 Author: Jakub Jelinek <jakub@redhat.com> Date: Wed Jul 28 10:52:51 2021 +0200 i386: Improve AVX2 expansion of vector >> vector DImode arithm. shifts [PR101611] AVX2 introduced vector >> vector shifts, but unfortunately for V{2,4}DImode it only supports logical and not arithmetic shifts, only AVX512F for V8DImode or AVX512VL for V{2,4}DImode fixed that omission. Earlier in GCC12 cycle I've committed vector >> scalar arithmetic shift emulation using various sequences, this patch handles the vector >> vector case. No need to adjust costs, the previous cost adjustment actually covers even the vector by vector shifts. The patch emits the right arithmetic V{2,4}DImode shifts using 2 logical right V{2,4}DImode shifts (once of the original operands, once of sign mask constant by the vector shift count), xor and subtraction, on each element (long long) x >> y is done as (((unsigned long long) x >> y) ^ (0x8000000000000000ULL >> y)) - (0x8000000000000000ULL >> y) i.e. if x doesn't have in some element the MSB set, it is just the logical shift, if it does, then the xor and subtraction cause also all higher bits to be set. 2021-07-28 Jakub Jelinek <jakub@redhat.com> PR target/101611 * config/i386/sse.md (vashr<mode>3): Split into vashrv8di3 expander and vashrv4di3 expander, where the latter requires just TARGET_AVX2 and has special !TARGET_AVX512VL expansion. (vashrv2di3<mask_name>): Rename to ... (vashrv2di3): ... this. Change condition to TARGET_XOP || TARGET_AVX2 and add special !TARGET_XOP && !TARGET_AVX512VL expansion. * gcc.target/i386/avx2-pr101611-1.c: New test. * gcc.target/i386/avx2-pr101611-2.c: New test.
next prev parent reply other threads:[~2021-07-28 8:53 UTC|newest] Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top 2021-07-24 8:17 [Bug target/101611] New: " glisse at gcc dot gnu.org 2021-07-24 14:45 ` [Bug target/101611] " hjl.tools at gmail dot com 2021-07-24 15:43 ` jakub at gcc dot gnu.org 2021-07-24 16:25 ` jakub at gcc dot gnu.org 2021-07-26 12:53 ` jakub at gcc dot gnu.org 2021-07-26 13:10 ` glisse at gcc dot gnu.org 2021-07-26 13:26 ` jakub at gcc dot gnu.org 2021-07-26 14:07 ` glisse at gcc dot gnu.org 2021-07-26 14:33 ` jakub at gcc dot gnu.org 2021-07-28 8:53 ` cvs-commit at gcc dot gnu.org [this message] 2021-07-28 8:54 ` jakub at gcc dot gnu.org 2021-08-04 22:01 ` pinskia at gcc dot gnu.org
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=bug-101611-4-0SrwTDxNFC@http.gcc.gnu.org/bugzilla/ \ --to=gcc-bugzilla@gcc.gnu.org \ --cc=gcc-bugs@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).