|
|
1.1 ! root 1: ! 2: ! 3: #include "fpp_defs.h" ! 4: ! 5: ! 6: /***************************************************************************** ! 7: * ! 8: * PIPELINE TEST #2 MONITOR ! 9: * ! 10: * This test will do: ! 11: * ! 12: * LNF(x), MULF(1), MULF(1), ADDF(0), MULF(1), STF ! 13: * ! 14: * where x is the fmacro1 LNF data. ! 15: *****************************************************************************/ ! 16: pipe_2() ! 17: { ! 18: asm(".globl _pipeline_2_t"); ! 19: asm("_pipeline_2_t:"); /* entry address */ ! 20: if( (cycle == 1) && (prt_hdrs) ) /* print headers on 1st cycle */ ! 21: { ! 22: writes(" PIPE_2 "); ! 23: } ! 24: subtest = 1; ! 25: pipe2_1(); /* data in REGs, no NOPs */ ! 26: subtest++; /* increment the subtest */ ! 27: pipe2_2(); /* data in REGs, 1 NOP */ ! 28: subtest++; /* increment the subtest */ ! 29: pipe2_3(); /* data in REGs, 2 NOPs */ ! 30: subtest++; /* increment the subtest */ ! 31: pipe2_4(); /* data in REGs, 3 NOPs */ ! 32: subtest++; /* increment the subtest */ ! 33: pipe2_5(); /* data in CACHE, no NOPs */ ! 34: subtest++; /* increment the subtest */ ! 35: pipe2_6(); /* data in CACHE, 1 NOP */ ! 36: subtest++; /* increment the subtest */ ! 37: pipe2_7(); /* data in CACHE, 2 NOPs */ ! 38: subtest++; /* increment the subtest */ ! 39: pipe2_8(); /* data in CACHE, 3 NOPs */ ! 40: subtest++; /* increment the subtest */ ! 41: pipe2_9(); /* data on STACK, no NOPs */ ! 42: subtest++; /* increment the subtest */ ! 43: pipe2_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: pipe2_1() ! 59: { ! 60: force_loop = FALSE; /* clear force_loop flag */ ! 61: index = 0; ! 62: do ! 63: { ! 64: sgl_value_1 = lnf_1_data[index].ld; /* get operand 1 */ ! 65: sgl_expected = lnf_1_data[index].exp; /* get expected results */ ! 66: sgl_value_2 = 0x40800000; /* floating '1' */ ! 67: sgl_value_3 = 0; /* floating '0' */ ! 68: /* ! 69: * If LOOP ON ERROR is set, this is the loop for this subtest. ! 70: * The force loop flag is set after the first error. ! 71: */ ! 72: asm("_pipe2_1_lp1:"); ! 73: asm("movl _sgl_value_1,r4"); /* move the data to r4 */ ! 74: asm("movl _sgl_value_2,r5"); /* move data to r5 */ ! 75: asm("movl _sgl_value_3,r6"); /* move data to r6 */ ! 76: asm("lnf r4"); /* load (negate) the data */ ! 77: asm("mulf r5"); /* multipy by '1' (twice) */ ! 78: asm("mulf r5"); ! 79: asm("addf r6"); /* add a '0' */ ! 80: asm("mulf r5"); /* multipy by '1' again */ ! 81: asm("stf r7"); /* store the result */ ! 82: if( force_loop ); ! 83: asm("brb _pipe2_1_lp1");; /* loop on the error */ ! 84: /* ! 85: * verify the results ! 86: */ ! 87: asm("movl r7,_sgl_st_acc"); /* get the result */ ! 88: if( sgl_st_acc != sgl_expected ) /* COMPARE the values */ ! 89: { ! 90: errcnt++; /* bump the error count */ ! 91: if ( prt_error ) ! 92: print_pipe2_er("Reg. Data, no NO-OPS"); ! 93: if ( halt_flg ) /* halt on error? */ ! 94: pipe2_er_hlt( subtest ); ! 95: if ( loop_on_err ) { ! 96: force_loop = TRUE; /* set the force loop flag */ ! 97: asm("brw _pipe2_1_lp1"); /* and loop */ ! 98: } ! 99: } /* end of compare error */ ! 100: } while( index++ < max_lnf_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: pipe2_2() ! 115: { ! 116: force_loop = FALSE; /* clear force_loop flag */ ! 117: index = 0; ! 118: do ! 119: { ! 120: sgl_value_1 = lnf_1_data[index].ld; /* get operand 1 */ ! 121: sgl_expected = lnf_1_data[index].exp; /* get expected results */ ! 122: sgl_value_2 = 0x40800000; /* floating '1' */ ! 123: sgl_value_3 = 0; /* floating '0' */ ! 124: /* ! 125: * If LOOP ON ERROR is set, this is the loop for this subtest. ! 126: * The force loop flag is set after the first error. ! 127: */ ! 128: asm("_pipe2_2_lp1:"); ! 129: asm("movl _sgl_value_1,r4"); /* move the data to r4 */ ! 130: asm("movl _sgl_value_2,r5"); /* move data to r5 */ ! 131: asm("movl _sgl_value_3,r6"); /* move data to r6 */ ! 132: asm("lnf r4"); /* load (negate) the data */ ! 133: asm("nop"); ! 134: asm("mulf r5"); /* multipy by '1' (twice) */ ! 135: asm("nop"); ! 136: asm("mulf r5"); ! 137: asm("nop"); ! 138: asm("addf r6"); /* add a '0' */ ! 139: asm("nop"); ! 140: asm("mulf r5"); /* multipy by '1' again */ ! 141: asm("nop"); ! 142: asm("stf r7"); /* store the result */ ! 143: if( force_loop ); ! 144: asm("brb _pipe2_2_lp1");; /* loop on the error */ ! 145: /* ! 146: * verify the results ! 147: */ ! 148: asm("movl r7,_sgl_st_acc"); /* get the result */ ! 149: if( sgl_st_acc != sgl_expected ) /* COMPARE the values */ ! 150: { ! 151: errcnt++; /* bump the error count */ ! 152: if ( prt_error ) ! 153: print_pipe2_er("Reg. Data, 1 NO-OP"); ! 154: if ( halt_flg ) /* halt on error? */ ! 155: pipe2_er_hlt( subtest ); ! 156: if ( loop_on_err ) { ! 157: force_loop = TRUE; /* set the force loop flag */ ! 158: asm("brw _pipe2_2_lp1"); /* and loop */ ! 159: } ! 160: } /* end of compare error */ ! 161: } while( index++ < max_lnf_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: pipe2_3() ! 176: { ! 177: force_loop = FALSE; /* clear force_loop flag */ ! 178: index = 0; ! 179: do ! 180: { ! 181: sgl_value_1 = lnf_1_data[index].ld; /* get operand 1 */ ! 182: sgl_expected = lnf_1_data[index].exp; /* get expected results */ ! 183: sgl_value_2 = 0x40800000; /* floating '1' */ ! 184: sgl_value_3 = 0; /* floating '0' */ ! 185: /* ! 186: * If LOOP ON ERROR is set, this is the loop for this subtest. ! 187: * The force loop flag is set after the first error. ! 188: */ ! 189: asm("_pipe2_3_lp1:"); ! 190: asm("movl _sgl_value_1,r4"); /* move the data to r4 */ ! 191: asm("movl _sgl_value_2,r5"); /* move data to r5 */ ! 192: asm("movl _sgl_value_3,r6"); /* move data to r6 */ ! 193: asm("lnf r4"); /* load (negate) the data */ ! 194: asm("nop"); ! 195: asm("nop"); ! 196: asm("mulf r5"); /* multipy by '1' (twice) */ ! 197: asm("nop"); ! 198: asm("nop"); ! 199: asm("mulf r5"); ! 200: asm("nop"); ! 201: asm("nop"); ! 202: asm("addf r6"); /* add a '0' */ ! 203: asm("nop"); ! 204: asm("nop"); ! 205: asm("mulf r5"); /* multipy by '1' again */ ! 206: asm("nop"); ! 207: asm("nop"); ! 208: asm("stf r7"); /* store the result */ ! 209: if( force_loop ); ! 210: asm("brb _pipe2_3_lp1");; /* loop on the error */ ! 211: /* ! 212: * verify the results ! 213: */ ! 214: asm("movl r7,_sgl_st_acc"); /* get the result */ ! 215: if( sgl_st_acc != sgl_expected ) /* COMPARE the values */ ! 216: { ! 217: errcnt++; /* bump the error count */ ! 218: if ( prt_error ) ! 219: print_pipe2_er("Reg. Data, 2 NO-OPS"); ! 220: if ( halt_flg ) /* halt on error? */ ! 221: pipe2_er_hlt( subtest ); ! 222: if ( loop_on_err ) { ! 223: force_loop = TRUE; /* set the force loop flag */ ! 224: asm("brw _pipe2_3_lp1"); /* and loop */ ! 225: } ! 226: } /* end of compare error */ ! 227: } while( index++ < max_lnf_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: pipe2_4() ! 242: { ! 243: force_loop = FALSE; /* clear force_loop flag */ ! 244: index = 0; ! 245: do ! 246: { ! 247: sgl_value_1 = lnf_1_data[index].ld; /* get operand 1 */ ! 248: sgl_expected = lnf_1_data[index].exp; /* get expected results */ ! 249: sgl_value_2 = 0x40800000; /* floating '1' */ ! 250: sgl_value_3 = 0; /* floating '0' */ ! 251: /* ! 252: * If LOOP ON ERROR is set, this is the loop for this subtest. ! 253: * The force loop flag is set after the first error. ! 254: */ ! 255: asm("_pipe2_4_lp1:"); ! 256: asm("movl _sgl_value_1,r4"); /* move the data to r4 */ ! 257: asm("movl _sgl_value_2,r5"); /* move data to r5 */ ! 258: asm("movl _sgl_value_3,r6"); /* move data to r6 */ ! 259: asm("lnf r4"); /* load (negate) the data */ ! 260: asm("nop"); ! 261: asm("nop"); ! 262: asm("nop"); ! 263: asm("mulf r5"); /* multipy by '1' (twice) */ ! 264: asm("nop"); ! 265: asm("nop"); ! 266: asm("nop"); ! 267: asm("mulf r5"); ! 268: asm("nop"); ! 269: asm("nop"); ! 270: asm("nop"); ! 271: asm("addf r6"); /* add a '0' */ ! 272: asm("nop"); ! 273: asm("nop"); ! 274: asm("nop"); ! 275: asm("mulf r5"); /* multipy by '1' again */ ! 276: asm("nop"); ! 277: asm("nop"); ! 278: asm("nop"); ! 279: asm("stf r7"); /* store the result */ ! 280: if( force_loop ); ! 281: asm("brb _pipe2_4_lp1");; /* loop on the error */ ! 282: /* ! 283: * verify the results ! 284: */ ! 285: asm("movl r7,_sgl_st_acc"); /* get the result */ ! 286: if( sgl_st_acc != sgl_expected ) /* COMPARE the values */ ! 287: { ! 288: errcnt++; /* bump the error count */ ! 289: if ( prt_error ) ! 290: print_pipe2_er("Reg. Data, 3 NO-OPS"); ! 291: if ( halt_flg ) /* halt on error? */ ! 292: pipe2_er_hlt( subtest ); ! 293: if ( loop_on_err ) { ! 294: force_loop = TRUE; /* set the force loop flag */ ! 295: asm("brw _pipe2_4_lp1"); /* and loop */ ! 296: } ! 297: } /* end of compare error */ ! 298: } while( index++ < max_lnf_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: pipe2_5() ! 314: { ! 315: force_loop = FALSE; /* clear force_loop flag */ ! 316: index = 0; ! 317: do ! 318: { ! 319: sgl_value_1 = lnf_1_data[index].ld; /* get operand 1 */ ! 320: sgl_expected = lnf_1_data[index].exp; /* get expected results */ ! 321: sgl_value_2 = 0x40800000; /* floating '1' */ ! 322: sgl_value_3 = 0; /* floating '0' */ ! 323: /* ! 324: * If LOOP ON ERROR is set, this is the loop for this subtest. ! 325: * The force loop flag is set after the first error. ! 326: */ ! 327: asm("_pipe2_5_lp1:"); ! 328: asm("lnf _sgl_value_1"); /* load (negate) the data */ ! 329: asm("mulf _sgl_value_2"); /* multipy by '1' (twice) */ ! 330: asm("mulf _sgl_value_2"); ! 331: asm("addf _sgl_value_3"); /* add a '0' */ ! 332: asm("mulf _sgl_value_2"); /* multipy by '1' again */ ! 333: asm("stf _sgl_st_acc"); /* store the result */ ! 334: if( force_loop ); ! 335: asm("brb _pipe2_5_lp1");; /* loop on the error */ ! 336: /* ! 337: * verify the results ! 338: */ ! 339: if( sgl_st_acc != sgl_expected ) /* COMPARE the values */ ! 340: { ! 341: errcnt++; /* bump the error count */ ! 342: if ( prt_error ) ! 343: print_pipe2_er("Cache Data, no NO-OPS"); ! 344: if ( halt_flg ) /* halt on error? */ ! 345: pipe2_er_hlt( subtest ); ! 346: if ( loop_on_err ) { ! 347: force_loop = TRUE; /* set the force loop flag */ ! 348: asm("brw _pipe2_5_lp1"); /* and loop */ ! 349: } ! 350: } /* end of compare error */ ! 351: } while( index++ < max_lnf_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: pipe2_6() ! 366: { ! 367: force_loop = FALSE; /* clear force_loop flag */ ! 368: index = 0; ! 369: do ! 370: { ! 371: sgl_value_1 = lnf_1_data[index].ld; /* get operand 1 */ ! 372: sgl_expected = lnf_1_data[index].exp; /* get expected results */ ! 373: sgl_value_2 = 0x40800000; /* floating '1' */ ! 374: sgl_value_3 = 0; /* floating '0' */ ! 375: /* ! 376: * If LOOP ON ERROR is set, this is the loop for this subtest. ! 377: * The force loop flag is set after the first error. ! 378: */ ! 379: asm("_pipe2_6_lp1:"); ! 380: asm("lnf _sgl_value_1"); /* load (negate) the data */ ! 381: asm("nop"); ! 382: asm("mulf _sgl_value_2"); /* multipy by '1' (twice) */ ! 383: asm("nop"); ! 384: asm("mulf _sgl_value_2"); ! 385: asm("nop"); ! 386: asm("addf _sgl_value_3"); /* add a '0' */ ! 387: asm("nop"); ! 388: asm("mulf _sgl_value_2"); /* multipy by '1' again */ ! 389: asm("nop"); ! 390: asm("stf _sgl_st_acc"); /* store the result */ ! 391: if( force_loop ); ! 392: asm("brb _pipe2_6_lp1");; /* loop on the error */ ! 393: /* ! 394: * verify the results ! 395: */ ! 396: if( sgl_st_acc != sgl_expected ) /* COMPARE the values */ ! 397: { ! 398: errcnt++; /* bump the error count */ ! 399: if ( prt_error ) ! 400: print_pipe2_er("Cache Data, 1 NO-OP"); ! 401: if ( halt_flg ) /* halt on error? */ ! 402: pipe2_er_hlt( subtest ); ! 403: if ( loop_on_err ) { ! 404: force_loop = TRUE; /* set the force loop flag */ ! 405: asm("brw _pipe2_6_lp1"); /* and loop */ ! 406: } ! 407: } /* end of compare error */ ! 408: } while( index++ < max_lnf_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: pipe2_7() ! 423: { ! 424: force_loop = FALSE; /* clear force_loop flag */ ! 425: index = 0; ! 426: do ! 427: { ! 428: sgl_value_1 = lnf_1_data[index].ld; /* get operand 1 */ ! 429: sgl_expected = lnf_1_data[index].exp; /* get expected results */ ! 430: sgl_value_2 = 0x40800000; /* floating '1' */ ! 431: sgl_value_3 = 0; /* floating '0' */ ! 432: /* ! 433: * If LOOP ON ERROR is set, this is the loop for this subtest. ! 434: * The force loop flag is set after the first error. ! 435: */ ! 436: asm("_pipe2_7_lp1:"); ! 437: asm("lnf _sgl_value_1"); /* load (negate) the data */ ! 438: asm("nop"); ! 439: asm("nop"); ! 440: asm("mulf _sgl_value_2"); /* multipy by '1' (twice) */ ! 441: asm("nop"); ! 442: asm("nop"); ! 443: asm("mulf _sgl_value_2"); ! 444: asm("nop"); ! 445: asm("nop"); ! 446: asm("addf _sgl_value_3"); /* add a '0' */ ! 447: asm("nop"); ! 448: asm("nop"); ! 449: asm("mulf _sgl_value_2"); /* multipy by '1' again */ ! 450: asm("nop"); ! 451: asm("nop"); ! 452: asm("stf _sgl_st_acc"); /* store the result */ ! 453: if( force_loop ); ! 454: asm("brb _pipe2_7_lp1");; /* loop on the error */ ! 455: /* ! 456: * verify the results ! 457: */ ! 458: if( sgl_st_acc != sgl_expected ) /* COMPARE the values */ ! 459: { ! 460: errcnt++; /* bump the error count */ ! 461: if ( prt_error ) ! 462: print_pipe2_er("Cache Data, 2 NO-OPS"); ! 463: if ( halt_flg ) /* halt on error? */ ! 464: pipe2_er_hlt( subtest ); ! 465: if ( loop_on_err ) { ! 466: force_loop = TRUE; /* set the force loop flag */ ! 467: asm("brw _pipe2_7_lp1"); /* and loop */ ! 468: } ! 469: } /* end of compare error */ ! 470: } while( index++ < max_lnf_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: pipe2_8() ! 485: { ! 486: force_loop = FALSE; /* clear force_loop flag */ ! 487: index = 0; ! 488: do ! 489: { ! 490: sgl_value_1 = lnf_1_data[index].ld; /* get operand 1 */ ! 491: sgl_expected = lnf_1_data[index].exp; /* get expected results */ ! 492: sgl_value_2 = 0x40800000; /* floating '1' */ ! 493: sgl_value_3 = 0; /* floating '0' */ ! 494: /* ! 495: * If LOOP ON ERROR is set, this is the loop for this subtest. ! 496: * The force loop flag is set after the first error. ! 497: */ ! 498: asm("_pipe2_8_lp1:"); ! 499: asm("lnf _sgl_value_1"); /* load (negate) the data */ ! 500: asm("nop"); ! 501: asm("nop"); ! 502: asm("nop"); ! 503: asm("mulf _sgl_value_2"); /* multipy by '1' (twice) */ ! 504: asm("nop"); ! 505: asm("nop"); ! 506: asm("nop"); ! 507: asm("mulf _sgl_value_2"); ! 508: asm("nop"); ! 509: asm("nop"); ! 510: asm("nop"); ! 511: asm("addf _sgl_value_3"); /* add a '0' */ ! 512: asm("nop"); ! 513: asm("nop"); ! 514: asm("nop"); ! 515: asm("mulf _sgl_value_2"); /* multipy by '1' again */ ! 516: asm("nop"); ! 517: asm("nop"); ! 518: asm("nop"); ! 519: asm("stf _sgl_st_acc"); /* store the result */ ! 520: if( force_loop ); ! 521: asm("brb _pipe2_8_lp1");; /* loop on the error */ ! 522: /* ! 523: * verify the results ! 524: */ ! 525: if( sgl_st_acc != sgl_expected ) /* COMPARE the values */ ! 526: { ! 527: errcnt++; /* bump the error count */ ! 528: if ( prt_error ) ! 529: print_pipe2_er("Cache Data, 3 NO-OPS"); ! 530: if ( halt_flg ) /* halt on error? */ ! 531: pipe2_er_hlt( subtest ); ! 532: if ( loop_on_err ) { ! 533: force_loop = TRUE; /* set the force loop flag */ ! 534: asm("brw _pipe2_8_lp1"); /* and loop */ ! 535: } ! 536: } /* end of compare error */ ! 537: } while( index++ < max_lnf_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: pipe2_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 = lnf_1_data[index].ld; /* get operand 1 */ ! 560: sgl_expected = lnf_1_data[index].exp; /* get expected results */ ! 561: sgl_value_2 = 0x40800000; /* floating '1' */ ! 562: sgl_value_3 = 0; /* floating '0' */ ! 563: asm("moval _pointer_data,_sgl_value_4");/* init / final SP value */ ! 564: /* ! 565: * If LOOP ON ERROR is set, this is the loop for this subtest. ! 566: * The force loop flag is set after the first error. ! 567: */ ! 568: asm("_pipe2_9_lp1:"); ! 569: asm("moval _pointer_data,r14"); /* set the stack pointer */ ! 570: asm("movl _sgl_value_2,-(r14)"); /* push a '1' on the stack */ ! 571: asm("movl _sgl_value_3,-(r14)"); /* push a '0' on the stack */ ! 572: asm("movl _sgl_value_2,-(r14)"); /* push 2 more '1's */ ! 573: asm("movl _sgl_value_2,-(r14)"); ! 574: asm("movl _sgl_value_1,-(r14)"); /* push the operand */ ! 575: /* ! 576: * now pop the data off the stack ! 577: */ ! 578: asm("lnf (r14)+"); /* load (negate) the data */ ! 579: asm("mulf (r14)+"); /* multiply by '1' (twice) */ ! 580: asm("mulf (r14)+"); ! 581: asm("addf (r14)+"); /* add a '0' */ ! 582: asm("mulf (r14)+"); /* multiply by '1' again */ ! 583: asm("stf r5"); /* store the result */ ! 584: if( force_loop ); ! 585: asm("brb _pipe2_9_lp1");; /* loop on the error */ ! 586: /* ! 587: * verify the results ! 588: */ ! 589: asm("movl r5,_sgl_st_acc"); /* get the result */ ! 590: asm("moval (r14),_sgl_value_5"); /* save the stack pointer */ ! 591: if( (sgl_st_acc != sgl_expected) || /* verify the result... */ ! 592: (sgl_value_5 != sgl_value_4) ) /* ... and the final SP */ ! 593: { ! 594: asm("movl _pre_event_fp,r13"); /* restore frame pointer */ ! 595: asm("movl _pre_event_sp,r14"); /* restore stack pointer */ ! 596: errcnt++; /* bump the error count */ ! 597: if ( prt_error ) ! 598: print_pipe2_er("POP Data from the STACK"); ! 599: writes("final Stack Pointer = "); ! 600: write32h( sgl_value_5 ); ! 601: writes(", expected SP = "); ! 602: write32h( sgl_value_4 ); ! 603: writes(" \n"); ! 604: if ( halt_flg ) /* halt on error? */ ! 605: pipe2_er_hlt( subtest ); ! 606: if ( loop_on_err ) { ! 607: force_loop = TRUE; /* set the force loop flag */ ! 608: asm("brw _pipe2_9_lp1"); /* and loop */ ! 609: } ! 610: } /* end of compare error */ ! 611: } while( index++ < max_lnf_1_index ); ! 612: asm("movl _pre_event_fp,r13"); /* restore the frame pointer */ ! 613: asm("movl _pre_event_sp,r14"); /* restore the stack pointer */ ! 614: } /* end of subtest 9 */ ! 615: ! 616: ! 617: ! 618: ! 619: ! 620: ! 621: /****************************************************************************** ! 622: * ! 623: * SUBTEST 10 ! 624: * get data via indexed FRAME pointer ! 625: * ! 626: * ADDR INDEX DATA ! 627: * pointer_data 4 <the STF result goes here> ! 628: * pointer_data-4 3 <operand data> ! 629: * pointer_data-16 0 point the frame pointer here ! 630: * ! 631: ******************************************************************************/ ! 632: pipe2_10() ! 633: { ! 634: asm("moval (r13),_pre_event_fp"); /* save the frame pointer */ ! 635: asm("moval (r14),_pre_event_sp"); /* save the stack pointer */ ! 636: force_loop = FALSE; /* clear force_loop flag */ ! 637: index = 0; ! 638: do ! 639: { ! 640: sgl_value_1 = lnf_1_data[index].ld; /* get operand 1 */ ! 641: sgl_expected = lnf_1_data[index].exp; /* get expected results */ ! 642: sgl_value_2 = 0x40800000; /* floating '1' */ ! 643: sgl_value_3 = 0; /* floating '0' */ ! 644: asm("moval _pointer_data,_sgl_value_4");/* get store data's addr */ ! 645: sgl_value_4 -= 4; /* decrement it by 4 (bytes)*/ ! 646: asm("movl _sgl_value_1,*_sgl_value_4"); /* set the operand data */ ! 647: sgl_value_4 -= 4; /* decrement it by 4 (bytes)*/ ! 648: asm("movl _sgl_value_2,*_sgl_value_4"); /* set the operand data */ ! 649: sgl_value_4 -= 4; /* decrement it by 4 (bytes)*/ ! 650: asm("movl _sgl_value_3,*_sgl_value_4"); /* set the operand data */ ! 651: sgl_value_4 -= 4; /* get FRAME PTR address */ ! 652: /* ! 653: * If LOOP ON ERROR is set, this is the loop for this subtest. ! 654: * The force loop flag is set after the first error. ! 655: */ ! 656: asm("_pipe2_10_lp1:"); ! 657: asm("movl _sgl_value_4,r13"); /* set the FRAME POINTER */ ! 658: asm("movl $1,r1"); /* r1 index = 1 longwords */ ! 659: asm("movl $2,r2"); /* r2 index = 2 longwords */ ! 660: asm("movl $3,r3"); /* r3 index = 3 longwords */ ! 661: asm("movl $4,r4"); /* r4 index = 4 longwords */ ! 662: asm("lnf (r13)[r3]"); /* load -indexed by r3 */ ! 663: asm("mulf (r13)[r2]"); /* multiply by '1' (twice) */ ! 664: asm("mulf (r13)[r2]"); ! 665: asm("addf (r13)[r1]"); /* add a '0' to it */ ! 666: asm("mulf (r13)[r2]"); /* multiply by '1' again */ ! 667: asm("stf (r13)[r4]"); /* store -indexed by r4 */ ! 668: if( force_loop ); ! 669: asm("brb _pipe2_10_lp1");; /* loop on the error */ ! 670: /* ! 671: * verify the results ! 672: */ ! 673: sgl_st_acc = pointer_data; /* move the stored result */ ! 674: asm("moval (r13),_sgl_value_5"); /* save the frame pointer */ ! 675: if( (sgl_st_acc != sgl_expected) || /* verify the result... */ ! 676: (sgl_value_5 != sgl_value_4) ) /* ... and the final FP */ ! 677: { ! 678: asm("movl _pre_event_fp,r13"); /* restore frame pointer */ ! 679: asm("movl _pre_event_sp,r14"); /* restore stack pointer */ ! 680: errcnt++; /* bump the error count */ ! 681: if ( prt_error ) ! 682: print_pipe2_er("indexed FP addressing"); ! 683: writes("final Frame Pointer = "); ! 684: writeh( sgl_value_5 ); ! 685: writes(", expected FP = "); ! 686: writeh( sgl_value_4 ); ! 687: writes(" \n"); ! 688: if ( halt_flg ) /* halt on error? */ ! 689: pipe2_er_hlt( subtest ); ! 690: if ( loop_on_err ) { ! 691: force_loop = TRUE; /* set the force loop flag */ ! 692: asm("brw _pipe2_10_lp1"); /* and loop */ ! 693: } ! 694: } /* end of compare error */ ! 695: } while( index++ < max_lnf_1_index ); ! 696: asm("movl _pre_event_fp,r13"); /* restore the frame pointer */ ! 697: asm("movl _pre_event_sp,r14"); /* restore the stack pointer */ ! 698: } /* end of subtest 10 */ ! 699: ! 700: ! 701: /****************************************************************************** ! 702: * ! 703: * ! 704: * print an error in the following form ! 705: * ! 706: * operand = xxxxxxxx, final Acc = xxxxxxxx, data index = dd ! 707: * expected Acc = xxxxxxxx ! 708: * ! 709: ******************************************************************************/ ! 710: print_pipe2_er(msg) ! 711: char *msg; ! 712: { ! 713: writes(" \n"); /* start a new print line */ ! 714: writes("cycle: "); ! 715: writed( cycle ); ! 716: writes(" test "); ! 717: writed( test_no ); ! 718: writes(" (Pipe 2), subtest "); ! 719: writed( subtest ); ! 720: writes(" error - "); ! 721: writes( msg ); ! 722: writec('\n'); ! 723: writes(" LNF (op1), MULF(1.0), MULF(1.0), ADD(0.0), MULF(1.0), STF\n"); ! 724: writes("operand = "); ! 725: write32h( sgl_value_1 ); ! 726: writes(", final Acc = "); ! 727: write32h( sgl_st_acc ); ! 728: writes(", data index = "); ! 729: writed( index ); ! 730: writec('\n'); ! 731: writes(" expected Acc = "); ! 732: write32h( sgl_expected ); ! 733: writec('\n'); ! 734: } ! 735: ! 736: ! 737: ! 738: ! 739: ! 740: /****************************************************************************** ! 741: * ! 742: * HALT ON ERROR ROUTINE ! 743: * ! 744: * halt with the necessary information saved in the registers ! 745: * ! 746: ******************************************************************************/ ! 747: pipe2_er_hlt( subtest ) ! 748: int subtest; ! 749: { ! 750: asm("movl _test_no,r0"); /* r0 = test number */ ! 751: asm("movl _subtest,r1"); /* r1 = subtest number */ ! 752: asm("movl $1,r2"); /* r2 = error code */ ! 753: asm("movl _cycle,r3"); /* r3 = cycle count */ ! 754: asm("movl _sgl_value_1,r4"); /* r4 = sgl operand */ ! 755: asm("movl _sgl_st_acc,r5"); /* r5 = sgl stored */ ! 756: asm("movl _sgl_expected,r6"); /* r6 = sgl expected */ ! 757: asm("movl _index,r7"); /* r7 = data index */ ! 758: asm("movl _sgl_value_2,r8"); /* r8 = floating one */ ! 759: asm("movl _sgl_value_3,r9"); /* r9 = floating zero */ ! 760: if( subtest == 9 ) { ! 761: asm("movl _sgl_value_5,r10"); /* r10= final SP value */ ! 762: asm("movl _sgl_value_4,r11"); /* r11= expected SP value */ ! 763: } else ! 764: if( subtest == 10 ) { ! 765: asm("movl _sgl_value_5,r10"); /* r10= final FP value */ ! 766: asm("movl _sgl_value_4,r11"); /* r11= expected FP value */ ! 767: }; ! 768: asm(".globl _pipe2_1_hlt"); ! 769: asm("_pipe2_1_hlt:"); /* PC after the halt */ ! 770: asm("halt"); /* HALT ... */ ! 771: } /* end of halt on error */
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.