summaryrefslogtreecommitdiff
path: root/sim/mips
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2022-11-04 07:38:20 +0700
committerMike Frysinger <vapier@gentoo.org>2022-11-08 14:55:50 +0700
commit2756004fe78954754946b61d3f6338d8b72b8332 (patch)
tree6628f729649c9f9cb1fb4f15b99a813f86a8bb12 /sim/mips
parent195064c8da5a86a602d6312c5ad31b2bdb3721f9 (diff)
downloadbinutils-gdb-2756004fe78954754946b61d3f6338d8b72b8332.tar.gz
sim: mips: call Unpredictable instead of setting bogus values [PR sim/29276]
The intention of this code seems to be to indicate that this insn should not be used and produces undefined behavior, so instead of setting registers to bogus values, call Unpredictable. This fixes build warnings due to 32-bit/64-bit type conversions, and outputs a log message for users at runtime instead of silent corruption. Bug: https://sourceware.org/PR29276
Diffstat (limited to 'sim/mips')
-rw-r--r--sim/mips/mips.igen4
1 files changed, 2 insertions, 2 deletions
diff --git a/sim/mips/mips.igen b/sim/mips/mips.igen
index dfad4227615..0746a52d5ab 100644
--- a/sim/mips/mips.igen
+++ b/sim/mips/mips.igen
@@ -1450,7 +1450,7 @@
else if ((fs & 0x1) == 0)
GPR[rt] = SET64HI (FGR[fs+1]) | FGR[fs];
else
- GPR[rt] = SET64HI (0xDEADC0DE) | 0xBAD0BAD0;
+ Unpredictable ();
TRACE_ALU_RESULT (GPR[rt]);
}
@@ -5782,7 +5782,7 @@
else if ((FS & 0x1) == 0)
v = SET64HI (FGR[FS+1]) | FGR[FS];
else
- v = SET64HI (0xDEADC0DE) | 0xBAD0BAD0;
+ Unpredictable ();
PENDING_FILL (RT, v);
TRACE_ALU_RESULT (v);
}