Annotation of cci/d/macro4/pipe13.c, revision 1.1.1.1

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