public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
* [Bug rtl-optimization/44214] Compiler does not optimize vector divide with -freciprocal-math (or -ffast-math) [not found] <bug-44214-4@http.gcc.gnu.org/bugzilla/> @ 2012-04-19 15:21 ` wschmidt at gcc dot gnu.org 2012-04-20 12:44 ` wschmidt at gcc dot gnu.org ` (2 subsequent siblings) 3 siblings, 0 replies; 7+ messages in thread From: wschmidt at gcc dot gnu.org @ 2012-04-19 15:21 UTC (permalink / raw) To: gcc-bugs http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44214 William J. Schmidt <wschmidt at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |bergner at vnet dot | |ibm.com, wschmidt at gcc | |dot gnu.org AssignedTo|unassigned at gcc dot |wschmidt at gcc dot gnu.org |gnu.org | --- Comment #4 from William J. Schmidt <wschmidt at gcc dot gnu.org> 2012-04-19 15:20:21 UTC --- I'll take this one. ^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug rtl-optimization/44214] Compiler does not optimize vector divide with -freciprocal-math (or -ffast-math) [not found] <bug-44214-4@http.gcc.gnu.org/bugzilla/> 2012-04-19 15:21 ` [Bug rtl-optimization/44214] Compiler does not optimize vector divide with -freciprocal-math (or -ffast-math) wschmidt at gcc dot gnu.org @ 2012-04-20 12:44 ` wschmidt at gcc dot gnu.org 2012-04-20 14:19 ` wschmidt at gcc dot gnu.org 2012-04-20 14:21 ` wschmidt at gcc dot gnu.org 3 siblings, 0 replies; 7+ messages in thread From: wschmidt at gcc dot gnu.org @ 2012-04-20 12:44 UTC (permalink / raw) To: gcc-bugs http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44214 William J. Schmidt <wschmidt at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Target Milestone|--- |4.8.0 ^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug rtl-optimization/44214] Compiler does not optimize vector divide with -freciprocal-math (or -ffast-math) [not found] <bug-44214-4@http.gcc.gnu.org/bugzilla/> 2012-04-19 15:21 ` [Bug rtl-optimization/44214] Compiler does not optimize vector divide with -freciprocal-math (or -ffast-math) wschmidt at gcc dot gnu.org 2012-04-20 12:44 ` wschmidt at gcc dot gnu.org @ 2012-04-20 14:19 ` wschmidt at gcc dot gnu.org 2012-04-20 14:21 ` wschmidt at gcc dot gnu.org 3 siblings, 0 replies; 7+ messages in thread From: wschmidt at gcc dot gnu.org @ 2012-04-20 14:19 UTC (permalink / raw) To: gcc-bugs http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44214 --- Comment #5 from William J. Schmidt <wschmidt at gcc dot gnu.org> 2012-04-20 14:19:23 UTC --- Author: wschmidt Date: Fri Apr 20 14:19:13 2012 New Revision: 186625 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=186625 Log: gcc: 2012-04-20 Bill Schmidt <wschmidt@linux.vnet.ibm.com> PR rtl-optimization/44214 * fold-const.c (exact_inverse): New function. (fold_binary_loc): Fold vector and complex division by constant into multiply by recripocal with flag_reciprocal_math; fold vector division by constant into multiply by reciprocal with exact inverse. gcc/testsuite: 2012-04-20 Bill Schmidt <wschmidt@linux.vnet.ibm.com> PR rtl-optimization/44214 * gcc.dg/pr44214-1.c: New test. * gcc.dg/pr44214-2.c: Likewise. * gcc.dg/pr44214-3.c: Likewise. Added: trunk/gcc/testsuite/gcc.dg/pr44214-1.c trunk/gcc/testsuite/gcc.dg/pr44214-2.c trunk/gcc/testsuite/gcc.dg/pr44214-3.c Modified: trunk/gcc/ChangeLog trunk/gcc/fold-const.c trunk/gcc/testsuite/ChangeLog ^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug rtl-optimization/44214] Compiler does not optimize vector divide with -freciprocal-math (or -ffast-math) [not found] <bug-44214-4@http.gcc.gnu.org/bugzilla/> ` (2 preceding siblings ...) 2012-04-20 14:19 ` wschmidt at gcc dot gnu.org @ 2012-04-20 14:21 ` wschmidt at gcc dot gnu.org 3 siblings, 0 replies; 7+ messages in thread From: wschmidt at gcc dot gnu.org @ 2012-04-20 14:21 UTC (permalink / raw) To: gcc-bugs http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44214 William J. Schmidt <wschmidt at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution| |FIXED --- Comment #6 from William J. Schmidt <wschmidt at gcc dot gnu.org> 2012-04-20 14:21:09 UTC --- Fixed. ^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug rtl-optimization/44214] New: Compiler does not optimize vector divide with -freciprocal-math (or -ffast-math) @ 2010-05-20 17:49 meissner at gcc dot gnu dot org 2010-05-20 18:00 ` [Bug rtl-optimization/44214] " meissner at gcc dot gnu dot org ` (2 more replies) 0 siblings, 3 replies; 7+ messages in thread From: meissner at gcc dot gnu dot org @ 2010-05-20 17:49 UTC (permalink / raw) To: gcc-bugs If you have code that does division by a constant that can be auto vectorized by the compiler, the compiler does not convert the division to multiplication by the reciprocal if -freciprocal-math (or -ffast-math), but instead does the division. The bug is in fold-const.c near line 11254, where the code for handling REAL_CST should be cloned to handle VECTOR_CST (and presumably COMPLEX_CST also). -- Summary: Compiler does not optimize vector divide with - freciprocal-math (or -ffast-math) Product: gcc Version: 4.5.0 Status: UNCONFIRMED Severity: enhancement Priority: P3 Component: rtl-optimization AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: meissner at gcc dot gnu dot org GCC build triplet: powerpc64-unknown-linux-gnu GCC host triplet: powerpc64-unknown-linux-gnu GCC target triplet: powerpc64-unknown-linux-gnu http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44214 ^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug rtl-optimization/44214] Compiler does not optimize vector divide with -freciprocal-math (or -ffast-math) 2010-05-20 17:49 [Bug rtl-optimization/44214] New: " meissner at gcc dot gnu dot org @ 2010-05-20 18:00 ` meissner at gcc dot gnu dot org 2010-05-20 18:02 ` meissner at gcc dot gnu dot org 2010-05-21 9:48 ` rguenth at gcc dot gnu dot org 2 siblings, 0 replies; 7+ messages in thread From: meissner at gcc dot gnu dot org @ 2010-05-20 18:00 UTC (permalink / raw) To: gcc-bugs ------- Comment #1 from meissner at gcc dot gnu dot org 2010-05-20 18:00 ------- Actually in looking at it further, I was wrong in the initial claim. Auto vectorization now handles division by a constant. Explicit vectors like PowerPC (and probably SPU) do show the problem. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44214 ^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug rtl-optimization/44214] Compiler does not optimize vector divide with -freciprocal-math (or -ffast-math) 2010-05-20 17:49 [Bug rtl-optimization/44214] New: " meissner at gcc dot gnu dot org 2010-05-20 18:00 ` [Bug rtl-optimization/44214] " meissner at gcc dot gnu dot org @ 2010-05-20 18:02 ` meissner at gcc dot gnu dot org 2010-05-21 9:48 ` rguenth at gcc dot gnu dot org 2 siblings, 0 replies; 7+ messages in thread From: meissner at gcc dot gnu dot org @ 2010-05-20 18:02 UTC (permalink / raw) To: gcc-bugs ------- Comment #2 from meissner at gcc dot gnu dot org 2010-05-20 18:02 ------- Created an attachment (id=20712) --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=20712&action=view) Example program that shows the issue on powerpc. Compile with -mcpu=power7 on powerpc. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44214 ^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug rtl-optimization/44214] Compiler does not optimize vector divide with -freciprocal-math (or -ffast-math) 2010-05-20 17:49 [Bug rtl-optimization/44214] New: " meissner at gcc dot gnu dot org 2010-05-20 18:00 ` [Bug rtl-optimization/44214] " meissner at gcc dot gnu dot org 2010-05-20 18:02 ` meissner at gcc dot gnu dot org @ 2010-05-21 9:48 ` rguenth at gcc dot gnu dot org 2 siblings, 0 replies; 7+ messages in thread From: rguenth at gcc dot gnu dot org @ 2010-05-21 9:48 UTC (permalink / raw) To: gcc-bugs ------- Comment #3 from rguenth at gcc dot gnu dot org 2010-05-21 09:47 ------- The fold code should probably simply use fold_binary to do the constant folding (which already should handle 1/x for x vector and complex. There is a build_one_cst to build the constant 1 for any type). The exact result check would need to use mpc (and I'm not sure its correct for -frounding-math anyway). -- rguenth at gcc dot gnu dot org changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |NEW Ever Confirmed|0 |1 Last reconfirmed|0000-00-00 00:00:00 |2010-05-21 09:47:56 date| | http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44214 ^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2012-04-20 14:21 UTC | newest] Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- [not found] <bug-44214-4@http.gcc.gnu.org/bugzilla/> 2012-04-19 15:21 ` [Bug rtl-optimization/44214] Compiler does not optimize vector divide with -freciprocal-math (or -ffast-math) wschmidt at gcc dot gnu.org 2012-04-20 12:44 ` wschmidt at gcc dot gnu.org 2012-04-20 14:19 ` wschmidt at gcc dot gnu.org 2012-04-20 14:21 ` wschmidt at gcc dot gnu.org 2010-05-20 17:49 [Bug rtl-optimization/44214] New: " meissner at gcc dot gnu dot org 2010-05-20 18:00 ` [Bug rtl-optimization/44214] " meissner at gcc dot gnu dot org 2010-05-20 18:02 ` meissner at gcc dot gnu dot org 2010-05-21 9:48 ` rguenth at gcc dot gnu dot org
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).