tinycc-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Tinycc-devel] Speed?


From: Thomas Harning Jr.
Subject: Re: [Tinycc-devel] Speed?
Date: Fri, 21 Nov 2003 08:41:12 -0500

At 03:08 AM 11/21/2003, you wrote:

But c is declared as "int", not as "unsigned int". This will not give
the same result if c is neg.
Yeah it will, it should output a right arithmetic shift on signed ints and doing that preserves sign by extending the highest order bit. Did quite a bit of assembly and floating point/integer math by direct gate-based hardware design, c, SPARC assembly, so I'm quite sure on that. Heh, with studying the SPARC and comparing to intel... sure has LOTS more registers to use and a very nice variable passing scheme as opposed to stack based. Cant wait til the nex gen Intel comes out to be a good consumer CPU..... though that'd mean that this project could probably use an overhaul, since generating I386 code would be suboptimal.

For >>= and signed integers, a right arithmetic shift should come out. [highest order bit extended into "empty" spots] For >>= and unsigned ints, a right logical shift should come out. [zeroes extended into "empty" spots] For <<= and any.. a left logical shift should come out [there is no such left arithmetic shift]. [zeroes extended into "empty" spots]




reply via email to

[Prev in Thread] Current Thread [Next in Thread]