public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/65614] New: PowerPC VSX systems should use XSCPSGNDP to copy scalar fp data to/from Altivec registers
@ 2015-03-27 19:43 meissner at gcc dot gnu.org
  2015-03-27 20:22 ` [Bug target/65614] " meissner at gcc dot gnu.org
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: meissner at gcc dot gnu.org @ 2015-03-27 19:43 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65614

            Bug ID: 65614
           Summary: PowerPC VSX systems should use XSCPSGNDP to copy
                    scalar fp data to/from Altivec registers
           Product: gcc
           Version: 5.0
            Status: UNCONFIRMED
          Severity: major
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: meissner at gcc dot gnu.org
              Host: powerpc64-unknown-linux-gnu
            Target: powerpc64-unknown-linux-gnu
             Build: powerpc64-unknown-linux-gnu

In trying to run Spec 2006 with the LRA register allocator, some of the
benchmarks hang on power7 (and presumably power8) after my fix for PR 65240
went it.  That fix changed how floating point constants are loaded into memory
and it now uses LFS (load float single precision) to load constants that can be
stored in single precision when -ffast-math is used (previously it only did
this optimization without -ffast-math).

The LRA register allocator is more aggressive about allocating scalar values to
the traditional Altivec registers, and will load constants into the FPR
registers, and do a move to an Altivec register.

Right now, GCC uses an XXLOR instruction to move scalar FP values outside of
the FPR registers.  In some cases, loading a value with LFS will create dirty
data and some instructions will generate a denormal exception if they get a
value with dirty data.

For moves between FPRs, the FMR instruction will convert the dirty data to a
non-dirty double precision value.  If we are moving to/from Altivec registers,
we should use a XSCPSGNDP instruction instead of XXLOR, since XSCPSGNDP is like
FMR in that it cleans up the data.


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug target/65614] PowerPC VSX systems should use XSCPSGNDP to copy scalar fp data to/from Altivec registers
  2015-03-27 19:43 [Bug target/65614] New: PowerPC VSX systems should use XSCPSGNDP to copy scalar fp data to/from Altivec registers meissner at gcc dot gnu.org
@ 2015-03-27 20:22 ` meissner at gcc dot gnu.org
  2015-03-27 20:29 ` meissner at gcc dot gnu.org
                   ` (7 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: meissner at gcc dot gnu.org @ 2015-03-27 20:22 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65614

Michael Meissner <meissner at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |ASSIGNED
   Last reconfirmed|                            |2015-03-27
     Ever confirmed|0                           |1

--- Comment #1 from Michael Meissner <meissner at gcc dot gnu.org> ---
I forgot to mention, that 410.bwaves, 465.tonto are the benchmarks that
generate incorrect results due to not using XSCPSGNDP.  The 456.hmmer benchmark
also generates correct results, and it also may fixed by using XSCPSGNDP.

Note, even though these show up with the LRA register allocator, it is possible
for the reload register allocator to generate the appropriate sequences to get
dirty data.

This only shows up in GCC 5.0, because that is the first release that allowed
scalar values to live in the traditional Altivec registers.


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug target/65614] PowerPC VSX systems should use XSCPSGNDP to copy scalar fp data to/from Altivec registers
  2015-03-27 19:43 [Bug target/65614] New: PowerPC VSX systems should use XSCPSGNDP to copy scalar fp data to/from Altivec registers meissner at gcc dot gnu.org
  2015-03-27 20:22 ` [Bug target/65614] " meissner at gcc dot gnu.org
@ 2015-03-27 20:29 ` meissner at gcc dot gnu.org
  2015-03-27 21:22 ` meissner at gcc dot gnu.org
                   ` (6 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: meissner at gcc dot gnu.org @ 2015-03-27 20:29 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65614

Michael Meissner <meissner at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P3                          |P2
   Target Milestone|---                         |5.0


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug target/65614] PowerPC VSX systems should use XSCPSGNDP to copy scalar fp data to/from Altivec registers
  2015-03-27 19:43 [Bug target/65614] New: PowerPC VSX systems should use XSCPSGNDP to copy scalar fp data to/from Altivec registers meissner at gcc dot gnu.org
  2015-03-27 20:22 ` [Bug target/65614] " meissner at gcc dot gnu.org
  2015-03-27 20:29 ` meissner at gcc dot gnu.org
