Annotation of cci/d/macro4/pipe7.c, revision 1.1

1.1     ! root        1: #include "fpp_defs.h"
        !             2: 
        !             3: 
        !             4: /*****************************************************************************
        !             5: *
        !             6: *      MONITOR FOR PIPELINE TEST #7 (The Trans-Siberian Pipeline test)
        !             7: *
        !             8: *  This test will do:
        !             9: *
        !            10: *      LDF(x), SUBF(x), ADDF(0), SUBF(x), ADDF(x), SUBF(0)        !            11: *              ADDF(x), SUBF(x), ADDF(0), SUBF(0), ADDF(x), STF
        !            12: *
        !            13: *  where the x's are the fmacro1 LDF data patterns. This test is an attempt
        !            14: *  to fill the instruction Queue.
        !            15: *****************************************************************************/
        !            16: pipe_7()
        !            17: {
        !            18:        asm(".globl _pipeline_7_t");
        !            19:        asm("_pipeline_7_t:");                  /* entry address            */
        !            20:        if( (cycle == 1) && (prt_hdrs) )        /* print headers on 1st cycle */
        !            21:        {
        !            22:           writes(" PIPE_7 ");
        !            23:        }
        !            24:        subtest = 1;
        !            25:        pipe7_1();                              /* data in REGs,  no NOPs */
        !            26:        subtest ++;                             /* increment subtest num  */
        !            27:        pipe7_2();                              /* data in REGs,   1 NOP  */
        !            28:        subtest ++;                             /* increment subtest num  */
        !            29:        pipe7_3();                              /* data in REGs,   2 NOPs */
        !            30:        subtest ++;                             /* increment subtest num  */
        !            31:        pipe7_4();                              /* data in REGs,   3 NOPs */
        !            32:        subtest ++;                             /* increment subtest num  */
        !            33:        pipe7_5();                              /* data in CACHE, no NOPs */
        !            34:        subtest ++;                             /* increment subtest num  */
        !            35:        pipe7_6();                              /* data in CACHE,  1 NOP  */
        !            36:        subtest ++;                             /* increment subtest num  */
        !            37:        pipe7_7();                              /* data in CACHE,  2 NOPs */
        !            38:        subtest ++;                             /* increment subtest num  */
        !            39:        pipe7_8();                              /* data in CACHE,  3 NOPs */
        !            40:        subtest ++;                             /* increment subtest num  */
        !            41:        pipe7_9();                              /* data on STACK, no NOPs */
        !            42:        subtest ++;                             /* increment subtest num  */
        !            43:        pipe7_10();                             /* data via FP  no NOPs */
        !            44:        asm("jmp *return");                     /* return to the test monitor */
        !            45: }
        !            46: 
        !            47: 
        !            48: 
        !            49: 
        !            50: 
        !            51: 
        !            52: /************************************************************************
        !            53: *
        !            54: *                      SUBTEST 1  
        !            55: *              data in registers, no NO-OPs
        !            56: *
        !            57: ************************************************************************/
        !            58: pipe7_1() 
        !            59: {
        !            60:        force_loop = FALSE;                     /* clear the force_loop flg */
        !            61:        index = 0;
        !            62:        do 
        !            63:        {
        !            64:           sgl_value_1  = ldf_1_data[index].ld;   /* get operand 1        */
        !            65:           sgl_expected = ldf_1_data[index].exp;  /* get expected results */
        !            66:           sgl_value_2  = 0;                      /* set one operand to 0 */
        !            67: /*
        !            68:  * If LOOP ON ERROR is set, this is the loop for this subtest.
        !            69:  * The force loop flag is set after the first error.
        !            70: */
        !            71:           asm("_pipe7_1_lp1:");
        !            72:           asm("movl _sgl_value_1,r4");         /* move the data to r4     */
        !            73:           asm("movl _sgl_value_2,r3");         /* move the '0' to r3      */
        !            74:           asm("ldf r4");                       /* load the ACC (ACC = op) */
        !            75:           asm("subf r4");                      /* sub. the op. (ACC = 0 ) */
        !            76:           asm("addf r3");                      /* add a '0'    (ACC = 0 ) */
        !            77:           asm("subf r4");                      /* sub. the op. (ACC =-op) */
        !            78:           asm("addf r4");                      /* add the op.  (ACC = 0 ) */
        !            79:           asm("subf r3");                      /* sub. a '0'   (ACC = 0 ) */
        !            80:           asm("addf r4");                      /* add the op.  (ACC = op) */
        !            81:           asm("subf r4");                      /* sub. the op. (ACC = 0 ) */
        !            82:           asm("addf r3");                      /* add a '0'    (ACC = 0 ) */
        !            83:           asm("subf r3");                      /* sub. a '0'   (ACC = 0 ) */
        !            84:           asm("addf r4");                      /* add the op.  (ACC = op) */
        !            85:           asm("stf r5");                       /* store the ACC (s/b= op) */
        !            86:           if( force_loop )
        !            87:              asm("brb _pipe7_1_lp1");;         /* loop on the error       */
        !            88: /* 
        !            89:  * verify the results
        !            90: */
        !            91:           asm("movl r5,_sgl_st_acc");          /* get the result          */
        !            92:           if( sgl_st_acc != sgl_expected )     /* COMPARE the values      */
        !            93:           {
        !            94:              errcnt++;                         /* bump the error count    */
        !            95:              if ( prt_error ) 
        !            96:                 print_pipe7_er("Reg. Data, no NO-OPs");
        !            97:              if ( halt_flg )
        !            98:                 pipe7_er_hlt( subtest );
        !            99:              if ( loop_on_err ) {
        !           100:                 force_loop = TRUE;             /* set the force loop flag */
        !           101:                 asm("jmp _pipe7_1_lp1");       /* and loop                */
        !           102:              }
        !           103:           }   /* end of compare error */
        !           104:        } while( index++ < max_ldf_1_index );
        !           105: }  /* end of subtest 1 */
        !           106: 
        !           107: 
        !           108: 
        !           109: 
        !           110: 
        !           111: 
        !           112: /************************************************************************
        !           113: *
        !           114: *                      SUBTEST 2  
        !           115: *              data in registers, 1 NO-OP
        !           116: *
        !           117: ************************************************************************/
        !           118: pipe7_2() 
        !           119: {
        !           120:        force_loop = FALSE;                     /* clear force_loop flag */
        !           121:        index = 0;
        !           122:        do 
        !           123:        {
        !           124:           sgl_value_1  = ldf_1_data[index].ld;   /* get operand 1        */
        !           125:           sgl_expected = ldf_1_data[index].exp;  /* get expected results */
        !           126:           sgl_value_2  = 0;                      /* get the '0' operand  */
        !           127: /*
        !           128:  * If LOOP ON ERROR is set, this is the loop for this subtest.
        !           129:  * The force loop flag is set after the first error.
        !           130: */
        !           131:           asm("_pipe7_2_lp1:");
        !           132:           asm("movl _sgl_value_1,r4");         /* move the data to r4     */
        !           133:           asm("movl _sgl_value_2,r3");         /* move the '0' to r3      */
        !           134:           asm("ldf r4");                       /* load the ACC (ACC = op) */
        !           135:           asm("nop");
        !           136:           asm("subf r4");                      /* sub. the op. (ACC = 0 ) */
        !           137:           asm("nop");
        !           138:           asm("addf r3");                      /* add a '0'    (ACC = 0 ) */
        !           139:           asm("nop");
        !           140:           asm("subf r4");                      /* sub. the op. (ACC =-op) */
        !           141:           asm("nop");
        !           142:           asm("addf r4");                      /* add the op.  (ACC = 0 ) */
        !           143:           asm("nop");
        !           144:           asm("subf r3");                      /* sub. a '0'   (ACC = 0 ) */
        !           145:           asm("nop");
        !           146:           asm("addf r4");                      /* add the op.  (ACC = op) */
        !           147:           asm("nop");
        !           148:           asm("subf r4");                      /* sub. the op. (ACC = 0 ) */
        !           149:           asm("nop");
        !           150:           asm("addf r3");                      /* add a '0'    (ACC = 0 ) */
        !           151:           asm("nop");
        !           152:           asm("subf r3");                      /* sub. a '0'   (ACC = 0 ) */
        !           153:           asm("nop");
        !           154:           asm("addf r4");                      /* add the op.  (ACC = op) */
        !           155:           asm("nop");
        !           156:           asm("stf r5");                       /* store the ACC (s/b= op) */
        !           157:           if( force_loop )
        !           158:              asm("brb _pipe7_2_lp1");;         /* loop on the error       */
        !           159: /* 
        !           160:  * verify the results
        !           161: */
        !           162:           asm("movl r5,_sgl_st_acc");          /* get the result          */
        !           163:           if( sgl_st_acc != sgl_expected )     /* COMPARE the values      */
        !           164:           {
        !           165:              errcnt++;                         /* bump the error count    */
        !           166:              if ( prt_error ) 
        !           167:                 print_pipe7_er("Reg. Data, 1 NO-OP");
        !           168:              if ( halt_flg )
        !           169:                 pipe7_er_hlt( subtest );
        !           170:              if ( loop_on_err ) {
        !           171:                 force_loop = TRUE;             /* set the force loop flag */
        !           172:                 asm("jmp _pipe7_2_lp1");       /* and loop                */
        !           173:              }
        !           174:           }   /* end of compare error */
        !           175:        } while( index++ < max_ldf_1_index );
        !           176: }  /* end of subtest 2 */
        !           177: 
        !           178: 
        !           179: 
        !           180: 
        !           181: 
        !           182: 
        !           183: /************************************************************************
        !           184: *
        !           185: *                      SUBTEST 3  
        !           186: *              data in registers, 2 NO-OPs
        !           187: *
        !           188: ************************************************************************/
        !           189: pipe7_3() 
        !           190: {
        !           191:        force_loop = FALSE;                     /* clear force_loop flag */
        !           192:        index = 0;
        !           193:        do 
        !           194:        {
        !           195:           sgl_value_1  = ldf_1_data[index].ld;   /* get operand 1        */
        !           196:           sgl_expected = ldf_1_data[index].exp;  /* get expected results */
        !           197:           sgl_value_2  = 0;                      /* set the '0' operand  */
        !           198: /*
        !           199:  * If LOOP ON ERROR is set, this is the loop for this subtest.
        !           200:  * The force loop flag is set after the first error.
        !           201: */
        !           202:           asm("_pipe7_3_lp1:");
        !           203:           asm("movl _sgl_value_1,r4");         /* move the data to r4     */
        !           204:           asm("movl _sgl_value_2,r3");         /* move the '0' to r3      */
        !           205:           asm("ldf r4");                       /* load the ACC (ACC = op) */
        !           206:           asm("nop");
        !           207:           asm("nop");
        !           208:           asm("subf r4");                      /* sub. the op. (ACC = 0 ) */
        !           209:           asm("nop");
        !           210:           asm("nop");
        !           211:           asm("addf r3");                      /* add a '0'    (ACC = 0 ) */
        !           212:           asm("nop");
        !           213:           asm("nop");
        !           214:           asm("subf r4");                      /* sub. the op. (ACC =-op) */
        !           215:           asm("nop");
        !           216:           asm("nop");
        !           217:           asm("addf r4");                      /* add the op.  (ACC = 0 ) */
        !           218:           asm("nop");
        !           219:           asm("nop");
        !           220:           asm("subf r3");                      /* sub. a '0'   (ACC = 0 ) */
        !           221:           asm("nop");
        !           222:           asm("nop");
        !           223:           asm("addf r4");                      /* add the op.  (ACC = op) */
        !           224:           asm("nop");
        !           225:           asm("nop");
        !           226:           asm("subf r4");                      /* sub. the op. (ACC = 0 ) */
        !           227:           asm("nop");
        !           228:           asm("nop");
        !           229:           asm("addf r3");                      /* add a '0'    (ACC = 0 ) */
        !           230:           asm("nop");
        !           231:           asm("nop");
        !           232:           asm("subf r3");                      /* sub. a '0'   (ACC = 0 ) */
        !           233:           asm("nop");
        !           234:           asm("nop");
        !           235:           asm("addf r4");                      /* add the op.  (ACC = op) */
        !           236:           asm("nop");
        !           237:           asm("nop");
        !           238:           asm("stf r5");                       /* store the ACC (s/b= op) */
        !           239:           if( force_loop )
        !           240:              asm("brb _pipe7_3_lp1");;         /* loop on the error       */
        !           241: /* 
        !           242:  * verify the results
        !           243: */
        !           244:           asm("movl r5,_sgl_st_acc");          /* get the result          */
        !           245:           if( sgl_st_acc != sgl_expected )     /* COMPARE the values      */
        !           246:           {
        !           247:              errcnt++;                         /* bump the error count    */
        !           248:              if ( prt_error ) 
        !           249:                 print_pipe7_er("Reg. Data, 2 NO-OPs");
        !           250:              if ( halt_flg )
        !           251:                 pipe7_er_hlt( subtest );
        !           252:              if ( loop_on_err ) {
        !           253:                 force_loop = TRUE;             /* set the force loop flag */
        !           254:                 asm("jmp _pipe7_3_lp1");       /* and loop                */
        !           255:              }
        !           256:           }   /* end of compare error */
        !           257:        } while( index++ < max_ldf_1_index );
        !           258: }  /* end of subtest 3 */
        !           259: 
        !           260: 
        !           261: 
        !           262: 
        !           263: 
        !           264: 
        !           265: /************************************************************************
        !           266: *
        !           267: *                      SUBTEST 4  
        !           268: *              data in registers, 3 NO-OPs
        !           269: *
        !           270: ************************************************************************/
        !           271: pipe7_4() 
        !           272: {
        !           273:        force_loop = FALSE;                     /* clear force_loop flag */
        !           274:        index = 0;
        !           275:        do 
        !           276:        {
        !           277:           sgl_value_1  = ldf_1_data[index].ld;   /* get operand 1        */
        !           278:           sgl_expected = ldf_1_data[index].exp;  /* get expected results */
        !           279:           sgl_value_2  = 0;                      /* set the '0' operand  */
        !           280: /*
        !           281:  * If LOOP ON ERROR is set, this is the loop for this subtest.
        !           282:  * The force loop flag is set after the first error.
        !           283: */
        !           284:           asm("_pipe7_4_lp1:");
        !           285:           asm("movl _sgl_value_1,r4");         /* move the data to r4     */
        !           286:           asm("movl _sgl_value_2,r3");         /* move the '0' to r3      */
        !           287:           asm("ldf r4");                       /* load the ACC (ACC = op) */
        !           288:           asm("nop");
        !           289:           asm("nop");
        !           290:           asm("nop");
        !           291:           asm("subf r4");                      /* sub. the op. (ACC = 0 ) */
        !           292:           asm("nop");
        !           293:           asm("nop");
        !           294:           asm("nop");
        !           295:           asm("addf r3");                      /* add a '0'    (ACC = 0 ) */
        !           296:           asm("nop");
        !           297:           asm("nop");
        !           298:           asm("nop");
        !           299:           asm("subf r4");                      /* sub. the op. (ACC =-op) */
        !           300:           asm("nop");
        !           301:           asm("nop");
        !           302:           asm("nop");
        !           303:           asm("addf r4");                      /* add the op.  (ACC = 0 ) */
        !           304:           asm("nop");
        !           305:           asm("nop");
        !           306:           asm("nop");
        !           307:           asm("subf r3");                      /* sub. a '0'   (ACC = 0 ) */
        !           308:           asm("nop");
        !           309:           asm("nop");
        !           310:           asm("nop");
        !           311:           asm("addf r4");                      /* add the op.  (ACC = op) */
        !           312:           asm("nop");
        !           313:           asm("nop");
        !           314:           asm("nop");
        !           315:           asm("subf r4");                      /* sub. the op. (ACC = 0 ) */
        !           316:           asm("nop");
        !           317:           asm("nop");
        !           318:           asm("nop");
        !           319:           asm("addf r3");                      /* add a '0'    (ACC = 0 ) */
        !           320:           asm("nop");
        !           321:           asm("nop");
        !           322:           asm("nop");
        !           323:           asm("subf r3");                      /* sub. a '0'   (ACC = 0 ) */
        !           324:           asm("nop");
        !           325:           asm("nop");
        !           326:           asm("nop");
        !           327:           asm("addf r4");                      /* add the op.  (ACC = op) */
        !           328:           asm("nop");
        !           329:           asm("nop");
        !           330:           asm("nop");
        !           331:           asm("stf r5");                       /* store the ACC (s/b= op) */
        !           332:           if( force_loop )
        !           333:              asm("brb _pipe7_4_lp1");;         /* loop on the error       */
        !           334: /* 
        !           335:  * verify the results
        !           336: */
        !           337:           asm("movl r5,_sgl_st_acc");          /* get the result          */
        !           338:           if( sgl_st_acc != sgl_expected )     /* COMPARE the values      */
        !           339:           {
        !           340:              errcnt++;                         /* bump the error count    */
        !           341:              if ( prt_error ) 
        !           342:                 print_pipe7_er("Reg. Data, 3 NO-OPs");
        !           343:              if ( halt_flg )
        !           344:                 pipe7_er_hlt( subtest );
        !           345:              if ( loop_on_err ) {
        !           346:                 force_loop = TRUE;             /* set the force loop flag */
        !           347:                 asm("jmp _pipe7_4_lp1");       /* and loop                */
        !           348:              }
        !           349:           }   /* end of compare error */
        !           350:        } while( index++ < max_ldf_1_index );
        !           351: }  /* end of subtest 4 */
        !           352: 
        !           353: 
        !           354: 
        !           355: 
        !           356: 
        !           357: 
        !           358: 
        !           359: /************************************************************************
        !           360: *
        !           361: *                      SUBTEST 5  
        !           362: *              data in Cache, no NO-OPs
        !           363: *
        !           364: ************************************************************************/
        !           365: pipe7_5() 
        !           366: {
        !           367:        force_loop = FALSE;                     /* clear force_loop flag */
        !           368:        index = 0;
        !           369:        do 
        !           370:        {
        !           371:           sgl_value_1  = ldf_1_data[index].ld;   /* get operand 1        */
        !           372:           sgl_expected = ldf_1_data[index].exp;  /* get expected results */
        !           373:           sgl_value_2  = 0;                      /* set the '0' operand  */
        !           374: /*
        !           375:  * If LOOP ON ERROR is set, this is the loop for this subtest.
        !           376:  * The force loop flag is set after the first error.
        !           377: */
        !           378:           asm("_pipe7_5_lp1:");
        !           379:           asm("ldf _sgl_value_1");             /* load the ACC (ACC = op) */
        !           380:           asm("subf _sgl_value_1");            /* sub. the op. (ACC = 0 ) */
        !           381:           asm("addf _sgl_value_2");            /* add a '0'    (ACC = 0 ) */
        !           382:           asm("subf _sgl_value_1");            /* sub. the op. (ACC =-op) */
        !           383:           asm("addf _sgl_value_1");            /* add the op.  (ACC = 0 ) */
        !           384:           asm("subf _sgl_value_2");            /* sub. a '0'   (ACC = 0 ) */
        !           385:           asm("addf _sgl_value_1");            /* add the op.  (ACC = op) */
        !           386:           asm("subf _sgl_value_1");            /* sub. the op. (ACC = 0 ) */
        !           387:           asm("addf _sgl_value_2");            /* add a '0'    (ACC = 0 ) */
        !           388:           asm("subf _sgl_value_2");            /* sub. a '0'   (ACC = 0 ) */
        !           389:           asm("addf _sgl_value_1");            /* add the op.  (ACC = op) */
        !           390:           asm("stf _sgl_st_acc");              /* store the ACC (s/b= op) */
        !           391:           if( force_loop )
        !           392:              asm("brb _pipe7_5_lp1");;         /* loop on the error       */
        !           393: /* 
        !           394:  * verify the results
        !           395: */
        !           396:           if( sgl_st_acc != sgl_expected )     /* COMPARE the values      */
        !           397:           {
        !           398:              errcnt++;                         /* bump the error count    */
        !           399:              if ( prt_error ) 
        !           400:                 print_pipe7_er("Cache Data, no NO-OPs");
        !           401:              if ( halt_flg )
        !           402:                 pipe7_er_hlt( subtest );
        !           403:              if ( loop_on_err ) {
        !           404:                 force_loop = TRUE;             /* set the force loop flag */
        !           405:                 asm("jmp _pipe7_5_lp1");       /* and loop                */
        !           406:              }
        !           407:           }   /* end of compare error */
        !           408:        } while( index++ < max_ldf_1_index );
        !           409: }  /* end of subtest 5 */
        !           410: 
        !           411: 
        !           412: 
        !           413: 
        !           414: 
        !           415: 
        !           416: /************************************************************************
        !           417: *
        !           418: *                      SUBTEST 6  
        !           419: *              data in Cache, 1 NO-OP
        !           420: *
        !           421: ************************************************************************/
        !           422: pipe7_6() 
        !           423: {
        !           424:        force_loop = FALSE;                     /* clear force_loop flag */
        !           425:        index = 0;
        !           426:        do 
        !           427:        {
        !           428:           sgl_value_1  = ldf_1_data[index].ld;   /* get operand 1        */
        !           429:           sgl_expected = ldf_1_data[index].exp;  /* get expected results */
        !           430: /*
        !           431:  * If LOOP ON ERROR is set, this is the loop for this subtest.
        !           432:  * The force loop flag is set after the first error.
        !           433: */
        !           434:           asm("_pipe7_6_lp1:");
        !           435:           asm("ldf _sgl_value_1");             /* load the ACC (ACC = op) */
        !           436:           asm("nop");
        !           437:           asm("subf _sgl_value_1");            /* sub. the op. (ACC = 0 ) */
        !           438:           asm("nop");
        !           439:           asm("addf _sgl_value_2");            /* add a '0'    (ACC = 0 ) */
        !           440:           asm("nop");
        !           441:           asm("subf _sgl_value_1");            /* sub. the op. (ACC =-op) */
        !           442:           asm("nop");
        !           443:           asm("addf _sgl_value_1");            /* add the op.  (ACC = 0 ) */
        !           444:           asm("nop");
        !           445:           asm("subf _sgl_value_2");            /* sub. a '0'   (ACC = 0 ) */
        !           446:           asm("nop");
        !           447:           asm("addf _sgl_value_1");            /* add the op.  (ACC = op) */
        !           448:           asm("nop");
        !           449:           asm("subf _sgl_value_1");            /* sub. the op. (ACC = 0 ) */
        !           450:           asm("nop");
        !           451:           asm("addf _sgl_value_2");            /* add a '0'    (ACC = 0 ) */
        !           452:           asm("nop");
        !           453:           asm("subf _sgl_value_2");            /* sub. a '0'   (ACC = 0 ) */
        !           454:           asm("nop");
        !           455:           asm("addf _sgl_value_1");            /* add the op.  (ACC = op) */
        !           456:           asm("nop");
        !           457:           asm("stf _sgl_st_acc");              /* store the ACC (s/b= op) */
        !           458:           if( force_loop )
        !           459:              asm("brb _pipe7_6_lp1");;         /* loop on the error       */
        !           460: /* 
        !           461:  * verify the results
        !           462: */
        !           463:           if( sgl_st_acc != sgl_expected )     /* COMPARE the values      */
        !           464:           {
        !           465:              errcnt++;                         /* bump the error count    */
        !           466:              if ( prt_error ) 
        !           467:                 print_pipe7_er("Cache Data, 1 NO-OP");
        !           468:              if ( halt_flg )
        !           469:                 pipe7_er_hlt( subtest );
        !           470:              if ( loop_on_err ) {
        !           471:                 force_loop = TRUE;             /* set the force loop flag */
        !           472:                 asm("jmp _pipe7_6_lp1");       /* and loop                */
        !           473:              }
        !           474:           }   /* end of compare error */
        !           475:        } while( index++ < max_ldf_1_index );
        !           476: }  /* end of subtest 6 */
        !           477: 
        !           478: 
        !           479: 
        !           480: 
        !           481: 
        !           482: 
        !           483: /************************************************************************
        !           484: *
        !           485: *                      SUBTEST 7  
        !           486: *              data in Cache, 2 NO-OPs
        !           487: *
        !           488: ************************************************************************/
        !           489: pipe7_7() 
        !           490: {
        !           491:        force_loop = FALSE;                     /* clear force_loop flag */
        !           492:        index = 0;
        !           493:        do 
        !           494:        {
        !           495:           sgl_value_1  = ldf_1_data[index].ld;   /* get operand 1        */
        !           496:           sgl_expected = ldf_1_data[index].exp;  /* get expected results */
        !           497:           sgl_value_2  = 0;                      /* set the '0' operand  */
        !           498: /*
        !           499:  * If LOOP ON ERROR is set, this is the loop for this subtest.
        !           500:  * The force loop flag is set after the first error.
        !           501: */
        !           502:           asm("_pipe7_7_lp1:");
        !           503:           asm("ldf _sgl_value_1");             /* load the ACC (ACC = op) */
        !           504:           asm("nop");
        !           505:           asm("nop");
        !           506:           asm("subf _sgl_value_1");            /* sub. the op. (ACC = 0 ) */
        !           507:           asm("nop");
        !           508:           asm("nop");
        !           509:           asm("addf _sgl_value_2");            /* add a '0'    (ACC = 0 ) */
        !           510:           asm("nop");
        !           511:           asm("nop");
        !           512:           asm("subf _sgl_value_1");            /* sub. the op. (ACC =-op) */
        !           513:           asm("nop");
        !           514:           asm("nop");
        !           515:           asm("addf _sgl_value_1");            /* add the op.  (ACC = 0 ) */
        !           516:           asm("nop");
        !           517:           asm("nop");
        !           518:           asm("subf _sgl_value_2");            /* sub. a '0'   (ACC = 0 ) */
        !           519:           asm("nop");
        !           520:           asm("nop");
        !           521:           asm("addf _sgl_value_1");            /* add the op.  (ACC = op) */
        !           522:           asm("nop");
        !           523:           asm("nop");
        !           524:           asm("subf _sgl_value_1");            /* sub. the op. (ACC = 0 ) */
        !           525:           asm("nop");
        !           526:           asm("nop");
        !           527:           asm("addf _sgl_value_2");            /* add a '0'    (ACC = 0 ) */
        !           528:           asm("nop");
        !           529:           asm("nop");
        !           530:           asm("subf _sgl_value_2");            /* sub. a '0'   (ACC = 0 ) */
        !           531:           asm("nop");
        !           532:           asm("nop");
        !           533:           asm("addf _sgl_value_1");            /* add the op.  (ACC = op) */
        !           534:           asm("nop");
        !           535:           asm("nop");
        !           536:           asm("stf _sgl_st_acc");              /* store the ACC (s/b= op) */
        !           537:           if( force_loop )
        !           538:              asm("brb _pipe7_7_lp1");;         /* loop on the error       */
        !           539: /* 
        !           540:  * verify the results
        !           541: */
        !           542:           if( sgl_st_acc != sgl_expected )     /* COMPARE the values      */
        !           543:           {
        !           544:              errcnt++;                         /* bump the error count    */
        !           545:              if ( prt_error ) 
        !           546:                 print_pipe7_er("Cache Data, 2 NO-OPs");
        !           547:              if ( halt_flg )
        !           548:                 pipe7_er_hlt( subtest );
        !           549:              if ( loop_on_err ) {
        !           550:                 force_loop = TRUE;             /* set the force loop flag */
        !           551:                 asm("jmp _pipe7_7_lp1");       /* and loop                */
        !           552:              }
        !           553:           }   /* end of compare error */
        !           554:        } while( index++ < max_ldf_1_index );
        !           555: }  /* end of subtest 7 */
        !           556: 
        !           557: 
        !           558: 
        !           559: 
        !           560: 
        !           561: 
        !           562: /************************************************************************
        !           563: *
        !           564: *                      SUBTEST 8  
        !           565: *              data in Cache, 3 NO-OPs
        !           566: *
        !           567: ************************************************************************/
        !           568: pipe7_8() 
        !           569: {
        !           570:        force_loop = FALSE;                     /* clear force_loop flag */
        !           571:        index = 0;
        !           572:        do 
        !           573:        {
        !           574:           sgl_value_1  = ldf_1_data[index].ld;   /* get operand 1        */
        !           575:           sgl_expected = ldf_1_data[index].exp;  /* get expected results */
        !           576:           sgl_value_2  = 0;                      /* set the '0' operand  */
        !           577: /*
        !           578:  * If LOOP ON ERROR is set, this is the loop for this subtest.
        !           579:  * The force loop flag is set after the first error.
        !           580: */
        !           581:           asm("_pipe7_8_lp1:");
        !           582:           asm("ldf _sgl_value_1");             /* load the ACC (ACC = op) */
        !           583:           asm("nop");
        !           584:           asm("nop");
        !           585:           asm("nop");
        !           586:           asm("subf _sgl_value_1");            /* sub. the op. (ACC = 0 ) */
        !           587:           asm("nop");
        !           588:           asm("nop");
        !           589:           asm("nop");
        !           590:           asm("addf _sgl_value_2");            /* add a '0'    (ACC = 0 ) */
        !           591:           asm("nop");
        !           592:           asm("nop");
        !           593:           asm("nop");
        !           594:           asm("subf _sgl_value_1");            /* sub. the op. (ACC =-op) */
        !           595:           asm("nop");
        !           596:           asm("nop");
        !           597:           asm("nop");
        !           598:           asm("addf _sgl_value_1");            /* add the op.  (ACC = 0 ) */
        !           599:           asm("nop");
        !           600:           asm("nop");
        !           601:           asm("nop");
        !           602:           asm("subf _sgl_value_2");            /* sub. a '0'   (ACC = 0 ) */
        !           603:           asm("nop");
        !           604:           asm("nop");
        !           605:           asm("nop");
        !           606:           asm("addf _sgl_value_1");            /* add the op.  (ACC = op) */
        !           607:           asm("nop");
        !           608:           asm("nop");
        !           609:           asm("nop");
        !           610:           asm("subf _sgl_value_1");            /* sub. the op. (ACC = 0 ) */
        !           611:           asm("nop");
        !           612:           asm("nop");
        !           613:           asm("nop");
        !           614:           asm("addf _sgl_value_2");            /* add a '0'    (ACC = 0 ) */
        !           615:           asm("nop");
        !           616:           asm("nop");
        !           617:           asm("nop");
        !           618:           asm("subf _sgl_value_2");            /* sub. a '0'   (ACC = 0 ) */
        !           619:           asm("nop");
        !           620:           asm("nop");
        !           621:           asm("nop");
        !           622:           asm("addf _sgl_value_1");            /* add the op.  (ACC = op) */
        !           623:           asm("nop");
        !           624:           asm("nop");
        !           625:           asm("nop");
        !           626:           asm("stf _sgl_st_acc");              /* store the ACC (s/b= op) */
        !           627:           if( force_loop )
        !           628:              asm("brb _pipe7_8_lp1");;         /* loop on the error       */
        !           629: /* 
        !           630:  * verify the results
        !           631: */
        !           632:           if( sgl_st_acc != sgl_expected )     /* COMPARE the values      */
        !           633:           {
        !           634:              errcnt++;                         /* bump the error count    */
        !           635:              if ( prt_error ) 
        !           636:                 print_pipe7_er("Cache Data, 3 NO-OPs");
        !           637:              if ( halt_flg )
        !           638:                 pipe7_er_hlt( subtest );
        !           639:              if ( loop_on_err ) {
        !           640:                 force_loop = TRUE;             /* set the force loop flag */
        !           641:                 asm("jmp _pipe7_8_lp1");       /* and loop                */
        !           642:              }
        !           643:           }   /* end of compare error */
        !           644:        } while( index++ < max_ldf_1_index );
        !           645: }  /* end of subtest 8 */
        !           646: 
        !           647: 
        !           648: 
        !           649: 
        !           650: 
        !           651: 
        !           652: /*****************************************************************************
        !           653: *
        !           654: *                      SUBTEST 9  
        !           655: *              data on the stack, no NO-OPs
        !           656: *
        !           657: *****************************************************************************/
        !           658: pipe7_9() 
        !           659: {
        !           660:        asm("moval (r13),_pre_event_fp");       /* save the frame pointer   */ 
        !           661:        asm("moval (r14),_pre_event_sp");       /* save the stack pointer   */ 
        !           662:        force_loop = FALSE;                     /* clear force_loop flag */
        !           663:        index = 0;
        !           664:        do 
        !           665:        {
        !           666:           sgl_value_1  = ldf_1_data[index].ld;   /* get operand 1          */
        !           667:           sgl_expected = ldf_1_data[index].exp;  /* get expected results   */
        !           668:           sgl_value_4  = 0;                      /* set the '0' operand  */
        !           669:           asm("moval _pointer_data,_sgl_value_2");/* init / final SP value */
        !           670: /*
        !           671:  * If LOOP ON ERROR is set, this is the loop for this subtest.
        !           672:  * The force loop flag is set after the first error.
        !           673: */
        !           674:           asm("_pipe7_9_lp1:");
        !           675:           asm("moval _pointer_data,r14");      /* set the stack pointer  */
        !           676:           asm("movl _sgl_value_1,-(r14)");     /* push operand to add    */
        !           677:           asm("movl _sgl_value_4,-(r14)");     /* '0' to subtract */
        !           678:           asm("movl _sgl_value_4,-(r14)");     /* '0' to add      */
        !           679:           asm("movl _sgl_value_1,-(r14)");     /* op. to subtract */
        !           680:           asm("movl _sgl_value_1,-(r14)");     /* op. to add      */
        !           681:           asm("movl _sgl_value_4,-(r14)");     /* '0' to subtract */
        !           682:           asm("movl _sgl_value_1,-(r14)");     /* op. to add      */
        !           683:           asm("movl _sgl_value_1,-(r14)");     /* op. to subtract */
        !           684:           asm("movl _sgl_value_4,-(r14)");     /* '0' to add      */
        !           685:           asm("movl _sgl_value_1,-(r14)");     /* op. to subtract */
        !           686:           asm("movl _sgl_value_1,-(r14)");     /* op. to load */
        !           687: /*
        !           688:  * now pop the data off the stack
        !           689: */
        !           690:           asm("ldf (r14)+");                   /* pop the data & load it  */
        !           691:           asm("subf (r14)+");                  /* sub. the op. (ACC = 0 ) */
        !           692:           asm("addf (r14)+");                  /* add a '0'    (ACC = 0 ) */
        !           693:           asm("subf (r14)+");                  /* sub. the op. (ACC =-op) */
        !           694:           asm("addf (r14)+");                  /* add the op.  (ACC = 0 ) */
        !           695:           asm("subf (r14)+");                  /* sub. a '0'   (ACC = 0 ) */
        !           696:           asm("addf (r14)+");                  /* add the op.  (ACC = op) */
        !           697:           asm("subf (r14)+");                  /* sub. the op. (ACC = 0 ) */
        !           698:           asm("addf (r14)+");                  /* add a '0'    (ACC = 0 ) */
        !           699:           asm("subf (r14)+");                  /* sub. a '0'   (ACC = 0 ) */
        !           700:           asm("addf (r14)+");                  /* add the op.  (ACC = op) */
        !           701:           asm("stf r5");                       /* store the ACC (s/b= op) */
        !           702:           if( force_loop )
        !           703:              asm("brb _pipe7_9_lp1");;         /* loop on the error       */
        !           704: /* 
        !           705:  * verify the results
        !           706: */
        !           707:           asm("movl r5,_sgl_st_acc");          /* get the result          */
        !           708:           asm("moval (r14),_sgl_value_3");     /* save the stack pointer  */
        !           709:           if( (sgl_st_acc  != sgl_expected) || /* verify the result...    */
        !           710:               (sgl_value_3 != sgl_value_2) )   /* ... and the final SP    */
        !           711:           {
        !           712:              asm("movl _pre_event_fp,r13");    /* restore frame pointer   */
        !           713:              asm("movl _pre_event_sp,r14");    /* restore stack pointer   */
        !           714:              errcnt++;                         /* bump the error count    */
        !           715:              if ( prt_error ) {
        !           716:                 print_pipe7_er("POP data from the STACK");
        !           717:                 writes("final Stack Pointer = ");
        !           718:                 write32h( sgl_value_5 );
        !           719:                 writes(",  expected SP = ");
        !           720:                 write32h( sgl_value_4 );
        !           721:                 writes("\n");
        !           722:              }
        !           723:              if ( halt_flg )                   /* halt on error?          */
        !           724:                 pipe7_er_hlt( subtest );
        !           725:              if ( loop_on_err ) {
        !           726:                 force_loop = TRUE;             /* set the force loop flag */
        !           727:                 asm("jmp _pipe7_9_lp1");       /* and loop                */
        !           728:              }
        !           729:           }   /* end of compare error */
        !           730:        } while( index++ < max_ldf_1_index );
        !           731:        asm("movl _pre_event_fp,r13");          /* restore the frame pointer */
        !           732:        asm("movl _pre_event_sp,r14");          /* restore the stack pointer */
        !           733: }  /* end of subtest 9 */
        !           734: 
        !           735: 
        !           736: 
        !           737: 
        !           738: 
        !           739: 
        !           740: /******************************************************************************
        !           741: *
        !           742: *                      SUBTEST 10  
        !           743: *      load 0, add operand 4 times  -get data via indexed FRAME pointer
        !           744: *
        !           745: *      ADDR            INDEX   DATA
        !           746: *      pointer_data      4     <the STF result goes here>
        !           747: *      pointer_data-4    3     <operand data>
        !           748: *      pointer_data-8    2     <'0' data>
        !           749: *      pointer_data-16   0     point the frame pointer here
        !           750: *
        !           751: ******************************************************************************/
        !           752: pipe7_10() 
        !           753: {
        !           754:        asm("moval (r13),_pre_event_fp");       /* save the frame pointer   */ 
        !           755:        asm("moval (r14),_pre_event_sp");       /* save the stack pointer   */ 
        !           756:        force_loop = FALSE;                     /* clear force_loop flag */
        !           757:        index = 0;
        !           758:        do 
        !           759:        {
        !           760:           sgl_value_1  = ldf_1_data[index].ld;    /* get operand 1         */
        !           761:           sgl_expected = ldf_1_data[index].exp;   /* get expected results  */
        !           762:           sgl_value_4  = 0;                      /* set the '0' operand  */
        !           763:           asm("moval _pointer_data,_sgl_value_2");/* init / final SP value */
        !           764: /*
        !           765:  * If LOOP ON ERROR is set, this is the loop for this subtest.
        !           766:  * The force loop flag is set after the first error.
        !           767: */
        !           768:           asm("_pipe7_10_lp1:");
        !           769:           asm("moval _pointer_data,_sgl_value_2");/* get store data's addr */
        !           770:           sgl_value_2 -= 4;                    /* decrement it by 4 (bytes)*/
        !           771:           asm("movl _sgl_value_1,*_sgl_value_2");/* set the operand data   */
        !           772:           sgl_value_2 -= 4;                    /* decrement it by 4 (bytes)*/
        !           773:           asm("movl _sgl_value_4,*_sgl_value_2");/* set the '0' data       */
        !           774:           sgl_value_2 -= 8;                    /* get the FP addr to use   */
        !           775:           asm("movl _sgl_value_2,r13");        /* set the FRAME POINTER    */
        !           776:           asm("movl $2,r2");                   /* r2 index = 2 longwords   */
        !           777:           asm("movl $3,r5");                   /* r5 index = 3 longwords   */
        !           778:           asm("movl $4,r6");                   /* r6 index = 4 longwords   */
        !           779:           asm("ldf (r13)[r5]");                /* load the operand via SP  */
        !           780:           asm("subf (r13)[r5]");               /* sub. the op. (ACC = 0 )  */
        !           781:           asm("addf (r13)[r2]");               /* add a '0'    (ACC = 0 )  */
        !           782:           asm("subf (r13)[r5]");               /* sub. the op. (ACC =-op)  */
        !           783:           asm("addf (r13)[r5]");               /* add the op.  (ACC = 0 )  */
        !           784:           asm("subf (r13)[r2]");               /* sub. a '0'   (ACC = 0 )  */
        !           785:           asm("addf (r13)[r5]");               /* add the op.  (ACC = op)  */
        !           786:           asm("subf (r13)[r5]");               /* sub. the op. (ACC = 0 )  */
        !           787:           asm("addf (r13)[r2]");               /* add a '0'    (ACC = 0 )  */
        !           788:           asm("subf (r13)[r2]");               /* sub. a '0'   (ACC = 0 )  */
        !           789:           asm("addf (r13)[r5]");               /* add the op.  (ACC = op)  */
        !           790:           asm("stf (r13)[r6]");                /* store -indexed by r6     */
        !           791:           if( force_loop )
        !           792:              asm("brb _pipe7_10_lp1");;        /* loop on the error       */
        !           793: /* 
        !           794:  * verify the results
        !           795: */
        !           796:           sgl_st_acc = pointer_data;           /* move the stored result  */
        !           797:           asm("moval (r13),_sgl_value_3");     /* save the frame pointer  */
        !           798:           if( (sgl_st_acc  != sgl_expected) || /* verify the result...    */
        !           799:               (sgl_value_3 != sgl_value_2) )   /* ... and the final FP    */
        !           800:           {
        !           801:              asm("movl _pre_event_fp,r13");    /* restore frame pointer   */
        !           802:              asm("movl _pre_event_sp,r14");    /* restore stack pointer   */
        !           803:              errcnt++;                         /* bump the error count    */
        !           804:              if ( prt_error ) {
        !           805:                 print_pipe7_er("indexed FP addressing");
        !           806:                 writes("final Frame Pointer = ");
        !           807:                 writeh( sgl_value_5 );
        !           808:                 writes(",  expected FP = ");
        !           809:                 writeh( sgl_value_4 );
        !           810:                 writes("\n");
        !           811:              }
        !           812:              if ( halt_flg )                   /* halt on error?          */
        !           813:                 pipe7_er_hlt( subtest );
        !           814:              if ( loop_on_err ) {
        !           815:                 force_loop = TRUE;             /* set the force loop flag */
        !           816:                 asm("jmp _pipe7_10_lp1");      /* and loop                */
        !           817:              }
        !           818:           }   /* end of compare error */
        !           819:        } while( index++ < max_ldf_1_index );
        !           820:        asm("movl _pre_event_fp,r13");          /* restore the frame pointer */
        !           821:        asm("movl _pre_event_sp,r14");          /* restore the stack pointer */
        !           822: }  /* end of subtest 10 */
        !           823: 
        !           824: 
        !           825: /******************************************************************************
        !           826: *
        !           827: *                      ERROR ROUTINE
        !           828: *
        !           829: *      print an error in the following form
        !           830: *
        !           831: *  operand = xxxxxxxx,   final Acc = xxxxxxxx,   data index = dd
        !           832: *                     expected Acc = xxxxxxxx
        !           833: *
        !           834: ******************************************************************************/
        !           835: print_pipe7_er(msg)
        !           836: char *msg;
        !           837: {
        !           838:        writes("\n");           /* start a new print line   */
        !           839:        writes("cycle: ");
        !           840:        writed( cycle );
        !           841:        writes(" test ");
        !           842:        writed( test_no );
        !           843:        writes("  (Pipe 7), subtest ");
        !           844:        writed( subtest );
        !           845:        writes(" error - ");
        !           846:        writes( msg );
        !           847:        writec('\n');
        !           848:        writes(
        !           849:        "LDF(op), SUBF(op), ADDF(0.0), SUBF(op),  ADDF(op),  SUBF(0.0),\n");
        !           850:        writes(
        !           851:        "         ADDF(op), SUBF(op),  ADDF(0.0), SUBF(0.0), ADDF(op),  STF\n");
        !           852:        writes("operand = ");
        !           853:        write32h( sgl_value_1 );
        !           854:        writes(",   final Acc = ");
        !           855:        write32h( sgl_st_acc );
        !           856:        writes(",   data index = ");
        !           857:        writed( index );
        !           858:        writec('\n');
        !           859:        writes("                   expected Acc = ");
        !           860:        write32h( sgl_expected );
        !           861:        writec('\n');
        !           862: }
        !           863: 
        !           864: 
        !           865: 
        !           866: 
        !           867: 
        !           868: /******************************************************************************
        !           869: *
        !           870: *                      HALT ON ERROR ROUTINE
        !           871: *
        !           872: *      halt with the necessary information saved in the registers
        !           873: *
        !           874: ******************************************************************************/
        !           875: pipe7_er_hlt( subtest )
        !           876: int subtest;
        !           877: {
        !           878:        asm("movl _test_no,r0");                /* r0 = test number        */
        !           879:        asm("movl _subtest,r1");                /* r1 = subtest number     */
        !           880:        asm("movl $1,r2");                      /* r2 = error code         */
        !           881:        asm("movl _cycle,r3");                  /* r3 = cycle count        */
        !           882:        asm("movl _sgl_value_1,r4");            /* r4 = sgl operand        */
        !           883:        asm("movl _sgl_st_acc,r5");             /* r5 = sgl stored         */
        !           884:        asm("movl _sgl_expected,r6");           /* r6 = sgl expected       */
        !           885:        asm("movl _index,r7");                  /* r7 = data index         */
        !           886:        asm("movl _sgl_value_2,r8");            /* r8 = floating zero      */
        !           887:        if( subtest == 9 ) {
        !           888:                asm("movl _sgl_value_3,r9");    /* r9 = final SP value     */
        !           889:                asm("movl _sgl_value_2,r10");   /* r10 = expected SP value */
        !           890:        } else
        !           891:        if( subtest == 10 ) {
        !           892:                asm("movl _sgl_value_3,r9");    /* r9 = final FP value     */
        !           893:                asm("movl _sgl_value_2,r10");   /* r10 = expected FP value */
        !           894:        };
        !           895:        asm(".globl _pipe7_1_hlt");
        !           896:        asm("_pipe7_1_hlt:");                   /* PC after the halt       */
        !           897:        asm("halt");                            /* HALT ...                */
        !           898: }  /* 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.