trunk/src/emu/cpu/rsp/rspdrc.c
| r241692 | r241693 | |
| 6318 | 6318 | |
| 6319 | 6319 | UINT16 urec; |
| 6320 | 6320 | SIMD_EXTRACT16(m_xv[VS2REG], urec, EL); |
| 6321 | | INT32 rec = (urec | m_reciprocal_high); |
| 6322 | | |
| 6321 | INT32 rec = (INT16)urec; |
| 6323 | 6322 | INT32 datainput = rec; |
| 6324 | 6323 | |
| 6325 | | if (rec < 0) |
| 6324 | if (m_dp_allowed) |
| 6326 | 6325 | { |
| 6327 | | if (m_dp_allowed) |
| 6326 | rec = (rec & 0x0000ffff) | m_reciprocal_high; |
| 6327 | datainput = rec; |
| 6328 | |
| 6329 | if (rec < 0) |
| 6328 | 6330 | { |
| 6329 | 6331 | if (rec < -32768) |
| 6330 | 6332 | { |
| r241692 | r241693 | |
| 6335 | 6337 | datainput = -datainput; |
| 6336 | 6338 | } |
| 6337 | 6339 | } |
| 6338 | | else |
| 6339 | | { |
| 6340 | | datainput = -datainput; |
| 6341 | | } |
| 6342 | 6340 | } |
| 6341 | else if (datainput < 0) |
| 6342 | { |
| 6343 | datainput = -datainput; |
| 6343 | 6344 | |
| 6345 | shifter = 0x10; |
| 6346 | } |
| 6344 | 6347 | |
| 6345 | 6348 | if (datainput) |
| 6346 | 6349 | { |
| r241692 | r241693 | |
| 6353 | 6356 | } |
| 6354 | 6357 | } |
| 6355 | 6358 | } |
| 6356 | | else |
| 6357 | | { |
| 6358 | | if (m_dp_allowed) |
| 6359 | | { |
| 6360 | | shifter = 0; |
| 6361 | | } |
| 6362 | | else |
| 6363 | | { |
| 6364 | | shifter = 0x10; |
| 6365 | | } |
| 6366 | | } |
| 6367 | 6359 | |
| 6368 | 6360 | INT32 address = ((datainput << shifter) & 0x7fc00000) >> 22; |
| 6369 | 6361 | INT32 fetchval = rsp_divtable[address]; |
| 6370 | 6362 | INT32 temp = (0x40000000 | (fetchval << 14)) >> ((~shifter) & 0x1f); |
| 6371 | | if (rec < 0) |
| 6372 | | { |
| 6373 | | temp = ~temp; |
| 6374 | | } |
| 6363 | temp ^= rec >> 31; |
| 6364 | |
| 6375 | 6365 | if (!rec) |
| 6376 | 6366 | { |
| 6377 | 6367 | temp = 0x7fffffff; |
| r241692 | r241693 | |
| 6408 | 6398 | int op = m_rsp_state->arg0; |
| 6409 | 6399 | |
| 6410 | 6400 | INT32 shifter = 0; |
| 6411 | | INT32 rec = ((UINT16)(VREG_S(VS2REG, EL & 7)) | m_reciprocal_high); |
| 6401 | INT32 rec = (INT16)VREG_S(VS2REG, EL & 7); |
| 6412 | 6402 | INT32 datainput = rec; |
| 6413 | 6403 | |
| 6414 | | if (rec < 0) |
| 6404 | if (m_dp_allowed) |
| 6415 | 6405 | { |
| 6416 | | if (m_dp_allowed) |
| 6406 | rec = (rec & 0x0000ffff) | m_reciprocal_high; |
| 6407 | datainput = rec; |
| 6408 | |
| 6409 | if (rec < 0) |
| 6417 | 6410 | { |
| 6418 | 6411 | if (rec < -32768) |
| 6419 | 6412 | { |
| r241692 | r241693 | |
| 6424 | 6417 | datainput = -datainput; |
| 6425 | 6418 | } |
| 6426 | 6419 | } |
| 6427 | | else |
| 6428 | | { |
| 6429 | | datainput = -datainput; |
| 6430 | | } |
| 6431 | 6420 | } |
| 6421 | else if (datainput < 0) |
| 6422 | { |
| 6423 | datainput = -datainput; |
| 6432 | 6424 | |
| 6425 | shifter = 0x10; |
| 6426 | } |
| 6433 | 6427 | |
| 6434 | 6428 | if (datainput) |
| 6435 | 6429 | { |
| r241692 | r241693 | |
| 6442 | 6436 | } |
| 6443 | 6437 | } |
| 6444 | 6438 | } |
| 6445 | | else |
| 6446 | | { |
| 6447 | | if (m_dp_allowed) |
| 6448 | | { |
| 6449 | | shifter = 0; |
| 6450 | | } |
| 6451 | | else |
| 6452 | | { |
| 6453 | | shifter = 0x10; |
| 6454 | | } |
| 6455 | | } |
| 6456 | 6439 | |
| 6457 | | INT32 address = ((datainput << shifter) & 0x7fc00000) >> 22; |
| 6458 | | INT32 fetchval = rsp_divtable[address]; |
| 6440 | UINT32 address = (datainput << shifter) >> 22; |
| 6441 | INT32 fetchval = rsp_divtable[address & 0x1ff]; |
| 6459 | 6442 | INT32 temp = (0x40000000 | (fetchval << 14)) >> ((~shifter) & 0x1f); |
| 6460 | | if (rec < 0) |
| 6461 | | { |
| 6462 | | temp = ~temp; |
| 6463 | | } |
| 6443 | temp ^= rec >> 31; |
| 6464 | 6444 | if (!rec) |
| 6465 | 6445 | { |
| 6466 | 6446 | temp = 0x7fffffff; |
| r241692 | r241693 | |
| 6745 | 6725 | INT32 shifter = 0; |
| 6746 | 6726 | UINT16 val; |
| 6747 | 6727 | SIMD_EXTRACT16(m_xv[VS2REG], val, EL); |
| 6748 | | INT32 rec = m_reciprocal_high | val; |
| 6728 | INT32 rec = (INT16)val; |
| 6749 | 6729 | INT32 datainput = rec; |
| 6750 | 6730 | |
| 6751 | | if (rec < 0) |
| 6731 | if (m_dp_allowed) |
| 6752 | 6732 | { |
| 6753 | | if (m_dp_allowed) |
| 6733 | rec = (rec & 0x0000ffff) | m_reciprocal_high; |
| 6734 | datainput = rec; |
| 6735 | |
| 6736 | if (rec < 0) |
| 6754 | 6737 | { |
| 6755 | 6738 | if (rec < -32768) |
| 6756 | 6739 | { |
| r241692 | r241693 | |
| 6761 | 6744 | datainput = -datainput; |
| 6762 | 6745 | } |
| 6763 | 6746 | } |
| 6764 | | else |
| 6765 | | { |
| 6766 | | datainput = -datainput; |
| 6767 | | } |
| 6768 | 6747 | } |
| 6748 | else if (datainput < 0) |
| 6749 | { |
| 6750 | datainput = -datainput; |
| 6769 | 6751 | |
| 6752 | shifter = 0x10; |
| 6753 | } |
| 6754 | |
| 6770 | 6755 | if (datainput) |
| 6771 | 6756 | { |
| 6772 | 6757 | for (int i = 0; i < 32; i++) |
| r241692 | r241693 | |
| 6778 | 6763 | } |
| 6779 | 6764 | } |
| 6780 | 6765 | } |
| 6781 | | else |
| 6782 | | { |
| 6783 | | if (m_dp_allowed) |
| 6784 | | { |
| 6785 | | shifter = 0; |
| 6786 | | } |
| 6787 | | else |
| 6788 | | { |
| 6789 | | shifter = 0x10; |
| 6790 | | } |
| 6791 | | } |
| 6792 | 6766 | |
| 6793 | 6767 | INT32 address = ((datainput << shifter) & 0x7fc00000) >> 22; |
| 6794 | 6768 | address = ((address | 0x200) & 0x3fe) | (shifter & 1); |
| 6795 | 6769 | |
| 6796 | 6770 | INT32 fetchval = rsp_divtable[address]; |
| 6797 | 6771 | INT32 temp = (0x40000000 | (fetchval << 14)) >> (((~shifter) & 0x1f) >> 1); |
| 6798 | | if (rec < 0) |
| 6799 | | { |
| 6800 | | temp = ~temp; |
| 6801 | | } |
| 6772 | temp ^= rec >> 31; |
| 6773 | |
| 6802 | 6774 | if (!rec) |
| 6803 | 6775 | { |
| 6804 | 6776 | temp = 0x7fffffff; |
| r241692 | r241693 | |
| 6829 | 6801 | int op = m_rsp_state->arg0; |
| 6830 | 6802 | |
| 6831 | 6803 | INT32 shifter = 0; |
| 6832 | | INT32 rec = m_reciprocal_high | (UINT16)VREG_S(VS2REG, EL & 7); |
| 6804 | INT32 rec = (INT16)VREG_S(VS2REG, EL & 7); |
| 6833 | 6805 | INT32 datainput = rec; |
| 6834 | 6806 | |
| 6835 | | if (rec < 0) |
| 6807 | if (m_dp_allowed) |
| 6836 | 6808 | { |
| 6837 | | if (m_dp_allowed) |
| 6809 | rec = (rec & 0x0000ffff) | m_reciprocal_high; |
| 6810 | datainput = rec; |
| 6811 | |
| 6812 | if (rec < 0) |
| 6838 | 6813 | { |
| 6839 | 6814 | if (rec < -32768) |
| 6840 | 6815 | { |
| r241692 | r241693 | |
| 6845 | 6820 | datainput = -datainput; |
| 6846 | 6821 | } |
| 6847 | 6822 | } |
| 6848 | | else |
| 6849 | | { |
| 6850 | | datainput = -datainput; |
| 6851 | | } |
| 6852 | 6823 | } |
| 6824 | else if (datainput < 0) |
| 6825 | { |
| 6826 | datainput = -datainput; |
| 6853 | 6827 | |
| 6828 | shifter = 0x10; |
| 6829 | } |
| 6830 | |
| 6854 | 6831 | if (datainput) |
| 6855 | 6832 | { |
| 6856 | 6833 | for (int i = 0; i < 32; i++) |
| r241692 | r241693 | |
| 6862 | 6839 | } |
| 6863 | 6840 | } |
| 6864 | 6841 | } |
| 6865 | | else |
| 6866 | | { |
| 6867 | | if (m_dp_allowed) |
| 6868 | | { |
| 6869 | | shifter = 0; |
| 6870 | | } |
| 6871 | | else |
| 6872 | | { |
| 6873 | | shifter = 0x10; |
| 6874 | | } |
| 6875 | | } |
| 6876 | 6842 | |
| 6877 | 6843 | INT32 address = ((datainput << shifter) & 0x7fc00000) >> 22; |
| 6878 | 6844 | address = ((address | 0x200) & 0x3fe) | (shifter & 1); |
| 6879 | 6845 | |
| 6880 | 6846 | INT32 fetchval = rsp_divtable[address]; |
| 6881 | 6847 | INT32 temp = (0x40000000 | (fetchval << 14)) >> (((~shifter) & 0x1f) >> 1); |
| 6882 | | if (rec < 0) |
| 6883 | | { |
| 6884 | | temp = ~temp; |
| 6885 | | } |
| 6848 | temp ^= rec >> 31; |
| 6849 | |
| 6886 | 6850 | if (!rec) |
| 6887 | 6851 | { |
| 6888 | 6852 | temp = 0x7fffffff; |