public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/63281] New: powerpc64le creates 64 bit constants from scratch instead of loading them
@ 2014-09-16 23:01 anton at samba dot org
  2014-09-17  6:32 ` [Bug target/63281] " amodra at gmail dot com
                   ` (14 more replies)
  0 siblings, 15 replies; 16+ messages in thread
From: anton at samba dot org @ 2014-09-16 23:01 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 63281
           Summary: powerpc64le creates 64 bit constants from scratch
                    instead of loading them
           Product: gcc
           Version: 5.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: anton at samba dot org

The following testcase:

#define CONST1 0x1234567812345678
#define CONST2 0x2345678123456781
#define CONST3 0x3456781234567812
#define CONST4 0x4567812345678123
#define CONST5 0x5678123456781234
#define CONST6 0x6781234567812345
#define CONST7 0x7812345678123456
#define CONST8 0x8123456781234567

void foo(unsigned long *a, unsigned long *b, unsigned long *c,
         unsigned long *d, unsigned long *e, unsigned long *f,
         unsigned long *g, unsigned long *h)
{
        *a = CONST1;
        *b = CONST2;
        *c = CONST3;
        *d = CONST4;
        *e = CONST5;
        *f = CONST6;
        *g = CONST7;
        *h = CONST8;
}

produces some pretty horrible code. We really should be loading the constants.
This looks to be present on 4.8, 4.9 and 5.0.

foo:
    std 27,-40(1)
    std 28,-32(1)
    lis 27,0x1234
    lis 28,0x2345
    std 29,-24(1)
    std 30,-16(1)
    lis 29,0x3456
    lis 30,0x4567
    std 31,-8(1)
    lis 31,0x5678
    ori 27,27,0x5678
    ori 28,28,0x6781
    ori 29,29,0x7812
    ori 30,30,0x8123
    ori 31,31,0x1234
    sldi 27,27,32
    sldi 28,28,32
    sldi 29,29,32
    sldi 30,30,32
    sldi 31,31,32
    lis 12,0x6781
    lis 0,0x7812
    lis 11,0x8123
    oris 27,27,0x1234
    oris 28,28,0x2345
    oris 29,29,0x3456
    oris 30,30,0x4567
    oris 31,31,0x5678
    ori 27,27,0x5678
    ori 28,28,0x6781
    ori 29,29,0x7812
    ori 30,30,0x8123
    ori 31,31,0x1234
    std 27,0(3)
    ld 27,-40(1)
    ori 12,12,0x2345
    ori 0,0,0x3456
    std 28,0(4)
    std 29,0(5)
    ori 11,11,0x4567
    sldi 12,12,32
    std 30,0(6)
    ld 28,-32(1)
    ld 29,-24(1)
    sldi 0,0,32
    sldi 11,11,32
    std 31,0(7)
    ld 30,-16(1)
    ld 31,-8(1)
    oris 12,12,0x6781
    oris 0,0,0x7812
    oris 11,11,0x8123
    ori 12,12,0x2345
    ori 0,0,0x3456
    ori 11,11,0x4567
    std 12,0(8)
    std 0,0(9)
    std 11,0(10)
    blr


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

end of thread, other threads:[~2022-01-10  6:52 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-09-16 23:01 [Bug target/63281] New: powerpc64le creates 64 bit constants from scratch instead of loading them anton at samba dot org
2014-09-17  6:32 ` [Bug target/63281] " amodra at gmail dot com
2014-09-17  6:40 ` amodra at gmail dot com
2021-12-21  9:23 ` [Bug rtl-optimization/63281] " guojiufu at gcc dot gnu.org
2021-12-21 11:09 ` guojiufu at gcc dot gnu.org
2021-12-21 14:29 ` segher at gcc dot gnu.org
2021-12-21 14:36 ` segher at gcc dot gnu.org
2021-12-30  3:29 ` guojiufu at gcc dot gnu.org
2021-12-30  7:14 ` amodra at gmail dot com
2021-12-31  1:51 ` guojiufu at gcc dot gnu.org
2021-12-31  2:00 ` guojiufu at gcc dot gnu.org
2021-12-31  7:33 ` segher at gcc dot gnu.org
2022-01-04  6:07 ` guojiufu at gcc dot gnu.org
2022-01-04  8:06 ` guojiufu at gcc dot gnu.org
2022-01-06 10:06 ` guojiufu at gcc dot gnu.org
2022-01-10  6:52 ` guojiufu 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).