GAS/MIPS: Add `-mfix-r5900' option for the R5900 short loop erratum

`-march=r5900' already enables the R5900 short loop workaround.
However, the R5900 ISA and most other MIPS ISAs are mutually
exclusive since R5900-specific instructions are generated as well.

The `-mfix-r5900' option can be used in combination with e.g.
`-mips2' or `-mips3' to generate generic MIPS binaries that also
work with the R5900 target.

This change has been tested with `make RUNTESTFLAGS=mips.exp
check-gas' for the targets `mipsr5900el-unknown-linux-gnu',
`mipsr5900el-elf' and `mips3-unknown-linux-gnu'.

	gas/
	* config/tc-mips.c (mips_fix_r5900, mips_fix_r5900_explicit):
	New variables.
	(options): Add OPTION_FIX_R5900 and OPTION_NO_FIX_R5900
	enumeration constants.
	(md_longopts): Add "mfix-r5900" and "mno-fix-r5900" options.
	(can_swap_branch_p, md_parse_option, mips_after_parse_args):
	Handle the new options.
	(md_show_usage): Document the `-mfix-r5900' option.
	* doc/as.texi: Likewise.
	* doc/c-mips.texi: Likewise.
	* testsuite/gas/mips/mips.exp: Run R5900 dump tests.
	* testsuite/gas/mips/r5900-fix.d: Test `-mfix-r5900' option.
	* testsuite/gas/mips/r5900-fix.s: Likewise.
	* testsuite/gas/mips/r5900-no-fix.d: Test `-mno-fix-r5900'.
	* testsuite/gas/mips/r5900-no-fix.s: Likewise.
9 files changed