@ 2015-03-27 21:22 ` meissner at gcc dot gnu.org
  2015-03-30  9:22 ` [Bug target/65614] [5 Regression] " rguenth at gcc dot gnu.org
                   ` (5 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: meissner at gcc dot gnu.org @ 2015-03-27 21:22 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65614

--- Comment #2 from Michael Meissner <meissner at gcc dot gnu.org> ---
Created attachment 35168
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=35168&action=edit
Proposed patch to fix the problem

This patch is believed to fix 410.bwaves and 465.tonto.  It will not fix
465.hmmer, which is presumably another problem.


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug target/65614] [5 Regression] PowerPC VSX systems should use XSCPSGNDP to copy scalar fp data to/from Altivec registers
  2015-03-27 19:43 [Bug target/65614] New: PowerPC VSX systems should use XSCPSGNDP to copy scalar fp data to/from Altivec registers meissner at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2015-03-27 21:22 ` meissner at gcc dot gnu.org
@ 2015-03-30  9:22 ` rguenth at gcc dot gnu.org
  2015-04-03 19:19 ` dje at gcc dot gnu.org
                   ` (4 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: rguenth at gcc dot gnu.org @ 2015-03-30  9:22 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65614

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |wrong-code
           Priority|P2                          |P1
            Summary|PowerPC VSX systems should  |[5 Regression] PowerPC VSX
                   |use XSCPSGNDP to copy       |systems should use
                   |scalar fp data to/from      |XSCPSGNDP to copy scalar fp
                   |Altivec registers           |data to/from Altivec
                   |                            |registers


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug target/65614] [5 Regression] PowerPC VSX systems should use XSCPSGNDP to copy scalar fp data to/from Altivec registers
  2015-03-27 19:43 [Bug target/65614] New: PowerPC VSX systems should use XSCPSGNDP to copy scalar fp data to/from Altivec registers meissner at gcc dot gnu.org
                   ` (3 preceding siblings ...)
  2015-03-30  9:22 ` [Bug target/65614] [5 Regression] " rguenth at gcc dot gnu.org
@ 2015-04-03 19:19 ` dje at gcc dot gnu.org
  2015-04-06 17:11 ` meissner at linux dot vnet.ibm.com
                   ` (3 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: dje at gcc dot gnu.org @ 2015-04-03 19:19 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65614

--- Comment #4 from David Edelsohn <dje at gcc dot gnu.org> ---
Comment on attachment 35227
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=35227
Proposed patch to fix the problem

The FLOAT_EXTEND cost should be based on the processor tuning, not the ISA.


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug target/65614] [5 Regression] PowerPC VSX systems should use XSCPSGNDP to copy scalar fp data to/from Altivec registers
  2015-03-27 19:43 [Bug target/65614] New: PowerPC VSX systems should use XSCPSGNDP to copy scalar fp data to/from Altivec registers meissner at gcc dot gnu.org
                   ` (4 preceding siblings ...)
  2015-04-03 19:19 ` dje at gcc dot gnu.org
