gcc-4.8-20130801 is now available

2013-08-01 Thread gccadmin
Snapshot gcc-4.8-20130801 is now available on
  ftp://gcc.gnu.org/pub/gcc/snapshots/4.8-20130801/
and on various mirrors, see http://gcc.gnu.org/mirrors.html for details.

This snapshot has been generated from the GCC 4.8 SVN branch
with the following options: svn://gcc.gnu.org/svn/gcc/branches/gcc-4_8-branch 
revision 201419

You'll find:

 gcc-4.8-20130801.tar.bz2 Complete GCC

  MD5=7cd67fb48f4fb843ecd94f6cef00c73b
  SHA1=f0aed9f58736bbc08cf44cbe8a99c80c206f3691

Diffs from 4.8-20130725 are available in the diffs/ subdirectory.

When a particular snapshot is ready for public consumption the LATEST-4.8
link is updated and a message is sent to the gcc list.  Please do not use
a snapshot before it has been announced that way.


AVR-gcc shift optimization

2013-08-01 Thread Asm Twiddler
Hello all.

The current implementation produces non-optimal code for large shifts
that aren't a multiple of eight when operating on long integers (4
bytes).
All such shifts are broken down into a slow loop shift.
For example, a logical shift right by 17 will result in a loop that
takes around 7 cycles per iteration resulting in ~119 cycles.
This takes at best 7 instruction words.

A more efficient implementation could be:
mov %B0,%D1
mov %A0,%C1
clr %C0
clr %D0
lsr %C0
ror %D0
This gives six cycles and six instruction words, but which can both be
reduced to five if movw exists.

There are several other locations where a more efficient
implementation may be done.

I'm just wondering why this functionality doesn't exist already.
It seems like this would probably be fairly easy to implement,
although a bit time consuming.
I would also guess lack of interest or lack of use of long integers.

Lack of this functionality wouldn't be a problem as one could simply
split the shift.
Sadly my attempts to split the shift result in it being recombined.

unsigned long temp = val >> 16;
return temp >> 1;

gives the same assembly as

return val >> 17;


Thanks for any info.