Annotation of cci/d/fpevent/fpm_test.c, revision 1.1

1.1     ! root        1: 
        !             2: #include "evt_defs.h"
        !             3: 
        !             4: /*
        !             5:  ********************************************************************
        !             6:  *
        !             7:  *     MONITOR FOR THE FPP EMULATION TRAP INTERFACE TEST
        !             8:  *
        !             9:  ********************************************************************
        !            10: */
        !            11: fpm_test()
        !            12: {
        !            13:        event_msg = "FPP Emulation";
        !            14:        test_event = FPM_CODE;
        !            15:        disable_mask = 0;               /* don't disable any events   */
        !            16:        evt_disabled = FALSE;           /* expected event is enabled  */
        !            17:        if( evt_inst )                  /* was the op-code specified? */
        !            18:        {
        !            19:              inst_index = get_fpm_index( evt_inst );
        !            20:              if( inst_index < 0 ) { 
        !            21:                   if( (prt_hdrs) && (cycle == 1) )   /* no reserved ops */
        !            22:                   {
        !            23:                         writes(
        !            24:                     "There is no FLOATING POINT EMULATION with op-code" );
        !            25:                         writeh( evt_inst );    /* print the ersatz op-code */
        !            26:                         writec('\n');
        !            27:                         error = TRUE;  /* needed for line feed control */
        !            28:                   }
        !            29:              } else 
        !            30:                   test_fpm_inst();     /* test the instruction */
        !            31:        } else                          /* test all applicable op-codes */
        !            32:              for(inst_index=0; inst_index < size_fpm_tbl; inst_index++)
        !            33:                         test_fpm_inst();
        !            34: }
        !            35:  
        !            36: 
        !            37: 
        !            38: /*
        !            39:  ***************************************************************************
        !            40:  *
        !            41:  *             Run the Reserved Operand Fault on one instruction
        !            42:  *
        !            43:  ***************************************************************************
        !            44: */
        !            45: test_fpm_inst()
        !            46: {
        !            47:        valid_test = TRUE;              /* a test is being run */
        !            48:        op_code    =  fpm_tbl[ inst_index ].inst_code;
        !            49:        op_name    =  fpm_tbl[ inst_index ].name;
        !            50:        precision  =  fpm_tbl[ inst_index ].precision;
        !            51:        no_ops     =  fpm_tbl[ inst_index ].no_operands;
        !            52:        data_ptr   =  fpm_data;
        !            53:        max_index  =  fpm_data_cnt;
        !            54:        if( precision == SGL ) {
        !            55:              sgl_op = TRUE;
        !            56:              acc_ld_size = SGL;        /* use a sgl precision Acc. */
        !            57:        } else {
        !            58:              sgl_op = FALSE;
        !            59:              acc_ld_size = DBL;        /* use a dbl precision Acc. */
        !            60:        } 
        !            61:        if( (prt_hdrs) && (cycle == 1) ) {
        !            62:              if( (!evt_inst) &&                /* print a line feed if   */
        !            63:                  (op_code == LOGF_OP_CODE) )   /*   the 1st line is full */
        !            64:                   writes("\n                       ");
        !            65:              writes( op_name );        /* print the instruction's name */
        !            66:        }
        !            67:        test_inst();
        !            68: }
        !            69: 
        !            70: 
        !            71: 
        !            72: /*
        !            73:  ***************************************************************************
        !            74:  *
        !            75:  *             GET THE INSTRUCTION TABLE INDEX FOR AN OP-CODE
        !            76:  *
        !            77:  *  Given the op_code of an instruction, return the instruction's index in
        !            78:  *  the FPM instruction table. Return a negative number if the op-code isn't 
        !            79:  *  in the table.
        !            80:  *
        !            81:  **************************************************************************
        !            82: */
        !            83: get_fpm_index( op_code )
        !            84: {
        !            85: int x;
        !            86:        x = 0;
        !            87:        while( (fpm_tbl[x].inst_code != op_code) && (x < size_fpm_tbl) )
        !            88:             x++;
        !            89:        if( x == size_fpm_tbl ) 
        !            90:             x = -1;
        !            91:        return( x );
        !            92: }
        !            93: 
        !            94: 

unix.superglobalmegacorp.com

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