public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/27125]  New: optimize array bit shift
@ 2006-04-11 20:31 ajrobb at bigfoot dot com
  2006-04-12  1:17 ` [Bug target/27125] " pinskia at gcc dot gnu dot org
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: ajrobb at bigfoot dot com @ 2006-04-11 20:31 UTC (permalink / raw)
  To: gcc-bugs

I was writing a routine to shift bits along an array. I want the compiler to
use the shrdl assembler command. It will do this if I load the values into an
(unsigned long long) value, bit it does a whole lot more - taking 22 seconds
to shift 1024000000 words on an 500MHz Intel PIII. The enclosed C routine
doesn't use (unsigned long long) and is a faster - taking 14 seconds.

1. I would like the optimiser to recognise a shrd like it recognises a ror.

2. I would like the optimiser to respect my choice of decrement to zero. (I
think earlier versions (3) of gcc C compiler would respect my choice to
decrement to zero rather then increment from zero to a limit.)

The hand-optimised assembler, my_bit32.s, takes just 8 seconds. Some 4 seconds
were gained by using shrdl and a further 2 seconds were gained by using decl
instead of incl and cmpl.


-- 
           Summary: optimize array bit shift
           Product: gcc
           Version: 4.1.0
            Status: UNCONFIRMED
          Severity: enhancement
          Priority: P3
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: ajrobb at bigfoot dot com
 GCC build triplet: i686-pc-linux-gnu
  GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu


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


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

* [Bug target/27125] optimize array bit shift
  2006-04-11 20:31 [Bug c/27125] New: optimize array bit shift ajrobb at bigfoot dot com
@ 2006-04-12  1:17 ` pinskia at gcc dot gnu dot org
  2006-05-10  9:45 ` ajrobb at bigfoot dot com
  2006-08-21  6:00 ` pinskia at gcc dot gnu dot org
  2 siblings, 0 replies; 4+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-04-12  1:17 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from pinskia at gcc dot gnu dot org  2006-04-12 01:17 -------
I don't see any attached sources or .s files.


-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |WAITING


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


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

* [Bug target/27125] optimize array bit shift
  2006-04-11 20:31 [Bug c/27125] New: optimize array bit shift ajrobb at bigfoot dot com
  2006-04-12  1:17 ` [Bug target/27125] " pinskia at gcc dot gnu dot org
@ 2006-05-10  9:45 ` ajrobb at bigfoot dot com
  2006-08-21  6:00 ` pinskia at gcc dot gnu dot org
  2 siblings, 0 replies; 4+ messages in thread
From: ajrobb at bigfoot dot com @ 2006-05-10  9:45 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from ajrobb at bigfoot dot com  2006-05-10 09:45 -------
Created an attachment (id=11428)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=11428&action=view)
multi-word bit shift

This is my loop - using a single index that decrements to zero

I have seen simpler loops perform twice as fast with decrement to zero compared
with increment to value.

.L8:
        movl    -4(%ebp,%ebx,4), %eax
        movl    %edi, %ecx
        movl    (%ebp,%ebx,4), %edx
        sall    %cl, %eax
        movl    %esi, %ecx
        shrl    %cl, %edx
        orl     %eax, %edx
        movl    %edx, (%ebp,%ebx,4)
        decl    %ebx
        jne     .L8


-- 


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


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

* [Bug target/27125] optimize array bit shift
  2006-04-11 20:31 [Bug c/27125] New: optimize array bit shift ajrobb at bigfoot dot com
  2006-04-12  1:17 ` [Bug target/27125] " pinskia at gcc dot gnu dot org
  2006-05-10  9:45 ` ajrobb at bigfoot dot com
@ 2006-08-21  6:00 ` pinskia at gcc dot gnu dot org
  2 siblings, 0 replies; 4+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-08-21  6:00 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from pinskia at gcc dot gnu dot org  2006-08-21 05:59 -------
This is a dup of bug 23813 and many others.  This is the standard subreg
problem.

*** This bug has been marked as a duplicate of 23813 ***


-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|WAITING                     |RESOLVED
         Resolution|                            |DUPLICATE


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


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

end of thread, other threads:[~2006-08-21  6:00 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-04-11 20:31 [Bug c/27125] New: optimize array bit shift ajrobb at bigfoot dot com
2006-04-12  1:17 ` [Bug target/27125] " pinskia at gcc dot gnu dot org
2006-05-10  9:45 ` ajrobb at bigfoot dot com
2006-08-21  6:00 ` pinskia 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).