@ 2015-04-06 17:11 ` meissner at linux dot vnet.ibm.com
  2015-04-07  3:36 ` meissner at gcc dot gnu.org
                   ` (2 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: meissner at linux dot vnet.ibm.com @ 2015-04-06 17:11 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65614

--- Comment #5 from Michael Meissner <meissner at linux dot vnet.ibm.com> ---
On Fri, Apr 03, 2015 at 07:19:24PM +0000, dje at gcc dot gnu.org wrote:
> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65614
> 
> --- Comment #4 from David Edelsohn <dje at gcc dot gnu.org> ---
> Comment on attachment 35227
>   --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=35227
> Proposed patch to fix the problem
> 
> The FLOAT_EXTEND cost should be based on the processor tuning, not the ISA.

This patch moves the decision to the cost structure based on the processor
tuning.  Is it ok to install?

[gcc]
2015-04-06  Michael Meissner  <meissner@linux.vnet.ibm.com>

    PR target/65614
    * config/rs6000/rs6000.c (struct processor_costs): Add cost field
    for SF->DF conversions to make FLOAT_EXTEND more expensive, so
    that LFD is used to load double constants instead of LFS.  Add
    defaults for all costs structures.  Add comments for missing
    initialization fields.
    (size32_cost): Likewise.
    (size64_cost): Likewise.
    (rs64a_cost): Likewise.
    (mpccore_cost): Likewise.
    (ppc403_cost): Likewise.
    (ppc405_cost): Likewise.
    (ppc440_cost): Likewise.
    (ppc476_cost): Likewise.
    (ppc601_cost): Likewise.
    (ppc603_cost): Likewise.
    (ppc604_cost): Likewise.
    (ppc604e_cost): Likewise.
    (ppc620_cost): Likewise.
    (ppc630_cost): Likewise.
    (ppccell_cost): Likewise.
    (ppc750_cost): Likewise.
    (ppc7450_cost): Likewise.
    (ppc8540_cost): Likewise.
    (ppce300c2c3_cost): Likewise.
    (ppce500mc_cost): Likewise.
    (ppce500mc64_cost): Likewise.
    (ppce5500_cost): Likewise.
    (ppce6500_cost): Likewise.
    (titan_cost): Likewise.
    (power4_cost): Likewise.
    (power6_cost): Likewise.
    (power7_cost): Likewise.
    (power8_cost): Likewise.
    (ppca2_cost): Likewise.
    (rs6000_rtx_costs): Make FLOAT_EXTEND use SFDF_convert field.

    * config/rs6000/rs6000.md (extendsfdf2_fpr): Generate XSCPSGNDP
    instead of XXLOR to copy SFmode to clear out dirty bits created
    when SFmode denormals are generated.
    (mov<mode>_hardfloat, FMOVE32 case): Likewise.
    (truncdfsf2_fpr): Add support for ISA 2.07 XSRSP instruction.

[gcc/testsuite]
2015-04-06  Michael Meissner  <meissner@linux.vnet.ibm.com>

    PR target/65614
    * gcc.target/powerpc/compress-float-ppc-pic.c: Run test on power5
    to get floating point compression.
    * gcc.target/powerpc/compress-foat-ppc.c: Likewise.


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug target/65614] [5 Regression] PowerPC VSX systems should use XSCPSGNDP to copy scalar fp data to/from Altivec registers
  2015-03-27 19:43 [Bug target/65614] New: PowerPC VSX systems should use XSCPSGNDP to copy scalar fp data to/from Altivec registers meissner at gcc dot gnu.org
                   ` (5 preceding siblings ...)
  2015-04-06 17:11 ` meissner at linux dot vnet.ibm.com
@ 2015-04-07  3:36 ` meissner at gcc dot gnu.org
  2015-04-07  7:52 ` jakub at gcc dot gnu.org
  2015-04-07 15:39 ` meissner at gcc dot gnu.org
  8 siblings, 0 replies; 10+ messages in thread
From: meissner at gcc dot gnu.org @ 2015-04-07  3:36 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65614

--- Comment #6 from Michael Meissner <meissner at gcc dot gnu.org> ---
Author: meissner
Date: Tue Apr  7 03:36:05 2015
New Revision: 221888

URL: https://gcc.gnu.org/viewcvs?rev=221888&root=gcc&view=rev
Log:
[gcc]
2015-04-06  Michael Meissner  <meissner@linux.vnet.ibm.com>

    PR target/65614
    * config/rs6000/rs6000.c (struct processor_costs): Add cost field
    for SF->DF conversions to make FLOAT_EXTEND more expensive, so
    that LFD is used to load double constants instead of LFS.  Add
    defaults for all costs structures.  Add comments for missing
    initialization fields.
    (size32_cost): Likewise.
    (size64_cost): Likewise.
    (rs64a_cost): Likewise.
    (mpccore_cost): Likewise.
    (ppc403_cost): Likewise.
    (ppc405_cost): Likewise.
    (ppc440_cost): Likewise.
    (ppc476_cost): Likewise.
    (ppc601_cost): Likewise.
    (ppc603_cost): Likewise.
    (ppc604_cost): Likewise.
    (ppc604e_cost): Likewise.
    (ppc620_cost): Likewise.
    (ppc630_cost): Likewise.
    (ppccell_cost): Likewise.
    (ppc750_cost): Likewise.
    (ppc7450_cost): Likewise.
    (ppc8540_cost): Likewise.
    (ppce300c2c3_cost): Likewise.
    (ppce500mc_cost): Likewise.
    (ppce500mc64_cost): Likewise.
    (ppce5500_cost): Likewise.
    (ppce6500_cost): Likewise.
    (titan_cost): Likewise.
    (power4_cost): Likewise.
    (power6_cost): Likewise.
    (power7_cost): Likewise.
    (power8_cost): Likewise.
    (ppca2_cost): Likewise.
    (rs6000_rtx_costs): Make FLOAT_EXTEND use SFDF_convert field.

    * config/rs6000/rs6000.md (extendsfdf2_fpr): Generate XSCPSGNDP
    instead of XXLOR to copy SFmode to clear out dirty bits created
    when SFmode denormals are generated.
    (mov<mode>_hardfloat, FMOVE32 case): Likewise.
    (truncdfsf2_fpr): Add support for ISA 2.07 XSRSP instruction.

