From a43b22b5774d090edbc94a27a8305d4b8306508c Mon Sep 17 00:00:00 2001 From: Steve Chamberlain Date: Wed, 24 May 1995 21:14:40 +0000 Subject: [PATCH] Wed May 24 14:07:11 1995 Steve Chamberlain * gencode.c (tab): Add bsrf and braf. --- sim/sh/ChangeLog | 22 ++++++++++++++++++++++ sim/sh/gencode.c | 26 +++++++++++--------------- 2 files changed, 33 insertions(+), 15 deletions(-) diff --git a/sim/sh/ChangeLog b/sim/sh/ChangeLog index 39bc83f0a74..6859d5ad291 100644 --- a/sim/sh/ChangeLog +++ b/sim/sh/ChangeLog @@ -1,3 +1,25 @@ +Wed May 24 14:07:11 1995 Steve Chamberlain + + * gencode.c (tab): Add bsrf and braf. + +Mon Apr 24 15:09:49 1995 Jason Molenda (crash@cygnus.com) + + * configure.in: use ../../bfd/hosts/std-host.h, not + ../bfd/hosts/std-host.h (which doesn't exist). + +Mon Mar 27 10:32:34 1995 J.T. Conklin + + * run.c: parse arguments with getopt(). + +Sun Feb 26 15:27:24 1995 Steve Chamberlain + + * configure.in: Use ../../bfd/hosts/std-host.h if specific + host unavailable. + +Mon Jan 23 16:10:58 1995 Torbjorn Granlund + + * interp.c (macw): Sign extend MACH at bit 10 for non-saturating case. + Sun Jan 22 13:55:36 1995 Torbjorn Granlund * gencode.c (op_tab): Make MAC.W call macw, not abort. diff --git a/sim/sh/gencode.c b/sim/sh/gencode.c index e171848e110..476acc17f4c 100644 --- a/sim/sh/gencode.c +++ b/sim/sh/gencode.c @@ -49,13 +49,10 @@ op tab[] = {"n","","add #,", "0111nnnni8*1....", "R[n] += SEXT(i);if (i == 0) { UNDEF(n); break; } "}, {"n","mn","add ,", "0011nnnnmmmm1100", "R[n] += R[m];"}, - {"n","mn","addc ,", "0011nnnnmmmm1110", "ult=R[n]+T;T=ult,", "0011nnnnmmmm1110", + "ult=R[n]+T;T=ult,", "0011nnnnmmmm1111", - "{long ans;", - " ans = R[n] + R[m];", - "T = ((~R[n] & R[m] & ans) | (R[n] & R[m] & ~ans)) >>31;", - "R[n] = ans;}"}, - + "ult = R[n] + R[m]; T = ((~(R[n] ^ R[m]) & (ult ^ R[n])) >> 31); R[n] = ult;"}, {"0","","and #,R0", "11001001i8*1....", ";R0&=i;"}, {"n","nm","and ,", "0010nnnnmmmm1001", " R[n]&=R[m];"}, {"","0","and.b #,@(R0,GBR)", "11001101i8*1....", ";WBAT(GBR+R0, RBAT(GBR+R0) & i);"}, @@ -99,7 +96,7 @@ op tab[] = {"","n","lds.l @+,MACH", "0100nnnn00000110", "MACH = SEXT(RLAT(R[n]));R[n]+=4;"}, {"","n","lds.l @+,MACL", "0100nnnn00010110", "MACL = RLAT(R[n]);R[n]+=4;"}, {"","n","lds.l @+,PR", "0100nnnn00100110", "PR = RLAT(R[n]);R[n]+=4;;"}, - {"","n","mac.w @+,@+", "0100nnnnmmmm1111", "abort();"}, + {"","n","mac.w @+,@+", "0100nnnnmmmm1111", "macw(R0,memory,n,m);"}, {"n","","mov #,", "1110nnnni8*1....", "R[n] = SEXT(i);"}, {"n","m","mov ,", "0110nnnnmmmm0011", "R[n] = R[m];"}, {"","mn0","mov.b ,@(R0,)", "0000nnnnmmmm0100", "WBAT(R[n]+R0, R[m]);"}, @@ -140,8 +137,7 @@ op tab[] = {"","mn","mul.l ,","0000nnnnmmmm0111","MACL=((int)R[n])*((int)R[m]);"}, {"","mn","mulu ,", "0010nnnnmmmm1110","MACL=((unsigned int)(unsigned short)R[n])*((unsigned int)(unsigned short)R[m]);"}, {"n","m","neg ,", "0110nnnnmmmm1011", "R[n] = - R[m];"}, - {"n","m","negc ,", "0110nnnnmmmm1010", - "ult=R[m]; R[n]=0-R[m]-T;T=SBIT(R[n])!=SBIT(ult); "}, + {"n","m","negc ,", "0110nnnnmmmm1010", "ult=-T;T=ult>0;R[n]=ult-R[m];T|=R[n]>ult;"}, {"","","nop", "0000000000001001", ""}, {"n","m","not ,", "0110nnnnmmmm0111", "R[n]=~R[m];"}, {"0","","or #,R0", "11001011i8*1....", "R0|=i;"}, @@ -187,8 +183,9 @@ op tab[] = {"n","n","sts.l MACL,@-", "0100nnnn00010010", "R[n]-=4;WLAT(R[n],MACL);"}, {"n","n","sts.l PR,@-", "0100nnnn00100010", "R[n]-=4;WLAT(R[n],PR);"}, {"n","nm","sub ,", "0011nnnnmmmm1000", "R[n]-=R[m];"}, - {"n","nm","subc ,", "0011nnnnmmmm1010", "ult=R[n]-T;T=ult>T;ult=ult-R[m];T=T|(ult>R[m]);R[n]=ult;"}, - {"n","nm","subv ,", "0011nnnnmmmm1011", "abort();"}, +{"n","nm","subc ,", "0011nnnnmmmm1010", "ult=R[n]-T;T=ult>R[n];R[n]=ult-R[m];T|=R[n]>ult;"}, + {"n","nm","subv ,", "0011nnnnmmmm1011", + "ult = R[n] - R[m]; T = (((R[n] ^ R[m]) & (ult ^ R[n])) >> 31); R[n] = ult;"}, {"n","nm","swap.b ,", "0110nnnnmmmm1000", "R[n]=((R[m]<<8)&0xff00)|((R[m]>>8)&0x00ff);"}, {"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);"}, @@ -205,11 +202,10 @@ op tab[] = {"n","n","dt ", "0100nnnn00010000", "R[n]--; T=R[n] == 0;"}, {"","nm","dmuls.l ,", "0011nnnnmmmm1101", "dmul(1,R[n],R[m]);"}, {"","nm","dmulu.l ,", "0011nnnnmmmm0101", "dmul(0,R[n],R[m]);"}, - {"","nm","mac.l @+,@+", "0000nnnnmmmm1111", ""}, - + {"","nm","mac.l @+,@+", "0000nnnnmmmm1111", "abort();"}, + {"","n","braf ", "0000nnnn00100011", "ult = PC; PC+=R[n]-2;SL(ult+2);"}, + {"","n","bsrf ", "0000nnnn00000011", "PR = PC; PC+=R[n]-2;SL(PR+2);"}, #if 0 - {"braf @", "0000nnnn00100011", ""}, - {"bsrf @", "0000nnnn00000011", ""}, {"divs.l ,", "0100nnnnmmmm1110", "divl(0,R[n],R[m]);"}, {"divu.l ,", "0100nnnnmmmm1101", "divl(0,R[n],R[m]);"}, #endif -- 2.30.2