summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlex Rønne Petersen <alexrp@xamarin.com>2013-11-15 15:08:06 +0100
committerAlex Rønne Petersen <alexrp@xamarin.com>2013-11-15 15:08:06 +0100
commit43b05e3c36d05526f7a9f3f8767569d026e4f1c6 (patch)
tree49c1133e751ee72616fddb1a22733d7ec8fa9ebd
parent2f56d471f089b8f514377ce501a0c1643652d639 (diff)
downloadffts-43b05e3c36d05526f7a9f3f8767569d026e4f1c6.zip
ffts-43b05e3c36d05526f7a9f3f8767569d026e4f1c6.tar.gz
Fix the `nop` opcode on some MIPS-based Loongson CPUs.
After much trouble building Mono in Debian/MIPS, @directhex narrowed it down to this issue: https://sourceware.org/ml/binutils/2009-11/msg00387.html So since some of the 2E and 2F versions of the Loongson CPUs break with a regular `sll zero, zero, 0` we need to issue an `or at, at, 0`. This makes sure we don't randomly deadlock or blow up when the CPU is under heavy load. Yes, really.
-rw-r--r--mips/mips-codegen.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/mips/mips-codegen.h b/mips/mips-codegen.h
index dc4df7d..1dbd1c6 100644
--- a/mips/mips-codegen.h
+++ b/mips/mips-codegen.h
@@ -334,7 +334,7 @@ enum {
/* misc and coprocessor ops */
#define mips_move(c,dest,src) mips_addu(c,dest,src,mips_zero)
#define mips_dmove(c,dest,src) mips_daddu(c,dest,src,mips_zero)
-#define mips_nop(c) mips_sll(c,0,0,0)
+#define mips_nop(c) mips_or(c,mips_at,mips_at,0)
#define mips_break(c,code) mips_emit32(c, ((code)<<6)|13)
#define mips_mfhi(c,dest) mips_format_r(c,0,0,0,dest,0,16)
#define mips_mflo(c,dest) mips_format_r(c,0,0,0,dest,0,18)
OpenPOWER on IntegriCloud