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