diff options
author | Chenghua Xu <paul.hua.gm@gmail.com> | 2018-08-29 20:08:58 +0800 |
---|---|---|
committer | Chenghua Xu <paul.hua.gm@gmail.com> | 2018-08-29 20:08:58 +0800 |
commit | a693765e23934996abbe4e44c4ba28eabdece4f9 (patch) | |
tree | 15c5e0d72cbff340fcc1f4afd57263b5ffe96ba0 /gas/config | |
parent | bdc6c06e3b08ec48ec5ee2174dedc846969c36fd (diff) | |
download | gdb-a693765e23934996abbe4e44c4ba28eabdece4f9.zip gdb-a693765e23934996abbe4e44c4ba28eabdece4f9.tar.gz gdb-a693765e23934996abbe4e44c4ba28eabdece4f9.tar.bz2 |
[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.
Diffstat (limited to 'gas/config')
-rw-r--r-- | gas/config/tc-mips.c | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/gas/config/tc-mips.c b/gas/config/tc-mips.c index 51eee00..e60cf4e 100644 --- a/gas/config/tc-mips.c +++ b/gas/config/tc-mips.c @@ -1535,6 +1535,8 @@ enum options OPTION_NO_LOONGSON_CAM, OPTION_LOONGSON_EXT, OPTION_NO_LOONGSON_EXT, + OPTION_LOONGSON_EXT2, + OPTION_NO_LOONGSON_EXT2, OPTION_END_OF_ENUM }; @@ -1601,6 +1603,8 @@ struct option md_longopts[] = {"mno-loongson-cam", no_argument, NULL, OPTION_NO_LOONGSON_CAM}, {"mloongson-ext", no_argument, NULL, OPTION_LOONGSON_EXT}, {"mno-loongson-ext", no_argument, NULL, OPTION_NO_LOONGSON_EXT}, + {"mloongson-ext2", no_argument, NULL, OPTION_LOONGSON_EXT2}, + {"mno-loongson-ext2", no_argument, NULL, OPTION_NO_LOONGSON_EXT2}, /* Old-style architecture options. Don't add more of these. */ {"m4650", no_argument, NULL, OPTION_M4650}, @@ -1813,6 +1817,11 @@ static const struct mips_ase mips_ases[] = { OPTION_LOONGSON_EXT, OPTION_NO_LOONGSON_EXT, 0, 0, -1, -1, -1 }, + + { "loongson-ext2", ASE_LOONGSON_EXT | ASE_LOONGSON_EXT2, 0, + OPTION_LOONGSON_EXT2, OPTION_NO_LOONGSON_EXT2, + 0, 0, -1, -1, + -1 }, }; /* The set of ASEs that require -mfp64. */ @@ -1820,7 +1829,8 @@ static const struct mips_ase mips_ases[] = { /* Groups of ASE_* flags that represent different revisions of an ASE. */ static const unsigned int mips_ase_groups[] = { - ASE_DSP | ASE_DSPR2 | ASE_DSPR3 + ASE_DSP | ASE_DSPR2 | ASE_DSPR3, + ASE_LOONGSON_EXT | ASE_LOONGSON_EXT2 }; /* Pseudo-op table. @@ -19050,6 +19060,8 @@ mips_convert_ase_flags (int ase) ext_ases |= AFL_ASE_LOONGSON_CAM; if (ase & ASE_LOONGSON_EXT) ext_ases |= AFL_ASE_LOONGSON_EXT; + if (ase & ASE_LOONGSON_EXT2) + ext_ases |= AFL_ASE_LOONGSON_EXT2; return ext_ases; } @@ -20080,6 +20092,9 @@ MIPS options:\n\ -mloongson-ext generate Loongson EXTensions (EXT) instructions\n\ -mno-loongson-ext do not generate Loongson EXTensions Instructions\n")); fprintf (stream, _("\ +-mloongson-ext2 generate Loongson EXTensions R2 (EXT2) instructions\n\ +-mno-loongson-ext2 do not generate Loongson EXTensions R2 Instructions\n")); + fprintf (stream, _("\ -minsn32 only generate 32-bit microMIPS instructions\n\ -mno-insn32 generate all microMIPS instructions\n")); fprintf (stream, _("\ |