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