[Bug tree-optimization/40073] Vector short/char shifts generate sub-optimal code

2022-03-08 Thread law at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=40073 --- Comment #19 from Jeffrey A. Law --- I stumbled over this as well as some point. One thing I started playing with, but had to set aside was making vect_get_range_info smarter. In particular the case I was looking at VAR would have a single

[Bug tree-optimization/40073] Vector short/char shifts generate sub-optimal code

2019-08-07 Thread linkw at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=40073 --- Comment #18 from Kewen Lin --- Created attachment 46687 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=46687&action=edit Powerpc case on vector rotation

[Bug tree-optimization/40073] Vector short/char shifts generate sub-optimal code

2019-07-20 Thread segher at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=40073 --- Comment #17 from Segher Boessenkool --- Yup, those testcases work fine for powerpc, too; and the signed versions of those do as well. (I couldn't find vector-types.h; I did "#define VECTOR_SIZE 16").

[Bug tree-optimization/40073] Vector short/char shifts generate sub-optimal code

2019-07-06 Thread amylaar at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=40073 --- Comment #16 from Jorn Wolfgang Rennecke --- Going from gcc 8.2 to gcc 9.1, I find the following two test cases are now autovectorized: /* { dg-do compile } */ /* { dg-options "-O3" } */ /* Test auto-vectorization */ #include "vector-types.

[Bug tree-optimization/40073] Vector short/char shifts generate sub-optimal code

2018-11-26 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=40073 --- Comment #15 from Richard Biener --- The pattern recognizer could apply some of these tricks. I'd rather not have GIMPLE narrow the operations and putting in MIN/MAX ops to make the code not undefined...

[Bug tree-optimization/40073] Vector short/char shifts generate sub-optimal code

2018-11-24 Thread amylaar at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=40073 --- Comment #14 from Jorn Wolfgang Rennecke --- (In reply to Jorn Wolfgang Rennecke from comment #12) > If we are right shifting a signed type, we could apply a MAX operation to the > shift count. Oops, I mean MIN of course. So that we can guar

[Bug tree-optimization/40073] Vector short/char shifts generate sub-optimal code

2018-11-24 Thread amylaar at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=40073 --- Comment #13 from Jorn Wolfgang Rennecke --- If the shifted value is 16 bit and int is 32 bit wide, then, depending on target costs, instead of a vector compare, we might decide to use a sign extract of bit 4 of the shift count instead.

[Bug tree-optimization/40073] Vector short/char shifts generate sub-optimal code

2018-11-24 Thread amylaar at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=40073 --- Comment #12 from Jorn Wolfgang Rennecke --- If we are left shifting a narrow signed type for the result, and no defined overflow semantics are in place, it should be OK to just vectorize the code using the result type. If we are right shifti

[Bug tree-optimization/40073] Vector short/char shifts generate sub-optimal code

2018-11-24 Thread amylaar at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=40073 Jorn Wolfgang Rennecke changed: What|Removed |Added CC||amylaar at gcc dot gnu.org ---

[Bug tree-optimization/40073] Vector short/char shifts generate sub-optimal code

2017-03-02 Thread segher at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=40073 Segher Boessenkool changed: What|Removed |Added CC||segher at gcc dot gnu.org --- Comme

[Bug tree-optimization/40073] Vector short/char shifts generate sub-optimal code

2015-06-12 Thread glisse at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=40073 Marc Glisse changed: What|Removed |Added CC||law at gcc dot gnu.org --- Comment #9 from

[Bug tree-optimization/40073] Vector short/char shifts generate sub-optimal code

2015-06-12 Thread alalaw01 at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=40073 --- Comment #8 from alalaw01 at gcc dot gnu.org --- Is there a case where the result is different with vs without all the extending/truncating? It seems we should need the extending/truncating on vectors exactly iff we need it on scalars?

[Bug tree-optimization/40073] Vector short/char shifts generate sub-optimal code

2015-06-12 Thread pinskia at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=40073 --- Comment #7 from Andrew Pinski --- (In reply to alalaw01 from comment #6) > Same problem on AArch64 (at -O3). We've decided the shift is to be done on > integers, widening the arguments and then truncating, before we hit the > vectorizer: Thi

[Bug tree-optimization/40073] Vector short/char shifts generate sub-optimal code

2015-06-12 Thread alalaw01 at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=40073 alalaw01 at gcc dot gnu.org changed: What|Removed |Added CC||alalaw01 at gcc dot gnu.org

[Bug tree-optimization/40073] Vector short/char shifts generate sub-optimal code

2014-04-26 Thread glisse at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40073 Marc Glisse changed: What|Removed |Added Status|UNCONFIRMED |NEW Last reconfirmed|

[Bug tree-optimization/40073] Vector short/char shifts generate sub-optimal code

2009-05-08 Thread rguenth at gcc dot gnu dot org
-- rguenth at gcc dot gnu dot org changed: What|Removed |Added CC||rguenth at gcc dot gnu dot |

[Bug tree-optimization/40073] Vector short/char shifts generate sub-optimal code

2009-05-08 Thread meissner at linux dot vnet dot ibm dot com
--- Comment #1 from meissner at linux dot vnet dot ibm dot com 2009-05-08 16:59 --- Created an attachment (id=17827) --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=17827&action=view) test case This code is an example of the code that generates sub-optimal code. -- http://gcc.

[Bug tree-optimization/40073] Vector short/char shifts generate sub-optimal code

2009-05-08 Thread meissner at linux dot vnet dot ibm dot com
--- Comment #5 from meissner at linux dot vnet dot ibm dot com 2009-05-08 17:06 --- Created an attachment (id=17831) --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=17831&action=view) Vectorizer verbose output This is the output from the Powerpc compiler with -fdump-tree-vect -ftre

[Bug tree-optimization/40073] Vector short/char shifts generate sub-optimal code

2009-05-08 Thread meissner at linux dot vnet dot ibm dot com
--- Comment #4 from meissner at linux dot vnet dot ibm dot com 2009-05-08 17:04 --- Created an attachment (id=17830) --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=17830&action=view) X86_64 example code This code was compiled with an x86_64 compiler with the -O3 -msse3 options.

[Bug tree-optimization/40073] Vector short/char shifts generate sub-optimal code

2009-05-08 Thread meissner at linux dot vnet dot ibm dot com
--- Comment #3 from meissner at linux dot vnet dot ibm dot com 2009-05-08 17:03 --- Created an attachment (id=17829) --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=17829&action=view) Powerpc example code This code was compiled with -O3 -maltivec. -- http://gcc.gnu.org/bugzill

[Bug tree-optimization/40073] Vector short/char shifts generate sub-optimal code

2009-05-08 Thread meissner at linux dot vnet dot ibm dot com
--- Comment #2 from meissner at linux dot vnet dot ibm dot com 2009-05-08 17:02 --- Created an attachment (id=17828) --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=17828&action=view) Replacement test case that doesn't need -DTYPE to show the bug Replacement test case. -- meiss