[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Tinycc-devel] Speed?
From: |
Philippe Ribet |
Subject: |
Re: [Tinycc-devel] Speed? |
Date: |
Fri, 21 Nov 2003 16:26:17 +0100 |
"Thomas Harning Jr." wrote:
> 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.
Oh? Fine!
Just compare -1 >> 8 and -1 / 256. According to your 'qualification', I'm
sure you'll quickly understand the problem.
> 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]
Well I guess you made this mistake just because you are just too tired today
;-)
--
Philippe Ribet
The README file said
"Requires Windows 95, NT 4.0, or better."
So... I installed it on Linux!