|
|
Power 6/32 Unix version 1.21
#include "fpp_defs.h"
/*****************************************************************************
*
* PIPELINE TEST #11 MONITOR
*
* This test will do a series of 2, 3, 4, 5, and 6 NEGFs.
*
*****************************************************************************/
pipe_11()
{
asm(".globl _pipeline_11_t");
asm("_pipeline_11_t:"); /* entry address */
if( (cycle == 1) && (prt_hdrs) ) /* print headers on 1st cycle */
{
writes(" PIPE_11");
}
pipe11_1(); /* do 2 NEGFs */
pipe11_2(); /* do 3 NEGFs */
pipe11_3(); /* do 4 NEGFs */
pipe11_4(); /* do 5 NEGFs */
pipe11_5(); /* do 6 NEGFs */
asm("jmp *return"); /* return to the test monitor */
}
/************************************************************************
*
* SUBTEST 1 : 2 NEGFs
*
************************************************************************/
pipe11_1()
{
subtest = 1;
force_loop = FALSE;
for( index = 0; index < max_ldf_1_index; index++ )
{
sgl_value_1 = ldf_1_data[index].ld; /* get operand 1 */
sgl_expected = ldf_1_data[index].exp; /* get expected results */
/*
* If LOOP ON ERROR is set, this is the loop for this subtest.
* The force loop flag is set after the first error.
*/
asm("_pipe11_1_lp1:");
asm("ldf _sgl_value_1"); /* load the operand */
asm("negf"); /* negate it ( twice ) */
asm("negf");
asm("stf _sgl_st_acc"); /* store the result */
if( force_loop )
asm("brb _pipe11_1_lp1"); /* loop on an error */
/*
* verify the results
*/
if( sgl_st_acc != sgl_expected ) { /* COMPARE the values */
errcnt++; /* bump the error count */
if( prt_error )
pipe11_print( 2 ); /* print error msg -2 NEGFS*/
if( halt_flg ) /* halt on error? */
pipe11_halt( 2 ); /* error halt -2 NEGFS */
if( loop_on_err ) {
force_loop = TRUE; /* set the force loop flag */
asm("jmp _pipe11_1_lp1"); /* and loop */
}
}
} /* end of FOR loop */
} /* end of subtest 1 */
/************************************************************************
*
* SUBTEST 2 : 3 NEGFs
*
************************************************************************/
pipe11_2()
{
subtest = 2;
force_loop = FALSE;
for( index = 0; index < max_ldf_1_index; index++ )
{
sgl_value_1 = ldf_1_data[index].ld; /* get operand 1 */
sgl_expected = ldf_1_data[index].exp; /* get expected results */
if( sgl_expected )
sgl_expected ^= 0x80000000; /* negate exptd results */
/*
* If LOOP ON ERROR is set, this is the loop for this subtest.
* The force loop flag is set after the first error.
*/
asm("_pipe11_2_lp1:");
asm("ldf _sgl_value_1"); /* load the operand */
asm("negf"); /* negate it ( 3 times ) */
asm("negf");
asm("negf");
asm("stf _sgl_st_acc"); /* store the result */
if( force_loop )
asm("brb _pipe11_2_lp1"); /* loop on an error */
/*
* verify the results
*/
if( sgl_st_acc != sgl_expected ) { /* COMPARE the values */
errcnt++; /* bump the error count */
if( prt_error )
pipe11_print( 3 ); /* print error msg -3 NEGFS*/
if( halt_flg ) /* halt on error? */
pipe11_halt( 3 ); /* error halt -3 NEGFS */
if( loop_on_err ) {
force_loop = TRUE; /* set the force loop flag */
asm("jmp _pipe11_2_lp1"); /* and loop */
}
}
} /* end of FOR loop */
} /* end of subtest 2 */
/************************************************************************
*
* SUBTEST 3 : 4 NEGFs
*
************************************************************************/
pipe11_3()
{
subtest = 3;
force_loop = FALSE;
for( index = 0; index < max_ldf_1_index; index++ )
{
sgl_value_1 = ldf_1_data[index].ld; /* get operand 1 */
sgl_expected = ldf_1_data[index].exp; /* get expected results */
/*
* If LOOP ON ERROR is set, this is the loop for this subtest.
* The force loop flag is set after the first error.
*/
asm("_pipe11_3_lp1:");
asm("ldf _sgl_value_1"); /* load the operand */
asm("negf"); /* negate it ( 4 times ) */
asm("negf");
asm("negf");
asm("negf");
asm("stf _sgl_st_acc"); /* store the result */
if( force_loop )
asm("brb _pipe11_3_lp1"); /* loop on an error */
/*
* verify the results
*/
if( sgl_st_acc != sgl_expected ) { /* COMPARE the values */
errcnt++; /* bump the error count */
if( prt_error )
pipe11_print( 4 ); /* print error msg -4 NEGFS*/
if( halt_flg ) /* halt on error? */
pipe11_halt( 4 ); /* error halt -4 NEGFS */
if( loop_on_err ) {
force_loop = TRUE; /* set the force loop flag */
asm("jmp _pipe11_3_lp1"); /* and loop */
}
}
} /* end of FOR loop */
} /* end of subtest 3 */
/************************************************************************
*
* SUBTEST 4 : 5 NEGFs
*
************************************************************************/
pipe11_4()
{
subtest = 4;
force_loop = FALSE;
for( index = 0; index < max_ldf_1_index; index++ )
{
sgl_value_1 = ldf_1_data[index].ld; /* get operand 1 */
sgl_expected = ldf_1_data[index].exp; /* get expected results */
if( sgl_expected )
sgl_expected ^= 0x80000000; /* negate exptd results */
/*
* If LOOP ON ERROR is set, this is the loop for this subtest.
* The force loop flag is set after the first error.
*/
asm("_pipe11_4_lp1:");
asm("ldf _sgl_value_1"); /* load the operand */
asm("negf"); /* negate it ( 5 times ) */
asm("negf");
asm("negf");
asm("negf");
asm("negf");
asm("stf _sgl_st_acc"); /* store the result */
if( force_loop )
asm("brb _pipe11_4_lp1"); /* loop on an error */
/*
* verify the results
*/
if( sgl_st_acc != sgl_expected ) { /* COMPARE the values */
errcnt++; /* bump the error count */
if( prt_error )
pipe11_print( 5 ); /* print error msg -5 NEGFS*/
if( halt_flg ) /* halt on error? */
pipe11_halt( 5 ); /* error halt -5 NEGFS */
if( loop_on_err ) {
force_loop = TRUE; /* set the force loop flag */
asm("jmp _pipe11_4_lp1"); /* and loop */
}
}
} /* end of FOR loop */
} /* end of subtest 4 */
/************************************************************************
*
* SUBTEST 5 : 6 NEGFs
*
************************************************************************/
pipe11_5()
{
subtest = 5;
force_loop = FALSE;
for( index = 0; index < max_ldf_1_index; index++ )
{
sgl_value_1 = ldf_1_data[index].ld; /* get operand 1 */
sgl_expected = ldf_1_data[index].exp; /* get expected results */
/*
* If LOOP ON ERROR is set, this is the loop for this subtest.
* The force loop flag is set after the first error.
*/
asm("_pipe11_5_lp1:");
asm("ldf _sgl_value_1"); /* load the operand */
asm("negf"); /* negate it ( 6 times ) */
asm("negf");
asm("negf");
asm("negf");
asm("negf");
asm("negf");
asm("stf _sgl_st_acc"); /* store the result */
if( force_loop )
asm("brb _pipe11_5_lp1"); /* loop on an error */
/*
* verify the results
*/
if( sgl_st_acc != sgl_expected ) { /* COMPARE the values */
errcnt++; /* bump the error count */
if( prt_error )
pipe11_print( 6 ); /* print error msg -6 NEGFS*/
if( halt_flg ) /* halt on error? */
pipe11_halt( 6 ); /* error halt -6 NEGFS */
if( loop_on_err ) {
force_loop = TRUE; /* set the force loop flag */
asm("jmp _pipe11_5_lp1"); /* and loop */
}
}
} /* end of FOR loop */
} /* end of subtest 5 */
/****************************************************************************
*
* PRINT AN ERROR MESSAGE
*
* cycle dd PIPELINE 11, subtest dd error
* LDF op, {NEGF}, STF
* operand = xxxxxxxx, final Acc = xxxxxxxx, data index = xxxxxxxx
* expected Acc = xxxxxxxx
****************************************************************************/
pipe11_print( nop_count )
int nop_count; /* # of NEGF instructions */
{
writes(" \n"); /* start a new print line */
writes("cycle: ");
writed( cycle );
writes(" (Pipe 11), subtest ");
writed( subtest );
writes(" error\n");
writes(" LDF(op), NEGF");
while( --nop_count )
writes(", NEGF");
writes(", STF\n");
writec('\n');
writes("operand = ");
write32h( sgl_value_1 );
writes(", final Acc = ");
write32h( sgl_st_acc );
writes(", data index = ");
writed( index );
writec('\n');
writes(" expected Acc = ");
write32h( sgl_expected );
writec('\n');
}
/****************************************************************************
*
* SET UP THE REGISTERS AND HALT
*
****************************************************************************/
pipe11_halt( nop_count )
int nop_count; /* # of NEGF instructions */
{
sgl_dummy1 = nop_count;
asm("movl _test_no,r0"); /* r0 = test number */
asm("movl _subtest,r1"); /* r1 = subtest number */
asm("movl $1,r2"); /* r2 = error code */
asm("movl _cycle,r3"); /* r3 = cycle count */
asm("movl _sgl_dummy1,r4"); /* r4 = # of NEGFS */
asm("movl _sgl_value_1,r5"); /* r5 = sgl operand */
asm("movl _sgl_st_acc,r6"); /* r6 = sgl stored */
asm("movl _sgl_expected,r7"); /* r7 = sgl expected */
asm("movl _index,r8"); /* r8 = data index */
asm("halt"); /* HALT ... */
}
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.