Access macros (was Re: Status)
eric at brouhaha.com
Tue Jun 12 10:43:57 PDT 2007
> You'd just have to be aware of endianess-issues with bit fields, as you
> most probably know.
No, because the code was carefully written to not depend on endianness.
See decode_inst(). This only has to be done when the microcode is loaded,
or the WCS is written in wrtram(), and various other bit manipulations
have to be done at those times anyhow.
> The "better" choice is to use macros to access shifted and masked values,
> which is what GNU generates for x86, too, just that for bit fields it
> isn't endianess independent, while for shifted values in macros it is.
The macros are nice, but I'm not convinced that it is better in the
specific case of the microinstruction word.
Aside from endianness, which has already been addressed, why do you
think using macros is better?
The change I would be most inclined to make would be to change
current_uinst from being a pointer to being the microinstrucion
itself. After that, I'd want to benchmark use of the global vs.
passing the microinstruction around as a parameter rather than
accessing the global.
In the case of IR decode, I think your macros are useful.
At this point I'm more concerned with correctness than minor
optimizations, so your findings on the shifter, video, etc. are
very much appreciated.
More information about the Altogether-devel