From b59e0b681533288e6817d4e0fc2353197471c469 Mon Sep 17 00:00:00 2001 From: "Frank Ch. Eigler" Date: Sat, 28 Mar 1998 00:35:43 +0000 Subject: [PATCH] * Modified sky PKE behavior according to new SCEI specs. --- sim/mips/sky-pke.c | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/sim/mips/sky-pke.c b/sim/mips/sky-pke.c index a0db39abedf..0d3473e278b 100644 --- a/sim/mips/sky-pke.c +++ b/sim/mips/sky-pke.c @@ -1982,20 +1982,12 @@ pke_code_unpack(struct pke_device* me, unsigned_4 pkecode) switch(PKE_REG_MASK_GET(me, MODE, MDE)) { case PKE_MODE_ADDROW: /* add row registers to output data */ + case PKE_MODE_ACCROW: /* same .. later conditionally accumulate */ for(i=0; i<4; i++) /* exploit R0..R3 contiguity */ unpacked_data[i] += me->regs[PKE_REG_R0 + i][0]; break; - case PKE_MODE_ACCROW: /* add row registers to output data; accumulate */ - for(i=0; i<4; i++) - { - /* exploit R0..R3 contiguity */ - unpacked_data[i] += me->regs[PKE_REG_R0 + i][0]; - me->regs[PKE_REG_R0 + i][0] = unpacked_data[i]; - } - break; - case PKE_MODE_INPUT: /* pass data through */ default: /* specified as undefined */ ; @@ -2016,6 +2008,11 @@ pke_code_unpack(struct pke_device* me, unsigned_4 pkecode) { case PKE_MASKREG_INPUT: masked_value = & unpacked_data[i]; + + /* conditionally accumulate */ + if(PKE_REG_MASK_GET(me, MODE, MDE) == PKE_MODE_ACCROW) + me->regs[PKE_REG_R0 + i][0] = unpacked_data[i]; + break; case PKE_MASKREG_ROW: /* exploit R0..R3 contiguity */ @@ -2044,6 +2041,11 @@ pke_code_unpack(struct pke_device* me, unsigned_4 pkecode) { /* no mask - just copy over entire unpacked quadword */ memcpy(vu_new_data, unpacked_data, sizeof(unpacked_data)); + + /* conditionally store accumulated row results */ + if(PKE_REG_MASK_GET(me, MODE, MDE) == PKE_MODE_ACCROW) + for(i=0; i<4; i++) + me->regs[PKE_REG_R0 + i][0] = unpacked_data[i]; } /* write new VU data word at address; reverse words if needed */ -- 2.30.2