[PATCH/MIPS] Split Loongson MultiMedia extensions Instructions (MMI) from loongson2f/3a

Paul Hua paul.hua.gm@gmail.com
Sat Jul 14 13:07:00 GMT 2018


Hi Maciej:

This is the v3 patch, it's move more instructions to mmi.
ChangeLog entries are same as v2.

> 1 out of 1 hunk FAILED -- saving rejects to file gas/testsuite/gas/mips/loongson-3a.d.rej
> 1 out of 1 hunk FAILED -- saving rejects to file gas/testsuite/gas/mips/loongson-3a.s.rej

$ file gas/testsuite/gas/mips/loongson-3a.d
gas/testsuite/gas/mips/loongson-3a.d: ASCII text, with CRLF line terminators
$ file gas/testsuite/gas/mips/loongson-3a.s
gas/testsuite/gas/mips/loongson-3a.s: assembler source, ASCII text,
with CRLF line terminators

Maybe this is the why the patch not applyed.

Thanks.

Paul Hua

Paul Hua
On Sat, Jul 14, 2018 at 12:03 PM Paul Hua <paul.hua.gm@gmail.com> wrote:
>
> Hi Maciej:
>
> Thanks for your kind comments.
>
> > 1 out of 1 hunk FAILED -- saving rejects to file gas/testsuite/gas/mips/loongson-3a.d.rej
> > 1 out of 1 hunk FAILED -- saving rejects to file gas/testsuite/gas/mips/loongson-3a.s.rej
>
> The patch just from git format-patch command,
>
> >  Also I don't see any earlier changes from you in binutils and this change
> > is substantial enough to require a copyright arrangement with FSF before
> > it can be accepted.  Do you have one in place?
>
> I have been signed binutils copyright assignment with FSF, but no
> write access yet.
>
> > > This patch split Loongson MultiMedia extensions Instructions (MMI)
> > > from loongson2f/3a.
> > > The MMI instructions set has been implemented in many loongson
> > > processors. I'd like to split it
> > > from loongson2f/3a and give it a name MMI. Even though i know that the
> > > R5900 used the name MMI
> > > in mips-opc.c, I also prefer the name MMI for those instructions.
> > > There are a lot of software has optimized
> > > with MMI,like pixman[1], FFmpeg[2].
> > >
> > > [1]https://cgit.freedesktop.org/pixman/commit/?id=c78e986085
> > > [2]http://ffmpeg.org/pipermail/ffmpeg-cvslog/2015-July/091449.html
> >
> >  Do you intend this text to become the commit description in the
> > repository?  If so, then please reformat it as a proper paragraph,
> > observing the 74-column limit and placing two spaces after full stops.
>
> No, that just explain why use mmi.
>
>
> >  2018-07-13 please (or whatever date that will be).  Also please use
> > a leading tab with ChangeLog entries, to ensure consistent formatting
> > between the change description and actual ChangeLog file contents.
>
> Done.
>
> > >     (mips_cpu_info_table):Add ASE_MMI for loongs2f/3a
>
> Done.
>
> >  Missing space after `:' and a full stop at the end; also `loongson2f/3a'
> > I suppose.
>
> Done.
>
> > >     * testsuite/gas/mips/loongso2f.d: Move mmi test to ...
> > >     * testsuite/gas/mips/loongso2f-mmi.d: Here.
> > >     * testsuite/gas/mips/loongso2f.s: Move mmi test to ...
> > >     * testsuite/gas/mips/loongso2f-mmi.s: Here.
> > >     * testsuite/gas/mips/loongso3a.d: Move mmi test to ...
> > >     * testsuite/gas/mips/loongso3a-mmi.d: Here.
> > >     * testsuite/gas/mips/loongso3a.s: Move mmi test to ...
> > >     * testsuite/gas/mips/loongso3a-mmi.s: Here.
> > >     * testsuite/gas/mips/mips.exp: involved
> > >      loongso2f-mmi and loongso3a-mmi test.
> >
> >  Typos: s/loongso/loongson-/g.  Also bad style and formatting in the last
> > line, perhaps:
> >
> >         * testsuite/gas/mips/mips.exp: Run loongson-2f-mmi and
> >         loongson-3a-mmi tests.
>
> Done.
>
> >
> > > include/
> > >     * elf/mips.h (AFL_ASE_MMI): New macros.
> >
> >  "New macro."
> >
> > >     * mips-opc.c(LMMI): New macro.
> >
> >  Missing space before the opening parenthesis.
> >
> > >     (mips_opcodes): Split mmi for loongson2f/3a.
> >
> >  Maybe:
> >
> >         (mips_opcodes): Replace IL2F|IL3A marking with LMMI for MMI
> >         instructions.
>
> Done.
>
> > > diff --git a/gas/doc/as.texi b/gas/doc/as.texi
> > > index 49b1ef1..b2afcd1 100644
> > > --- a/gas/doc/as.texi
> > > +++ b/gas/doc/as.texi
> > > @@ -1526,6 +1527,13 @@ Generate code for the Global INValidate (GINV) Application Specific
> > >  Extension.  This tells the assembler to accept GINV instructions.
> > >  @samp{-mno-ginv} turns off this option.
> > >
> > > +@item -mmmi
> > > +@itemx -mno-mmi
> > > +Generate code for the Loongson MultiMedia extensions Instructions (MMI)
> > > +Application Specific Extension. This tells the assembler to accept MMI
> >
> >  Two spaces after a full stop please.
>
> Done.
>
> > > diff --git a/gas/doc/c-mips.texi b/gas/doc/c-mips.texi
> > > index 24f6843..f01024a 100644
> > > --- a/gas/doc/c-mips.texi
> > > +++ b/gas/doc/c-mips.texi
> > > @@ -246,6 +246,13 @@ Generate code for the Global INValidate (GINV) Application Specific
> > >  Extension.  This tells the assembler to accept GINV instructions.
> > >  @samp{-mno-ginv} turns off this option.
> > >
> > > +@item -mmmi
> > > +@itemx -mno-mmi
> > > +Generate code for the Loongson MultiMedia extensions Instructions (MMI)
> > > +Application Specific Extension. This tells the assembler to accept MMI
> >
> >  Likewise.
>
> Done.
>
> > > +
> > > +
> >
> >  Trailing empty lines.
> >
> All done.
>
> > > diff --git a/include/opcode/mips.h b/include/opcode/mips.h
> > > index 1ab1780..1d0998c 100644
> > > --- a/include/opcode/mips.h
> > > +++ b/include/opcode/mips.h
> > > @@ -1302,6 +1302,8 @@ static const unsigned int mips_isa_table[] = {
> > >  #define ASE_CRC64            0x00080000
> > >  /* Global INValidate Extension.  */
> > >  #define ASE_GINV             0x00100000
> > > +/* Loongson MultiMedia extensions Instructions (MMI). */
> >
> >  Two spaces after a full stop please.
>
> Done.
>
> > > +#define ASE_MMI              0x00200000
> > >
> > >  /* MIPS ISA defines, use instead of hardcoding ISA level.  */
> > >
> > > diff --git a/opcodes/mips-dis.c b/opcodes/mips-dis.c
> > > index bbf2132..b9fd9e5 100644
> > > --- a/opcodes/mips-dis.c
> > > +++ b/opcodes/mips-dis.c
> > > @@ -626,11 +626,11 @@ const struct mips_arch_choice mips_arch_choices[] =
> > >      NULL, 0, mips_cp1_names_numeric, mips_hwr_names_numeric },
> > >
> > >    { "loongson2f",   1, bfd_mach_mips_loongson_2f, CPU_LOONGSON_2F,
> > > -    ISA_MIPS3 | INSN_LOONGSON_2F, 0, mips_cp0_names_numeric,
> > > +    ISA_MIPS3 | ASE_MMI, 0, mips_cp0_names_numeric,
> > >      NULL, 0, mips_cp1_names_numeric, mips_hwr_names_numeric },
> > >
> > >    { "loongson3a",   1, bfd_mach_mips_loongson_3a, CPU_LOONGSON_3A,
> > > -    ISA_MIPS64R2 | INSN_LOONGSON_3A, 0, mips_cp0_names_numeric,
> > > +    ISA_MIPS64R2 | ASE_MMI, 0, mips_cp0_names_numeric,
> > >      NULL, 0, mips_cp1_names_mips3264, mips_hwr_names_numeric },
> >
> >  Why do you remove INSN_LOONGSON_2F and INSN_LOONGSON_3A flags?  AFAICT
> > the MMI instructions are not the only ones these processors have?
>
> Fixed.
>
> > > diff --git a/opcodes/mips-opc.c b/opcodes/mips-opc.c
> > > index 1cbcbc6..0dc15f9 100644
> > > --- a/opcodes/mips-opc.c
> > > +++ b/opcodes/mips-opc.c
> > > @@ -412,6 +412,9 @@ decode_mips_operand (const char *p)
> > >  /* Global INValidate (GINV) support.  */
> > >  #define GINV ASE_GINV
> > >
> > > +/* Loongson MultiMedia extensions Instructions (MMI) support. */
> >
> >  Two spaces after a full stop please.
> >
> >  Please resubmit with these issues addressed, and, as noted at the top,
> > explain your copyright status with FSF.
> >
> >   Maciej
-------------- next part --------------
2018-07-14  Chenghua Xu  <paul.hua.gm@gmail.com>

