File:  [Power 6/32 Unix Tahoe 4.2BSD] / cci / d / macro4 / pipe2.c
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs
Sun Jul 28 12:30:56 2019 UTC (6 years, 11 months ago) by root
Branches: bsd, MAIN
CVS tags: v121, HEAD
Power 6/32 Unix version 1.21



#include "fpp_defs.h"


/*****************************************************************************
*
*			PIPELINE TEST #2 MONITOR
*
*  This test will do:
*
*	LNF(x), MULF(1), MULF(1), ADDF(0), MULF(1), STF
*
*  where x is the fmacro1 LNF data.
*****************************************************************************/
pipe_2()
{
	asm(".globl _pipeline_2_t");
	asm("_pipeline_2_t:");			/* entry address            */
	if( (cycle == 1) && (prt_hdrs) )	/* print headers on 1st cycle */
	{
	   writes(" PIPE_2 ");
	}
	subtest = 1;
	pipe2_1();				/* data in REGs,  no NOPs */
	subtest++;				/* increment the subtest  */
	pipe2_2();				/* data in REGs,   1 NOP  */
	subtest++;				/* increment the subtest  */
	pipe2_3();				/* data in REGs,   2 NOPs */
	subtest++;				/* increment the subtest  */
	pipe2_4();				/* data in REGs,   3 NOPs */
	subtest++;				/* increment the subtest  */
	pipe2_5();				/* data in CACHE, no NOPs */
	subtest++;				/* increment the subtest  */
	pipe2_6();				/* data in CACHE,  1 NOP  */
	subtest++;				/* increment the subtest  */
	pipe2_7();				/* data in CACHE,  2 NOPs */
	subtest++;				/* increment the subtest  */
	pipe2_8();				/* data in CACHE,  3 NOPs */
	subtest++;				/* increment the subtest  */
	pipe2_9();				/* data on STACK, no NOPs */
	subtest++;				/* increment the subtest  */
	pipe2_10();				/* data via FP  no NOPs */
	asm("jmp *return");			/* return to the test monitor */
}






/************************************************************************
*
*			SUBTEST 1  
*		data in registers, no NO-OPs
*
************************************************************************/
pipe2_1() 
{
	force_loop = FALSE;			/* clear force_loop flag */
	index = 0;
	do 
	{
	   sgl_value_1  = lnf_1_data[index].ld;   /* get operand 1        */
	   sgl_expected = lnf_1_data[index].exp;  /* get expected results */
	   sgl_value_2  = 0x40800000;		  /* floating '1'         */
	   sgl_value_3  = 0;		   	  /* floating '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("_pipe2_1_lp1:");
	   asm("movl _sgl_value_1,r4");		/* move the data to r4     */
	   asm("movl _sgl_value_2,r5");		/* move data to r5         */
	   asm("movl _sgl_value_3,r6");		/* move data to r6         */
	   asm("lnf r4");			/* load (negate) the data  */
	   asm("mulf r5");			/* multipy by '1' (twice)  */
	   asm("mulf r5");
	   asm("addf r6");			/* add a '0'               */
	   asm("mulf r5");			/* multipy by '1' again    */
	   asm("stf r7");			/* store the result        */
	   if( force_loop );
	      asm("brb _pipe2_1_lp1");;		/* loop on the error       */
/* 
 * verify the results
*/
	   asm("movl r7,_sgl_st_acc");		/* get the result          */
	   if( sgl_st_acc != sgl_expected )   	/* COMPARE the values      */
	   {
	      errcnt++;				/* bump the error count    */
	      if ( prt_error ) 
	         print_pipe2_er("Reg. Data, no NO-OPS");
	      if ( halt_flg ) 			/* halt on error?          */
	         pipe2_er_hlt( subtest );
	      if ( loop_on_err ) {
		 force_loop = TRUE;		/* set the force loop flag */
		 asm("brw _pipe2_1_lp1");	/* and loop                */
	      }
	   }   /* end of compare error */
	} while( index++ < max_lnf_1_index );
}  /* end of subtest 1 */






