|
|
Power 6/32 Unix version 1.21
#include "fpp_defs.h"
/*****************************************************************************
*
* MONITOR FOR PIPELINE TEST #7 (The Trans-Siberian Pipeline test)
*
* This test will do:
*
* LDF(x), SUBF(x), ADDF(0), SUBF(x), ADDF(x), SUBF(0),
* ADDF(x), SUBF(x), ADDF(0), SUBF(0), ADDF(x), STF
*
* where the x's are the fmacro1 LDF data patterns. This test is an attempt
* to fill the instruction Queue.
*****************************************************************************/
pipe_7()
{
asm(".globl _pipeline_7_t");
asm("_pipeline_7_t:"); /* entry address */
if( (cycle == 1) && (prt_hdrs) ) /* print headers on 1st cycle */
{
writes(" PIPE_7 ");
}
subtest = 1;
pipe7_1(); /* data in REGs, no NOPs */
subtest ++; /* increment subtest num */
pipe7_2(); /* data in REGs, 1 NOP */
subtest ++; /* increment subtest num */
pipe7_3(); /* data in REGs, 2 NOPs */
subtest ++; /* increment subtest num */
pipe7_4(); /* data in REGs, 3 NOPs */
subtest ++; /* increment subtest num */
pipe7_5(); /* data in CACHE, no NOPs */
subtest ++; /* increment subtest num */
pipe7_6(); /* data in CACHE, 1 NOP */
subtest ++; /* increment subtest num */
pipe7_7(); /* data in CACHE, 2 NOPs */
subtest ++; /* increment subtest num */
pipe7_8(); /* data in CACHE, 3 NOPs */
subtest ++; /* increment subtest num */
pipe7_9(); /* data on STACK, no NOPs */
subtest ++; /* increment subtest num */
pipe7_10(); /* data via FP no NOPs */
asm("jmp *return"); /* return to the test monitor */
}
/************************************************************************
*
* SUBTEST 1
* data in registers, no NO-OPs
*
************************************************************************/
pipe7_1()
{
force_loop = FALSE; /* clear the force_loop flg */
index = 0;
do
{
sgl_value_1 = ldf_1_data[index].ld; /* get operand 1 */
sgl_expected = ldf_1_data[index].exp; /* get expected results */
sgl_value_2 = 0; /* set one operand to 0 */
/*
* If LOOP ON ERROR is set, this is the loop for this subtest.
* The force loop flag is set after the first error.
*/
asm("_pipe7_1_lp1:");
asm("movl _sgl_value_1,r4"); /* move the data to r4 */
asm("movl _sgl_value_2,r3"); /* move the '0' to r3 */
asm("ldf r4"); /* load the ACC (ACC = op) */
asm("subf r4"); /* sub. the op. (ACC = 0 ) */
asm("addf r3"); /* add a '0' (ACC = 0 ) */
asm("subf r4"); /* sub. the op. (ACC =-op) */
asm("addf r4"); /* add the op. (ACC = 0 ) */
asm("subf r3"); /* sub. a '0' (ACC = 0 ) */
asm("addf r4"); /* add the op. (ACC = op) */
asm("subf r4"); /* sub. the op. (ACC = 0 ) */
asm("addf r3"); /* add a '0' (ACC = 0 ) */
asm("subf r3"); /* sub. a '0' (ACC = 0 ) */
asm("addf r4"); /* add the op. (ACC = op) */
asm("stf r5"); /* store the ACC (s/b= op) */
if( force_loop )
asm("brb _pipe7_1_lp1");; /* loop on the error */
/*
* verify the results
*/
asm("movl r5,_sgl_st_acc"); /* get the result */
if( sgl_st_acc != sgl_expected ) /* COMPARE the values */
{
errcnt++; /* bump the error count */
if ( prt_error )
print_pipe7_er("Reg. Data, no NO-OPs");
if ( halt_flg )
pipe7_er_hlt( subtest );
if ( loop_on_err ) {
force_loop = TRUE; /* set the force loop flag */
asm("jmp _pipe7_1_lp1"); /* and loop */
}
} /* end of compare error */
} while( index++ < max_ldf_1_index );
} /* end of subtest 1 */
/************************************************************************
*
* SUBTEST 2
* data in registers, 1 NO-OP
*
************************************************************************/
pipe7_2()
{
force_loop = FALSE; /* clear force_loop flag */
index = 0;
do
{
sgl_value_1 = ldf_1_data[index].ld; /* get operand 1 */
sgl_expected = ldf_1_data[index].exp; /* get expected results */
sgl_value_2 = 0; /* get the '0' operand */
/*
* If LOOP ON ERROR is set, this is the loop for this subtest.
* The force loop flag is set after the first error.
*/
asm("_pipe7_2_lp1:");
asm("movl _sgl_value_1,r4"); /* move the data to r4 */
asm("movl _sgl_value_2,r3"); /* move the '0' to r3 */
asm("ldf r4"); /* load the ACC (ACC = op) */
asm("nop");
asm("subf r4"); /* sub. the op. (ACC = 0 ) */
asm("nop");
asm("addf r3"); /* add a '0' (ACC = 0 ) */
asm("nop");
asm("subf r4"); /* sub. the op. (ACC =-op) */
asm("nop");
asm("addf r4"); /* add the op. (ACC = 0 ) */
asm("nop");
asm("subf r3"); /* sub. a '0' (ACC = 0 ) */
asm("nop");
asm("addf r4"); /* add the op. (ACC = op) */
asm("nop");
asm("subf r4"); /* sub. the op. (ACC = 0 ) */
asm("nop");
asm("addf r3"); /* add a '0' (ACC = 0 ) */
asm("nop");
asm("subf r3"); /* sub. a '0' (ACC = 0 ) */
asm("nop");
asm("addf r4"); /* add the op. (ACC = op) */
asm("nop");
asm("stf r5"); /* store the ACC (s/b= op) */
if( force_loop )
asm("brb _pipe7_2_lp1");; /* loop on the error */
/*
* verify the results
*/
asm("movl r5,_sgl_st_acc"); /* get the result */
if( sgl_st_acc != sgl_expected ) /* COMPARE the values */
{
errcnt++; /* bump the error count */
if ( prt_error )
print_pipe7_er("Reg. Data, 1 NO-OP");
if ( halt_flg )
pipe7_er_hlt( subtest );
if ( loop_on_err ) {
force_loop = TRUE; /* set the force loop flag */
asm("jmp _pipe7_2_lp1"); /* and loop */
}
} /* end of compare error */
} while( index++ < max_ldf_1_index );
} /* end of subtest 2 */
/************************************************************************
*
* SUBTEST 3
* data in registers, 2 NO-OPs
*
************************************************************************/
pipe7_3()
{
force_loop = FALSE; /* clear force_loop flag */
index = 0;
do
{
sgl_value_1 = ldf_1_data[index].ld; /* get operand 1 */
sgl_expected = ldf_1_data[index].exp; /* get expected results */
sgl_value_2 = 0; /* set the '0' operand */
/*
* If LOOP ON ERROR is set, this is the loop for this subtest.
* The force loop flag is set after the first error.
*/
asm("_pipe7_3_lp1:");
asm("movl _sgl_value_1,r4"); /* move the data to r4 */
asm("movl _sgl_value_2,r3"); /* move the '0' to r3 */
asm("ldf r4"); /* load the ACC (ACC = op) */
asm("nop");
asm("nop");
asm("subf r4"); /* sub. the op. (ACC = 0 ) */
asm("nop");
asm("nop");
asm("addf r3"); /* add a '0' (ACC = 0 ) */
asm("nop");
asm("nop");
asm("subf r4"); /* sub. the op. (ACC =-op) */
asm("nop");
asm("nop");
asm("addf r4"); /* add the op. (ACC = 0 ) */
asm("nop");
asm("nop");
asm("subf r3"); /* sub. a '0' (ACC = 0 ) */
asm("nop");
asm("nop");
asm("addf r4"); /* add the op. (ACC = op) */
asm("nop");
asm("nop");
asm("subf r4"); /* sub. the op. (ACC = 0 ) */
asm("nop");
asm("nop");
asm("addf r3"); /* add a '0' (ACC = 0 ) */
asm("nop");
asm("nop");
asm("subf r3"); /* sub. a '0' (ACC = 0 ) */
asm("nop");
asm("nop");
asm("addf r4"); /* add the op. (ACC = op) */
asm("nop");
asm("nop");
asm("stf r5"); /* store the ACC (s/b= op) */
if( force_loop )
asm("brb _pipe7_3_lp1");; /* loop on the error */
/*
* verify the results
*/
asm("movl r5,_sgl_st_acc"); /* get the result */
if( sgl_st_acc != sgl_expected ) /* COMPARE the values */
{
errcnt++; /* bump the error count */
if ( prt_error )
print_pipe7_er("Reg. Data, 2 NO-OPs");
if ( halt_flg )
pipe7_er_hlt( subtest );
if ( loop_on_err ) {
force_loop = TRUE; /* set the force loop flag */
asm("jmp _pipe7_3_lp1"); /* and loop */
}
} /* end of compare error */
} while( index++ < max_ldf_1_index );
} /* end of subtest 3 */
/************************************************************************
*
* SUBTEST 4
* data in registers, 3 NO-OPs
*
************************************************************************/
pipe7_4()
{
force_loop = FALSE; /* clear force_loop flag */
index = 0;
do
{
sgl_value_1 = ldf_1_data[index].ld; /* get operand 1 */
sgl_expected = ldf_1_data[index].exp; /* get expected results */
sgl_value_2 = 0; /* set the '0' operand */
/*
* If LOOP ON ERROR is set, this is the loop for this subtest.
* The force loop flag is set after the first error.
*/
asm("_pipe7_4_lp1:");
asm("movl _sgl_value_1,r4"); /* move the data to r4 */
asm("movl _sgl_value_2,r3"); /* move the '0' to r3 */
asm("ldf r4"); /* load the ACC (ACC = op) */
asm("nop");
asm("nop");
asm("nop");
asm("subf r4"); /* sub. the op. (ACC = 0 ) */
asm("nop");
asm("nop");
asm("nop");
asm("addf r3"); /* add a '0' (ACC = 0 ) */
asm("nop");
asm("nop");
asm("nop");
asm("subf r4"); /* sub. the op. (ACC =-op) */
asm("nop");
asm("nop");
asm("nop");
asm("addf r4"); /* add the op. (ACC = 0 ) */
asm("nop");
asm("nop");
asm("nop");
asm("subf r3"); /* sub. a '0' (ACC = 0 ) */
asm("nop");
asm("nop");
asm("nop");
asm("addf r4"); /* add the op. (ACC = op) */
asm("nop");
asm("nop");
asm("nop");
asm("subf r4"); /* sub. the op. (ACC = 0 ) */
asm("nop");
asm("nop");
asm("nop");
asm("addf r3"); /* add a '0' (ACC = 0 ) */
asm("nop");
asm("nop");
asm("nop");
asm("subf r3"); /* sub. a '0' (ACC = 0 ) */
asm("nop");
asm("nop");
asm("nop");
asm("addf r4"); /* add the op. (ACC = op) */
asm("nop");
asm("nop");
asm("nop");
asm("stf r5"); /* store the ACC (s/b= op) */
if( force_loop )
asm("brb _pipe7_4_lp1");; /* loop on the error */
/*
* verify the results
*/
asm("movl r5,_sgl_st_acc"); /* get the result */
if( sgl_st_acc != sgl_expected ) /* COMPARE the values */
{
errcnt++; /* bump the error count */
if ( prt_error )
print_pipe7_er("Reg. Data, 3 NO-OPs");
if ( halt_flg )
pipe7_er_hlt( subtest );
if ( loop_on_err ) {
force_loop = TRUE; /* set the force loop flag */
asm("jmp _pipe7_4_lp1"); /* and loop */
}
} /* end of compare error */
} while( index++ < max_ldf_1_index );
} /* end of subtest 4 */
/************************************************************************
*
* SUBTEST 5
* data in Cache, no NO-OPs
*
************************************************************************/
pipe7_5()
{
force_loop = FALSE; /* clear force_loop flag */
index = 0;
do
{
sgl_value_1 = ldf_1_data[index].ld; /* get operand 1 */
sgl_expected = ldf_1_data[index].exp; /* get expected results */
sgl_value_2 = 0; /* set the '0' operand */
/*
* If LOOP ON ERROR is set, this is the loop for this subtest.
* The force loop flag is set after the first error.
*/
asm("_pipe7_5_lp1:");
asm("ldf _sgl_value_1"); /* load the ACC (ACC = op) */
asm("subf _sgl_value_1"); /* sub. the op. (ACC = 0 ) */
asm("addf _sgl_value_2"); /* add a '0' (ACC = 0 ) */
asm("subf _sgl_value_1"); /* sub. the op. (ACC =-op) */
asm("addf _sgl_value_1"); /* add the op. (ACC = 0 ) */
asm("subf _sgl_value_2"); /* sub. a '0' (ACC = 0 ) */
asm("addf _sgl_value_1"); /* add the op. (ACC = op) */
asm("subf _sgl_value_1"); /* sub. the op. (ACC = 0 ) */
asm("addf _sgl_value_2"); /* add a '0' (ACC = 0 ) */
asm("subf _sgl_value_2"); /* sub. a '0' (ACC = 0 ) */
asm("addf _sgl_value_1"); /* add the op. (ACC = op) */
asm("stf _sgl_st_acc"); /* store the ACC (s/b= op) */
if( force_loop )
asm("brb _pipe7_5_lp1");; /* loop on the error */
/*
* verify the results
*/
if( sgl_st_acc != sgl_expected ) /* COMPARE the values */
{
errcnt++; /* bump the error count */
if ( prt_error )
print_pipe7_er("Cache Data, no NO-OPs");
if ( halt_flg )
pipe7_er_hlt( subtest );
if ( loop_on_err ) {
force_loop = TRUE; /* set the force loop flag */
asm("jmp _pipe7_5_lp1"); /* and loop */
}
} /* end of compare error */
} while( index++ < max_ldf_1_index );
} /* end of subtest 5 */
/************************************************************************
*
* SUBTEST 6
* data in Cache, 1 NO-OP
*
************************************************************************/
pipe7_6()
{
force_loop = FALSE; /* clear force_loop flag */
index = 0;
do
{
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("_pipe7_6_lp1:");
asm("ldf _sgl_value_1"); /* load the ACC (ACC = op) */
asm("nop");
asm("subf _sgl_value_1"); /* sub. the op. (ACC = 0 ) */
asm("nop");
asm("addf _sgl_value_2"); /* add a '0' (ACC = 0 ) */
asm("nop");
asm("subf _sgl_value_1"); /* sub. the op. (ACC =-op) */
asm("nop");
asm("addf _sgl_value_1"); /* add the op. (ACC = 0 ) */
asm("nop");
asm("subf _sgl_value_2"); /* sub. a '0' (ACC = 0 ) */
asm("nop");
asm("addf _sgl_value_1"); /* add the op. (ACC = op) */
asm("nop");
asm("subf _sgl_value_1"); /* sub. the op. (ACC = 0 ) */
asm("nop");
asm("addf _sgl_value_2"); /* add a '0' (ACC = 0 ) */
asm("nop");
asm("subf _sgl_value_2"); /* sub. a '0' (ACC = 0 ) */
asm("nop");
asm("addf _sgl_value_1"); /* add the op. (ACC = op) */
asm("nop");
asm("stf _sgl_st_acc"); /* store the ACC (s/b= op) */
if( force_loop )
asm("brb _pipe7_6_lp1");; /* loop on the error */
/*
* verify the results
*/
if( sgl_st_acc != sgl_expected ) /* COMPARE the values */
{
errcnt++; /* bump the error count */
if ( prt_error )
print_pipe7_er("Cache Data, 1 NO-OP");
if ( halt_flg )
pipe7_er_hlt( subtest );
if ( loop_on_err ) {
force_loop = TRUE; /* set the force loop flag */
asm("jmp _pipe7_6_lp1"); /* and loop */
}
} /* end of compare error */
} while( index++ < max_ldf_1_index );
} /* end of subtest 6 */
/************************************************************************
*
* SUBTEST 7
* data in Cache, 2 NO-OPs
*
************************************************************************/
pipe7_7()
{
force_loop = FALSE; /* clear force_loop flag */
index = 0;
do
{
sgl_value_1 = ldf_1_data[index].ld; /* get operand 1 */
sgl_expected = ldf_1_data[index].exp; /* get expected results */
sgl_value_2 = 0; /* set the '0' operand */
/*
* If LOOP ON ERROR is set, this is the loop for this subtest.
* The force loop flag is set after the first error.
*/
asm("_pipe7_7_lp1:");
asm("ldf _sgl_value_1"); /* load the ACC (ACC = op) */
asm("nop");
asm("nop");
asm("subf _sgl_value_1"); /* sub. the op. (ACC = 0 ) */
asm("nop");
asm("nop");
asm("addf _sgl_value_2"); /* add a '0' (ACC = 0 ) */
asm("nop");
asm("nop");
asm("subf _sgl_value_1"); /* sub. the op. (ACC =-op) */
asm("nop");
asm("nop");
asm("addf _sgl_value_1"); /* add the op. (ACC = 0 ) */
asm("nop");
asm("nop");
asm("subf _sgl_value_2"); /* sub. a '0' (ACC = 0 ) */
asm("nop");
asm("nop");
asm("addf _sgl_value_1"); /* add the op. (ACC = op) */
asm("nop");
asm("nop");
asm("subf _sgl_value_1"); /* sub. the op. (ACC = 0 ) */
asm("nop");
asm("nop");
asm("addf _sgl_value_2"); /* add a '0' (ACC = 0 ) */
asm("nop");
asm("nop");
asm("subf _sgl_value_2"); /* sub. a '0' (ACC = 0 ) */
asm("nop");
asm("nop");
asm("addf _sgl_value_1"); /* add the op. (ACC = op) */
asm("nop");
asm("nop");
asm("stf _sgl_st_acc"); /* store the ACC (s/b= op) */
if( force_loop )
asm("brb _pipe7_7_lp1");; /* loop on the error */
/*
* verify the results
*/
if( sgl_st_acc != sgl_expected ) /* COMPARE the values */
{
errcnt++; /* bump the error count */
if ( prt_error )
print_pipe7_er("Cache Data, 2 NO-OPs");
if ( halt_flg )
pipe7_er_hlt( subtest );
if ( loop_on_err ) {
force_loop = TRUE; /* set the force loop flag */
asm("jmp _pipe7_7_lp1"); /* and loop */
}
} /* end of compare error */
} while( index++ < max_ldf_1_index );
} /* end of subtest 7 */
/************************************************************************
*
* SUBTEST 8
* data in Cache, 3 NO-OPs
*
************************************************************************/
pipe7_8()
{
force_loop = FALSE; /* clear force_loop flag */
index = 0;
do
{
sgl_value_1 = ldf_1_data[index].ld; /* get operand 1 */
sgl_expected = ldf_1_data[index].exp; /* get expected results */
sgl_value_2 = 0; /* set the '0' operand */
/*
* If LOOP ON ERROR is set, this is the loop for this subtest.
* The force loop flag is set after the first error.
*/
asm("_pipe7_8_lp1:");
asm("ldf _sgl_value_1"); /* load the ACC (ACC = op) */
asm("nop");
asm("nop");
asm("nop");
asm("subf _sgl_value_1"); /* sub. the op. (ACC = 0 ) */
asm("nop");
asm("nop");
asm("nop");
asm("addf _sgl_value_2"); /* add a '0' (ACC = 0 ) */
asm("nop");
asm("nop");
asm("nop");
asm("subf _sgl_value_1"); /* sub. the op. (ACC =-op) */
asm("nop");
asm("nop");
asm("nop");
asm("addf _sgl_value_1"); /* add the op. (ACC = 0 ) */
asm("nop");
asm("nop");
asm("nop");
asm("subf _sgl_value_2"); /* sub. a '0' (ACC = 0 ) */
asm("nop");
asm("nop");
asm("nop");
asm("addf _sgl_value_1"); /* add the op. (ACC = op) */
asm("nop");
asm("nop");
asm("nop");
asm("subf _sgl_value_1"); /* sub. the op. (ACC = 0 ) */
asm("nop");
asm("nop");
asm("nop");
asm("addf _sgl_value_2"); /* add a '0' (ACC = 0 ) */
asm("nop");
asm("nop");
asm("nop");
asm("subf _sgl_value_2"); /* sub. a '0' (ACC = 0 ) */
asm("nop");
asm("nop");
asm("nop");
asm("addf _sgl_value_1"); /* add the op. (ACC = op) */
asm("nop");
asm("nop");
asm("nop");
asm("stf _sgl_st_acc"); /* store the ACC (s/b= op) */
if( force_loop )
asm("brb _pipe7_8_lp1");; /* loop on the error */
/*
* verify the results
*/
if( sgl_st_acc != sgl_expected ) /* COMPARE the values */
{
errcnt++; /* bump the error count */
if ( prt_error )
print_pipe7_er("Cache Data, 3 NO-OPs");
if ( halt_flg )
pipe7_er_hlt( subtest );
if ( loop_on_err ) {
force_loop = TRUE; /* set the force loop flag */
asm("jmp _pipe7_8_lp1"); /* and loop */
}
} /* end of compare error */
} while( index++ < max_ldf_1_index );
} /* end of subtest 8 */
/*****************************************************************************
*
* SUBTEST 9
* data on the stack, no NO-OPs
*
*****************************************************************************/
pipe7_9()
{
asm("moval (r13),_pre_event_fp"); /* save the frame pointer */
asm("moval (r14),_pre_event_sp"); /* save the stack pointer */
force_loop = FALSE; /* clear force_loop flag */
index = 0;
do
{
sgl_value_1 = ldf_1_data[index].ld; /* get operand 1 */
sgl_expected = ldf_1_data[index].exp; /* get expected results */
sgl_value_4 = 0; /* set the '0' operand */
asm("moval _pointer_data,_sgl_value_2");/* init / final SP value */
/*
* If LOOP ON ERROR is set, this is the loop for this subtest.
* The force loop flag is set after the first error.
*/
asm("_pipe7_9_lp1:");
asm("moval _pointer_data,r14"); /* set the stack pointer */
asm("movl _sgl_value_1,-(r14)"); /* push operand to add */
asm("movl _sgl_value_4,-(r14)"); /* '0' to subtract */
asm("movl _sgl_value_4,-(r14)"); /* '0' to add */
asm("movl _sgl_value_1,-(r14)"); /* op. to subtract */
asm("movl _sgl_value_1,-(r14)"); /* op. to add */
asm("movl _sgl_value_4,-(r14)"); /* '0' to subtract */
asm("movl _sgl_value_1,-(r14)"); /* op. to add */
asm("movl _sgl_value_1,-(r14)"); /* op. to subtract */
asm("movl _sgl_value_4,-(r14)"); /* '0' to add */
asm("movl _sgl_value_1,-(r14)"); /* op. to subtract */
asm("movl _sgl_value_1,-(r14)"); /* op. to load */
/*
* now pop the data off the stack
*/
asm("ldf (r14)+"); /* pop the data & load it */
asm("subf (r14)+"); /* sub. the op. (ACC = 0 ) */
asm("addf (r14)+"); /* add a '0' (ACC = 0 ) */
asm("subf (r14)+"); /* sub. the op. (ACC =-op) */
asm("addf (r14)+"); /* add the op. (ACC = 0 ) */
asm("subf (r14)+"); /* sub. a '0' (ACC = 0 ) */
asm("addf (r14)+"); /* add the op. (ACC = op) */
asm("subf (r14)+"); /* sub. the op. (ACC = 0 ) */
asm("addf (r14)+"); /* add a '0' (ACC = 0 ) */
asm("subf (r14)+"); /* sub. a '0' (ACC = 0 ) */
asm("addf (r14)+"); /* add the op. (ACC = op) */
asm("stf r5"); /* store the ACC (s/b= op) */
if( force_loop )
asm("brb _pipe7_9_lp1");; /* loop on the error */
/*
* verify the results
*/
asm("movl r5,_sgl_st_acc"); /* get the result */
asm("moval (r14),_sgl_value_3"); /* save the stack pointer */
if( (sgl_st_acc != sgl_expected) || /* verify the result... */
(sgl_value_3 != sgl_value_2) ) /* ... and the final SP */
{
asm("movl _pre_event_fp,r13"); /* restore frame pointer */
asm("movl _pre_event_sp,r14"); /* restore stack pointer */
errcnt++; /* bump the error count */
if ( prt_error ) {
print_pipe7_er("POP data from the STACK");
writes("final Stack Pointer = ");
write32h( sgl_value_5 );
writes(", expected SP = ");
write32h( sgl_value_4 );
writes("\n");
}
if ( halt_flg ) /* halt on error? */
pipe7_er_hlt( subtest );
if ( loop_on_err ) {
force_loop = TRUE; /* set the force loop flag */
asm("jmp _pipe7_9_lp1"); /* and loop */
}
} /* end of compare error */
} while( index++ < max_ldf_1_index );
asm("movl _pre_event_fp,r13"); /* restore the frame pointer */
asm("movl _pre_event_sp,r14"); /* restore the stack pointer */
} /* end of subtest 9 */
/******************************************************************************
*
* SUBTEST 10
* load 0, add operand 4 times -get data via indexed FRAME pointer
*
* ADDR INDEX DATA
* pointer_data 4 <the STF result goes here>
* pointer_data-4 3 <operand data>
* pointer_data-8 2 <'0' data>
* pointer_data-16 0 point the frame pointer here
*
******************************************************************************/
pipe7_10()
{
asm("moval (r13),_pre_event_fp"); /* save the frame pointer */
asm("moval (r14),_pre_event_sp"); /* save the stack pointer */
force_loop = FALSE; /* clear force_loop flag */
index = 0;
do
{
sgl_value_1 = ldf_1_data[index].ld; /* get operand 1 */
sgl_expected = ldf_1_data[index].exp; /* get expected results */
sgl_value_4 = 0; /* set the '0' operand */
asm("moval _pointer_data,_sgl_value_2");/* init / final SP value */
/*
* If LOOP ON ERROR is set, this is the loop for this subtest.
* The force loop flag is set after the first error.
*/
asm("_pipe7_10_lp1:");
asm("moval _pointer_data,_sgl_value_2");/* get store data's addr */
sgl_value_2 -= 4; /* decrement it by 4 (bytes)*/
asm("movl _sgl_value_1,*_sgl_value_2");/* set the operand data */
sgl_value_2 -= 4; /* decrement it by 4 (bytes)*/
asm("movl _sgl_value_4,*_sgl_value_2");/* set the '0' data */
sgl_value_2 -= 8; /* get the FP addr to use */
asm("movl _sgl_value_2,r13"); /* set the FRAME POINTER */
asm("movl $2,r2"); /* r2 index = 2 longwords */
asm("movl $3,r5"); /* r5 index = 3 longwords */
asm("movl $4,r6"); /* r6 index = 4 longwords */
asm("ldf (r13)[r5]"); /* load the operand via SP */
asm("subf (r13)[r5]"); /* sub. the op. (ACC = 0 ) */
asm("addf (r13)[r2]"); /* add a '0' (ACC = 0 ) */
asm("subf (r13)[r5]"); /* sub. the op. (ACC =-op) */
asm("addf (r13)[r5]"); /* add the op. (ACC = 0 ) */
asm("subf (r13)[r2]"); /* sub. a '0' (ACC = 0 ) */
asm("addf (r13)[r5]"); /* add the op. (ACC = op) */
asm("subf (r13)[r5]"); /* sub. the op. (ACC = 0 ) */
asm("addf (r13)[r2]"); /* add a '0' (ACC = 0 ) */
asm("subf (r13)[r2]"); /* sub. a '0' (ACC = 0 ) */
asm("addf (r13)[r5]"); /* add the op. (ACC = op) */
asm("stf (r13)[r6]"); /* store -indexed by r6 */
if( force_loop )
asm("brb _pipe7_10_lp1");; /* loop on the error */
/*
* verify the results
*/
sgl_st_acc = pointer_data; /* move the stored result */
asm("moval (r13),_sgl_value_3"); /* save the frame pointer */
if( (sgl_st_acc != sgl_expected) || /* verify the result... */
(sgl_value_3 != sgl_value_2) ) /* ... and the final FP */
{
asm("movl _pre_event_fp,r13"); /* restore frame pointer */
asm("movl _pre_event_sp,r14"); /* restore stack pointer */
errcnt++; /* bump the error count */
if ( prt_error ) {
print_pipe7_er("indexed FP addressing");
writes("final Frame Pointer = ");
writeh( sgl_value_5 );
writes(", expected FP = ");
writeh( sgl_value_4 );
writes("\n");
}
if ( halt_flg ) /* halt on error? */
pipe7_er_hlt( subtest );
if ( loop_on_err ) {
force_loop = TRUE; /* set the force loop flag */
asm("jmp _pipe7_10_lp1"); /* and loop */
}
} /* end of compare error */
} while( index++ < max_ldf_1_index );
asm("movl _pre_event_fp,r13"); /* restore the frame pointer */
asm("movl _pre_event_sp,r14"); /* restore the stack pointer */
} /* end of subtest 10 */
/******************************************************************************
*
* ERROR ROUTINE
*
* print an error in the following form
*
* operand = xxxxxxxx, final Acc = xxxxxxxx, data index = dd
* expected Acc = xxxxxxxx
*
******************************************************************************/
print_pipe7_er(msg)
char *msg;
{
writes("\n"); /* start a new print line */
writes("cycle: ");
writed( cycle );
writes(" test ");
writed( test_no );
writes(" (Pipe 7), subtest ");
writed( subtest );
writes(" error - ");
writes( msg );
writec('\n');
writes(
"LDF(op), SUBF(op), ADDF(0.0), SUBF(op), ADDF(op), SUBF(0.0),\n");
writes(
" ADDF(op), SUBF(op), ADDF(0.0), SUBF(0.0), ADDF(op), STF\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');
}
/******************************************************************************
*
* HALT ON ERROR ROUTINE
*
* halt with the necessary information saved in the registers
*
******************************************************************************/
pipe7_er_hlt( subtest )
int subtest;
{
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_value_1,r4"); /* r4 = sgl operand */
asm("movl _sgl_st_acc,r5"); /* r5 = sgl stored */
asm("movl _sgl_expected,r6"); /* r6 = sgl expected */
asm("movl _index,r7"); /* r7 = data index */
asm("movl _sgl_value_2,r8"); /* r8 = floating zero */
if( subtest == 9 ) {
asm("movl _sgl_value_3,r9"); /* r9 = final SP value */
asm("movl _sgl_value_2,r10"); /* r10 = expected SP value */
} else
if( subtest == 10 ) {
asm("movl _sgl_value_3,r9"); /* r9 = final FP value */
asm("movl _sgl_value_2,r10"); /* r10 = expected FP value */
};
asm(".globl _pipe7_1_hlt");
asm("_pipe7_1_hlt:"); /* PC after the halt */
asm("halt"); /* HALT ... */
} /* end of halt on error */
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.