From ce4713dc3b85fce3d7f4395d446887717ac86e99 Mon Sep 17 00:00:00 2001 From: Ron Unrau Date: Mon, 23 Feb 1998 23:40:40 +0000 Subject: [PATCH] Make it compile again for -DTARGET_SKY --- sim/mips/interp.c | 65 ++++++++++++++++++++++++----------------------- 1 file changed, 33 insertions(+), 32 deletions(-) diff --git a/sim/mips/interp.c b/sim/mips/interp.c index 8f2553e53ad..fa83966926d 100644 --- a/sim/mips/interp.c +++ b/sim/mips/interp.c @@ -632,28 +632,29 @@ sim_store_register (sd,rn,memory,length) HI1 = T2H_8(*(unsigned64*)memory); return 8; } - /* end-sanitize-r5900 */ + /* start-sanitize-sky */ #ifdef TARGET_SKY - else if( rn > NUM_R5900_REGS ) { - rn = rn - NUM_R5900_REGS; - - if( rn < 16 ) - vu_regs[0].i[rn] = T2H_2( *(unsigned short *) memory ); - else if( rn < NUM_VU_REGS ) - vu_regs[0].f[rn - 16] = T2H_4( *(unsigned int *) memory ); - else { - rn = rn - NUM_VU_REGS; + if (rn > NUM_R5900_REGS) + { + rn = rn - NUM_R5900_REGS; if( rn < 16 ) - vu_regs[1].i[rn] = T2H_2( *(unsigned short *) memory ); + vu_regs[0].i[rn] = T2H_2( *(unsigned short *) memory ); else if( rn < NUM_VU_REGS ) - vu_regs[1].f[rn - 16] = T2H_4( *(unsigned int *) memory ); - else - sim_io_eprintf( sd, "Invalid VU register (register store ignored)\n" ); + vu_regs[0].f[rn - 16] = T2H_4( *(unsigned int *) memory ); + else { + rn = rn - NUM_VU_REGS; + + if( rn < 16 ) + vu_regs[1].i[rn] = T2H_2( *(unsigned short *) memory ); + else if( rn < NUM_VU_REGS ) + vu_regs[1].f[rn - 16] = T2H_4( *(unsigned int *) memory ); + else + sim_io_eprintf( sd, "Invalid VU register (register store ignored)\n" ); + } } - } #endif /* end-sanitize-sky */ @@ -721,31 +722,31 @@ sim_fetch_register (sd,rn,memory,length) *((unsigned64*)memory) = H2T_8(HI1); return 8; } - /* end-sanitize-r5900 */ + /* start-sanitize-sky */ #ifdef TARGET_SKY - if( rn > NUM_R5900_REGS ) { - rn = rn - NUM_R5900_REGS; - - if( rn < 16 ) - *((unsigned short *) memory) = H2T_2( vu_regs[0].i[rn] ); - else if( rn < NUM_VU_REGS ) - *((unsigned int *) memory) = H2T_4( vu_regs[0].f[rn - 16] ); - else { - rn = rn - NUM_VU_REGS; + if( rn > NUM_R5900_REGS ) + { + rn = rn - NUM_R5900_REGS; if( rn < 16 ) - (*(unsigned short *) memory) = H2T_2( vu_regs[1].i[rn] ); + *((unsigned short *) memory) = H2T_2( vu_regs[0].i[rn] ); else if( rn < NUM_VU_REGS ) - (*(unsigned int *) memory) = H2T_4( vu_regs[1].f[rn - 16] ); - else - sim_io_eprintf( sd, "Invalid VU register (register fetch ignored)\n" ); + *((unsigned int *) memory) = H2T_4( vu_regs[0].f[rn - 16] ); + else { + rn = rn - NUM_VU_REGS; + + if( rn < 16 ) + (*(unsigned short *) memory) = H2T_2( vu_regs[1].i[rn] ); + else if( rn < NUM_VU_REGS ) + (*(unsigned int *) memory) = H2T_4( vu_regs[1].f[rn - 16] ); + else + sim_io_eprintf( sd, "Invalid VU register (register fetch ignored)\n" ); + } + return -1; } - return -1; - } #endif - /* end-sanitize-sky */ /* Any floating point register */ -- 2.30.2