/************************************************************************
*
*			SUBTEST 2  
*	 	data in registers, 1 NO-OP
*
************************************************************************/
pipe2_2() 
{
	force_loop = FALSE;			/* clear force_loop flag */
	index = 0;
	do 
	{
	   sgl_value_1  = lnf_1_data[index].ld;   /* get operand 1        */
	   sgl_expected = lnf_1_data[index].exp;  /* get expected results */
	   sgl_value_2  = 0x40800000;		   /* floating '1'         */
	   sgl_value_3  = 0;		   	   /* floating '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("_pipe2_2_lp1:");
	   asm("movl _sgl_value_1,r4");		/* move the data to r4     */
	   asm("movl _sgl_value_2,r5");		/* move data to r5         */
	   asm("movl _sgl_value_3,r6");		/* move data to r6         */
	   asm("lnf r4");			/* load (negate) the data  */
	   asm("nop");
	   asm("mulf r5");			/* multipy by '1' (twice)  */
	   asm("nop");
	   asm("mulf r5");
	   asm("nop");
	   asm("addf r6");			/* add a '0'               */
	   asm("nop");
	   asm("mulf r5");			/* multipy by '1' again    */
	   asm("nop");
	   asm("stf r7");			/* store the result        */
	   if( force_loop );
	      asm("brb _pipe2_2_lp1");;		/* loop on the error       */
/* 
 * verify the results
*/
	   asm("movl r7,_sgl_st_acc");		/* get the result          */
	   if( sgl_st_acc != sgl_expected )   	/* COMPARE the values      */
	   {
	      errcnt++;				/* bump the error count    */
	      if ( prt_error ) 
	         print_pipe2_er("Reg. Data, 1 NO-OP");
	      if ( halt_flg ) 			/* halt on error?          */
	         pipe2_er_hlt( subtest );
	      if ( loop_on_err ) {
		 force_loop = TRUE;		/* set the force loop flag */
		 asm("brw _pipe2_2_lp1");	/* and loop                */
	      }
	   }   /* end of compare error */
	} while( index++ < max_lnf_1_index );
}  /* end of subtest 2 */






/************************************************************************
*
*			SUBTEST 3  
*		data in registers, 2 NO-OPs
*
************************************************************************/
pipe2_3() 
{
	force_loop = FALSE;			/* clear force_loop flag */
	index = 0;
	do 
	{
	   sgl_value_1  = lnf_1_data[index].ld;   /* get operand 1        */
	   sgl_expected = lnf_1_data[index].exp;  /* get expected results */
	   sgl_value_2  = 0x40800000;		   /* floating '1'         */
	   sgl_value_3  = 0;		   	   /* floating '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("_pipe2_3_lp1:");
	   asm("movl _sgl_value_1,r4");		/* move the data to r4     */
	   asm("movl _sgl_value_2,r5");		/* move data to r5         */
	   asm("movl _sgl_value_3,r6");		/* move data to r6         */
	   asm("lnf r4");			/* load (negate) the data  */
	   asm("nop");
	   asm("nop");
	   asm("mulf r5");			/* multipy by '1' (twice)  */
	   asm("nop");
	   asm("nop");
	   asm("mulf r5");
	   asm("nop");
	   asm("nop");
	   asm("addf r6");			/* add a '0'               */
	   asm("nop");
	   asm("nop");
	   asm("mulf r5");			/* multipy by '1' again    */
	   asm("nop");
	   asm("nop");
	   asm("stf r7");			/* store the result        */
	   if( force_loop );
	      asm("brb _pipe2_3_lp1");;		/* loop on the error       */
/* 
 * verify the results
*/
	   asm("movl r7,_sgl_st_acc");		/* get the result          */
	   if( sgl_st_acc != sgl_expected )   	/* COMPARE the values      */
	   {
	      errcnt++;				/* bump the error count    */
	      if ( prt_error ) 
	         print_pipe2_er("Reg. Data, 2 NO-OPS");
	      if ( halt_flg ) 			/* halt on error?          */
	         pipe2_er_hlt( subtest );
	      if ( loop_on_err ) {
		 force_loop = TRUE;		/* set the force loop flag */
		 asm("brw _pipe2_3_lp1");	/* and loop                */
	      }
	   }   /* end of compare error */
	} while( index++ < max_lnf_1_index );
}  /* end of subtest 3 */






