Closed clbr closed 2 years ago
I found a workaround:
lb r1, org(buf)(r0)
happens to work. However it's painful to write, so I'd still like native support.
This bug is an unfortunate effect of a syntax conflict between MIPS base/offset syntax and expression functions. You don't need the org(buf)
in the workaround, just (buf)(r0)
will do.
Seems the parser could still handle this, if increasing complexity a bit. Only in this specific position in loads/stores, if there is no function by that name, check data labels.
This is indeed an unfortunate side effect. The only way around it is to determine the type of the expression based on whether the identifier is a function or not... which is very annoying, as it makes the grammar even more context sensitive than it already is... but it wouldn't be too difficult to achieve.
Both of these loads error out. When the address of a memory area fits into the signed 16-bit offset, the assembler should allow this pattern. I'm aware the load macros circumvent this for the standard loads (lb r1, buf), but not for RSP's vector loads.
This is a recommended pattern on the RSP, because with its 4kb memory addresses always fit into the offset.