[TUHS] v7 K&R C

Warner Losh imp at bsdimp.com
Sun May 17 06:37:15 AEST 2020

On Sat, May 16, 2020 at 2:35 PM Brad Spencer <brad at anduin.eldar.org> wrote:

> Paul Winalski <paul.winalski at gmail.com> writes:
> > On 5/15/20, Warner Losh <imp at bsdimp.com> wrote:
> >>
> >> arm has been the biggest outlier in terms of unsigned char. In FreeBSD,
> >> this has been the second largest source of bugs with the platform... the
> >> OABI weird alignment requirements being the first (thankfully behind
> us)...
> >
> > Why did the implementers of the Unix ABI for ARM decide to have char
> > be unsigned?  Was there an architectural reason for it?
> >
> > -Paul W.
> My understanding is that it is a lot more efficient to use unsigned char
> on arm.  You can make gcc, for example, deal with this, but it costs.  I
> remember having to tell gcc to deal with it when I ported the Doom
> engine to a StrongARM processor device under NetBSD many years ago.  I
> mostly remember the code running well enough, but it was larger.

I've seen numbers that suggest it's about 10% smaller to use unsigned
characters, and the code runs 5-10% faster. I've not looked at the
generated code to understand why, exactly, that might be the case.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://minnie.tuhs.org/pipermail/tuhs/attachments/20200516/f7feb9fd/attachment.htm>

More information about the TUHS mailing list