📄 fputest.c
字号:
0x42d80000, 0x405b0000,0x42da0000, 0x405b4000,0x42dc0000, 0x405b8000,0x42de0000, 0x405bc000,0x42e00000, 0x405c0000,0x42e20000, 0x405c4000,0x42e40000, 0x405c8000,0x42e60000, 0x405cc000,0x42e80000, 0x405d0000,0x42ea0000, 0x405d4000,0x42ec0000, 0x405d8000,0x42ee0000, 0x405dc000,0x42f00000, 0x405e0000,0x42f20000, 0x405e4000,0x42f40000, 0x405e8000,0x42f60000, 0x405ec000,0x42f80000, 0x405f0000,0x42fa0000, 0x405f4000,0x42fc0000, 0x405f8000,0x42fe0000, 0x405fc000,0x43000000, 0x40600000,0x43010000, 0x40602000,0x43020000, 0x40604000,0x43030000, 0x40606000,0x43040000, 0x40608000,0x43050000, 0x4060a000,0x43060000, 0x4060c000,0x43070000, 0x4060e000,0x43080000, 0x40610000,0x43090000, 0x40612000,0x430a0000, 0x40614000,0x430b0000, 0x40616000,0x430c0000, 0x40618000,0x430d0000, 0x4061a000,0x430e0000, 0x4061c000,0x430f0000, 0x4061e000,0x43100000, 0x40620000,0x43110000, 0x40622000,0x43120000, 0x40624000,0x43130000, 0x40626000,0x43140000, 0x40628000,0x43150000, 0x4062a000,0x43160000, 0x4062c000,0x43170000, 0x4062e000,0x43180000, 0x40630000,0x43190000, 0x40632000,0x431a0000, 0x40634000,0x431b0000, 0x40636000,0x431c0000, 0x40638000,0x431d0000, 0x4063a000,0x431e0000, 0x4063c000,0x431f0000, 0x4063e000,0x43200000, 0x40640000,0x43210000, 0x40642000,0x43220000, 0x40644000,0x43230000, 0x40646000,0x43240000, 0x40648000,0x43250000, 0x4064a000,0x43260000, 0x4064c000,0x43270000, 0x4064e000,0x43280000, 0x40650000,0x43290000, 0x40652000,0x432a0000, 0x40654000,0x432b0000, 0x40656000,0x432c0000, 0x40658000,0x432d0000, 0x4065a000,0x432e0000, 0x4065c000,0x432f0000, 0x4065e000,0x43300000, 0x40660000,0x43310000, 0x40662000,0x43320000, 0x40664000,0x43330000, 0x40666000,0x43340000, 0x40668000,0x43350000, 0x4066a000,0x43360000, 0x4066c000,0x43370000, 0x4066e000,0x43380000, 0x40670000,0x43390000, 0x40672000,0x433a0000, 0x40674000,0x433b0000, 0x40676000,0x433c0000, 0x40678000,0x433d0000, 0x4067a000,0x433e0000, 0x4067c000,0x433f0000, 0x4067e000,0x43400000, 0x40680000,0x43410000, 0x40682000,0x43420000, 0x40684000,0x43430000, 0x40686000,0x43440000, 0x40688000,0x43450000, 0x4068a000,0x43460000, 0x4068c000,0x43470000, 0x4068e000,0x43480000, 0x40690000,0x43490000, 0x40692000,0x434a0000, 0x40694000,0x434b0000, 0x40696000,0x434c0000, 0x40698000,0x434d0000, 0x4069a000,0x434e0000, 0x4069c000,0x434f0000, 0x4069e000,0x43500000, 0x406a0000,0x43510000, 0x406a2000,0x43520000, 0x406a4000,0x43530000, 0x406a6000,0x43540000, 0x406a8000,0x43550000, 0x406aa000,0x43560000, 0x406ac000,0x43570000, 0x406ae000,0x43580000, 0x406b0000,0x43590000, 0x406b2000,0x435a0000, 0x406b4000,0x435b0000, 0x406b6000,0x435c0000, 0x406b8000,0x435d0000, 0x406ba000,0x435e0000, 0x406bc000,0x435f0000, 0x406be000,0x43600000, 0x406c0000,0x43610000, 0x406c2000,0x43620000, 0x406c4000,0x43630000, 0x406c6000,0x43640000, 0x406c8000,0x43650000, 0x406ca000,0x43660000, 0x406cc000,0x43670000, 0x406ce000,0x43680000, 0x406d0000,0x43690000, 0x406d2000,0x436a0000, 0x406d4000,0x436b0000, 0x406d6000,0x436c0000, 0x406d8000,0x436d0000, 0x406da000,0x436e0000, 0x406dc000,0x436f0000, 0x406de000,0x43700000, 0x406e0000,0x43710000, 0x406e2000,0x43720000, 0x406e4000,0x43730000, 0x406e6000,0x43740000, 0x406e8000,0x43750000, 0x406ea000,0x43760000, 0x406ec000,0x43770000, 0x406ee000,0x43780000, 0x406f0000,0x43790000, 0x406f2000,0x437a0000, 0x406f4000,0x437b0000, 0x406f6000,0x437c0000, 0x406f8000,0x437d0000, 0x406fa000,0x437e0000, 0x406fc000,0x437f0000, 0x406fe000};unsigned long neg_val[] = { 0x80000000, 0xBF800000, 0xC0000000, 0xC0400000, 0xC0800000, 0xC0A00000, 0xC0C00000, 0xC0E00000, 0xC1000000, 0xC1100000, 0xC1200000, 0xC1300000, 0xC1400000, 0xC1500000, 0xC1600000, 0xC1700000, 0xC1800000 }; /* * Datapath.c *//* * The following routine for checking the data path between registers and * memory and between memory and an floating register, and between the * floating register and the weitek chips. All the bits are covered * including the sign bit. * * It works like this : * f0 = value * f1 = 0 * add = f4 = f0 + f1 * * for multiply * f2 =1 * mult = f8 = f0 * f2 * * DOUBLE PRECISION * f0 = msw of value * f1 = lsw of value * f2 = 0 * f3 = 0 * add = f4 = f0 + f2 * * f6 = msw of 1 * f7 = lsw of 1 * mult = f8 = f0 * f6 */unsigned long result_lsw, result_msw; data_path_sp(){ int i, j, k ; unsigned long result, value; clear_regs(0); for (i = 0; i < 2; i++) { /* sign bit */ for (j = 1; j < 255; j++) { for (k = 0; k < 23; k++) { value = (i << 31) | (j << 23) | (1 << k); if (result = datap_add(value)) { send_message(0, ERROR, "\nAdd SP failed: expected / read = %x / %x\n", value, result); return(-1); } if (result = datap_mult(value)) { send_message(0, ERROR, "\nMultiply SP failed:expected / read = %x / %x\n", value, result); return(-1); } } } } return(0);} data_path_dp(){ int i, j, k, l; unsigned long result_lsw, result_msw, value_lsw, value_msw; clear_regs(0); for (i = 0; i < 2; i++) { for (j = 1; j < 2047; j++) { for (k = 0; k < 52; k++) { value_lsw = (1 << k); if (k > 32) l = k - 32; else l = 32; value_msw = (i << 31) | (j << 20) | (1 << l); if (datap_add_dp(value_msw, value_lsw)){ send_message(0, ERROR,"\nAdd DP failed: msw : expected / read = %x / %x\n\ lsw : expected / read = %x / %x\n", value_msw, result_msw, value_lsw, result_lsw); return(-1); } if (datap_mult_dp(value_msw, value_lsw)){ send_message(0, ERROR, "\nMultiply DP failed: msw : expected / read = %x / %x\n\ lsw : expected / read = %x / %x\n", value_msw, result_msw, value_lsw, result_lsw); return(-1); } } } } return(0);}/* * * The following test does 10 add operation continuously, * 10 multiply operations continusously and * see any thing goes wrong. */ timing_test() { int i; unsigned long result, value_lsw; for (i = 0; i < 1000; i++) { clear_regs(0); if (result = timing_add_sp()) { send_message(0, ERROR, "\nSingle Precision: add, expected / observed = 0x41200000 / 0x%x\n", result); return(-1); } clear_regs(0); if (result = timing_mult_sp()) { send_message(0, ERROR, "\nSingle Precision: Multiply, expected / observed = 0x43470000 / 0x%x\n", result); return(-1); } clear_regs(0); if (result = timing_add_dp(&value_lsw)){ send_message(0, ERROR,"\nDouble Precision: Add, MSW : expcected / observed = 0x40240000 / 0x%x\n\ LSW : expected / observed = 0x0 / 0x%x\n", result, value_lsw); return(-1); } clear_regs(0); if (result = timing_mult_dp(&value_lsw)) { send_message(0, ERROR,"\nDouble Precision: Multiply, MSW : expcected / observed = 0x4034000 / 0x%x\n\ LSW : expected / observed = 0x0 / 0x%x\n", result, value_lsw); return(-1); } } return(0);}chain_sp_test(){ int i, result; clear_regs(0); set_fsr(0); for (i = 1; i < 60; i++) { if ((result = chain_sp(i)) != i) { send_message(0, ERROR, "\nError: expected / observed = %x / 0x%x\n", i, result); return(-1); } } return(0);}chain_dp_test(){ int i, result; clear_regs(0); set_fsr(0); for (i = 1; i < 60; i++) { if ((result = chain_dp(i)) != i) { send_message(0, ERROR, "\nError: expected / observed = %x / 0x%x\n", i, result); return(-1); } } return(0); } /* * Instruction.c */integer_to_float_sp(){ int i; unsigned long result; clear_regs(0); for (i = 0; i < 200; i++) { result = int_float_s(i); if (result != val[i].floatsingle) { send_message(0, ERROR, "\nfitos failed: int = %d, expected / observed = %x / %x\n", i,val[i].floatsingle, result); return(-1); } } return(0);}integer_to_float_dp(){ int i; unsigned long res1; clear_regs(0); for (i = 0; i < 200; i++) { res1 = int_float_d(i); if (res1 != val[i].floatdouble) { send_message(0, ERROR, "\nfitod failed: int = %d, expected / observed = %x / %x\n", i,val[i].floatdouble, res1); return(-1); } }
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -