Re: 32 or 64 bit processor info in C
- From: Flash Gordon <spam@xxxxxxxxxxxxxxxxxx>
- Date: Sat, 21 Apr 2007 23:25:20 +0100
Malcolm McLean wrote, On 21/04/07 17:45:
"Flash Gordon" <spam@xxxxxxxxxxxxxxxxxx> wrote in message news:5pmpf4xeum.ln2@xxxxxxxxxxxxxxxxxxxxxxxxxxIdeally you'd have one extra bit so that signed arithmetic couldn't fail to have enough resolution. However at least in C the convention is that indices are scaled by the data type. So the problem only arises for char arrays taking up over half the address space. That happens rarely enough for it to be reasonable to say "many functions may not work on your dataset, you will have to code specially with unsigned types".
Some of the DSPs with 24 or 48 bit integer registers and ALUs will have had 16/32 bit address busses. However, I suppose Malcolm might be happy with an int larger than the address bus by a few bits.
You entirely missed the point that on those processors in int is WIDER than the address bus. You also ignored (and snipped) my other points.
Most architectures don't distinguish between address and data integer registers,
Most that you have come across possibly, but I doubt that you have come across most architectures.
> so it makes sense to use the same registers to hold pointers
and ints.
It is not simply the width of the address register that is important, it is also the memory bandwidth. Since memory is slow using 64 bit integers when you do not need them can slow things significantly.
--
Flash Gordon
.
- Follow-Ups:
- Re: 32 or 64 bit processor info in C
- From: Malcolm McLean
- Re: 32 or 64 bit processor info in C
- References:
- 32 or 64 bit processor info in C
- From: broeisi
- Re: 32 or 64 bit processor info in C
- From: Malcolm McLean
- Re: 32 or 64 bit processor info in C
- From: Eric Sosman
- Re: 32 or 64 bit processor info in C
- From: Stephen Sprunk
- Re: 32 or 64 bit processor info in C
- From: Keith Thompson
- Re: 32 or 64 bit processor info in C
- From: Malcolm McLean
- Re: 32 or 64 bit processor info in C
- From: Eric Sosman
- Re: 32 or 64 bit processor info in C
- From: Malcolm McLean
- Re: 32 or 64 bit processor info in C
- From: Keith Thompson
- Re: 32 or 64 bit processor info in C
- From: Malcolm McLean
- Re: 32 or 64 bit processor info in C
- From: Richard Bos
- Re: 32 or 64 bit processor info in C
- From: Malcolm McLean
- Re: 32 or 64 bit processor info in C
- From: Keith Thompson
- Re: 32 or 64 bit processor info in C
- From: Malcolm McLean
- Re: 32 or 64 bit processor info in C
- From: Eric Sosman
- Re: 32 or 64 bit processor info in C
- From: Malcolm McLean
- Re: 32 or 64 bit processor info in C
- From: Eric Sosman
- Re: 32 or 64 bit processor info in C
- From: Richard Heathfield
- Re: 32 or 64 bit processor info in C
- From: Eric Sosman
- Re: 32 or 64 bit processor info in C
- From: Malcolm McLean
- Re: 32 or 64 bit processor info in C
- From: Richard Bos
- Re: 32 or 64 bit processor info in C
- From: Malcolm McLean
- Re: 32 or 64 bit processor info in C
- From: Eric Sosman
- Re: 32 or 64 bit processor info in C
- From: Malcolm McLean
- Re: 32 or 64 bit processor info in C
- From: Ian Collins
- Re: 32 or 64 bit processor info in C
- From: Flash Gordon
- Re: 32 or 64 bit processor info in C
- From: Malcolm McLean
- 32 or 64 bit processor info in C
- Prev by Date: Re: Anonymous functions in C.
- Next by Date: Sample implementation of Dijkstras algorithm
- Previous by thread: Re: 32 or 64 bit processor info in C
- Next by thread: Re: 32 or 64 bit processor info in C
- Index(es):
Relevant Pages
|