src/emu/cpu/rsp/rspdrc.c
| r9867 | r9868 | |
| 123 | 123 | UINT32 vres[8]; /* used for temporary vector results */ |
| 124 | 124 | |
| 125 | 125 | /* register mappings */ |
| 126 | | drcuml_parameter regmap[34]; /* parameter to register mappings for all 32 integer registers */ |
| 126 | drcuml_parameter regmap[32]; /* parameter to register mappings for all 32 integer registers */ |
| 127 | 127 | |
| 128 | 128 | /* subroutines */ |
| 129 | 129 | drcuml_codehandle * entry; /* entry point */ |
| r9867 | r9868 | |
| 676 | 676 | rsp->impstate->drcfe = drcfe_init(device, &feconfig, rsp); |
| 677 | 677 | |
| 678 | 678 | /* compute the register parameters */ |
| 679 | | for (regnum = 0; regnum < 34; regnum++) |
| 679 | for (regnum = 0; regnum < 32; regnum++) |
| 680 | 680 | { |
| 681 | 681 | rsp->impstate->regmap[regnum].type = (regnum == 0) ? DRCUML_PTYPE_IMMEDIATE : DRCUML_PTYPE_MEMORY; |
| 682 | 682 | rsp->impstate->regmap[regnum].value = (regnum == 0) ? 0 : (FPTR)&rsp->r[regnum]; |
| 683 | 683 | } |
| 684 | 684 | |
| 685 | /* |
| 686 | drcbe_info beinfo; |
| 687 | drcuml_get_backend_info(rsp->impstate->drcuml, &beinfo); |
| 688 | if (beinfo.direct_iregs > 2) |
| 689 | { |
| 690 | rsp->impstate->regmap[30].type = DRCUML_PTYPE_INT_REGISTER; |
| 691 | rsp->impstate->regmap[30].value = DRCUML_REG_I2; |
| 692 | } |
| 693 | if (beinfo.direct_iregs > 3) |
| 694 | { |
| 695 | rsp->impstate->regmap[31].type = DRCUML_PTYPE_INT_REGISTER; |
| 696 | rsp->impstate->regmap[31].value = DRCUML_REG_I3; |
| 697 | } |
| 698 | if (beinfo.direct_iregs > 4) |
| 699 | { |
| 700 | rsp->impstate->regmap[2].type = DRCUML_PTYPE_INT_REGISTER; |
| 701 | rsp->impstate->regmap[2].value = DRCUML_REG_I4; |
| 702 | } |
| 703 | if (beinfo.direct_iregs > 5) |
| 704 | { |
| 705 | rsp->impstate->regmap[3].type = DRCUML_PTYPE_INT_REGISTER; |
| 706 | rsp->impstate->regmap[3].value = DRCUML_REG_I5; |
| 707 | } |
| 708 | if (beinfo.direct_iregs > 6) |
| 709 | { |
| 710 | rsp->impstate->regmap[4].type = DRCUML_PTYPE_INT_REGISTER; |
| 711 | rsp->impstate->regmap[4].value = DRCUML_REG_I6; |
| 712 | } |
| 713 | */ |
| 714 | |
| 685 | 715 | /* mark the cache dirty so it is updated on next execute */ |
| 686 | 716 | rsp->impstate->cache_dirty = TRUE; |
| 687 | 717 | } |
| r9867 | r9868 | |
| 715 | 745 | return ret; |
| 716 | 746 | } |
| 717 | 747 | |
| 718 | | static void dumpvecs(rsp_state *rsp) |
| 719 | | { |
| 720 | | /* |
| 721 | | char fuck[1024]; |
| 722 | | rsp_dasm_one(fuck, rsp->pc, IREAD32(rsp, rsp->pc)); |
| 723 | | printf("%08x: %s\n", rsp->pc, fuck); |
| 724 | | printf("v0: %08x %08x %08x %08x\n", rsp->v[ 0].l[0], rsp->v[ 0].l[1], rsp->v[ 0].l[2], rsp->v[ 0].l[3]); |
| 725 | | printf("v1: %08x %08x %08x %08x\n", rsp->v[ 1].l[0], rsp->v[ 1].l[1], rsp->v[ 1].l[2], rsp->v[ 1].l[3]); |
| 726 | | printf("v2: %08x %08x %08x %08x\n", rsp->v[ 2].l[0], rsp->v[ 2].l[1], rsp->v[ 2].l[2], rsp->v[ 2].l[3]); |
| 727 | | printf("v3: %08x %08x %08x %08x\n", rsp->v[ 3].l[0], rsp->v[ 3].l[1], rsp->v[ 3].l[2], rsp->v[ 3].l[3]); |
| 728 | | printf("v4: %08x %08x %08x %08x\n", rsp->v[ 4].l[0], rsp->v[ 4].l[1], rsp->v[ 4].l[2], rsp->v[ 4].l[3]); |
| 729 | | printf("v5: %08x %08x %08x %08x\n", rsp->v[ 5].l[0], rsp->v[ 5].l[1], rsp->v[ 5].l[2], rsp->v[ 5].l[3]); |
| 730 | | printf("v6: %08x %08x %08x %08x\n", rsp->v[ 6].l[0], rsp->v[ 6].l[1], rsp->v[ 6].l[2], rsp->v[ 6].l[3]); |
| 731 | | printf("v7: %08x %08x %08x %08x\n", rsp->v[ 7].l[0], rsp->v[ 7].l[1], rsp->v[ 7].l[2], rsp->v[ 7].l[3]); |
| 732 | | printf("v8: %08x %08x %08x %08x\n", rsp->v[ 8].l[0], rsp->v[ 8].l[1], rsp->v[ 8].l[2], rsp->v[ 8].l[3]); |
| 733 | | printf("v9: %08x %08x %08x %08x\n", rsp->v[ 9].l[0], rsp->v[ 9].l[1], rsp->v[ 9].l[2], rsp->v[ 9].l[3]); |
| 734 | | printf("v10: %08x %08x %08x %08x\n", rsp->v[10].l[0], rsp->v[10].l[1], rsp->v[10].l[2], rsp->v[10].l[3]); |
| 735 | | printf("v11: %08x %08x %08x %08x\n", rsp->v[11].l[0], rsp->v[11].l[1], rsp->v[11].l[2], rsp->v[11].l[3]); |
| 736 | | printf("v12: %08x %08x %08x %08x\n", rsp->v[12].l[0], rsp->v[12].l[1], rsp->v[12].l[2], rsp->v[12].l[3]); |
| 737 | | printf("v13: %08x %08x %08x %08x\n", rsp->v[13].l[0], rsp->v[13].l[1], rsp->v[13].l[2], rsp->v[13].l[3]); |
| 738 | | printf("v14: %08x %08x %08x %08x\n", rsp->v[14].l[0], rsp->v[14].l[1], rsp->v[14].l[2], rsp->v[14].l[3]); |
| 739 | | printf("v15: %08x %08x %08x %08x\n", rsp->v[15].l[0], rsp->v[15].l[1], rsp->v[15].l[2], rsp->v[15].l[3]); |
| 740 | | printf("v16: %08x %08x %08x %08x\n", rsp->v[16].l[0], rsp->v[16].l[1], rsp->v[16].l[2], rsp->v[16].l[3]); |
| 741 | | printf("v17: %08x %08x %08x %08x\n", rsp->v[17].l[0], rsp->v[17].l[1], rsp->v[17].l[2], rsp->v[17].l[3]); |
| 742 | | printf("v18: %08x %08x %08x %08x\n", rsp->v[18].l[0], rsp->v[18].l[1], rsp->v[18].l[2], rsp->v[18].l[3]); |
| 743 | | printf("v19: %08x %08x %08x %08x\n", rsp->v[19].l[0], rsp->v[19].l[1], rsp->v[19].l[2], rsp->v[19].l[3]); |
| 744 | | printf("v20: %08x %08x %08x %08x\n", rsp->v[20].l[0], rsp->v[20].l[1], rsp->v[20].l[2], rsp->v[20].l[3]); |
| 745 | | printf("v21: %08x %08x %08x %08x\n", rsp->v[21].l[0], rsp->v[21].l[1], rsp->v[21].l[2], rsp->v[21].l[3]); |
| 746 | | printf("v22: %08x %08x %08x %08x\n", rsp->v[22].l[0], rsp->v[22].l[1], rsp->v[22].l[2], rsp->v[22].l[3]); |
| 747 | | printf("v23: %08x %08x %08x %08x\n", rsp->v[23].l[0], rsp->v[23].l[1], rsp->v[23].l[2], rsp->v[23].l[3]); |
| 748 | | printf("v24: %08x %08x %08x %08x\n", rsp->v[24].l[0], rsp->v[24].l[1], rsp->v[24].l[2], rsp->v[24].l[3]); |
| 749 | | printf("v25: %08x %08x %08x %08x\n", rsp->v[25].l[0], rsp->v[25].l[1], rsp->v[25].l[2], rsp->v[25].l[3]); |
| 750 | | printf("v26: %08x %08x %08x %08x\n", rsp->v[26].l[0], rsp->v[26].l[1], rsp->v[26].l[2], rsp->v[26].l[3]); |
| 751 | | printf("v27: %08x %08x %08x %08x\n", rsp->v[27].l[0], rsp->v[27].l[1], rsp->v[27].l[2], rsp->v[27].l[3]); |
| 752 | | printf("v28: %08x %08x %08x %08x\n", rsp->v[28].l[0], rsp->v[28].l[1], rsp->v[28].l[2], rsp->v[28].l[3]); |
| 753 | | printf("v29: %08x %08x %08x %08x\n", rsp->v[29].l[0], rsp->v[29].l[1], rsp->v[29].l[2], rsp->v[29].l[3]); |
| 754 | | printf("v30: %08x %08x %08x %08x\n", rsp->v[30].l[0], rsp->v[30].l[1], rsp->v[30].l[2], rsp->v[30].l[3]); |
| 755 | | printf("v31: %08x %08x %08x %08x\n", rsp->v[31].l[0], rsp->v[31].l[1], rsp->v[31].l[2], rsp->v[31].l[3]); |
| 756 | | printf("\n"); |
| 757 | | */ |
| 758 | | } |
| 759 | | |
| 760 | 748 | static void cfunc_rsp_lbv(void *param) |
| 761 | 749 | { |
| 762 | 750 | rsp_state *rsp = (rsp_state*)param; |
| r9867 | r9868 | |
| 810 | 798 | VREG_B(dest, i) = READ8(rsp, ea); |
| 811 | 799 | ea++; |
| 812 | 800 | } |
| 813 | | |
| 814 | | dumpvecs(rsp); |
| 815 | 801 | } |
| 816 | 802 | |
| 817 | 803 | static void cfunc_rsp_llv(void *param) |
| r9867 | r9868 | |
| 942 | 928 | VREG_B(dest, i) = READ8(rsp, ea); |
| 943 | 929 | ea++; |
| 944 | 930 | } |
| 945 | | |
| 946 | | dumpvecs(rsp); |
| 947 | 931 | } |
| 948 | 932 | |
| 949 | 933 | static void cfunc_rsp_lpv(void *param) |
| r9867 | r9868 | |
| 973 | 957 | { |
| 974 | 958 | VREG_S(dest, i) = READ8(rsp, ea + (((16-index) + i) & 0xf)) << 8; |
| 975 | 959 | } |
| 976 | | |
| 977 | | dumpvecs(rsp); |
| 978 | 960 | } |
| 979 | 961 | |
| 980 | 962 | static void cfunc_rsp_luv(void *param) |
| r9867 | r9868 | |
| 1004 | 986 | { |
| 1005 | 987 | VREG_S(dest, i) = READ8(rsp, ea + (((16-index) + i) & 0xf)) << 7; |
| 1006 | 988 | } |
| 1007 | | |
| 1008 | | dumpvecs(rsp); |
| 1009 | 989 | } |
| 1010 | 990 | |
| 1011 | 991 | static void cfunc_rsp_lhv(void *param) |
| r9867 | r9868 | |
| 1035 | 1015 | { |
| 1036 | 1016 | VREG_S(dest, i) = READ8(rsp, ea + (((16-index) + (i<<1)) & 0xf)) << 7; |
| 1037 | 1017 | } |
| 1038 | | |
| 1039 | | dumpvecs(rsp); |
| 1040 | 1018 | } |
| 1041 | 1019 | |
| 1042 | 1020 | static void cfunc_rsp_lfv(void *param) |
| r9867 | r9868 | |
| 1073 | 1051 | VREG_S(dest, i) = READ8(rsp, ea) << 7; |
| 1074 | 1052 | ea += 4; |
| 1075 | 1053 | } |
| 1076 | | |
| 1077 | | dumpvecs(rsp); |
| 1078 | 1054 | } |
| 1079 | 1055 | |
| 1080 | 1056 | static void cfunc_rsp_lwv(void *param) |
| r9867 | r9868 | |
| 1109 | 1085 | VREG_B(dest, i & 0xf) = READ8(rsp, ea); |
| 1110 | 1086 | ea += 4; |
| 1111 | 1087 | } |
| 1112 | | |
| 1113 | | dumpvecs(rsp); |
| 1114 | 1088 | } |
| 1115 | 1089 | |
| 1116 | 1090 | static void cfunc_rsp_ltv(void *param) |
| r9867 | r9868 | |
| 1154 | 1128 | |
| 1155 | 1129 | ea += 2; |
| 1156 | 1130 | } |
| 1157 | | |
| 1158 | | dumpvecs(rsp); |
| 1159 | 1131 | } |
| 1160 | 1132 | |
| 1161 | 1133 | static int generate_lwc2(rsp_state *rsp, drcuml_block *block, compiler_state *compiler, const opcode_desc *desc) |
| r9867 | r9868 | |
| 2289 | 2261 | CLEAR_ZERO_FLAGS(); |
| 2290 | 2262 | CLEAR_CARRY_FLAGS(); |
| 2291 | 2263 | WRITEBACK_RESULT(); |
| 2292 | | |
| 2293 | | dumpvecs(rsp); |
| 2294 | 2264 | } |
| 2295 | 2265 | |
| 2296 | 2266 | INLINE void cfunc_rsp_vsub(void *param) |
| r9867 | r9868 | |
| 2327 | 2297 | CLEAR_ZERO_FLAGS(); |
| 2328 | 2298 | CLEAR_CARRY_FLAGS(); |
| 2329 | 2299 | WRITEBACK_RESULT(); |
| 2330 | | |
| 2331 | | dumpvecs(rsp); |
| 2332 | 2300 | } |
| 2333 | 2301 | |
| 2334 | 2302 | INLINE void cfunc_rsp_vabs(void *param) |