[Bug target/57819] Suboptimal shift patterns
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57819 Jakub Jelinek jakub at gcc dot gnu.org changed: What|Removed |Added Status|UNCONFIRMED |RESOLVED Resolution|--- |FIXED --- Comment #3 from Jakub Jelinek jakub at gcc dot gnu.org --- Author: jakub Date: Mon Jul 8 08:48:40 2013 New Revision: 200775 URL: http://gcc.gnu.org/viewcvs?rev=200775root=gccview=rev Log: PR target/57819 * simplify-rtx.c (simplify_unary_operation_1) case ZERO_EXTEND: Simplify (zero_extend:SI (subreg:QI (and:SI (reg:SI) (const_int 63)) 0)). * combine.c (make_extraction): Create ZERO_EXTEND or SIGN_EXTEND using simplify_gen_unary instead of gen_rtx_*_EXTEND. * config/i386/i386.md (*jcc_btmode_1): New define_insn_and_split. * gcc.target/i386/pr57819.c: New test. Added: trunk/gcc/testsuite/gcc.target/i386/pr57819.c Modified: trunk/gcc/ChangeLog trunk/gcc/combine.c trunk/gcc/config/i386/i386.md trunk/gcc/simplify-rtx.c trunk/gcc/testsuite/ChangeLog
[Bug target/57819] Suboptimal shift patterns
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57819 Jakub Jelinek jakub at gcc dot gnu.org changed: What|Removed |Added CC||jakub at gcc dot gnu.org --- Comment #1 from Jakub Jelinek jakub at gcc dot gnu.org --- Created attachment 30456 -- http://gcc.gnu.org/bugzilla/attachment.cgi?id=30456action=edit gcc49-pr57819.patch Untested fix. I've actually had in one version also optimization of the zero_extend if SUBREG_REG's mode is wider then ZERO_EXTEND mode - then just return lowpart subreg, but that breaks the test1 function, the matching is quite sensitive.
[Bug target/57819] Suboptimal shift patterns
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57819 --- Comment #2 from Jakub Jelinek jakub at gcc dot gnu.org --- Created attachment 30457 -- http://gcc.gnu.org/bugzilla/attachment.cgi?id=30457action=edit gcc49-pr57819-2.patch Alternative that touches only i386 backend. In theory I think the simplify-rtx.c and combine.c changes are good and desirable, perhaps even with what I've tried first - that (zero_extend:SI (subreg:QI (and:DI (reg:DI) (const_int 63)) 0)) would be folded into (subreg:SI (and:DI (reg:DI) (const_int 63)) 0) But perhaps many backends will be surprised by that change and will need tweaks here and there. So any preferences here? I can bootstrap/regtest both patches...