|
|
Power 6/32 Unix version 1.21
#include "fpp_defs.h"
/*****************************************************************************
*
* PIPELINE TEST #10
*
* LDF(op1), MULF(op2), STF op3, SUBF op3, STF
*
* -where the operands are the fmacro1 MULF data patterns. The SUBF operand
* is the stored result of the MULF.
* -If the 1st STF isn't completed before the SUBF data is fetched then we
* won't get a final accumulator of zero.
*****************************************************************************/
pipe_10()
{
asm(".globl _pipeline_10_t");
asm("_pipeline_10_t:");
if( (cycle == 1) && (prt_hdrs) ) /* print headers on 1st cycle */
writes(" PIPE_10");
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;
/*
* This is the start of the LOOP ON ERROR section
*/
asm("_pipe10_1_lp:");
asm("ldf _sgl_value_1"); /* get the 1st operand */
asm("mulf _sgl_value_2"); /* multiply by the 2nd op. */
asm("stf _sgl_value_3"); /* save the MULF result */
asm("subf _sgl_value_3"); /* and subtract it again */
asm("stf _sgl_st_acc"); /* save the final result */
if( force_loop )
asm("brb _pipe10_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 )
pipe10_print(); /* print the error mesage */
if ( halt_flg )
pipe10_halt( 1 ); /* halt on the error */
if ( loop_on_err ) {
force_loop = TRUE;
asm("jmp _pipe10_1_lp");;
}
}
}
asm("jmp *return"); /* return to the test monitor */
}
/*
**************************************************************************
*
* print an error message of the form
*
* cycle: xx Test xx, Error subtracting the stored data (op3), index = xx
* test sequence = LDF(op1), MULF(op2), STF(op3), SUBF(op3), STF
* operand 1 = xxxxxxxx, final Acc = xxxxxxxx, data index = dd
* operand 2 = xxxxxxxx, expected Acc = xxxxxxxx
* operand 3 = xxxxxxxx, expected op3 = xxxxxxxx
**************************************************************************/
pipe10_print()
{
writes(" \n"); /* start a new print line */
writes("cycle: ");
writed( cycle );
writes(" Test ");
writed( test_no );
writes(" (Pipe 10), error\n");
writes(" LDF(op1), MULF(op2), STF(op3), 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( 0 );
writec('\n');
writes("operand 3 = ");
write32h( sgl_value_3 );
writes(", expected op3 = ");
write32h( 0 );
writec('\n');
}
/*
**************************************************************************
*
* HALT ON AN ERROR
*
**************************************************************************
*/
pipe10_halt()
{
sgl_value_4 = 0;
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_value_3,r6"); /* r6 = sgl operand #3 */
asm("movl _sgl_st_acc,r7"); /* r7 = sgl stored */
asm("movl _sgl_expected,r8"); /* r8 = sgl expected */
asm("movl _sgl_value_4,r9"); /* r9 = op3 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.