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

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