|
|
Power 6/32 Unix version 1.21
#include "fpp_defs.h"
/*****************************************************************************
*
* PIPELINE TEST #19
*
* LDD(op1), MULD(op2), STD op3, SUBD op3, STD
*
* -where the operands are the fmacro1 MULD data patterns. The SUBD operand
* is the stored result of the MULD.
* -If the 1st STD isn't completed before the SUBD data is fetched then we
* won't get a final accumulator of zero.
*****************************************************************************/
pipe_19()
{
asm(".globl _pipeline_19_t");
asm("_pipeline_19_t:");
if( (cycle == 1) && (prt_hdrs) ) /* print headers on 1st cycle */
writes(" PIPE_19");
force_loop = FALSE; /* clear force_loop flag */
for( index = 0; index <= max_muld_1_index; index++ ) {
dbl_value_1 = muld_1_data[index].op_1; /* get the data */
dbl_value_2 = muld_1_data[index].op_2; /* operands */
dbl_expected = muld_1_data[index].exp;
/*
* This is the start of the LOOP ON ERROR section
*/
asm("_pipe19_1_lp:");
asm("ldd _dbl_value_1"); /* get the 1st operand */
asm("muld _dbl_value_2"); /* multiply by the 2nd op. */
asm("std _dbl_value_3"); /* save the MULD result */
asm("subd _dbl_value_3"); /* and subtract it again */
asm("std _dbl_st_acc"); /* save the final result */
if( force_loop )
asm("brb _pipe19_1_lp");; /* loop on the error */
/*
* Verify the results
*/
if( (dbl_st_acc.m) || (dbl_st_acc.l) ) { /* the Acc s/b = 0 */
errcnt++; /* bump the error count */
if ( prt_error )
pipe19_print(); /* print the error mesage */
if ( halt_flg )
pipe19_halt( 1 ); /* halt on the error */
if ( loop_on_err ) {
force_loop = TRUE;
asm("jmp _pipe19_1_lp");;
}
}
}
asm("jmp *return"); /* return to the test monitor */
}
/*
**************************************************************************
*
* print an error message of the form
*
* cycle: xx Test xx (Pipe 19), error
* test sequence = LDD(op1), MULD(op2), STD(op3), SUBD(op3), STD
* operand 1 = xxxxxxxx xxxxxxxx, final Acc = xxxxxxxx xxxxxxxx, index = xx
* operand 2 = xxxxxxxx xxxxxxxx, expected Acc = xxxxxxxx xxxxxxxx
* operand 3 = xxxxxxxx xxxxxxxx, expected op3 = xxxxxxxx xxxxxxxx
**************************************************************************
*/
pipe19_print()
{
writes(" \n"); /* start a new print line */
writes("cycle: ");
writed( cycle );
writes(" Test ");
writed( test_no );
writes(" (Pipe 19), error\n");
writes("LDD(op1), MULD(op2), STD(op3), SUBD(op3), STD\n");
writes("operand 1 = ");
write32h( dbl_value_1.m );
writec(' ');
write32h( dbl_value_1.l );
writes(", final Acc = ");
write32h( dbl_st_acc.m );
writec(' ');
write32h( dbl_st_acc.l );
writes(", index = ");
writed( index );
writes("\noperand 2 = ");
write32h( dbl_value_2.m );
writec(' ');
write32h( dbl_value_2.l );
writes(", expected Acc = ");
write32h( 0 );
writec(' ');
write32h( 0 );
writes("\noperand 3 = ");
write32h( dbl_value_3.m );
writec(' ');
write32h( dbl_value_3.l );
writes(", expected op3 = ");
write32h( dbl_expected.m );
writec(' ');
write32h( dbl_expected.l );
writec('\n');
}
/*
**************************************************************************
*
* HALT ON AN ERROR
*
**************************************************************************
*/
pipe19_halt()
{
sgl_value_1 = dbl_value_1.m;
sgl_value_2 = dbl_value_1.l;
sgl_value_3 = dbl_value_2.m;
sgl_value_4 = dbl_value_2.l;
sgl_value_5 = dbl_value_3.m;
sgl_value_6 = dbl_value_3.l;
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 = MS of operand #1 */
asm("movl _sgl_value_2,r5"); /* r5 = LS of operand #1 */
asm("movl _sgl_value_3,r6"); /* r6 = MS of operand #2 */
asm("movl _sgl_value_4,r7"); /* r7 = LS of operand #2 */
asm("movl _sgl_value_5,r8"); /* r8 = MS of operand #3 */
asm("movl _sgl_value_6,r9"); /* r9 = LS of operand #3 */
sgl_value_1 = dbl_st_acc.m;
sgl_value_2 = dbl_st_acc.l;
asm("movl _sgl_value_1,r10"); /* r10 = MS of final value */
asm("movl _sgl_value_2,r11"); /* r11 = LS of final value */
asm("clrl r12"); /* r12 = MS exp value (0) */
asm("clrl r13"); /* r13 = LS exp value (0) */
asm("movl _index,r14"); /* r14 = data index */
asm("halt"); /* HALT ... */
}
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.