This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Optimizations on long long multiply/divide on PowerPC32 don't work


On Sun, Dec 09, 2001 at 10:58:14PM -0800, Linus Torvalds wrote:
> I'm sorry you feel that way, but what the gcc team has done to libgcc
> has only made me _more_ convinced that not linking against that
> steenking heap of *** is a really good idea.. 

Ok, I'll bite -- what have we done to libgcc?

> The fact that gcc cannot do a 64-bit divide by a constant is a gcc
> deficiency.  But it is NOT cause for including crap in the kernel. 

Hogwash.  Look at the example again.  Signed division is not merely
a shift.  It's more like

	long long t1(long long v)
	{
	  return (v + ((v < 0) ? 0x1ffLL : 0LL)) >> 9;
	}

GCC knows how to do this.  It will do this if the target supports
all of these operations on 64 bit data types and it considers them
to be cheap enough.


r~


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]