Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84; site calgary.UUCP Path: utzoo!watmath!clyde!bonnie!akgua!whuxlm!whuxl!houxm!ihnp4!alberta!calgary!radford From: radford@calgary.UUCP (Radford Neal) Newsgroups: net.arch Subject: Re: Strange architecture proposal Message-ID: <978@calgary.UUCP> Date: Fri, 15-Feb-85 17:31:08 EST Article-I.D.: calgary.978 Posted: Fri Feb 15 17:31:08 1985 Date-Received: Mon, 18-Feb-85 05:27:46 EST References: <968@calgary.UUCP> <1256@watcgl.UUCP> Organization: University of Calgary, Calgary, Alberta Lines: 42 > I think the idea of having addresses encode the data type is ultimately > unworkable, for the following reasons: > > 1) How do you handle different data types of the same size? For example, > the VAX "long" and "float" data types are the same size, but have > different move instructions... > > 2) The addressing scheme assumes that every object is a power of 2 bytes > in size. What do you do about structures? If their size is rounded > up to the next power of 2, you may waste almost half of your memory. > If their size is not rounded, then you need to come up with some way > to represent a pointer to an odd-sized object... > > 3) All objects must be aligned on a "natural" boundary. ... I don't think > anyone will tolerate the requirement that a 4Mb table be aligned on a > 4Mb boundary... These are certainly problems of a sort, but I don't think they render the scheme unworkable. With regard to (1): The scheme I propose manages to encode the "type" using only one bit. The cost of this is that actually only the length of the datum, not things like int vs. float are encoded in the pointer, so you don't get a full "object-oriented" architecture. Instead, you would still need an "integer-add" and a "floating-point-add" instruction. Whether you still need an "integer-move" and a "floating-point-move" is open to debate (I don't like traps on moves myself), but that's another subject. If you want you can devote eight bits (or some such) to type information in a pointer and get rid of all type specificity in operation codes, but it costs more than one bit of course. As for (2): Although I wouldn't totally rule out rounding structure sizes to a power of two, I'm not really advocating that radical a solution. You can copy structures with a loop like lots of machines do. I'd probably limit the extent of the scheme to whatever the largest data type of the machine is (8 byte quad integers or whatever). This way you also don't have to align your 4MB table... Radford Neal The University of Calgary