public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "rguenther at suse dot de" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug fortran/25620] Missed optimization with power
Date: Mon, 04 Sep 2006 14:17:00 -0000 [thread overview]
Message-ID: <20060904141743.17156.qmail@sourceware.org> (raw)
In-Reply-To: <bug-25620-6642@http.gcc.gnu.org/bugzilla/>
------- Comment #10 from rguenther at suse dot de 2006-09-04 14:17 -------
Subject: Re: Missed optimization with power
On Mon, 4 Sep 2006, jv244 at cam dot ac dot uk wrote:
>
>
> ------- Comment #9 from jv244 at cam dot ac dot uk 2006-09-04 14:10 -------
> (In reply to comment #7)
> > Looking at how we deal with all this, we seem to like pow() very much during
> > folding, even doing the reverse transformations you suggest. The
> > transformation
> > back to sqrt ( x**N ) with N being an integer could be done by
> > expand_builtin_pow
> > in case that computation of sqrt is cheap. Other than that, exposing integer
> > powers is only a win if theres some CSE possibility.
>
> Despite this PR being a bit old, I'd like to add another (similar example, also
> from real code) where other compilers generate much better code:
>
> subroutine t(x)
> x=x**1.5
> end subroutine t
>
> pgf90:
> # lineno: 0
> sqrtss (%rdi), %xmm0
> mulss (%rdi), %xmm0
> movss %xmm0, (%rdi)
>
> gfortran -S -O3 -ffast-math:
> movss (%rdi), %xmm0
> movq %rdi, %rbx
> movss .LC0(%rip), %xmm1
> call powf
> movss %xmm0, (%rbx)
> popq %rbx
> ret
This should be doable from expand_builtin_pow if we have an optab
for the sqrt computation.
Richard.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25620
next prev parent reply other threads:[~2006-09-04 14:17 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-01-01 12:29 [Bug tree-optimization/25620] New: Missed optimisation " jv244 at cam dot ac dot uk
2006-01-06 14:07 ` [Bug tree-optimization/25620] Missed optimization with power (only with -ffast-math) pinskia at gcc dot gnu dot org
2006-01-13 16:37 ` [Bug tree-optimization/25620] Missed optimization with power pinskia at gcc dot gnu dot org
2006-01-13 16:44 ` [Bug fortran/25620] " rguenth at gcc dot gnu dot org
2006-01-13 17:33 ` jv244 at cam dot ac dot uk
2006-01-13 17:38 ` jv244 at cam dot ac dot uk
2006-01-13 18:15 ` jv244 at cam dot ac dot uk
2006-01-13 18:42 ` rguenth at gcc dot gnu dot org
2006-01-13 19:58 ` kargl at gcc dot gnu dot org
2006-09-04 14:10 ` jv244 at cam dot ac dot uk
2006-09-04 14:17 ` rguenther at suse dot de [this message]
2006-11-04 15:01 ` rguenth at gcc dot gnu dot org
2006-11-05 20:39 ` [Bug middle-end/25620] " patchapp at dberlin dot org
2006-11-26 14:30 ` patchapp at dberlin dot org
2006-11-27 11:39 ` rguenth at gcc dot gnu dot org
2006-11-27 11:52 ` [Bug fortran/25620] " rguenth at gcc dot gnu dot org
2006-11-27 16:49 ` jv244 at cam dot ac dot uk
2007-01-22 22:02 ` fxcoudert at gcc dot gnu dot org
2010-03-18 14:37 ` vincent at vinc17 dot 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=20060904141743.17156.qmail@sourceware.org \
--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: link
Be 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).