aboutsummaryrefslogtreecommitdiff
path: root/sim/mips/interp.c
diff options
context:
space:
mode:
authorAndrew Cagney <cagney@redhat.com>1998-02-03 05:39:15 +0000
committerAndrew Cagney <cagney@redhat.com>1998-02-03 05:39:15 +0000
commit37379a256bf9e85add0024d7e13f43aa0eba4282 (patch)
tree19cdf90a93fdfda5365083158138807156b533a6 /sim/mips/interp.c
parent229811d19034006249ce7e2e2b76f526557d9cc0 (diff)
downloadgdb-37379a256bf9e85add0024d7e13f43aa0eba4282.zip
gdb-37379a256bf9e85add0024d7e13f43aa0eba4282.tar.gz
gdb-37379a256bf9e85add0024d7e13f43aa0eba4282.tar.bz2
IGEN - Replace IMEM (IMEM_IMMED) macro with IMEM<insn-size> macro,
update v850, tic80 and mips simulators. IGEN - Prepend prefix to more generated symbols and macros (idecode_issue, instruction_word). IGEN - Add -Wnowith option to supress warnings about word size inflicts in input files. MIPS - Clean up Makefile.in, m16.igen, m16.dc (new), m16run.c (new) so that a mips16 simulator built using IGEN can be compiled.
Diffstat (limited to 'sim/mips/interp.c')
-rw-r--r--sim/mips/interp.c38
1 files changed, 23 insertions, 15 deletions
diff --git a/sim/mips/interp.c b/sim/mips/interp.c
index 6de127a..9045004 100644
--- a/sim/mips/interp.c
+++ b/sim/mips/interp.c
@@ -339,7 +339,6 @@ sim_open (kind, cb, abfd, argv)
registers: */
{
int rn;
-<<<<<<< interp.c
for (rn = 0; (rn < (LAST_EMBED_REGNUM + 1)); rn++)
{
if (rn < 32)
@@ -353,20 +352,6 @@ sim_open (kind, cb, abfd, argv)
else
cpu->register_widths[rn] = 0;
}
-=======
- for (rn = 0; (rn < (LAST_EMBED_REGNUM + 1)); rn++) {
- if (rn < 32)
- cpu->register_widths[rn] = WITH_TARGET_WORD_BITSIZE;
- else if ((rn >= FGRIDX) && (rn < (FGRIDX + 32)))
- cpu->register_widths[rn] = WITH_TARGET_WORD_BITSIZE;
- else if ((rn >= 33) && (rn <= 37))
- cpu->register_widths[rn] = WITH_TARGET_WORD_BITSIZE;
- else if ((rn == SRIDX) || (rn == FCR0IDX) || (rn == FCR31IDX) || ((rn >= 72) && (rn <= 89)))
- cpu->register_widths[rn] = 32;
- else
- cpu->register_widths[rn] = 0;
- }
->>>>>>> 1.94
/* start-sanitize-r5900 */
/* set the 5900 "upper" registers to 64 bits */
@@ -1580,6 +1565,29 @@ ifetch32 (SIM_DESC sd,
}
+unsigned16
+ifetch16 (SIM_DESC sd,
+ sim_cpu *cpu,
+ address_word cia,
+ address_word vaddr)
+{
+ /* Copy the action of the LW instruction */
+ address_word reverse = (ReverseEndian ? (LOADDRMASK >> 2) : 0);
+ address_word bigend = (BigEndianCPU ? (LOADDRMASK >> 2) : 0);
+ unsigned64 value;
+ address_word paddr;
+ unsigned16 instruction;
+ unsigned byte;
+ int cca;
+ AddressTranslation (vaddr, isINSTRUCTION, isLOAD, &paddr, &cca, isTARGET, isREAL);
+ paddr = ((paddr & ~LOADDRMASK) | ((paddr & LOADDRMASK) ^ (reverse << 2)));
+ LoadMemory (&value, NULL, cca, AccessLength_WORD, paddr, vaddr, isINSTRUCTION, isREAL);
+ byte = ((vaddr & LOADDRMASK) ^ (bigend << 2));
+ instruction = ((value >> (8 * byte)) & 0xFFFFFFFF);
+ return instruction;
+}
+
+
/* Description from page A-26 of the "MIPS IV Instruction Set" manual (revision 3.1) */
/* Order loads and stores to synchronise shared memory. Perform the
action necessary to make the effects of groups of synchronizable