public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/21017] New: ppc 64bit target not using rlwinm
@ 2005-04-14  1:39 anton at samba dot org
  2005-04-14 14:13 ` [Bug target/21017] " pinskia at gcc dot gnu dot org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: anton at samba dot org @ 2005-04-14  1:39 UTC (permalink / raw)
  To: gcc-bugs

Using a recent 4.0 CVS:

gcc version 4.0.0 20050412 (prerelease)

Compiling the following as 64bit:

unsigned int foo(unsigned int x)
{
                return ((x >> 16) & 0xffff) | ((x & 0xffff) << 16);
}

Results in:

.L.foo:
        slwi 0,3,16
        srwi 3,3,16
        or 3,3,0
        rldicl 3,3,0,32
        blr

Compiling for 32bit results in:

foo:
        rlwinm 3,3,16,0xffffffff
        blr

It looks like the 64bit case could be done in 2 instructions if we masked the
top 32bits of the rlwinm result.

-- 
           Summary: ppc 64bit target not using rlwinm
           Product: gcc
           Version: 4.0.0
            Status: UNCONFIRMED
          Severity: enhancement
          Priority: P2
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: anton at samba dot org
                CC: gcc-bugs at gcc dot gnu dot org
GCC target triplet: powerpc64-unknown-linux-gnu


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


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

* [Bug target/21017] ppc 64bit target not using rlwinm
  2005-04-14  1:39 [Bug c/21017] New: ppc 64bit target not using rlwinm anton at samba dot org
@ 2005-04-14 14:13 ` pinskia at gcc dot gnu dot org
  2005-04-14 16:26 ` pinskia at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-04-14 14:13 UTC (permalink / raw)
  To: gcc-bugs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
          Component|c                           |target
           Keywords|                            |missed-optimization


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


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

* [Bug target/21017] ppc 64bit target not using rlwinm
  2005-04-14  1:39 [Bug c/21017] New: ppc 64bit target not using rlwinm anton at samba dot org
  2005-04-14 14:13 ` [Bug target/21017] " pinskia at gcc dot gnu dot org
@ 2005-04-14 16:26 ` pinskia at gcc dot gnu dot org
  2005-04-14 19:41 ` pinskia at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-04-14 16:26 UTC (permalink / raw)
  To: gcc-bugs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |pinskia at gcc dot gnu dot
                   |                            |org


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


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

* [Bug target/21017] ppc 64bit target not using rlwinm
  2005-04-14  1:39 [Bug c/21017] New: ppc 64bit target not using rlwinm anton at samba dot org
  2005-04-14 14:13 ` [Bug target/21017] " pinskia at gcc dot gnu dot org
  2005-04-14 16:26 ` pinskia at gcc dot gnu dot org
@ 2005-04-14 19:41 ` pinskia at gcc dot gnu dot org
  2005-09-06  0:28 ` amodra at bigpond dot net dot au
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-04-14 19:41 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2005-04-14 19:40 -------
Looks like subregs are getting in the way.
Confirmed.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|                            |1
   Last reconfirmed|0000-00-00 00:00:00         |2005-04-14 19:40:31
               date|                            |


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


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

* [Bug target/21017] ppc 64bit target not using rlwinm
  2005-04-14  1:39 [Bug c/21017] New: ppc 64bit target not using rlwinm anton at samba dot org
                   ` (2 preceding siblings ...)
  2005-04-14 19:41 ` pinskia at gcc dot gnu dot org
@ 2005-09-06  0:28 ` amodra at bigpond dot net dot au
  2005-09-06  0:37 ` amodra at bigpond dot net dot au
  2005-09-06  1:36 ` amodra at bigpond dot net dot au
  5 siblings, 0 replies; 7+ messages in thread
From: amodra at bigpond dot net dot au @ 2005-09-06  0:28 UTC (permalink / raw)
  To: gcc-bugs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |amodra at bigpond dot net
                   |dot org                     |dot au
             Status|NEW                         |ASSIGNED


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


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

* [Bug target/21017] ppc 64bit target not using rlwinm
  2005-04-14  1:39 [Bug c/21017] New: ppc 64bit target not using rlwinm anton at samba dot org
                   ` (3 preceding siblings ...)
  2005-09-06  0:28 ` amodra at bigpond dot net dot au
@ 2005-09-06  0:37 ` amodra at bigpond dot net dot au
  2005-09-06  1:36 ` amodra at bigpond dot net dot au
  5 siblings, 0 replies; 7+ messages in thread
From: amodra at bigpond dot net dot au @ 2005-09-06  0:37 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From amodra at bigpond dot net dot au  2005-09-06 00:37 -------
Yes, we get
(ior:SI (lshiftrt:SI (subreg:SI (reg/v:DI 119 [ x ]) 4)
        (const_int 16 [0x10]))
    (subreg:SI (ashift:DI (reg/v:DI 119 [ x ])
            (const_int 16 [0x10])) 4))
which doesn't match the test in simplify_logical to simplify to a rotate.

The second operand of ior has been "simplified" by simplify_shift_const from
(ashift:SI (subreg:SI (reg/v:DI 119 [ x ]) 4) (const_int 16 [0x10])), which, if
it was left that way, would allow a match.  I think simplify_shift_const is OK
in what it's doing, ie. it is a useful optimisation in other cases, so I'll see
about matching the subreg pattern in simplify_logical.

-- 


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


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

* [Bug target/21017] ppc 64bit target not using rlwinm
  2005-04-14  1:39 [Bug c/21017] New: ppc 64bit target not using rlwinm anton at samba dot org
                   ` (4 preceding siblings ...)
  2005-09-06  0:37 ` amodra at bigpond dot net dot au
@ 2005-09-06  1:36 ` amodra at bigpond dot net dot au
  5 siblings, 0 replies; 7+ messages in thread
From: amodra at bigpond dot net dot au @ 2005-09-06  1:36 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From amodra at bigpond dot net dot au  2005-09-06 01:36 -------
Actually, the 32-bit code is valid for 64-bit.  ie. we don't need an
 rldicl 3,3,0,32
after the rlwinm, but that's another problem entirely.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
                URL|                            |http://gcc.gnu.org/ml/gcc-
                   |                            |patches/2005-
                   |                            |09/msg00298.html
           Keywords|                            |patch


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


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

end of thread, other threads:[~2005-09-06  1:36 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-04-14  1:39 [Bug c/21017] New: ppc 64bit target not using rlwinm anton at samba dot org
2005-04-14 14:13 ` [Bug target/21017] " pinskia at gcc dot gnu dot org
2005-04-14 16:26 ` pinskia at gcc dot gnu dot org
2005-04-14 19:41 ` pinskia at gcc dot gnu dot org
2005-09-06  0:28 ` amodra at bigpond dot net dot au
2005-09-06  0:37 ` amodra at bigpond dot net dot au
2005-09-06  1:36 ` amodra at bigpond dot net dot au

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