[MIPS/GAS] Add Loongson EXT2 Instructions support.

bfd/
	* elfxx-mips.c (print_mips_ases): Add Loongson EXT2 extension.

binutils/
	* readelf.c (print_mips_ases): Add Loongson EXT2 extension.

gas/
	* NEWS: Mention Loongson EXTensions R2 (EXT2) support.
	* config/tc-mips.c (options): Add OPTION_LOONGSON_EXT2 and
	OPTION_NO_LOONGSON_EXT2.
	(md_longopts): Likewise.
	(mips_ases): Define availability for EXT.
	(mips_convert_ase_flags): Map ASE_LOONGSON_EXT2 to
	AFL_ASE_LOONGSON_EXT2.
	(md_show_usage): Add help for -mloongson-ext2 and
	-mno-loongson-ext2.
	* doc/as.texi: Document -mloongson-ext2, -mno-loongson-ext2.
	* doc/c-mips.texi: Document -mloongson-ext2, -mno-loongson-ext2,
	.set loongson-ext2 and .set noloongson-ext2.
	* testsuite/gas/mips/loongson-ext2.d: New test.
	* testsuite/gas/mips/loongson-ext2.s: New test.
	* testsuite/gas/mips/mips.exp: Run loongson-ext2 test.

include/
	* elf/mips.h (AFL_ASE_LOONGSON_EXT2): New macro.
	(AFL_ASE_MASK): Update to include AFL_ASE_LOONGSON_EXT2.
	* opcode/mips.h (ASE_LOONGSON_EXT2): New macro.

opcodes/
	* mips-dis.c (parse_mips_ase_option): Handle -M loongson-ext
	option.
	(print_mips_disassembler_options): Document -M loongson-ext.
	* mips-opc.c (LEXT2): New macro.
	(mips_opcodes): Add cto, ctz, dcto, dctz instructions.
This commit is contained in:
Chenghua Xu 2018-08-29 20:08:58 +08:00
parent bdc6c06e3b
commit a693765e23
18 changed files with 144 additions and 2 deletions

View file

@ -267,6 +267,13 @@ Application Specific Extension. This tells the assembler to accept EXT
instructions.
@samp{-mno-loongson-ext} turns off this option.
@item -mloongson-ext2
@itemx -mno-loongson-ext2
Generate code for the Loongson EXTensions R2 (EXT2) instructions
Application Specific Extension. This tells the assembler to accept EXT2
instructions.
@samp{-mno-loongson-ext2} turns off this option.
@item -minsn32
@itemx -mno-insn32
Only use 32-bit instruction encodings when generating code for the
@ -1182,6 +1189,15 @@ instructions from the Loongson EXT from that point on in the assembly.
The @code{.set noloongson-ext} directive prevents Loongson EXT instructions
from being accepted.
@cindex Loongson EXTensions R2 (EXT2) instructions generation override
@kindex @code{.set loongson-ext2}
@kindex @code{.set noloongson-ext2}
The directive @code{.set loongson-ext2} makes the assembler accept
instructions from the Loongson EXT2 from that point on in the assembly.
This directive implies @code{.set loognson-ext}.
The @code{.set noloongson-ext2} directive prevents Loongson EXT2 instructions
from being accepted.
Traditional MIPS assemblers do not support these directives.
@node MIPS Floating-Point