aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorYunQiang Su <yunqiang.su@cipunited.com>2021-09-03 03:32:26 -0400
committerYunQiang Su <syq@debian.org>2021-09-07 08:45:37 +0800
commit58572bbb62c9588c658fd7656ee359d27c306fb2 (patch)
tree071a3b6cd2a11239c564fee6b423a17e9a5bbf72 /gcc
parent9f99555f29cb1bce06ad7e27f254945deffafe33 (diff)
downloadgcc-58572bbb62c9588c658fd7656ee359d27c306fb2.zip
gcc-58572bbb62c9588c658fd7656ee359d27c306fb2.tar.gz
gcc-58572bbb62c9588c658fd7656ee359d27c306fb2.tar.bz2
MIPS: add .module arch and ase to all output asm
Currently, the asm output file for MIPS has no rev info. It can make some trouble, for example: assembler is mips1 by default, gcc is fpxx by default. To assemble the output of gcc -S, we have to pass -mips2 to assembler. The same situation is for some CPU has extension insn. Octeon is an example. So we can just add ".set arch=octeon". If an ASE is enabled, .module ase will also be used. gcc/ChangeLog: * config/mips/mips.c (mips_file_start): add .module for arch and ase.
Diffstat (limited to 'gcc')
-rw-r--r--gcc/config/mips/mips.c37
1 files changed, 37 insertions, 0 deletions
diff --git a/gcc/config/mips/mips.c b/gcc/config/mips/mips.c
index 493d3de..ade5d70 100644
--- a/gcc/config/mips/mips.c
+++ b/gcc/config/mips/mips.c
@@ -9896,6 +9896,43 @@ mips_file_start (void)
else
fputs ("\t.module\tnooddspreg\n", asm_out_file);
+ fprintf (asm_out_file, "\t.module\tarch=%s\n", mips_arch_info->name);
+ /* FIXME: DSPR3 is not supported by GCC? gas does support it */
+ if (TARGET_DSPR2)
+ fputs ("\t.module\tdspr2\n", asm_out_file);
+ else if (TARGET_DSP)
+ fputs ("\t.module\tdsp\n", asm_out_file);
+ if (TARGET_EVA)
+ fputs ("\t.module\teva\n", asm_out_file);
+ if (TARGET_MCU)
+ fputs ("\t.module\tmcu\n", asm_out_file);
+ if (TARGET_MDMX)
+ fputs ("\t.module\tmdmx\n", asm_out_file);
+ if (TARGET_MIPS3D)
+ fputs ("\t.module\tmips3d\n", asm_out_file);
+ if (TARGET_MT)
+ fputs ("\t.module\tmt\n", asm_out_file);
+ if (TARGET_SMARTMIPS)
+ fputs ("\t.module\tsmartmips\n", asm_out_file);
+ if (TARGET_VIRT)
+ fputs ("\t.module\tvirt\n", asm_out_file);
+ if (TARGET_MSA)
+ fputs ("\t.module\tmsa\n", asm_out_file);
+ if (TARGET_XPA)
+ fputs ("\t.module\txpa\n", asm_out_file);
+ /* FIXME: MIPS16E2 is not supported by GCC? gas does support it */
+ if (TARGET_CRC)
+ fputs ("\t.module\tcrc\n", asm_out_file);
+ if (TARGET_GINV)
+ fputs ("\t.module\tginv\n", asm_out_file);
+ if (TARGET_LOONGSON_MMI)
+ fputs ("\t.module\tloongson-mmi\n", asm_out_file);
+ /* FIXME: LOONGSON-CAM is not supported by GCC? gas does support it */
+ if (TARGET_LOONGSON_EXT2)
+ fputs ("\t.module\tloongson-ext2\n", asm_out_file);
+ else if (TARGET_LOONGSON_EXT)
+ fputs ("\t.module\tloongson-ext\n", asm_out_file);
+
#else
#ifdef HAVE_AS_GNU_ATTRIBUTE
{