Add support for absolute value macro expansion
LGTM with a couple changes
|3537 ↗||(On Diff #45276)|
This should be a nop when both registers are the same. Assembling
a: abs $2, $3 b: abs $2, $2 c:
00000000 <a>: 0: 04610002 bgez v1,c <b> 4: 00601021 move v0,v1 8: 00031022 neg v0,v1 0000000c <b>: c: 04410002 bgez v0,18 <c> 10: 00000000 nop 14: 00021022 neg v0,v0 00000018 <c>: ...
|3539 ↗||(On Diff #45276)|
This nop should be deleted. Assuming you tested this the same way I did (by assembling then disassembling) then the nop you saw was padding to round off the section size.
|1811–1812 ↗||(On Diff #45276)|
Just a spelling nit: Could you make it obvious that it's a macro in the name? I'm thinking ABSMacro or ABSPseudo.
We ought to tidy up the existing names at some point but that's for another patch.
|5–9 ↗||(On Diff #45276)|
Could you test 'abs $4, $4' too?