A scheme for microcoded arrays based on CMLARRAY. Comments invited. The hope is that we can convert most of the system to use this at some point. This is a melding of two messages and some current ideas. If there are inconsistencies in the text please let me know. Edited: 25 March 1986 by pedersen.pa. Edited: 26 March 1986 by pedersen.pa. ---- Any array consists of a "rank vector" pointer, and a storage base pointer. Array: -- 32 bits -- rankvector storagebase ... There may be additional information after the base but it is only of interest to lisp array code. This other information would be used to set up The rankvector is a variable length data structure which presents a view of the array's storage. It contains a elementtype descripter, the rank of the array, and then triples, one for each dimension of the array, describing the extent of each dimension. Rank vector: word (16 bits) containing element-descriptor word containing the rank (# of indices or dimensions) (From here on entries are double words or 32 bits) first index offset first index max (or fill pointer) first index block width (size of storage in this dimension) second index offset ... [Only 1 dimensional arrays can have "real" fill pointers.] The element-descriptor field contains an 8 bit wide field in the low byte. The lower 4 bits indicate element-size, the upper 4 indicate element-kind: sign, unsigned, float or pointer. Currently allocated tags are: element-size field (4 bits): 0 bit 1 2 bit 2 4 bit 3 8 bit 4 16 bit 5 24 bit 6 32 bit 7 64 bit element-kind field (4 bits): 0 unsigned 1 signed 2 pointer 3 float 4 character Not all combinations are valid, most are not microcoded. The compiler will open up two array access cases into calls to microcode: arrays of rank 1 and rank 2. These will be converted into a call to the ARRAYINDEX1 or ARRAYINDEX2 opcode, followed by a call to ARRAYREF or ARRAYSETF: (AREF FOO 1 2) becomes: push FOO push x push y ARRAYINDEX2 ; leaves offset on stack in element units ARRAYREF Similarly for ARRAYINDEX1. ARRAYINDEX2 computes the (unboxed!) quantity x+xoffset + xwidth*(y+yoffset), checking if x was greater than x limit or y greater than y limit. (and that x+xoffset >= 0 and y+yoffset >= 0). It leaves FOO at stack -1 and the (unboxed) base offset at top of stack. ARRAYINDEX1 would compute the similar value x+xoffset, after checking if x