This is the mail archive of the fortran@gcc.gnu.org mailing list for the GNU Fortran project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: revap types, step 1


Ron Young wrote:
> If a given machine is not byte addressable ,then
> logical*1,logical*4,integer*1,integer*2 and maybe integer*4 don't make
> since.

For integers this is not true at all: integer*1 is an integer with a range
[-128,127], no matter how many bytes you need to store them (IOW no matter how
memory accesses have to be aligned). This is functionality different from the
one integer*4 offers you.

Also, these datatypes might come in handy when using packed structure, i.e.
TYPE a
 INTEGER*1 :: a
 LOGICAL*1 :: b
 INTEGER*2 :: c
END TYPE a
could be made to occupy 4 bytes of storage instead of 16, if wished. Access to
structure components would then of course have to happen in chunks of the
right alignment, but this wouldn't have to be great loss.

- Tobi


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]