diff options
author | Fredrik Noring <noring@nocrew.org> | 2018-11-30 18:32:36 +0000 |
---|---|---|
committer | Maciej W. Rozycki <macro@linux-mips.org> | 2018-11-30 18:32:36 +0000 |
commit | 27c634e0ed18f769fb92d03fb75ea491fb6656ec (patch) | |
tree | db6c1e97130b20724ac361837f886500ba15f8e0 /gas/doc | |
parent | 92528b6772a19dd671b52d954c14886b11fc0a8d (diff) | |
download | gdb-27c634e0ed18f769fb92d03fb75ea491fb6656ec.zip gdb-27c634e0ed18f769fb92d03fb75ea491fb6656ec.tar.gz gdb-27c634e0ed18f769fb92d03fb75ea491fb6656ec.tar.bz2 |
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.
Diffstat (limited to 'gas/doc')
-rw-r--r-- | gas/doc/as.texi | 9 | ||||
-rw-r--r-- | gas/doc/c-mips.texi | 8 |
2 files changed, 17 insertions, 0 deletions
diff --git a/gas/doc/as.texi b/gas/doc/as.texi index acecd35..1e00e78 100644 --- a/gas/doc/as.texi +++ b/gas/doc/as.texi @@ -453,6 +453,7 @@ gcc(1), ld(1), and the Info entries for @file{binutils} and @file{ld}. [@b{-mfix-rm7000}] [@b{-mno-fix-rm7000}] [@b{-mfix-vr4120}] [@b{-mno-fix-vr4120}] [@b{-mfix-vr4130}] [@b{-mno-fix-vr4130}] + [@b{-mfix-r5900}] [@b{-mno-fix-r5900}] [@b{-mdebug}] [@b{-no-mdebug}] [@b{-mpdr}] [@b{-mno-pdr}] @end ifset @@ -1444,6 +1445,14 @@ of an mfhi or mflo instruction occurs in the following two instructions. Cause nops to be inserted if a dmult or dmultu instruction is followed by a load instruction. +@item -mfix-r5900 +@itemx -mno-fix-r5900 +Do not attempt to schedule the preceding instruction into the delay slot +of a branch instruction placed at the end of a short loop of six +instructions or fewer and always schedule a @code{nop} instruction there +instead. The short loop bug under certain conditions causes loops to +execute only once or twice, due to a hardware bug in the R5900 chip. + @item -mdebug @itemx -no-mdebug Cause stabs-style debugging output to go into an ECOFF-style .mdebug diff --git a/gas/doc/c-mips.texi b/gas/doc/c-mips.texi index 7751ce0..76dfb10 100644 --- a/gas/doc/c-mips.texi +++ b/gas/doc/c-mips.texi @@ -327,6 +327,14 @@ Insert nops to work around the 24K @samp{eret}/@samp{deret} errata. Replace @code{pref} hints 0 - 4 and 6 - 24 with hint 28 to work around certain CN63XXP1 errata. +@item -mfix-r5900 +@itemx -mno-fix-r5900 +Do not attempt to schedule the preceding instruction into the delay slot +of a branch instruction placed at the end of a short loop of six +instructions or fewer and always schedule a @code{nop} instruction there +instead. The short loop bug under certain conditions causes loops to +execute only once or twice, due to a hardware bug in the R5900 chip. + @item -m4010 @itemx -no-m4010 Generate code for the LSI R4010 chip. This tells the assembler to |