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/101384] [9/10/12 Regression] wrong code at -Og and above with vector shift/multiply Date: Tue, 20 Jul 2021 15:28:31 +0000 [thread overview] Message-ID: <bug-101384-4-c3BYO5joqu@http.gcc.gnu.org/bugzilla/> (raw) In-Reply-To: <bug-101384-4@http.gcc.gnu.org/bugzilla/> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101384 --- Comment #10 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:e0e82856d535f56c916382f892ed2435dde54d4d commit r12-2416-ge0e82856d535f56c916382f892ed2435dde54d4d Author: Jakub Jelinek <jakub@redhat.com> Date: Tue Jul 20 17:26:10 2021 +0200 rs6000: Fix up easy_vector_constant_msb handling [PR101384] The following gcc.dg/pr101384.c testcase is miscompiled on powerpc64le-linux. easy_altivec_constant has code to try construct vector constants with different element sizes, perhaps different from CONST_VECTOR's mode. But as written, that works fine for vspltis[bhw] cases, but not for the vspltisw x,-1; vsl[bhw] x,x,x case, because that creates always a V16QImode, V8HImode or V4SImode constant containing broadcasted constant with just the MSB set. The vspltis_constant function etc. expects the vspltis[bhw] instructions where the small [-16..15] or even [-32..30] constant is sign-extended to the remaining step bytes, but that is not the case for the 0x80...00 constants, with step > 1 we can't handle e.g. { 0x80, 0xff, 0xff, 0xff, 0x80, 0xff, 0xff, 0xff, 0x80, 0xff, 0xff, 0xff, 0x80, 0xff, 0xff, 0xff } vectors but do want to handle e.g. { 0, 0, 0, 0x80, 0, 0, 0, 0x80, 0, 0, 0, 0x80, 0, 0, 0, 0x80 } and similarly with copies > 1 we do want to handle e.g. { 0x80808080, 0x80808080, 0x80808080, 0x80808080 }. 2021-07-20 Jakub Jelinek <jakub@redhat.com> PR target/101384 * config/rs6000/rs6000-protos.h (easy_altivec_constant): Change return type from bool to int. * config/rs6000/rs6000.c (vspltis_constant): Fix up handling the EASY_VECTOR_MSB case if either step or copies is not 1. (vspltis_shifted): Fix comment typo. (easy_altivec_constant): Change return type from bool to int, instead of returning true return byte size of the element mode that should be used to synthetize the constant. * config/rs6000/predicates.md (easy_vector_constant_msb): Require that vspltis_shifted is 0, handle the case where easy_altivec_constant assumes using different vector mode from CONST_VECTOR's mode. * config/rs6000/altivec.md (easy_vector_constant_msb splitter): Use easy_altivec_constant to determine mode in which -1 >> -1 should be performed, use rs6000_expand_vector_init instead of gen_vec_initv4sisi. * gcc.dg/pr101384.c: New test. * gcc.target/powerpc/pr101384-1.c: New test. * gcc.target/powerpc/pr101384-2.c: New test.
next prev parent reply other threads:[~2021-07-20 15:28 UTC|newest] Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top 2021-07-09 7:58 [Bug target/101384] New: " zsojka at seznam dot cz 2021-07-12 17:00 ` [Bug target/101384] " jakub at gcc dot gnu.org 2021-07-13 12:12 ` jakub at gcc dot gnu.org 2021-07-13 12:12 ` [Bug target/101384] [9/10/11/12 Regression] " jakub at gcc dot gnu.org 2021-07-13 12:20 ` jakub at gcc dot gnu.org 2021-07-13 16:13 ` segher at gcc dot gnu.org 2021-07-13 16:55 ` jakub at gcc dot gnu.org 2021-07-13 22:09 ` segher at gcc dot gnu.org 2021-07-14 7:55 ` jakub at gcc dot gnu.org 2021-07-20 14:43 ` cvs-commit at gcc dot gnu.org 2021-07-20 14:45 ` [Bug target/101384] [9/10/12 " jakub at gcc dot gnu.org 2021-07-20 15:28 ` cvs-commit at gcc dot gnu.org [this message] 2021-07-20 15:38 ` [Bug target/101384] [9/10 " jakub at gcc dot gnu.org 2022-05-10 8:20 ` cvs-commit at gcc dot gnu.org 2022-05-11 6:21 ` cvs-commit at gcc dot gnu.org 2022-05-11 6:36 ` jakub 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-101384-4-c3BYO5joqu@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).