[PATCH] gas: pru: Add TSEN and MVI instructions
Dimitar Dimitrov
dimitar@dinux.eu
Fri Mar 6 18:09:12 GMT 2026
On Fri, Mar 06, 2026 at 02:20:41PM +0100, Jan Beulich wrote:
> On 22.02.2026 20:23, Dimitar Dimitrov wrote:
> > Add support for TSEN and MVI instructions to GAS and libopcodes.
> > TSEN is available in newer PRU core revisions, and can be used to
> > implement multitasking. MVI allows indirectly addressing CPU registers
> > using a pointer in R1 register.
>
> There don't look to be any provisions to limit insn availability based on
> a targeted core revision. This isn't quite nice, but probably shouldn't
> get in the way of getting this in. Seeing there is no maintainer for this
> target - okay, with one nit addressed:
I agree. I'll try to follow with a change to introduce a core revision
flag.
I volunteer to maintain the pru port, if that helps.
>
> > --- a/opcodes/pru-dis.c
> > +++ b/opcodes/pru-dis.c
> > @@ -66,15 +66,34 @@ pru_find_opcode (unsigned long opcode)
> > #define NUMREGNAMES (32 * 8)
> >
> > static void
> > -pru_print_insn_arg_reg (unsigned int r, unsigned int sel,
> > - disassemble_info *info)
> > +pru_print_insn_arg_indreg (unsigned int r, unsigned int sel,
> > + unsigned int mode,
> > + disassemble_info *info)
> > {
> > + const char *fmtstr;
> > unsigned int i = r * RSEL_NUM_ITEMS + sel;
> > assert (i < (unsigned int)pru_num_regs);
> > assert (i < NUMREGNAMES);
> > - (*info->fprintf_func) (info->stream, "%s", pru_regs[i].name);
> > +
> > + switch (mode)
> > + {
> > + case MVI_OP_MODE_DIRECT: fmtstr = "%s"; break;
> > + case MVI_OP_MODE_INDIRECT: fmtstr = "*%s"; break;
> > + case MVI_OP_MODE_INDIRECT_POSTINC: fmtstr = "*%s++"; break;
> > + case MVI_OP_MODE_INDIRECT_PREDEC: fmtstr = "*--%s"; break;
> > + default: fmtstr = "<invalid>%s"; break;
> > + }
> > + (*info->fprintf_func) (info->stream, fmtstr, pru_regs[i].name);
> > +}
> > +
> > +static void
> > +pru_print_insn_arg_reg (unsigned int r, unsigned int sel,
> > + disassemble_info *info)
> > +{
> > + pru_print_insn_arg_indreg (r, sel, MVI_OP_MODE_DIRECT, info);
> > }
> >
> > +
> > /* The function pru_print_insn_arg uses the character pointed
>
> Please don't introduce double blank lines.
Sorry. I fixed it.
>
> Seeing that your original contribution of the port was committed by Alan,
> I assume this change will again want committing on your behalf?
I have write access, so with your approval I pushed this as
bd2f485e24365d6a5717efeeb3c6d4edb5231796.
Thank you,
Dimitar
>
> Jan
More information about the Binutils
mailing list