Path: utzoo!mnetor!uunet!mcvax!unido!ecrcvax!johng From: johng@ecrcvax.UUCP (John Gregor) Newsgroups: comp.arch Subject: Re: RISC data alignment Message-ID: <496@ecrcvax.UUCP> Date: 10 Feb 88 13:00:04 GMT References: <2635@calmasd.GE.COM> <28200092@ccvaxa> Reply-To: johng@ecrcvax.UUCP (John Gregor) Organization: ECRC, Munich 81, West Germany Lines: 25 In article <28200092@ccvaxa> aglew@ccvaxa.UUCP writes: > >I have often wanted an optimizing compiler that could take >struct { long a; int b; long c; char d; } >which is usually mapped into bytes as AAAABBxxCCCCDxxx >(on a machine where misaligned accesses are penalized) >and make it into AAAACCCCBBDx. > >Andy "Krazy" Glew. Gould CSD-Urbana. 1101 E. University, Urbana, IL 61801 I would like that also, but don't call it a struct. Rearranging the order breaks lots of code and violates K&R p. 196. Within a structure, the objects declared have addresses which increase as their declarations are read left-to-right. Call it a collection, or packed struct or something else. If I had a PCish type machine, I'd really like a feature like that. I'm spoiled rotten by virtual memory :-). -- pqpqpqpqpqpqpqpqpqpqpqpqpqpqpqpqpqpqpqpqpqpqpqpqpqpqpqpqpqpqpqpqpqpqpqpqpqpqpqpq bdbdbdbdbdbdbdbdbdbdbdbdbdbdbdbdbdbdbdbdbdbdbdbdbdbdbdbdbdbdbdbdbdbdbdbdbdbdbdbd John Gregor johng%ecrcvax.UUCP@germany.CSNET