Open clbr opened 4 years ago
These directives do not automatically align. They should probably emit a warning if they are used outside of the required alignment, as opcodes do.
Unaligned data values may very well occur in actual MIPS programs, the architecture even has dedicated instructions for handling unaligned loads and stores (lwl
, lwr
, swl
, swr
), therefore I'm not sure a warning makes sense for the standard data directives (having a new set of aligned data directives may be a good idea however).
The program has to be explicitly coded to expect unaligned values, and those instructions may not exist on some implementations (e.g. rsp does not have them).
I'll just add that if a warning is added for unaligned data values, it would be great to have a way to turn that on/off for when you do want to use unaligned data (which, depending on the game, can be quite often) without spamming the log with warnings.
Whether the larger-than-byte data entries are aligned or not is not mentioned in the docs at all.
It appears they are unaligned. If this is intentional, can we get new default macros that are aligned? So that it's not possible to accidentally create an unaligned variable.