Implement microMIPS 16-bit LWSP and SWSP instructions.
Details
Diff Detail
Event Timeline
test/MC/Mips/micromips-16-bit-instructions.s | ||
---|---|---|
74 | This is another case where there is a difference between microMIPS reference documentation and gas. gas doesn't support lwsp and swsp mnemonics. gas emits these two encodings (0x4868 and 0xc89f ) when assembling following two instructions lw $3, 32($sp) I suggest that you (at least for now) print these instructions using the mnemonics that gas supports, and add a comment in the patch that this problem exists. |
Implemented assembler pseudo instructions LW/SW: If offset fits into 7 bits and base register is SP then create LWSP/SWSP encoding instead of LW/SW.
This patch doesn't correctly handle the case when (offset % 4) != 0. For example, for the following instruction
lw v1,123(sp)
instead of emitting 32-bit "lw v1,123(sp)" the patch emits 16-bit "lw v1,120(sp)"
Please include this instruction in the tests.
This is another case where there is a difference between microMIPS reference documentation and gas. gas doesn't support lwsp and swsp mnemonics. gas emits these two encodings (0x4868 and 0xc89f ) when assembling following two instructions
lw $3, 32($sp)
sw $4, 124($sp)
I suggest that you (at least for now) print these instructions using the mnemonics that gas supports, and add a comment in the patch that this problem exists.