|
|
Power 6/32 Unix version 1.21
#include "evt_defs.h"
/*
********************************************************************
*
* MONITOR FOR THE FPP EMULATION TRAP INTERFACE TEST
*
********************************************************************
*/
fpm_test()
{
event_msg = "FPP Emulation";
test_event = FPM_CODE;
disable_mask = 0; /* don't disable any events */
evt_disabled = FALSE; /* expected event is enabled */
if( evt_inst ) /* was the op-code specified? */
{
inst_index = get_fpm_index( evt_inst );
if( inst_index < 0 ) {
if( (prt_hdrs) && (cycle == 1) ) /* no reserved ops */
{
writes(
"There is no FLOATING POINT EMULATION with op-code" );
writeh( evt_inst ); /* print the ersatz op-code */
writec('\n');
error = TRUE; /* needed for line feed control */
}
} else
test_fpm_inst(); /* test the instruction */
} else /* test all applicable op-codes */
for(inst_index=0; inst_index < size_fpm_tbl; inst_index++)
test_fpm_inst();
}
/*
***************************************************************************
*
* Run the Reserved Operand Fault on one instruction
*
***************************************************************************
*/
test_fpm_inst()
{
valid_test = TRUE; /* a test is being run */
op_code = fpm_tbl[ inst_index ].inst_code;
op_name = fpm_tbl[ inst_index ].name;
precision = fpm_tbl[ inst_index ].precision;
no_ops = fpm_tbl[ inst_index ].no_operands;
data_ptr = fpm_data;
max_index = fpm_data_cnt;
if( precision == SGL ) {
sgl_op = TRUE;
acc_ld_size = SGL; /* use a sgl precision Acc. */
} else {
sgl_op = FALSE;
acc_ld_size = DBL; /* use a dbl precision Acc. */
}
if( (prt_hdrs) && (cycle == 1) ) {
if( (!evt_inst) && /* print a line feed if */
(op_code == LOGF_OP_CODE) ) /* the 1st line is full */
writes("\n ");
writes( op_name ); /* print the instruction's name */
}
test_inst();
}
/*
***************************************************************************
*
* GET THE INSTRUCTION TABLE INDEX FOR AN OP-CODE
*
* Given the op_code of an instruction, return the instruction's index in
* the FPM instruction table. Return a negative number if the op-code isn't
* in the table.
*
**************************************************************************
*/
get_fpm_index( op_code )
{
int x;
x = 0;
while( (fpm_tbl[x].inst_code != op_code) && (x < size_fpm_tbl) )
x++;
if( x == size_fpm_tbl )
x = -1;
return( x );
}
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.