Re: [patch] signed char fix for awe driver

From: David Huggins-Daines (dhd@linuxcare.com)
Date: Sun Jun 11 2000 - 20:09:42 EST


Russell King <rmk@arm.linux.org.uk> writes:

> Matti Aarnio writes:
> > On Sun, Jun 11, 2000 at 04:30:42PM +0100, Philip Blundell wrote:
> > > - char fixkey, fixvel; /* fixed key, velocity */
> > > + signed char fixkey, fixvel; /* fixed key, velocity */
> >
> > Philip, just curious, which CPU has its 'char' type
> > defaulted to unsigned ?

ARM, of course.

> Many ARM processors are more efficient with unsigned chars (it saves
> two instructions per load of a signed char to promote the char to a
> 32-bit quantity required for signed arithmetic).

Ditto for Alpha; on EV5, which is what generic kernels compile for,
load of signed char (presuming -O is in effect, of course) takes 3
instructions vs. 2 for unsigned. Also two of these are shifts, which
can only be executed by one of the two execution units on EV5.

That, and signed chars and shorts can occasionally trigger compiler
bugs on Alpha :P

-- 
dhd@linuxcare.com, http://www.linuxcare.com/
Linuxcare. Support for the revolution.

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Thu Jun 15 2000 - 21:00:24 EST