🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: net.lang.c
Article #9437

Re: Significant deficiency in C

#9437
From: Andrew Koenig
Date: Tue, 30 Sep 1986 12:46
18 lines
1572 bytes
> Inspecting critical loops in the generated code, I was shocked to find that the
> compiler was doing what it could to make things fast, but it was hindered by
> the requirement that char types be promoted to int before being used in an
> expression.  The 8088 CPU has 16-bit registers that are made up of pairs of
> 8-bit registers and each 8-bit register can be separately used for 8-bit
> operations, making character-oriented code extremely efficient.  But the
> compiler was forced to treat such code as int-oriented code (ints being 16 bits
> in this implementation).  Hand-crafted assembly code, where the programmer
> knows whether or not 16 bits will be ultimately needed, isn't similarly
> restricted. 

One would think that for many char operations it is possible for
the compiler to figure out that doing it in 8 bits and expanding to
16 at the end only if necessary will give the same result as expanding
to 16 bits immediately.

Can you give us some examples of code that you think would be
impossible to get right without changing the rules?
Technical Details
Message-ID: <6129@alice.uUCp>
Path: arc1-ca.pugleaf.net!utzoo!watmath!clyde!burl!ulysses!bellcore!petrus!scherzo!allegra!alice!ark
References: <4200@brl-smoke.ARPA>

Show Full Headers
Complete Article Headers
Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Path: arc1-ca.pugleaf.net!utzoo!watmath!clyde!burl!ulysses!bellcore!petrus!scherzo!allegra!alice!ark
From: ark@alice.UucP (Andrew Koenig)
Newsgroups: net.lang.c
Subject: Re: Significant deficiency in C
Message-ID: <6129@alice.uUCp>
Date: Tue, 30-Sep-86 08:46:44 EDT
Article-I.D.: alice.6129
Posted: Tue Sep 30 08:46:44 1986
Date-Received: Wed, 1-Oct-86 05:27:02 EDT
References: <4200@brl-smoke.ARPA>
Organization: Bell Labs, Murray Hill
Lines: 18