public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug regression/16457] New: PowerPC - Combine two rldicr instructions into a single rlwinm.
@ 2004-07-09 18:05 gcc-bugzilla at gcc dot gnu dot org
  2004-07-09 18:57 ` [Bug target/16457] " pinskia at gcc dot gnu dot org
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: gcc-bugzilla at gcc dot gnu dot org @ 2004-07-09 18:05 UTC (permalink / raw)
  To: gcc-bugs

Description:
A non-optimal code sequence is illustrated.  Two rlidcr instructions could
be replaced by a single rlwinm.  Duplicate using gcc 3.5 and command line:

gcc -O3 -m64 -c test.c

Testcase:
char *q;

void foo (char *p) {
  unsigned int x;
  q = p - (x & ~1);
}

Assembly:
      rldicr 0,0,32,31
      ld 9,.LC0@toc(2)
      rldicr 0,0,32,62
      subf 3,0,3
      std 3,0(9)
      blr

  The two rldicr instructions can be combined into one rlwinm
  with the resulting code looking like this:

      ld 9,.LC0@toc(2)
     rlwinm 0,0,0,0,30
     subf 3,0,3
     std 3,0(9)
     blr



-- 
           Summary: PowerPC - Combine two rldicr instructions into a single
                    rlwinm.
           Product: gcc
           Version: 3.5.0
            Status: UNCONFIRMED
          Severity: enhancement
          Priority: P1
         Component: regression
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: steinmtz at us dot ibm dot com
                CC: gcc-bugs at gcc dot gnu dot org,steinmtz at us dot ibm
                    dot com
 GCC build triplet: powerpc64-linux
  GCC host triplet: powerpc64-linux
GCC target triplet: powerpc64-linux


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


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

* [Bug target/16457] PowerPC - Combine two rldicr instructions into a single rlwinm.
  2004-07-09 18:05 [Bug regression/16457] New: PowerPC - Combine two rldicr instructions into a single rlwinm gcc-bugzilla at gcc dot gnu dot org
@ 2004-07-09 18:57 ` pinskia at gcc dot gnu dot org
  2004-07-09 19:12 ` pinskia at gcc dot gnu dot org
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-07-09 18:57 UTC (permalink / raw)
  To: gcc-bugs



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


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


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

* [Bug target/16457] PowerPC - Combine two rldicr instructions into a single rlwinm.
  2004-07-09 18:05 [Bug regression/16457] New: PowerPC - Combine two rldicr instructions into a single rlwinm gcc-bugzilla at gcc dot gnu dot org
  2004-07-09 18:57 ` [Bug target/16457] " pinskia at gcc dot gnu dot org
@ 2004-07-09 19:12 ` pinskia at gcc dot gnu dot org
  2004-11-03 14:50 ` nathan at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-07-09 19:12 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-07-09 19:12 -------
Confirmed.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|                            |1
   Last reconfirmed|0000-00-00 00:00:00         |2004-07-09 19:12:09
               date|                            |


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


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

* [Bug target/16457] PowerPC - Combine two rldicr instructions into a single rlwinm.
  2004-07-09 18:05 [Bug regression/16457] New: PowerPC - Combine two rldicr instructions into a single rlwinm gcc-bugzilla at gcc dot gnu dot org
  2004-07-09 18:57 ` [Bug target/16457] " pinskia at gcc dot gnu dot org
  2004-07-09 19:12 ` pinskia at gcc dot gnu dot org
@ 2004-11-03 14:50 ` nathan at gcc dot gnu dot org
  2004-11-03 15:41 ` pinskia at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: nathan at gcc dot gnu dot org @ 2004-11-03 14:50 UTC (permalink / raw)
  To: gcc-bugs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |nathan at gcc dot gnu dot
                   |dot org                     |org
             Status|NEW                         |ASSIGNED


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


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

* [Bug target/16457] PowerPC - Combine two rldicr instructions into a single rlwinm.
  2004-07-09 18:05 [Bug regression/16457] New: PowerPC - Combine two rldicr instructions into a single rlwinm gcc-bugzilla at gcc dot gnu dot org
                   ` (2 preceding siblings ...)
  2004-11-03 14:50 ` nathan at gcc dot gnu dot org
@ 2004-11-03 15:41 ` pinskia at gcc dot gnu dot org
  2004-11-11 16:59 ` nathan at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-11-03 15:41 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-11-03 15:41 -------
What is happening is the following instruction is being split up:
(insn:HI 14 13 15 0 (parallel [
            (set (reg:DI 123)
                (and:DI (reg/v:DI 118 [ x ])
                    (const_int 4294967294 [0xfffffffe])))
            (clobber (scratch:CC))
        ]) 273 {anddi3} (nil)
    (expr_list:REG_DEAD (reg/v:DI 118 [ x ])
        (expr_list:REG_UNUSED (scratch:CC)
            (nil))))