/************************************************************************
*
*			SUBTEST 4  
*		data in registers, 3 NO-OPs
*
************************************************************************/
pipe2_4() 
{
	force_loop = FALSE;			/* clear force_loop flag */
	index = 0;
	do 
	{
	   sgl_value_1  = lnf_1_data[index].ld;   /* get operand 1        */
	   sgl_expected = lnf_1_data[index].exp;  /* get expected results */
	   sgl_value_2  = 0x40800000;		   /* floating '1'         */
	   sgl_value_3  = 0;		   	   /* floating '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("_pipe2_4_lp1:");
	   asm("movl _sgl_value_1,r4");		/* move the data to r4     */
	   asm("movl _sgl_value_2,r5");		/* move data to r5         */
	   asm("movl _sgl_value_3,r6");		/* move data to r6         */
	   asm("lnf r4");			/* load (negate) the data  */
	   asm("nop");
	   asm("nop");
	   asm("nop");
	   asm("mulf r5");			/* multipy by '1' (twice)  */
	   asm("nop");
	   asm("nop");
	   asm("nop");
	   asm("mulf r5");
	   asm("nop");
	   asm("nop");
	   asm("nop");
	   asm("addf r6");			/* add a '0'               */
	   asm("nop");
	   asm("nop");
	   asm("nop");
	   asm("mulf r5");			/* multipy by '1' again    */
	   asm("nop");
	   asm("nop");
	   asm("nop");
	   asm("stf r7");			/* store the result        */
	   if( force_loop );
	      asm("brb _pipe2_4_lp1");;		/* loop on the error       */
/* 
 * verify the results
*/
	   asm("movl r7,_sgl_st_acc");		/* get the result          */
	   if( sgl_st_acc != sgl_expected )   	/* COMPARE the values      */
	   {
	      errcnt++;				/* bump the error count    */
	      if ( prt_error ) 
	         print_pipe2_er("Reg. Data, 3 NO-OPS");
	      if ( halt_flg ) 			/* halt on error?          */
	         pipe2_er_hlt( subtest );
	      if ( loop_on_err ) {
		 force_loop = TRUE;		/* set the force loop flag */
		 asm("brw _pipe2_4_lp1");	/* and loop                */
	      }
	   }   /* end of compare error */
	} while( index++ < max_lnf_1_index );
}  /* end of subtest 4 */







/************************************************************************
*
*			SUBTEST 5  
*		data in Cache, no NO-OPs
*
************************************************************************/
pipe2_5() 
{
	force_loop = FALSE;			/* clear force_loop flag */
	index = 0;
	do 
	{
	   sgl_value_1  = lnf_1_data[index].ld;   /* get operand 1        */
	   sgl_expected = lnf_1_data[index].exp;  /* get expected results */
	   sgl_value_2  = 0x40800000;		   /* floating '1'         */
	   sgl_value_3  = 0;		   	   /* floating '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("_pipe2_5_lp1:");
	   asm("lnf _sgl_value_1");		/* load (negate) the data  */
	   asm("mulf _sgl_value_2");		/* multipy by '1' (twice)  */
	   asm("mulf _sgl_value_2");
	   asm("addf _sgl_value_3");		/* add a '0'               */
	   asm("mulf _sgl_value_2");		/* multipy by '1' again    */
	   asm("stf _sgl_st_acc");		/* store the result        */
	   if( force_loop );
	      asm("brb _pipe2_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_pipe2_er("Cache Data, no NO-OPS");
	      if ( halt_flg ) 			/* halt on error?          */
	         pipe2_er_hlt( subtest );
	      if ( loop_on_err ) {
		 force_loop = TRUE;		/* set the force loop flag */
		 asm("brw _pipe2_5_lp1");	/* and loop                */
	      }
	   }   /* end of compare error */
	} while( index++ < max_lnf_1_index );
}  /* end of subtest 5 */






