|
|
Power 6/32 Unix version 1.21
#include "dmp_defs.h"
/***********************************************************************
*
* Verify final single precision accumulator value for Math functions
*
* This code is the same as CHK_SGL_ACC in that it checks the final
* single precision accumulator value except that this code doesn't
* check the PSL flag bits. In fact, the error printing and halting
* routines are in file CHK_SGL_ACC.
* This routine is used because SINF & COSF play with the PSL flags.
***********************************************************************/
chk_math()
{
sgl_ld_acc = dbl_ld_acc.m; /* move the data to */
sgl_st_acc = dbl_st_acc.m; /* the sgl data */
sgl_expected = dbl_expected.m; /* operands */
sgl_value_1 = dbl_value_1.m;
sgl_value_2 = dbl_value_2.m;
sgl_dummy1 = init_psl & 0xffffff00; /* clear PSL's DBL bit */
sgl_dummy2 = psl_val & 0xffffff00; /* get final PSL value */
if( sgl_st_acc != sgl_expected ) {
errcnt++;
if( prt_error )
prt_s_acc_e( bad_result_msg );
if( halt_flg )
hlt_s_acc_e( 1 ); /* error code 1 */
if( loop_on_err )
force_loop = TRUE; /* set loop flag */
}
else if( sgl_dummy2 != sgl_dummy1 ) {
errcnt++;
if( prt_error )
prt_s_acc_e( bad_psl_msg );
if( halt_flg )
hlt_s_acc_e( 2 ); /* error code 2 */
if( loop_on_err )
force_loop = TRUE; /* set loop flag */
}
else if( no_page_faults != exp_page_faults ) {
errcnt++;
if( prt_error )
prt_s_acc_e( trans_flt_cnt_msg );
if( halt_flg )
hlt_s_acc_e( 3 ); /* error code 3 */
if( loop_on_err )
force_loop = TRUE; /* set loop flag */
}
else {
reg_no = 0;
regs_ok = TRUE;
while( (reg_no <= 13) && (regs_ok) ) /* check 1st 13 regs */
if( store_regs[ reg_no ] == exp_regs[ reg_no ] )
reg_no++;
else
regs_ok = FALSE;
if( !regs_ok ) {
errcnt++;
if( prt_error )
prt_s_acc_e( reg_modified_msg );
if( halt_flg )
hlt_s_acc_e( 4 ); /* error code 4 */
if( loop_on_err )
force_loop = TRUE; /* set loop flag */
}
}
}
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.