[PATCH] MIPS/opcodes: Fix floor/round exclusions for R5900

David Guillen Fandos david@davidgf.net
Sun Jan 18 08:23:02 GMT 2026


El sáb, 17 ene 2026 a las 17:16, Maciej W. Rozycki
(<macro@orcam.me.uk>) escribió:
>
> On Sat, 17 Jan 2026, David Guillen Fandos wrote:
>
> > Signed-off-by: David Guillen Fandos <david@davidgf.net>
>
>  This is missing a change description giving justification for the patch.
> E.g. if the instructions are unimplemented, but were mistakenly included
> with R5900 support, then please state so.  Also is there any backing
> documentation available?
>

Hello Maciej, Thank you very much for the review!

The instructions are indeed unsupported and left included by some oversight.
I found the original thread where some of this was discussed back in the day:
https://gcc.gnu.org/legacy-ml/gcc-patches/2013-01/msg00658.html

The official manual "EE Core Instruction Set Manual" does not include these
instructions (I also manually re-verified this fact since I wanted to see it
for myself too, but the CPU does indeed throw an exception).

Let me send a v2 PATCH with an updated description and the pinfo tab corrected.

> > diff --git a/opcodes/mips-opc.c b/opcodes/mips-opc.c
> > index 234e8bb3409..4a1e842b09c 100644
> > --- a/opcodes/mips-opc.c
> > +++ b/opcodes/mips-opc.c
> > @@ -1206,7 +1206,7 @@ const struct mips_opcode mips_builtin_opcodes[] =
> >  {"floor.l.d",                "D,S",          0x4620000b, 0xffff003f, WR_1|RD_2|FP_D,         0,              I3_33,          0,      0 },
> >  {"floor.l.s",                "D,S",          0x4600000b, 0xffff003f, WR_1|RD_2|FP_S|FP_D,    0,              I3_33,          0,      0 },
> >  {"floor.w.d",                "D,S",          0x4620000f, 0xffff003f, WR_1|RD_2|FP_S|FP_D,    0,              I2,             0,      SF },
> > -{"floor.w.s",                "D,S",          0x4600000f, 0xffff003f, WR_1|RD_2|FP_S,         0,              I2,             0,      0 },
> > +{"floor.w.s",                "D,S",          0x4600000f, 0xffff003f, WR_1|RD_2|FP_S,         0,              I2,             0,      EE },
>                                                                        ^
>  While changing this line please correct `pinfo' flags to be preceded by a
> tab rather than space, just as intended with this array and still with the
> majority of elements.
>
> > @@ -1823,7 +1823,7 @@ const struct mips_opcode mips_builtin_opcodes[] =
> >  {"round.l.d",                "D,S",          0x46200008, 0xffff003f, WR_1|RD_2|FP_D,         0,              I3_33,          0,      0 },
> >  {"round.l.s",                "D,S",          0x46000008, 0xffff003f, WR_1|RD_2|FP_S|FP_D,    0,              I3_33,          0,      0 },
> >  {"round.w.d",                "D,S",          0x4620000c, 0xffff003f, WR_1|RD_2|FP_S|FP_D,    0,              I2,             0,      SF },
> > -{"round.w.s",                "D,S",          0x4600000c, 0xffff003f, WR_1|RD_2|FP_S,         0,              I2,             0,      0 },
> > +{"round.w.s",                "D,S",          0x4600000c, 0xffff003f, WR_1|RD_2|FP_S,         0,              I2,             0,      EE },
>                                                                        ^
>  Likewise here.
>
>  There've been no regressions in my testing with this change in place so
> it's otherwise OK.
>
>   Maciej


More information about the Binutils mailing list