From 2ca7c3c41703f380668e19a9407adb72095edcce Mon Sep 17 00:00:00 2001 From: Jeff Law Date: Thu, 31 Aug 1995 04:07:00 +0000 Subject: * gencode.c (gensim): abort if an unknown opcode is encountered. --- sim/sh/ChangeLog | 33 +++++++++++++++++++++++++++++++-- sim/sh/gencode.c | 11 ++++------- 2 files changed, 35 insertions(+), 9 deletions(-) (limited to 'sim/sh') diff --git a/sim/sh/ChangeLog b/sim/sh/ChangeLog index b868485..8fecfab 100644 --- a/sim/sh/ChangeLog +++ b/sim/sh/ChangeLog @@ -1,7 +1,36 @@ +Wed Aug 30 22:05:17 1995 Jeff Law (law@snake.cs.utah.edu) + + * gencode.c (gensim): abort if an unknown opcode is encountered. + +Tue Aug 22 14:16:46 1995 J.T. Conklin + + * interp.c (trap): Use trap vector 34 for host system interface. + * gencode.c: Add 34 to conditional which determines which traps + will be handled by simulator. + +Fri Aug 11 17:59:15 1995 Jim Wilson + + * run.c: Include . Define SIGQUIT if not defined. + (main): New variables reason and sigrc. After simulator exits, + check to see if it exited because of a signal, and if so, then + use the signal number as the return value. + +Thu Aug 3 10:45:37 1995 Fred Fish + + * Update all FSF addresses except those in COPYING* files. + +Tue Jul 18 23:33:10 1995 Fred Fish + + * interp.c (trap): Only use SYS_execv if defined. Might be + implemented as execve(arg1,arg2,0), as with Unixware 2.0. + (sim_resume): In sbit initializer, cast shifted arg to unsigned + to avoid signed integer overflow. + Wed Jul 5 14:32:54 1995 J.T. Conklin - * Makefile.in (distclean, mostlyclean, realclean): Remove autoconf - files. + * Makefile.in (clean): Remove run, libsim.a. + (distclean, mostlyclean, realclean): Remove Makefile and + autoconf files. * sh.mt: Removed. diff --git a/sim/sh/gencode.c b/sim/sh/gencode.c index 476acc1..7685b71 100644 --- a/sim/sh/gencode.c +++ b/sim/sh/gencode.c @@ -151,14 +151,10 @@ op tab[] = "{ int tmp = PC; PC=RLAT(R[15])+2;R[15]+=4;SET_SR(RLAT(R[15]) & 0x3f3);R[15]+=4;SL(tmp+2);}"}, {"","","rts", "0000000000001011", "ult=PC;PC=PR+2;SL(ult+2);"}, {"","","sett", "0000000000011000", "T=1;"}, - -/* start-sanitize-sh3 */ {"n","mn","shad ,", "0100nnnnmmmm1100", "R[n] = (R[m] < 0) ? (((int)R[n]) >> -(R[m]&0x1f) ): (R[n] << ((R[m]) & 0x1f)) ;"}, - {"n","mn","shld ,", "0100nnnnmmmm1101", "R[n] = (R[m] < 0) ? (((unsigned int)R[n]) >> -(R[m]&0x1f) ): (R[n] << ((R[m]) & 0x1f)) ;"}, -/* end-sanitize-sh3 */ {"n","n","shal ", "0100nnnn00100000", "T=R[n]<0; R[n]<<=1;"}, {"n","n","shar ", "0100nnnn00100001", "T=R[n]&1; R[n] = R[n] >> 1;"}, {"n","n","shll ", "0100nnnn00000000", "T=R[n]<0; R[n]<<=1;"}, @@ -190,7 +186,7 @@ op tab[] = {"n","nm","swap.w ,", "0110nnnnmmmm1001", "R[n]=((R[m]<<16)&0xffff0000)|((R[m]>>16)&0x00ffff);"}, {"","n","tas.b @", "0100nnnn00011011", "ult=RBAT(R[n]);T=ult==0;WBAT(R[n],ult|0x80);"}, {"0","","trapa #", "11000011i8*1....", - "{ long imm = 0xff & i; if (i<20||i==0xc3) trap(i,R,memory,maskl,maskw,little_endian); else { R[15]-=4; WLAT(R[15],GET_SR()); R[15]-=4;WLAT(R[15],PC+2); PC=RLAT(VBR+(imm<<2))-2;}}"}, + "{ long imm = 0xff & i; if (i<20||i==34||i==0xc3) trap(i,R,memory,maskl,maskw,little_endian); else { R[15]-=4; WLAT(R[15],GET_SR()); R[15]-=4;WLAT(R[15],PC+2); PC=RLAT(VBR+(imm<<2))-2;}}"}, {"","0","tst #,R0", "11001000i8*1....", "T=(R0&i)==0;"}, {"","mn","tst ,", "0010nnnnmmmm1000", "T=(R[n]&R[m])==0;"}, {"","0","tst.b #,@(R0,GBR)", "11001100i8*1....", "T=(RBAT(GBR+R0)&i)==0;"}, @@ -466,7 +462,7 @@ genopc () printf ("sh_opcode_info sh_table[]={\n"); for (p = tab; p->name; p++) { - printf ("\n\/\* %s %-20s*/", p->code, p->name); + printf ("\n/* %s %-20s*/", p->code, p->name); think (p); } printf ("0};\n"); @@ -619,7 +615,7 @@ gensim () char *s = p->code; - printf ("\/\* %s %s *\/\n", p->name, p->code); + printf ("/* %s %s */\n", p->name, p->code); printf ("case %d: \n", p->index); printf ("{\n"); @@ -718,6 +714,7 @@ gensim () printf ("break;\n"); printf ("}\n"); } + printf("default:\n{\nabort();;\n}\n"); printf ("}\n}\n"); } -- cgit v1.1