[gcc/testsuite]
2015-04-06  Michael Meissner  <meissner@linux.vnet.ibm.com>

    PR target/65614
    * gcc.target/powerpc/compress-float-ppc-pic.c: Run test on power5
    to get floating point compression.
    * gcc.target/powerpc/compress-foat-ppc.c: Likewise.


Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/config/rs6000/rs6000.c
    trunk/gcc/config/rs6000/rs6000.md
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/testsuite/gcc.target/powerpc/compress-float-ppc-pic.c
    trunk/gcc/testsuite/gcc.target/powerpc/compress-float-ppc.c


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug target/65614] [5 Regression] PowerPC VSX systems should use XSCPSGNDP to copy scalar fp data to/from Altivec registers
  2015-03-27 19:43 [Bug target/65614] New: PowerPC VSX systems should use XSCPSGNDP to copy scalar fp data to/from Altivec registers meissner at gcc dot gnu.org
                   ` (6 preceding siblings ...)
  2015-04-07  3:36 ` meissner at gcc dot gnu.org
@ 2015-04-07  7:52 ` jakub at gcc dot gnu.org
  2015-04-07 15:39 ` meissner at gcc dot gnu.org
  8 siblings, 0 replies; 10+ messages in thread
From: jakub at gcc dot gnu.org @ 2015-04-07  7:52 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65614

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jakub at gcc dot gnu.org

--- Comment #7 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Thus fixed?


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug target/65614] [5 Regression] PowerPC VSX systems should use XSCPSGNDP to copy scalar fp data to/from Altivec registers
  2015-03-27 19:43 [Bug target/65614] New: PowerPC VSX systems should use XSCPSGNDP to copy scalar fp data to/from Altivec registers meissner at gcc dot gnu.org
                   ` (7 preceding siblings ...)
  2015-04-07  7:52 ` jakub at gcc dot gnu.org
@ 2015-04-07 15:39 ` meissner at gcc dot gnu.org
  8 siblings, 0 replies; 10+ messages in thread
From: meissner at gcc dot gnu.org @ 2015-04-07 15:39 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65614

Michael Meissner <meissner at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|---                         |FIXED

--- Comment #8 from Michael Meissner <meissner at gcc dot gnu.org> ---
Problem should be resolved in subversion id 221888.


^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2015-04-07 15:39 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-03-27 19:43 [Bug target/65614] New: PowerPC VSX systems should use XSCPSGNDP to copy scalar fp data to/from Altivec registers meissner at gcc dot gnu.org
2015-03-27 20:22 ` [Bug target/65614] " meissner at gcc dot gnu.org
2015-03-27 20:29 ` meissner at gcc dot gnu.org
2015-03-27 21:22 ` meissner at gcc dot gnu.org
2015-03-30  9:22 ` [Bug target/65614] [5 Regression] " rguenth at gcc dot gnu.org
2015-04-03 19:19 ` dje at gcc dot gnu.org
2015-04-06 17:11 ` meissner at linux dot vnet.ibm.com
2015-04-07  3:36 ` meissner at gcc dot gnu.org
2015-04-07  7:52 ` jakub at gcc dot gnu.org
2015-04-07 15:39 ` meissner at gcc dot gnu.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).