/************************************************************************
*
*			SUBTEST 6  
*		data in Cache, 1 NO-OP
*
************************************************************************/
pipe2_6() 
{
	force_loop = FALSE;			/* clear force_loop flag */
	index = 0;
	do 
	{
	   sgl_value_1  = lnf_1_data[index].ld;   /* get operand 1        */
	   sgl_expected = lnf_1_data[index].exp;  /* get expected results */
	   sgl_value_2  = 0x40800000;		   /* floating '1'         */
	   sgl_value_3  = 0;		   	   /* floating '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("_pipe2_6_lp1:");
	   asm("lnf _sgl_value_1");		/* load (negate) the data  */
	   asm("nop");
	   asm("mulf _sgl_value_2");		/* multipy by '1' (twice)  */
	   asm("nop");
	   asm("mulf _sgl_value_2");
	   asm("nop");
	   asm("addf _sgl_value_3");		/* add a '0'               */
	   asm("nop");
	   asm("mulf _sgl_value_2");		/* multipy by '1' again    */
	   asm("nop");
	   asm("stf _sgl_st_acc");		/* store the result        */
	   if( force_loop );
	      asm("brb _pipe2_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_pipe2_er("Cache Data, 1 NO-OP");
	      if ( halt_flg ) 			/* halt on error?          */
	         pipe2_er_hlt( subtest );
	      if ( loop_on_err ) {
		 force_loop = TRUE;		/* set the force loop flag */
		 asm("brw _pipe2_6_lp1");	/* and loop                */
	      }
	   }   /* end of compare error */
	} while( index++ < max_lnf_1_index );
}  /* end of subtest 6 */






/************************************************************************
*
*			SUBTEST 7  
*		data in Cache, 2 NO-OPs
*
************************************************************************/
pipe2_7() 
{
	force_loop = FALSE;			/* clear force_loop flag */
	index = 0;
	do 
	{
	   sgl_value_1  = lnf_1_data[index].ld;   /* get operand 1        */
	   sgl_expected = lnf_1_data[index].exp;  /* get expected results */
	   sgl_value_2  = 0x40800000;		   /* floating '1'         */
	   sgl_value_3  = 0;		   	   /* floating '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("_pipe2_7_lp1:");
	   asm("lnf _sgl_value_1");		/* load (negate) the data  */
	   asm("nop");
	   asm("nop");
	   asm("mulf _sgl_value_2");		/* multipy by '1' (twice)  */
	   asm("nop");
	   asm("nop");
	   asm("mulf _sgl_value_2");
	   asm("nop");
	   asm("nop");
	   asm("addf _sgl_value_3");		/* add a '0'               */
	   asm("nop");
	   asm("nop");
	   asm("mulf _sgl_value_2");		/* multipy by '1' again    */
	   asm("nop");
	   asm("nop");
	   asm("stf _sgl_st_acc");		/* store the result        */
	   if( force_loop );
	      asm("brb _pipe2_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_pipe2_er("Cache Data, 2 NO-OPS");
	      if ( halt_flg ) 			/* halt on error?          */
	         pipe2_er_hlt( subtest );
	      if ( loop_on_err ) {
		 force_loop = TRUE;		/* set the force loop flag */
		 asm("brw _pipe2_7_lp1");	/* and loop                */
	      }
	   }   /* end of compare error */
	} while( index++ < max_lnf_1_index );
}  /* end of subtest 7 */






