* compile.c: Change literal regnumbers to REGNUMS.

This commit is contained in:
Andrey Volkov 2002-05-17 18:47:14 +00:00
parent 6e591d68a5
commit 3b02cf9281
2 changed files with 19 additions and 13 deletions

View file

@ -1,3 +1,8 @@
2002-05-17 Andrey Volkov (avolkov@transas.com)
* compile.c: Change literal regnumbers to REGNUMS.
Fix instruction and cycles counting
2001-12-20 Kazu Hirata <kazu@hxi.com> 2001-12-20 Kazu Hirata <kazu@hxi.com>
* compile.c: Fix formatting. * compile.c: Fix formatting.

View file

@ -111,10 +111,7 @@ static int memory_size;
static int static int
get_now () get_now ()
{ {
#ifndef WIN32 return time (0); /* WinXX HAS UNIX like 'time', so why not using it? */
return time (0);
#endif
return 0;
} }
static int static int
@ -155,7 +152,7 @@ lvalue (x, rn)
return X (OP_MEM, SP); return X (OP_MEM, SP);
default: default:
abort (); abort (); /* ?? May be something more usefull? */
} }
} }
@ -608,7 +605,7 @@ fetch (arg, n)
return t; return t;
default: default:
abort (); abort (); /* ?? May be something more usefull? */
} }
} }
@ -997,8 +994,12 @@ sim_resume (sd, step, siggnal)
#endif #endif
cycles += code->cycles; if (code->opcode)
insts++; {
cycles += code->cycles;
insts++;
}
switch (code->opcode) switch (code->opcode)
{ {
case 0: case 0:
@ -1860,10 +1861,10 @@ sim_fetch_register (sd, rn, buf, length)
{ {
default: default:
abort (); abort ();
case 8: case CCR_REGNUM:
v = cpu.ccr; v = cpu.ccr;
break; break;
case 9: case PC_REGNUM:
v = cpu.pc; v = cpu.pc;
break; break;
case R0_REGNUM: case R0_REGNUM:
@ -1876,15 +1877,15 @@ sim_fetch_register (sd, rn, buf, length)
case R7_REGNUM: case R7_REGNUM:
v = cpu.regs[rn]; v = cpu.regs[rn];
break; break;
case 10: case CYCLE_REGNUM:
v = cpu.cycles; v = cpu.cycles;
longreg = 1; longreg = 1;
break; break;
case 11: case TICK_REGNUM:
v = cpu.ticks; v = cpu.ticks;
longreg = 1; longreg = 1;
break; break;
case 12: case INST_REGNUM:
v = cpu.insts; v = cpu.insts;
longreg = 1; longreg = 1;
break; break;