public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/52107] New: IBM 128bit long double constant loaded inefficiently
@ 2012-02-03 13:05 amodra at gmail dot com
  2012-02-03 13:34 ` [Bug target/52107] " rguenth at gcc dot gnu.org
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: amodra at gmail dot com @ 2012-02-03 13:05 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52107

             Bug #: 52107
           Summary: IBM 128bit long double constant loaded inefficiently
    Classification: Unclassified
           Product: gcc
           Version: 4.7.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: amodra@gmail.com


/* -m64 -O2 -mcmodel=small */

typedef float TFtype __attribute__ ((mode (TF)));

TFtype f2 (TFtype x)
{
  return x * 0x1p-64f;
}

gives

[snip]
.LC2:
        .tc ID_0_0[TC],0x000000000
.LC3:
        .tc ID_0_3bf00000[TC],0x03bf00000
[snip]
.L.f2:
        mflr 0
        lfd 3,.LC3@toc(2)
        std 0,16(1)
        stdu 1,-128(1)
        lfd 4,.LC2@toc(2)
        stfd 3,112(1)
        ld 9,112(1)
        sldi 9,9,32
        std 9,112(1)
        lfd 3,112(1)
        bl __gcc_qmul
[snip]

Horrible!  How come the bit pattern is stored right-shifted, and so needs
shifting back into place?  By comparison, gcc-4.4.1 generated

[snip]
.LC1:
        .tc ID_3bf00000_0[TC],0x3bf0000000000000
.LC2:
        .tc ID_0_0[TC],0x000000000
[snip]
.L.f2:
        mflr 0
        lfd 4,.LC2@toc(2)
        lfd 3,.LC1@toc(2)
        std 0,16(1)
        stdu 1,-112(1)
        bl __gcc_qmul
[snip]


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

* [Bug target/52107] IBM 128bit long double constant loaded inefficiently
  2012-02-03 13:05 [Bug target/52107] New: IBM 128bit long double constant loaded inefficiently amodra at gmail dot com
@ 2012-02-03 13:34 ` rguenth at gcc dot gnu.org
  2012-02-03 23:18 ` amodra at gmail dot com
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: rguenth at gcc dot gnu.org @ 2012-02-03 13:34 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52107

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2012-02-03
     Ever Confirmed|0                           |1

--- Comment #1 from Richard Guenther <rguenth at gcc dot gnu.org> 2012-02-03 13:34:18 UTC ---
I suppose to save data space? ...


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

* [Bug target/52107] IBM 128bit long double constant loaded inefficiently
  2012-02-03 13:05 [Bug target/52107] New: IBM 128bit long double constant loaded inefficiently amodra at gmail dot com
  2012-02-03 13:34 ` [Bug target/52107] " rguenth at gcc dot gnu.org
@ 2012-02-03 23:18 ` amodra at gmail dot com
  2012-02-03 23:21 ` amodra at gmail dot com
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: amodra at gmail dot com @ 2012-02-03 23:18 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52107