/************************************************************************
*
*			SUBTEST 8  
*		data in Cache, 3 NO-OPs
*
************************************************************************/
pipe2_8() 
{
	force_loop = FALSE;			/* clear force_loop flag */
	index = 0;
	do 
	{
	   sgl_value_1  = lnf_1_data[index].ld;   /* get operand 1        */
	   sgl_expected = lnf_1_data[index].exp;  /* get expected results */
	   sgl_value_2  = 0x40800000;		   /* floating '1'         */
	   sgl_value_3  = 0;		   	   /* floating '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("_pipe2_8_lp1:");
	   asm("lnf _sgl_value_1");		/* load (negate) the data  */
	   asm("nop");
	   asm("nop");
	   asm("nop");
	   asm("mulf _sgl_value_2");		/* multipy by '1' (twice)  */
	   asm("nop");
	   asm("nop");
	   asm("nop");
	   asm("mulf _sgl_value_2");
	   asm("nop");
	   asm("nop");
	   asm("nop");
	   asm("addf _sgl_value_3");		/* add a '0'               */
	   asm("nop");
	   asm("nop");
	   asm("nop");
	   asm("mulf _sgl_value_2");		/* multipy by '1' again    */
	   asm("nop");
	   asm("nop");
	   asm("nop");
	   asm("stf _sgl_st_acc");		/* store the result        */
	   if( force_loop );
	      asm("brb _pipe2_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_pipe2_er("Cache Data, 3 NO-OPS");
	      if ( halt_flg ) 			/* halt on error?          */
	         pipe2_er_hlt( subtest );
	      if ( loop_on_err ) {
		 force_loop = TRUE;		/* set the force loop flag */
		 asm("brw _pipe2_8_lp1");	/* and loop                */
	      }
	   }   /* end of compare error */
	} while( index++ < max_lnf_1_index );
}  /* end of subtest 8 */






/*****************************************************************************
*
*			SUBTEST 9  
*		data on the stack, no NO-OPs
*
*****************************************************************************/
pipe2_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  = lnf_1_data[index].ld;   /* get operand 1          */
	   sgl_expected = lnf_1_data[index].exp;  /* get expected results   */
	   sgl_value_2  = 0x40800000;		  /* floating '1'           */
	   sgl_value_3  = 0;		   	  /* floating '0'           */
	   asm("moval _pointer_data,_sgl_value_4");/* 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("_pipe2_9_lp1:");
	   asm("moval _pointer_data,r14");	/* set the stack pointer   */
	   asm("movl _sgl_value_2,-(r14)");	/* push a '1' on the stack */
	   asm("movl _sgl_value_3,-(r14)");	/* push a '0' on the stack */
	   asm("movl _sgl_value_2,-(r14)");	/* push 2 more '1's        */
	   asm("movl _sgl_value_2,-(r14)");
	   asm("movl _sgl_value_1,-(r14)");	/* push the operand        */
/*
 * now pop the data off the stack
*/
	   asm("lnf (r14)+");			/* load (negate) the data  */
	   asm("mulf (r14)+");			/* multiply by '1' (twice) */
	   asm("mulf (r14)+");
	   asm("addf (r14)+");			/* add a '0'               */
	   asm("mulf (r14)+");			/* multiply by '1' again   */
	   asm("stf r5");			/* store the result        */
	   if( force_loop );
	      asm("brb _pipe2_9_lp1");;		/* loop on the error       */
