From: David Edelsohn <dje.gcc@gmail.com>
To: Michael Meissner <meissner@linux.vnet.ibm.com>,
GCC Patches <gcc-patches@gcc.gnu.org>
Subject: Re: [PATCH] PR target/65240, Fix Power{7,8} insn constraint issue with -O3 -ffast-math
Date: Wed, 11 Mar 2015 17:02:00 -0000 [thread overview]
Message-ID: <CAGWvnymp1VoTfGpgxmPwbsWcnTVrZin1-etCAvOHJ0UMaHbzMA@mail.gmail.com> (raw)
In-Reply-To: <20150305200638.GA3059@ibm-tiger.the-meissners.org>
On Thu, Mar 5, 2015 at 3:06 PM, Michael Meissner
<meissner@linux.vnet.ibm.com> wrote:
> This patch fixes PR 65240, which was a latent bug that was introduced when I
> added the -mupper-regs support to the PowerPC compiler. In the PowerPC
> compiler, if you use -ffast-math, the compiler allows floating point constants
> in move RTLs until register allocation time, in order to allow the
> optimizations that replace division by a constant with multiplication by the
> reciprocal. If the register being loaded up is a traditional Altivec register,
> the load will fail, since there is no D-FORM (register+offset) addressing mode
> for the traditional altivec registers.
>
> I had had a define_split to try and handle this situation, but it didn't work
> all of the time. I rewrote the insns, so there is an UNSPEC in it to prevent
> over optimization.
>
> I have done bootstrap builds and make check's on both a big endian power7
> system, and a little endian power8 system with no regressions in the tests. I
> have also built both power7 and power8 spec 2006 (v5) versions, and Spec
> built. I have run the Spec floating point tests on a power7 box, and all of
> the tests performed about at the same speed as before the bug fix was done,
> with the exception of gromacs, which is 4% faster with the fix.
>
> Looking at the static instruction counts, the big change is to fold the addi
> instruction into the load of the constant if it is loading the value to a
> traditional floating point register (previously, it would load up the constant
> with addis/addi and then do an indirect load). I do see other instructions
> change, including a few more floating point loads, but with the exception of
> gromacs, most of the changes are in the noise level.
>
> Is this ok to install into the trunk? At present, it is not needed for GCC
> 4.9, since that branch does not have the -mupper-regs support.
>
> [gcc]
> 2015-03-05 Michael Meissner <meissner@linux.vnet.ibm.com>
>
> PR target/65240
> * config/rs6000/rs6000.md (UNSPEC_FUSION_FP_CONSTANT): New unspec.
> (Vsx_load): New mode attribute to give appropriate VSX load
> instruction.
> (move floating point constant define_split): Use an UNSPEC to make
> sure that the load of the constant is kept as a memory address,
> instead of being converted back into a move of the constant.
> (load_<mode>_constant): Likewise.
>
> [gcc/testsuite]
> 2015-03-05 Michael Meissner <meissner@linux.vnet.ibm.com>
>
> PR target/65240
> * gcc.target/powerpc/pr65240.c: New test.
I am concerned with the create_TOC_reference use for TARGET_TOC. Has
this been tested with big endian -mcmodel=small?
Thanks, David
next prev parent reply other threads:[~2015-03-11 17:02 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-03-05 20:07 Michael Meissner
2015-03-06 12:05 ` Richard Biener
2015-03-09 15:59 ` Michael Meissner
2015-03-11 17:02 ` David Edelsohn [this message]
2015-03-11 22:21 ` Michael Meissner
2015-03-12 0:52 ` David Edelsohn
2015-03-12 15:30 ` Michael Meissner
2015-03-12 15:37 ` David Edelsohn
2015-03-17 23:19 ` Michael Meissner
2015-03-18 11:08 ` Richard Biener
2015-03-20 17:44 ` Michael Meissner
2015-04-04 18:25 ` Andreas Schwab
2015-04-04 23:07 ` Alan Modra
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=CAGWvnymp1VoTfGpgxmPwbsWcnTVrZin1-etCAvOHJ0UMaHbzMA@mail.gmail.com \
--to=dje.gcc@gmail.com \
--cc=gcc-patches@gcc.gnu.org \
--cc=meissner@linux.vnet.ibm.com \
/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).