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

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