/* 
 * verify the results
*/
	   asm("movl r5,_sgl_st_acc");		/* get the result          */
	   asm("moval (r14),_sgl_value_5");	/* save the stack pointer  */
	   if( (sgl_st_acc  != sgl_expected) || /* verify the result...    */
	       (sgl_value_5 != sgl_value_4) )	/* ... 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_pipe2_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?          */
	         pipe2_er_hlt( subtest );
	      if ( loop_on_err ) {
		 force_loop = TRUE;		/* set the force loop flag */
		 asm("brw _pipe2_9_lp1");	/* and loop                */
	      }
	   }   /* end of compare error */
	} while( index++ < max_lnf_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  
*		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-16	  0	point the frame pointer here
*
******************************************************************************/
pipe2_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  = lnf_1_data[index].ld;    /* get operand 1         */
	   sgl_expected = lnf_1_data[index].exp;   /* get expected results  */
	   sgl_value_2  = 0x40800000;		   /* floating '1'         */
	   sgl_value_3  = 0;		   	   /* floating '0'         */
	   asm("moval _pointer_data,_sgl_value_4");/* get store data's addr */
	   sgl_value_4 -= 4;			/* decrement it by 4 (bytes)*/
	   asm("movl _sgl_value_1,*_sgl_value_4"); /* set the operand data  */
	   sgl_value_4 -= 4;			/* decrement it by 4 (bytes)*/
	   asm("movl _sgl_value_2,*_sgl_value_4"); /* set the operand data  */
	   sgl_value_4 -= 4;			/* decrement it by 4 (bytes)*/
	   asm("movl _sgl_value_3,*_sgl_value_4"); /* set the operand data  */
	   sgl_value_4 -= 4;			   /* get FRAME PTR address */
/*
 * If LOOP ON ERROR is set, this is the loop for this subtest.
 * The force loop flag is set after the first error.
*/
	   asm("_pipe2_10_lp1:");
	   asm("movl _sgl_value_4,r13");	/* set the FRAME POINTER    */
	   asm("movl $1,r1");			/* r1 index = 1 longwords   */
	   asm("movl $2,r2");			/* r2 index = 2 longwords   */
	   asm("movl $3,r3");			/* r3 index = 3 longwords   */
	   asm("movl $4,r4");			/* r4 index = 4 longwords   */
	   asm("lnf (r13)[r3]");		/* load  -indexed by r3     */
	   asm("mulf (r13)[r2]");		/* multiply by '1' (twice)  */
	   asm("mulf (r13)[r2]");
	   asm("addf (r13)[r1]");		/* add a '0' to it          */
	   asm("mulf (r13)[r2]");		/* multiply by '1' again    */
	   asm("stf (r13)[r4]");		/* store -indexed by r4     */
	   if( force_loop );
	      asm("brb _pipe2_10_lp1");;	/* loop on the error       */
/* 
 * verify the results
*/
	   sgl_st_acc = pointer_data;		/* move the stored result  */
	   asm("moval (r13),_sgl_value_5");	/* save the frame pointer  */
	   if( (sgl_st_acc  != sgl_expected) || /* verify the result...    */
	       (sgl_value_5 != sgl_value_4) )	/* ... 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_pipe2_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?          */
	         pipe2_er_hlt( subtest );
	      if ( loop_on_err ) {
		 force_loop = TRUE;		/* set the force loop flag */
		 asm("brw _pipe2_10_lp1");	/* and loop                */
	      }
	   }   /* end of compare error */
	} while( index++ < max_lnf_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 */


/******************************************************************************
*
*
*	print an error in the following form
*
*  operand = xxxxxxxx,   final Acc = xxxxxxxx,   data index = dd
*                     expected Acc = xxxxxxxx
*
******************************************************************************/
print_pipe2_er(msg)
char *msg;
{
	writes(" \n");		/* start a new print line   */
	writes("cycle: ");
	writed( cycle );
	writes(" test ");
	writed( test_no );
	writes("  (Pipe 2), subtest ");
	writed( subtest );
	writes(" error - ");
	writes( msg );
	writec('\n');
writes(" LNF (op1), MULF(1.0), MULF(1.0), ADD(0.0), MULF(1.0), 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
*
******************************************************************************/
pipe2_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 one       */
	asm("movl _sgl_value_3,r9");		/* r9 = floating zero      */
	if( subtest == 9 ) {
		asm("movl _sgl_value_5,r10");	/* r10= final SP value     */
		asm("movl _sgl_value_4,r11");	/* r11= expected SP value  */
	} else
	if( subtest == 10 ) {
		asm("movl _sgl_value_5,r10");	/* r10= final FP value     */
		asm("movl _sgl_value_4,r11");	/* r11= expected FP value  */
	};
	asm(".globl _pipe2_1_hlt");
	asm("_pipe2_1_hlt:");			/* PC after the halt       */
	asm("halt");				/* HALT ...                */
}  /* end of halt on error */

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.