[Bug target/92566] rs6000_preferred_simd_mode isn't very good
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92566 Kewen Lin changed: What|Removed |Added Status|ASSIGNED|RESOLVED Resolution|--- |FIXED --- Comment #14 from Kewen Lin --- Fixed.
[Bug target/92566] rs6000_preferred_simd_mode isn't very good
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92566 --- Comment #13 from Kewen Lin --- Author: linkw Date: Thu Nov 28 06:34:31 2019 New Revision: 278800 URL: https://gcc.gnu.org/viewcvs?rev=278800&root=gcc&view=rev Log: [rs6000] Fix PR92566 by checking VECTOR_UNIT_NONE_P As Segher pointed out in PR92566, we shouldn't offer some vector modes which aren't supported under current setting. This patch is to make it check by VECTOR_UNIT_NONE_P which is initialized as current architecture masks. 2019-11-28 Kewen Lin PR target/92566 * gcc/config/rs6000/rs6000.c (rs6000_preferred_simd_mode): Check by VECTOR_UNIT_NONE_P instead. Modified: trunk/gcc/ChangeLog trunk/gcc/config/rs6000/rs6000.c
[Bug target/92566] rs6000_preferred_simd_mode isn't very good
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92566 --- Comment #12 from Kewen Lin --- FWIW, I did some statistics collection with regression testing on P8 machine, the #hits on early return is 516, while the other # is 1147412. So the conclusion is that early return is useless (at least for those modern CPUs :))
[Bug target/92566] rs6000_preferred_simd_mode isn't very good
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92566 Kewen Lin changed: What|Removed |Added Attachment #47325|0 |1 is obsolete|| --- Comment #11 from Kewen Lin --- Created attachment 47328 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=47328&action=edit Simplify with VECTOR_UNIT_NONE_P and mode_for_vector Remove if (!TARGET_ALTIVEC && !TARGET_VSX) ...
[Bug target/92566] rs6000_preferred_simd_mode isn't very good
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92566 --- Comment #10 from Kewen Lin --- Yes, you are right, it's fine to drop it. Since the previous code will early return if it's under (!TARGET_ALTIVEC && !TARGET_VSX), I was thinking it may be good to put an early return there. I'm fine to remove it.
[Bug target/92566] rs6000_preferred_simd_mode isn't very good
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92566 --- Comment #9 from Segher Boessenkool --- Oh, and I think you can drop the if (!TARGET_ALTIVEC && !TARGET_VSX) thing? The rest of the code should handle that fine?
[Bug target/92566] rs6000_preferred_simd_mode isn't very good
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92566 --- Comment #8 from Segher Boessenkool --- I don't think you need lines 4909..4911. How can we test this? Is there good test coverage for it already?
[Bug target/92566] rs6000_preferred_simd_mode isn't very good
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92566 Kewen Lin changed: What|Removed |Added Attachment #47306|0 |1 is obsolete|| --- Comment #7 from Kewen Lin --- Created attachment 47325 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=47325&action=edit Simplify with VECTOR_UNIT_NONE_P and mode_for_vector Updated as mode_for_vector.
[Bug target/92566] rs6000_preferred_simd_mode isn't very good
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92566 --- Comment #6 from Kewen Lin --- Great! I was thinking there whether exists some array to map from mode to vector, but missed this one. Good to know we have this kind of function!
[Bug target/92566] rs6000_preferred_simd_mode isn't very good
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92566 --- Comment #5 from Segher Boessenkool --- The whole function can be something as simple as mode = mode_for_vector (mode, 16 / GET_MODE_SIZE (mode)); if (this is actually an existing mode && !VECTOR_UNIT_NONE (mode)) return mode; return word_mode; Or, why not?
[Bug target/92566] rs6000_preferred_simd_mode isn't very good
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92566 Kewen Lin changed: What|Removed |Added Attachment #47295|0 |1 is obsolete|| --- Comment #4 from Kewen Lin --- Created attachment 47306 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=47306&action=edit Get possible mode and query by VECTOR_UNIT_NONE_P Updated as Segher's comment.
[Bug target/92566] rs6000_preferred_simd_mode isn't very good
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92566 --- Comment #3 from Segher Boessenkool --- It should do something like if (!VECTOR_UNIT_NONE_P (V2DImode)) return V2DImode; and similar for all existing entries. Putting the same conditionals in multiple places is prone to error, as this PR shows.
[Bug target/92566] rs6000_preferred_simd_mode isn't very good
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92566 --- Comment #2 from Kewen Lin --- Created attachment 47295 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=47295&action=edit Guard V2DImode and V1TImode under VSX and P8VECTOR
[Bug target/92566] rs6000_preferred_simd_mode isn't very good
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92566 Kewen Lin changed: What|Removed |Added Status|UNCONFIRMED |ASSIGNED Last reconfirmed||2019-11-19 CC||linkw at gcc dot gnu.org Assignee|unassigned at gcc dot gnu.org |linkw at gcc dot gnu.org Ever confirmed|0 |1 --- Comment #1 from Kewen Lin --- Currently we guard V2DImode under TARGET_VSX && TARGET_P8_VECTOR in rs6000.c.