bfd/
	* elfxx-mips.c (print_mips_ases): Add MMI extension.
binutils/
	* readelf.c (print_mips_ases): Add MMI extension.
gas/
	* NEWS: Mention MultiMedia extensions Instructions (MMI) support.
	* config/tc-mips.c (options): Add OPTION_MMI and OPTION_NO_MMI.
	(md_longopts): Likewise.
	(mips_ases): Define availability for MMI.
	(mips_convert_ase_flags): Map ASE_MMI to AFL_ASE_MMI.
	(mips_cpu_info_table): Add ASE_MMI for loongson2f/3a.
	(md_show_usage): Add help for -mmmi and -mno-mmi.
	* doc/as.texi: Document -mmmi, -mno-mmi.
	* doc/c-mips.texi: Document -mmmi, -mno-mmi, .set mmi and
	.set nommi.
	* testsuite/gas/mips/loongson-2f.d: Move mmi test to ...
	* testsuite/gas/mips/loongson-2f-mmi.d: Here.
	* testsuite/gas/mips/loongson-2f.s: Move mmi test to ...
	* testsuite/gas/mips/loongson-2f-mmi.s: Here.
	* testsuite/gas/mips/loongson-3a.d: Move mmi test to ...
	* testsuite/gas/mips/loongson-3a-mmi.d: Here.
	* testsuite/gas/mips/loongson-3a.s: Move mmi test to ...
	* testsuite/gas/mips/loongson-3a-mmi.s: Here.
	* testsuite/gas/mips/mips.exp: Run loongson-2f-mmi and
	loongson-3a-mmi tests.
include/
	* elf/mips.h (AFL_ASE_MMI): New macro.
	(AFL_ASE_MASK): Update to include AFL_ASE_MMI.
	* opcode/mips.h (ASE_MMI): New macro.
opcodes/
	* mips-dis.c (mips_arch_choices): Add MMI to loongson2f and
	loongson3a descriptors.
	(parse_mips_ase_option): Handle -mmmi option.
	(print_mips_disassembler_options): Document -mmmi.
	* mips-opc.c (LMMI): New macro.
	(mips_opcodes): Replace IL2F|IL3A marking with LMMI for MMI
	instructions.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: binutils-add-loongson-mmi-support-v3.patch
Type: text/x-patch
Size: 65984 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/binutils/attachments/20180714/9bb02ddb/attachment.bin>


More information about the Binutils mailing list