|
|
Power 6/32 Unix version 1.21
#include "fpp_defs.h"
/*****************************************************************************
*
* PIPELINE TEST #9
*
* LDF(op1), MULF(op2), CVFL r0, SUBF operand[r0], STF
*
* -where the operands are the fmacro1 MULF data patterns. The SUBF operand's
* address is based on the result of the CVFL.
* -The load, multiply, and convert will be done twice. The first time will
* be to get the index and the data to subtract. The data to subtract will
* be the same as the accumulator so we'll expect a reasult of zero. The
* data will be stored based on the 1st CVFL result.
* -If the 2nd CVFL doesn't get done before the SUBF operand is fetched then
* we won't get a final accumulator of zero.
* -For size reasons, only the MULF data with a result between -100 and +100
* will be used for this test.
*****************************************************************************/
pipe_9()
{
asm(".globl _pipeline_9_t");
asm("_pipeline_9_t:");
if( (cycle == 1) && (prt_hdrs) ) /* print headers on 1st cycle */
writes(" PIPE_9 ");
force_loop = FALSE; /* clear force_loop flag */
for( index = 0; index <= max_mulf_1_index; index++ ) {
sgl_value_1 = mulf_1_data[index].op_1; /* get the data */
sgl_value_2 = mulf_1_data[index].op_2; /* operands */
sgl_expected = mulf_1_data[index].exp;
asm("ldf _sgl_value_1");
asm("mulf _sgl_value_2");
asm("cvfl _index2");
asm("nop");
if( (index2 >= -99) && (index2 <= 99) ) {
if( index2 ) {
sgl_value_5 = 0; /* set a dummy index */
adr_pipe_ops[sgl_value_5] = 0;
} else {
sgl_value_5 = 6; /* set a dummy index */
adr_pipe_ops[sgl_value_5] = 0xabadbabe;
}
asm("movl _index2,r0"); /* save the index */
asm("stf _pipe_ops[r0]"); /* save the Acc's value */
asm("stf _sgl_value_4"); /* save this value */
/*
* This is the start of the LOOP ON ERROR section
*/
asm("_pipe9_1_lp:");
asm("movl _sgl_value_5,r0"); /* save the bum index */
asm("ldf _sgl_value_1");
asm("mulf _sgl_value_2");
asm("cvfl r0"); /* set up the index to use */
asm("subf _pipe_ops[r0]"); /* subtract saved value */
asm("stf _sgl_st_acc");
asm("movl r0,_sgl_value_6"); /* save the index used */
if( force_loop )
asm("brb _pipe9_1_lp");; /* loop on the error */
/*
* Verify the results
*/
if( sgl_st_acc ) { /* the Acc s/b cleared */
errcnt++; /* bump the error count */
if ( prt_error )
pipe9_print(); /* print the error mesage */
if ( halt_flg )
pipe9_halt( 1 ); /* halt on the error */
if ( loop_on_err ) {
force_loop = 1;
asm("jmp _pipe9_1_lp");;
}
}
}
};
asm("jmp *return"); /* return to the test monitor */
}
/***************************************************************************
*
* print an error message of the form
*
* cycle: xx Test xx, (Pipe 9), error
* test sequence = LDF(op1), MULF(op2), CVFL r0, SUBF operand[r0], STF
* op #1 = xxxxxxxx, final Acc = xxxxxxxx, data index = xxxxxxxx
* op #2 = xxxxxxxx, expected Acc = xxxxxxxx
* op #3 = xxxxxxxx, CVFL result = xxxxxxxx
* int expected = xxxxxxxx
***************************************************************************/
pipe9_print()
{
writes("\n"); /* start a new print line */
writes("cycle: ");
writed( cycle );
writes(" Test ");
writed( test_no );
writes(" (Pipe 9), error\n");
writes(" LDF(op1), MULF(op2), CVFL(r0), SUBF(op3), STF\n");
writes("operand 1 = ");
write32h( sgl_value_1 );
writes(", final Acc = ");
write32h( sgl_st_acc );
writes(", data index = ");
writed( index );
writec('\n');
writes("operand 2 = ");
write32h( sgl_value_2 );
writes(", expected Acc = ");
write32h( sgl_expected );
writec('\n');
writes("operand 3 = ");
write32h( sgl_value_4 );
writes(", CVFL result = ");
write32h( sgl_value_6 );
writec('\n');
writes(" int expected = ");
write32h( index2 );
writec('\n');
}
/*
**************************************************************************
*
* HALT ON AN ERROR
*
**************************************************************************
*/
pipe9_halt()
{
asm("movl _test_no,r0"); /* r0 = test number */
asm("movl $1,r1"); /* r1 = subtest number */
asm("movl $1,r2"); /* r2 = error code */
asm("movl _cycle,r3"); /* r3 = cycle count */
asm("movl _sgl_value_1,r4"); /* r4 = sgl operand #1 */
asm("movl _sgl_value_2,r5"); /* r5 = sgl operand #2 */
asm("movl _sgl_st_acc,r6"); /* r6 = sgl stored */
asm("movl _sgl_expected,r7"); /* r7 = sgl expected */
asm("movl _sgl_value_6,r8"); /* r8 = CVFL int actual */
asm("movl _index2,r9"); /* r9 = CVFL int expected */
asm("movl _index,r10"); /* r10 = data index */
asm("halt"); /* HALT ... */
}
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.