This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: How Can I add a 8bits offset for MIPS?
Liu <proljc@gmail.com> writes:
> hi all
> MIPS have only 16bits offset, I need a 8bits offset now. How can I make it?
> I know very few about bfd, please tell me more details, thanks.
Support for Loongson 3A was recently added to binutils and some of
its instructions also need non-16-bit-offsets. See:
#define OP_SH_OFFSET_A 6
#define OP_MASK_OFFSET_A 0xff
#define OP_SH_OFFSET_B 3
#define OP_MASK_OFFSET_B 0xff
#define OP_SH_OFFSET_C 6
#define OP_MASK_OFFSET_C 0x1ff
in include/opcode/mips.h, and the way they're handled in the rest
of the codebase. OFFSET_A is an 8-bit offset in bits 6-13,
OFFSET_B is an 8-bit offset in bits 3-10. The associated mips-opc.c
operand strings are "+a" and "+b".
If your offsets are in the same bit positions as either A or B,
then you could use them directly. If not, you could add an
OFFSET_D (and "+d") along the same lines.
Richard