Re: Supporting byte-addressability on word-addressed hardware

"steve (s.s.) simmons" <simmons@bnr.ca>
Wed, 28 Jun 1995 13:19:51 GMT

          From comp.compilers

Related articles
Supporting byte-addressability on word-addressed hardware lehotsky@tiac.net (1995-06-27)
Re: Supporting byte-addressability on word-addressed hardware simmons@bnr.ca (steve (s.s.) simmons) (1995-06-28)
Re: Supporting byte-addressability on word-addressed hardware markt@harlequin.co.uk (1995-07-04)
Re: Supporting byte-addressability on word-addressed hardware pardo@cs.washington.edu (1995-07-05)
Re: Supporting byte-addressability on word-addressed hardware bob@tera.com (1995-07-06)
Re: Supporting byte-addressability on word-addressed hardware mfx@cs.tu-berlin.de (1995-07-06)
Re: Supporting byte-addressability on word-addressed hardware tl@ae.chalmers.se (1995-07-12)
Re: Supporting byte-addressability on word-addressed hardware pardo@cs.washington.edu (1995-07-19)
[1 later articles]
| List of all articles for this month |

Newsgroups: gnu.gcc.help,comp.compilers
From: "steve (s.s.) simmons" <simmons@bnr.ca>
Keywords: GCC, architecture
Organization: Bell-Northern Research Ltd.
References: 95-06-081
Date: Wed, 28 Jun 1995 13:19:51 GMT



IMHO, all data structures should be word aligned on a word addressable machine.
The original hardware architects didn't envision the machine users
as caring about compact memory layouts, so your compiler should follow the
spirit of the original designers and not sacrifice runtime for
memory. This is just my opinion, and you have real problem to solve
with a real question.


I have a couple of questions, first where are you going to store this
2 bit offset. Is it embeded in the pointer itself and you are
limiting the machine to being 30 bit addressable or are you storing
it as part of the original data in memory??? Whatever you do, treat
all pointers as equals regardless of what they point to... It should
only make a difference when you derefence them.


That is, all pointers should be laid out in memory equivalently.


Here is yet another gotcha??


                char cp[10]; int *ip = (int*) (cp+1);


                cp[0] = cp[1] = cp[2] = cp[3] = 0;
                cp[4] = 2;




What does *ip equal???


              0 - if you force word alignment.
              2 - if you assume little endian (or is it bigger endian??)
              0x020000000 - if you assume the other endian???


This is mostly like undefined behavior by the C standard since
requires understanding endianess.


IMHO, I would probably make all pointers 64 bits (really 34 bits). It is
ironic to embed the 2 bits inside the 32 word and lose all that addressable
so that you can have compact array structures.




Thank you.


Steve Simmons
--


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.