From fe2f8313f06e64b7462c921bb83c230ae1d692ac Mon Sep 17 00:00:00 2001 From: Stu Grossman Date: Wed, 15 Nov 1995 00:47:21 +0000 Subject: * gencode.c: jsr, bsr and bsrf actually save pc+4 in pr, and rts actually uses pr+0. --- sim/sh/ChangeLog | 3 ++- sim/sh/gencode.c | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) (limited to 'sim/sh') diff --git a/sim/sh/ChangeLog b/sim/sh/ChangeLog index 19db378..3879582 100644 --- a/sim/sh/ChangeLog +++ b/sim/sh/ChangeLog @@ -1,6 +1,7 @@ Tue Nov 14 15:19:43 1995 Stu Grossman (grossman@cygnus.com) - * gencode.c: jsr actually saves pc+4, and rts actually uses pr+0. + * gencode.c: jsr, bsr and bsrf actually save pc+4 in pr, and rts + actually uses pr+0. Sat Oct 21 13:01:18 1995 Jim Wilson diff --git a/sim/sh/gencode.c b/sim/sh/gencode.c index 1c79f87..7c7f426 100644 --- a/sim/sh/gencode.c +++ b/sim/sh/gencode.c @@ -58,7 +58,7 @@ op tab[] = {"","0","and.b #,@(R0,GBR)", "11001101i8*1....", ";WBAT(GBR+R0, RBAT(GBR+R0) & i);"}, {"","","bra ", "1010i12.........", "ult = PC; PC=PC+(i<<1)+2;SL(ult+2);"}, - {"","","bsr ", "1011i12.........", "PR = PC; PC=PC+(i<<1)+2;SL(PR+2);"}, + {"","","bsr ", "1011i12.........", "PR = PC + 4; PC=PC+(i<<1)+2;SL(PR-2);"}, {"","","bt ", "10001001i8p1....", "if(T) {PC+=(SEXT(i)<<1)+2;C+=2;}"}, {"","","bf ", "10001011i8p1....", "if(T==0) {PC+=(SEXT(i)<<1)+2;C+=2;}"}, {"","","bt.s ", "10001101i8p1....","if(T) {ult = PC; PC+=(SEXT(i)<<1)+2;C+=2;SL(ult+2);}"}, @@ -200,7 +200,7 @@ op tab[] = {"","nm","dmulu.l ,", "0011nnnnmmmm0101", "dmul(0,R[n],R[m]);"}, {"","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);"}, + {"","n","bsrf ", "0000nnnn00000011", "PR = PC + 4; PC+=R[n]-2;SL(PR-2);"}, #if 0 {"divs.l ,", "0100nnnnmmmm1110", "divl(0,R[n],R[m]);"}, {"divu.l ,", "0100nnnnmmmm1101", "divl(0,R[n],R[m]);"}, -- cgit v1.1