--- Comment #2 from Alan Modra <amodra at gmail dot com> 2012-02-03 23:17:36 UTC ---
.tc generates an 8-byte word in both cases, so no space saved in the toc.  This
bit of code in rs6000_emit_move does the loads in DImode, then cse1 shows the
toc load being converted to a load immediate and it all goes downhill from
there.

  /* 128-bit constant floating-point values on Darwin should really be
     loaded as two parts.  */
  if (!TARGET_IEEEQUAD && TARGET_LONG_DOUBLE_128
      && mode == TFmode && GET_CODE (operands[1]) == CONST_DOUBLE)
    {
      /* DImode is used, not DFmode, because simplify_gen_subreg doesn't
     know how to get a DFmode SUBREG of a TFmode.  */


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

* [Bug target/52107] IBM 128bit long double constant loaded inefficiently
  2012-02-03 13:05 [Bug target/52107] New: IBM 128bit long double constant loaded inefficiently amodra at gmail dot com
  2012-02-03 13:34 ` [Bug target/52107] " rguenth at gcc dot gnu.org
  2012-02-03 23:18 ` amodra at gmail dot com
@ 2012-02-03 23:21 ` amodra at gmail dot com
  2012-02-06 22:09 ` amodra at gcc dot gnu.org
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: amodra at gmail dot com @ 2012-02-03 23:21 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52107

Alan Modra <amodra at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED
         AssignedTo|unassigned at gcc dot       |amodra at gmail dot com
                   |gnu.org                     |

--- Comment #3 from Alan Modra <amodra at gmail dot com> 2012-02-03 23:20:56 UTC ---
Investigating a fix.


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

* [Bug target/52107] IBM 128bit long double constant loaded inefficiently
  2012-02-03 13:05 [Bug target/52107] New: IBM 128bit long double constant loaded inefficiently amodra at gmail dot com
                   ` (2 preceding siblings ...)
  2012-02-03 23:21 ` amodra at gmail dot com
@ 2012-02-06 22:09 ` amodra at gcc dot gnu.org
  2012-02-06 23:42 ` amodra at gcc dot gnu.org
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: amodra at gcc dot gnu.org @ 2012-02-06 22:09 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52107

--- Comment #4 from Alan Modra <amodra at gcc dot gnu.org> 2012-02-06 22:09:17 UTC ---
Author: amodra
Date: Mon Feb  6 22:09:13 2012
New Revision: 183945

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=183945
Log:
    PR target/52107
    * config/rs6000/rs6000.c (rs6000_emit_move): Don't create DImode
    subregs of TFmode.


Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/config/rs6000/rs6000.c


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

* [Bug target/52107] IBM 128bit long double constant loaded inefficiently
  2012-02-03 13:05 [Bug target/52107] New: IBM 128bit long double constant loaded inefficiently amodra at gmail dot com
                   ` (3 preceding siblings ...)
  2012-02-06 22:09 ` amodra at gcc dot gnu.org
@ 2012-02-06 23:42 ` amodra at gcc dot gnu.org
  2012-02-06 23:43 ` amodra at gmail dot com
  2012-02-06 23:46 ` amodra at gmail dot com
  6 siblings, 0 replies; 8+ messages in thread
From: amodra at gcc dot gnu.org @ 2012-02-06 23:42 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52107

--- Comment #5 from Alan Modra <amodra at gcc dot gnu.org> 2012-02-06 23:41:49 UTC ---
Author: amodra
Date: Mon Feb  6 23:41:45 2012
New Revision: 183947

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=183947
Log:
    PR target/52107
    * config/rs6000/rs6000.c (rs6000_emit_move): Don't create DImode
    subregs of TFmode.


Modified:
    branches/gcc-4_6-branch/gcc/ChangeLog
    branches/gcc-4_6-branch/gcc/config/rs6000/rs6000.c


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

* [Bug target/52107] IBM 128bit long double constant loaded inefficiently
  2012-02-03 13:05 [Bug target/52107] New: IBM 128bit long double constant loaded inefficiently amodra at gmail dot com
                   ` (4 preceding siblings ...)
  2012-02-06 23:42 ` amodra at gcc dot gnu.org
@ 2012-02-06 23:43 ` amodra at gmail dot com
  2012-02-06 23:46 ` amodra at gmail dot com
  6 siblings, 0 replies; 8+ messages in thread
From: amodra at gmail dot com @ 2012-02-06 23:43 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52107

Alan Modra <amodra at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|                            |FIXED
   Target Milestone|---                         |4.8.0

--- Comment #6 from Alan Modra <amodra at gmail dot com> 2012-02-06 23:43:15 UTC ---
Fixed mainline and 4.6


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

* [Bug target/52107] IBM 128bit long double constant loaded inefficiently
  2012-02-03 13:05 [Bug target/52107] New: IBM 128bit long double constant loaded inefficiently amodra at gmail dot com
                   ` (5 preceding siblings ...)
  2012-02-06 23:43 ` amodra at gmail dot com
@ 2012-02-06 23:46 ` amodra at gmail dot com
  6 siblings, 0 replies; 8+ messages in thread
From: amodra at gmail dot com @ 2012-02-06 23:46 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52107

Alan Modra <amodra at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|4.8.0                       |4.7.0


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

end of thread, other threads:[~2012-02-06 23:46 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-02-03 13:05 [Bug target/52107] New: IBM 128bit long double constant loaded inefficiently amodra at gmail dot com
2012-02-03 13:34 ` [Bug target/52107] " rguenth at gcc dot gnu.org
2012-02-03 23:18 ` amodra at gmail dot com
2012-02-03 23:21 ` amodra at gmail dot com
2012-02-06 22:09 ` amodra at gcc dot gnu.org
2012-02-06 23:42 ` amodra at gcc dot gnu.org
2012-02-06 23:43 ` amodra at gmail dot com
2012-02-06 23:46 ` amodra at gmail dot com

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).