The short loop bug under certain conditions causes loops to execute only once or twice, due to a hardware bug in the R5900 chip. `-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. The workaround is implemented by GAS rather than by GCC. The following small `shortloop.c' file has been used as a test with GCC 8.2.0: void shortloop(void) { __asm__ __volatile__ ( " li $3, 300\n" "loop:\n" " addi $3, -1\n" " addi $4, -1\n" " bne $3, $0, loop\n" " li $4, 3\n" ::); } The following six combinations have been tested: % mipsr5900el-unknown-linux-gnu-gcc -O1 -c shortloop.c % mipsr5900el-unknown-linux-gnu-gcc -O1 -c shortloop.c -mfix-r5900 % mipsr5900el-unknown-linux-gnu-gcc -O1 -c shortloop.c -mno-fix-r5900 % mipsr4000el-unknown-linux-gnu-gcc -O1 -c shortloop.c % mipsr4000el-unknown-linux-gnu-gcc -O1 -c shortloop.c -mfix-r5900 % mipsr4000el-unknown-linux-gnu-gcc -O1 -c shortloop.c -mno-fix-r5900 The R5900 short loop erratum is corrected in exactly three cases: 1. for the target `mipsr5900el' by default; 2. for the target `mipsr5900el' with `-mfix-r5900'; 3. for any other MIPS target (e.g. `mipsr4000el') with `-mfix-r5900'. In all other cases the correction is not made. 2018-11-27 Fredrik Noring <noring@nocrew.org> gcc/ * config/mips/mips.c (mips_reorg_process_insns) (mips_option_override): Handle `-mfix-r5900'. * config/mips/mips.h (ASM_SPEC): Add `mfix-r5900' and `mno-fix-r5900'. * config/mips/mips.opt (mfix-r5900): New option. * doc/invoke.texi: Document the `r5900' processor name, and `-mfix-r5900' and `-mno-fix-r5900' options. From-SVN: r266519
Name |
Last commit
|
Last update |
---|---|---|
.. | ||
10000.md | Loading commit data... | |
20kc.md | Loading commit data... | |
24k.md | Loading commit data... | |
3000.md | Loading commit data... | |
4000.md | Loading commit data... | |
4100.md | Loading commit data... | |
4130.md | Loading commit data... | |
4300.md | Loading commit data... | |
4600.md | Loading commit data... | |
4k.md | Loading commit data... | |
5000.md | Loading commit data... | |
5400.md | Loading commit data... | |
5500.md | Loading commit data... | |
5k.md | Loading commit data... | |
6000.md | Loading commit data... | |
7000.md | Loading commit data... | |
74k.md | Loading commit data... | |
9000.md | Loading commit data... | |
constraints.md | Loading commit data... | |
driver-native.c | Loading commit data... | |
elf.h | Loading commit data... | |
elfoabi.h | Loading commit data... | |
elforion.h | Loading commit data... | |
frame-header-opt.c | Loading commit data... | |
generic.md | Loading commit data... | |
genopt.sh | Loading commit data... | |
gnu-user.h | Loading commit data... | |
gs264e.md | Loading commit data... | |
gs464.md | Loading commit data... | |
gs464e.md | Loading commit data... | |
i6400.md | Loading commit data... | |
linux-common.h | Loading commit data... | |
linux.h | Loading commit data... | |
loongson-mmi.md | Loading commit data... | |
loongson-mmiintrin.h | Loading commit data... | |
loongson.h | Loading commit data... | |
loongson2ef.md | Loading commit data... | |
m5100.md | Loading commit data... | |
micromips.md | Loading commit data... | |
mips-cpus.def | Loading commit data... | |
mips-d.c | Loading commit data... | |
mips-dsp.md | Loading commit data... | |
mips-dspr2.md | Loading commit data... | |
mips-fixed.md | Loading commit data... | |
mips-ftypes.def | Loading commit data... | |
mips-modes.def | Loading commit data... | |
mips-msa.md | Loading commit data... | |
mips-opts.h | Loading commit data... | |
mips-protos.h | Loading commit data... | |
mips-ps-3d.md | Loading commit data... | |
mips-tables.opt | Loading commit data... | |
mips.c | Loading commit data... | |
mips.h | Loading commit data... | |
mips.md | Loading commit data... | |
mips.opt | Loading commit data... | |
msa.h | Loading commit data... | |
mti-elf.h | Loading commit data... | |
mti-linux.h | Loading commit data... | |
n32-elf.h | Loading commit data... | |
netbsd.h | Loading commit data... | |
octeon.md | Loading commit data... | |
p5600.md | Loading commit data... | |
p6600.md | Loading commit data... | |
predicates.md | Loading commit data... | |
r3900.h | Loading commit data... | |
rtems.h | Loading commit data... | |
sb1.md | Loading commit data... | |
sde.h | Loading commit data... | |
sde.opt | Loading commit data... | |
sdemtk.h | Loading commit data... | |
sr71k.md | Loading commit data... | |
st.h | Loading commit data... | |
sync.md | Loading commit data... | |
t-elf | Loading commit data... | |
t-img-elf | Loading commit data... | |
t-img-linux | Loading commit data... | |
t-irix6 | Loading commit data... | |
t-isa3264 | Loading commit data... | |
t-linux64 | Loading commit data... | |
t-mips | Loading commit data... | |
t-mti-elf | Loading commit data... | |
t-mti-linux | Loading commit data... | |
t-r3900 | Loading commit data... | |
t-rtems | Loading commit data... | |
t-sb1 | Loading commit data... | |
t-sde | Loading commit data... | |
t-sdemtk | Loading commit data... | |
t-sr71k | Loading commit data... | |
t-st | Loading commit data... | |
t-vr | Loading commit data... | |
t-vxworks | Loading commit data... | |
vr.h | Loading commit data... | |
vxworks.h | Loading commit data... | |
x-native | Loading commit data... | |
xlp.md | Loading commit data... | |
xlr.md | Loading commit data... |