It is being split up inefficently.

-- 


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


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

* [Bug target/16457] PowerPC - Combine two rldicr instructions into a single rlwinm.
  2004-07-09 18:05 [Bug regression/16457] New: PowerPC - Combine two rldicr instructions into a single rlwinm gcc-bugzilla at gcc dot gnu dot org
                   ` (3 preceding siblings ...)
  2004-11-03 15:41 ` pinskia at gcc dot gnu dot org
@ 2004-11-11 16:59 ` nathan at gcc dot gnu dot org
  2004-11-11 17:01 ` pinskia at gcc dot gnu dot org
  2004-11-11 17:04 ` cvs-commit at gcc dot gnu dot org
  6 siblings, 0 replies; 8+ messages in thread
From: nathan at gcc dot gnu dot org @ 2004-11-11 16:59 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From nathan at gcc dot gnu dot org  2004-11-11 16:59 -------
2004-11-11  Nathan Sidwell  <nathan@codesourcery.com>

	PR target/16457
	* config/rs6000/rs6000.c (mask64_2_operand): Stub to call
	mask64_1or2_operand.
	(mask64_1or2_operand): Broken out of mask64_2_operand, add flag
	to spot rlwinm opportunities.
	(and64_2_operand): Use mask_1or2_operand.
	* config/rs6000/rs6000.md (anddi3): Use rlwinm when possible.

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


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


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

* [Bug target/16457] PowerPC - Combine two rldicr instructions into a single rlwinm.
  2004-07-09 18:05 [Bug regression/16457] New: PowerPC - Combine two rldicr instructions into a single rlwinm gcc-bugzilla at gcc dot gnu dot org
                   ` (4 preceding siblings ...)
  2004-11-11 16:59 ` nathan at gcc dot gnu dot org
@ 2004-11-11 17:01 ` pinskia at gcc dot gnu dot org
  2004-11-11 17:04 ` cvs-commit at gcc dot gnu dot org
  6 siblings, 0 replies; 8+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-11-11 17:01 UTC (permalink / raw)
  To: gcc-bugs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |4.0.0


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


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

* [Bug target/16457] PowerPC - Combine two rldicr instructions into a single rlwinm.
  2004-07-09 18:05 [Bug regression/16457] New: PowerPC - Combine two rldicr instructions into a single rlwinm gcc-bugzilla at gcc dot gnu dot org
                   ` (5 preceding siblings ...)
  2004-11-11 17:01 ` pinskia at gcc dot gnu dot org
@ 2004-11-11 17:04 ` cvs-commit at gcc dot gnu dot org
  6 siblings, 0 replies; 8+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2004-11-11 17:04 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From cvs-commit at gcc dot gnu dot org  2004-11-11 17:03 -------
Subject: Bug 16457

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	nathan@gcc.gnu.org	2004-11-11 17:03:40

Modified files:
	gcc            : ChangeLog 
	gcc/testsuite  : ChangeLog 
	gcc/config/rs6000: rs6000.c rs6000.md 
Added files:
	gcc/testsuite/gcc.dg: ppc-and-1.c 

Log message:
	.:
	PR target/16457
	* config/rs6000/rs6000.c (mask64_2_operand): Stub to call
	mask64_1or2_operand.
	(mask64_1or_2_operand): Broken out of mask64_2_operand, add flag
	to spot rlwinm opportunities.
	(and64_2_operand): Use mask_1or2_operand.
	* config/rs6000/rs6000.md (anddi3): Use rlwinm when possible.
	testsuite:
	PR target/16457
	* gcc.dg/ppc-and-1: New

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&r1=2.6277&r2=2.6278
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&r1=1.4576&r2=1.4577
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gcc.dg/ppc-and-1.c.diff?cvsroot=gcc&r1=NONE&r2=1.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/config/rs6000/rs6000.c.diff?cvsroot=gcc&r1=1.740&r2=1.741
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/config/rs6000/rs6000.md.diff?cvsroot=gcc&r1=1.333&r2=1.334



-- 


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


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

end of thread, other threads:[~2004-11-11 17:04 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-07-09 18:05 [Bug regression/16457] New: PowerPC - Combine two rldicr instructions into a single rlwinm gcc-bugzilla at gcc dot gnu dot org
2004-07-09 18:57 ` [Bug target/16457] " pinskia at gcc dot gnu dot org
2004-07-09 19:12 ` pinskia at gcc dot gnu dot org
2004-11-03 14:50 ` nathan at gcc dot gnu dot org
2004-11-03 15:41 ` pinskia at gcc dot gnu dot org
2004-11-11 16:59 ` nathan at gcc dot gnu dot org
2004-11-11 17:01 ` pinskia at gcc dot gnu dot org
2004-11-11 17:04 ` cvs-commit at gcc dot gnu dot 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).