IsUnsigned() function?

Henry Spencer henry at zoo.toronto.edu
Wed Aug 1 04:22:52 AEST 1990


In article <17181 at haddock.ima.isc.com> karl at kelp.ima.isc.com (Karl Heuer) writes:
>>Side note: can anyone out there give a good explanation as to why
>>chars were *ever* signed in the first place,
>
>The pdp11's byte-to-word instruction did sign extension, so it was cheaper to
>have chars be signed...

I've heard Dennis express some doubts about this decision in retrospect,
but it was a sensible thing to do at the time.  The cost penalty for
doing unsigned chars on the 11 is fairly high unless you do enough
optimization to discover that the expression in question ignores the
high bits anyway (e.g. by assigning the value to another char variable).
-- 
The 486 is to a modern CPU as a Jules  | Henry Spencer at U of Toronto Zoology
Verne reprint is to a modern SF novel. |  henry at zoo.toronto.edu   utzoo!henry



More information about the Comp.lang.c mailing list