Sounds basically like the right direction. I suggest using a tuple rather than a list if you intend it to be read-only, and also to consider having a class you can instantiate to represent the list members if they get complicated. I know there are other places where I've done "if it's a scalar, that means X, but if it's a list, then it's Y", but in the end I think that was a bad idea, and if the semantics aren't sort of immediately obvious then it's better to have a class with methods that can have descriptive names, and where the internal structure is hidden behind those methods.
Steve On Fri, Sep 30, 2011 at 2:07 PM, Gabriel Michael Black < [email protected]> wrote: > How about the indices are a list, and if the type is a scalar it's the > type, but if it's also a list (of the same length as the index list) then it > describes the type of each index. > > Gabe > > > Quoting Gabe Black <[email protected]>: > > There are a few use cases for composite operands, operands that are >> built up from the value of several registers. For instance, double >> precision floats built from two single precision registers, and a >> control + condition code register where the control bits and the >> condition codes are tracked separately. >> >> What should the syntax be for telling the isa_parser about these? My >> initial thought is a python list of expressions that generate each >> index. Then the read/write code would refer to a range of the source or >> dest index array using the normal register index value as the starting >> point. This doesn't handle the second case above where the two registers >> may be different types. >> >> Gabe >> ______________________________**_________________ >> gem5-dev mailing list >> [email protected] >> http://m5sim.org/mailman/**listinfo/gem5-dev<http://m5sim.org/mailman/listinfo/gem5-dev> >> >> > > ______________________________**_________________ > gem5-dev mailing list > [email protected] > http://m5sim.org/mailman/**listinfo/gem5-dev<http://m5sim.org/mailman/listinfo/gem5-dev> > _______________________________________________ gem5-dev mailing list [email protected] http://m5sim.org/mailman/listinfo/gem5-dev
