[PATCH] gas: pru: Add TSEN and MVI instructions
Jan Beulich
jbeulich@suse.com
Fri Mar 6 13:20:41 GMT 2026
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:
> --- 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.
Seeing that your original contribution of the port was committed by Alan,
I assume this change will again want committing on your behalf?
Jan
More information about the Binutils
mailing list