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

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