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

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