Merge pull request #598 from pcercuei/lightrec_events
authornotaz <notasas@gmail.com>
Sat, 29 Jan 2022 23:50:49 +0000 (01:50 +0200)
committerGitHub <noreply@github.com>
Sat, 29 Jan 2022 23:50:49 +0000 (01:50 +0200)
Unlock Lightrec to its full potential

libpcsxcore/new_dynarec/assem_arm.c
libpcsxcore/new_dynarec/emu_if.c
libpcsxcore/new_dynarec/emu_if.h
libpcsxcore/new_dynarec/linkage_arm.S
libpcsxcore/new_dynarec/linkage_arm64.S
libpcsxcore/new_dynarec/new_dynarec.c

index 381a541..32ef979 100644 (file)
@@ -101,8 +101,6 @@ const u_int invalidate_addr_reg[16] = {
   0,
   0};
 
-static u_int needs_clear_cache[1<<(TARGET_SIZE_2-17)];
-
 /* Linker */
 
 static void set_jump_target(void *addr, void *target_)
@@ -547,7 +545,7 @@ static void emit_loadreg(int r, int hr)
     }
     u_int offset = (u_char *)addr - (u_char *)&dynarec_local;
     assert(offset<4096);
-    assem_debug("ldr %s,fp+%d\n",regname[hr],offset);
+    assem_debug("ldr %s,fp+%d # r%d\n",regname[hr],offset,r);
     output_w32(0xe5900000|rd_rn_rm(hr,FP,0)|offset);
   }
 }
@@ -568,7 +566,7 @@ static void emit_storereg(int r, int hr)
   }
   u_int offset = addr-(u_int)&dynarec_local;
   assert(offset<4096);
-  assem_debug("str %s,fp+%d\n",regname[hr],offset);
+  assem_debug("str %s,fp+%d # r%d\n",regname[hr],offset,r);
   output_w32(0xe5800000|rd_rn_rm(hr,FP,0)|offset);
 }
 
@@ -1642,7 +1640,8 @@ static void emit_extjump2(u_char *addr, u_int target, void *linker)
 
   emit_loadlp(target,0);
   emit_loadlp((u_int)addr,1);
-  assert(addr>=ndrc->translation_cache&&addr<(ndrc->translation_cache+(1<<TARGET_SIZE_2)));
+  assert(ndrc->translation_cache <= addr &&
+         addr < ndrc->translation_cache + sizeof(ndrc->translation_cache));
   //assert((target>=0x80000000&&target<0x80800000)||(target>0xA4000000&&target<0xA4001000));
 //DEBUG >
 #ifdef DEBUG_CYCLE_COUNT
index bbcd756..fea1c7a 100644 (file)
@@ -67,22 +67,18 @@ static irq_func * const irq_funcs[] = {
 /* local dupe of psxBranchTest, using event_cycles */
 static void irq_test(void)
 {
-       u32 irqs = psxRegs.interrupt;
        u32 cycle = psxRegs.cycle;
        u32 irq, irq_bits;
 
-       // irq_funcs() may queue more irqs
-       psxRegs.interrupt = 0;
-
-       for (irq = 0, irq_bits = irqs; irq_bits != 0; irq++, irq_bits >>= 1) {
+       for (irq = 0, irq_bits = psxRegs.interrupt; irq_bits != 0; irq++, irq_bits >>= 1) {
                if (!(irq_bits & 1))
                        continue;
                if ((s32)(cycle - event_cycles[irq]) >= 0) {
-                       irqs &= ~(1 << irq);
+                       // note: irq_funcs() also modify psxRegs.interrupt
+                       psxRegs.interrupt &= ~(1u << irq);
                        irq_funcs[irq]();
                }
        }
-       psxRegs.interrupt |= irqs;
 
        if ((psxHu32(0x1070) & psxHu32(0x1074)) && (Status & 0x401) == 0x401) {
                psxException(0x400, 0);
@@ -477,7 +473,7 @@ u32 irq_test_cycle;
 u32 handler_cycle;
 u32 last_io_addr;
 
-static void dump_mem(const char *fname, void *mem, size_t size)
+void dump_mem(const char *fname, void *mem, size_t size)
 {
        FILE *f1 = fopen(fname, "wb");
        if (f1 == NULL)
@@ -662,7 +658,7 @@ void do_insn_cmp(void)
 
        psxRegs.code = rregs.code; // don't care
        psxRegs.cycle += last_count;
-       //psxRegs.cycle = rregs.cycle;
+       //psxRegs.cycle = rregs.cycle; // needs reload in _cmp
        psxRegs.CP0.r[9] = rregs.CP0.r[9]; // Count
 
        //if (psxRegs.cycle == 166172) breakme();
@@ -719,9 +715,9 @@ void do_insn_cmp(void)
        for (i = 0; i < 8; i++)
                printf("r%d=%08x r%2d=%08x r%2d=%08x r%2d=%08x\n", i, allregs_p[i],
                        i+8, allregs_p[i+8], i+16, allregs_p[i+16], i+24, allregs_p[i+24]);
-       printf("PC: %08x/%08x, cycle %u\n", psxRegs.pc, ppc, psxRegs.cycle);
-       dump_mem("/mnt/ntz/dev/pnd/tmp/psxram.dump", psxM, 0x200000);
-       dump_mem("/mnt/ntz/dev/pnd/tmp/psxregs.dump", psxH, 0x10000);
+       printf("PC: %08x/%08x, cycle %u, next %u\n", psxRegs.pc, ppc, psxRegs.cycle, next_interupt);
+       //dump_mem("/tmp/psxram.dump", psxM, 0x200000);
+       //dump_mem("/mnt/ntz/dev/pnd/tmp/psxregs.dump", psxH, 0x10000);
        exit(1);
 ok:
        //psxRegs.cycle = rregs.cycle + 2; // sync timing
index db11f7b..5a3a5e8 100644 (file)
@@ -68,12 +68,12 @@ void jump_handler_write32(u32 addr, u32 data, u32 cycles, u32 *table);
 void jump_handler_write_h(u32 addr, u32 data, u32 cycles, void *handler);
 void jump_handle_swl(u32 addr, u32 data, u32 cycles);
 void jump_handle_swr(u32 addr, u32 data, u32 cycles);
-void rcnt0_read_count_m0(u32 addr, u32, u32 cycles);
-void rcnt0_read_count_m1(u32 addr, u32, u32 cycles);
-void rcnt1_read_count_m0(u32 addr, u32, u32 cycles);
-void rcnt1_read_count_m1(u32 addr, u32, u32 cycles);
-void rcnt2_read_count_m0(u32 addr, u32, u32 cycles);
-void rcnt2_read_count_m1(u32 addr, u32, u32 cycles);
+u32  rcnt0_read_count_m0(u32 addr, u32, u32 cycles);
+u32  rcnt0_read_count_m1(u32 addr, u32, u32 cycles);
+u32  rcnt1_read_count_m0(u32 addr, u32, u32 cycles);
+u32  rcnt1_read_count_m1(u32 addr, u32, u32 cycles);
+u32  rcnt2_read_count_m0(u32 addr, u32, u32 cycles);
+u32  rcnt2_read_count_m1(u32 addr, u32, u32 cycles);
 
 extern unsigned int address;
 extern unsigned int hack_addr;
index d409aff..5538462 100644 (file)
@@ -34,6 +34,7 @@
 #define gen_interupt           ESYM(gen_interupt)
 #define invalidate_addr                ESYM(invalidate_addr)
 #define gteCheckStallRaw       ESYM(gteCheckStallRaw)
+#define psxException           ESYM(psxException)
 #endif
 
        .bss
@@ -497,19 +498,28 @@ FUNCTION(fp_exception_ds):
        .size   fp_exception_ds, .-fp_exception_ds
 
        .align  2
+FUNCTION(jump_break_ds):
+       mov     r0, #0x24
+       mov     r1, #1
+       b       call_psxException
+FUNCTION(jump_break):
+       mov     r0, #0x24
+       mov     r1, #0
+       b       call_psxException
+FUNCTION(jump_syscall_ds):
+       mov     r0, #0x20
+       mov     r1, #1
+       b       call_psxException
 FUNCTION(jump_syscall):
-       ldr     r1, [fp, #LO_reg_cop0+48] /* Status */
-       mov     r3, #0x80000000
-       str     r0, [fp, #LO_reg_cop0+56] /* EPC */
-       orr     r1, #2
-       mov     r2, #0x20
-       str     r1, [fp, #LO_reg_cop0+48] /* Status */
-       str     r2, [fp, #LO_reg_cop0+52] /* Cause */
-       add     r0, r3, #0x80
-       bl      get_addr_ht
-       mov     pc, r0
-       .size   jump_syscall, .-jump_syscall
-       .align  2
+       mov     r0, #0x20
+       mov     r1, #0
+
+call_psxException:
+       ldr     r3, [fp, #LO_last_count]
+       str     r2, [fp, #LO_pcaddr]
+       add     r10, r3, r10
+       str     r10, [fp, #LO_cycle]            /* PCSX cycles */
+       bl      psxException
 
        /* note: psxException might do recursive recompiler call from it's HLE code,
         * so be ready for this */
index b9ab726..39e95a8 100644 (file)
@@ -182,19 +182,28 @@ FUNCTION(fp_exception_ds):
        .size   fp_exception_ds, .-fp_exception_ds
 
        .align  2
+FUNCTION(jump_break_ds):
+       mov     w0, #0x24
+       mov     w1, #1
+       b       call_psxException
+FUNCTION(jump_break):
+       mov     w0, #0x24
+       mov     w1, #0
+       b       call_psxException
+FUNCTION(jump_syscall_ds):
+       mov     w0, #0x20
+       mov     w1, #1
+       b       call_psxException
 FUNCTION(jump_syscall):
-       ldr     w1, [rFP, #LO_reg_cop0+48] /* Status */
-       mov     w3, #0x80000000
-       str     w0, [rFP, #LO_reg_cop0+56] /* EPC */
-       orr     w1, w1, #2
-       mov     w2, #0x20
-       str     w1, [rFP, #LO_reg_cop0+48] /* Status */
-       str     w2, [rFP, #LO_reg_cop0+52] /* Cause */
-       add     w0, w3, #0x80
-       bl      get_addr_ht
-       br      x0
-       .size   jump_syscall, .-jump_syscall
-       .align  2
+       mov     w0, #0x20
+       mov     w1, #0
+
+call_psxException:
+       ldr     w3, [rFP, #LO_last_count]
+       str     w2, [rFP, #LO_pcaddr]
+       add     rCC, w3, rCC
+       str     rCC, [rFP, #LO_cycle]           /* PCSX cycles */
+       bl      psxException
 
        /* note: psxException might do recursive recompiler call from it's HLE code,
         * so be ready for this */
index 0900736..8ae1589 100644 (file)
@@ -49,6 +49,7 @@
 
 //#define DISASM
 //#define ASSEM_PRINT
+//#define REG_ALLOC_PRINT
 
 #ifdef ASSEM_PRINT
 #define assem_debug printf
 #define MAXBLOCK 4096
 #define MAX_OUTPUT_BLOCK_SIZE 262144
 
+#ifdef VITA
+// apparently Vita has a 16MB limit, so either we cut tc in half,
+// or use this hack (it's a hack because tc size was designed to be power-of-2)
+#define TC_REDUCE_BYTES 4096
+#else
+#define TC_REDUCE_BYTES 0
+#endif
+
 struct ndrc_mem
 {
-  u_char translation_cache[1 << TARGET_SIZE_2];
+  u_char translation_cache[(1 << TARGET_SIZE_2) - TC_REDUCE_BYTES];
   struct
   {
     struct tramp_insns ops[2048 / sizeof(struct tramp_insns)];
@@ -110,9 +119,13 @@ enum stub_type {
   INVCODE_STUB = 14,
 };
 
+// regmap_pre[i]    - regs before [i] insn starts; dirty things here that
+//                    don't match .regmap will be written back
+// [i].regmap_entry - regs that must be set up if someone jumps here
+// [i].regmap       - regs [i] insn will read/(over)write
 struct regstat
 {
-  signed char regmap_entry[HOST_REGS]; // pre-insn + loop preloaded regs?
+  signed char regmap_entry[HOST_REGS];
   signed char regmap[HOST_REGS];
   uint64_t wasdirty;
   uint64_t dirty;
@@ -198,7 +211,7 @@ static struct decoded_insn
   static u_int ba[MAXBLOCK];
   static uint64_t unneeded_reg[MAXBLOCK];
   static uint64_t branch_unneeded_reg[MAXBLOCK];
-  // pre-instruction [i], excluding loop-preload regs?
+  // see 'struct regstat' for a description
   static signed char regmap_pre[MAXBLOCK][HOST_REGS];
   // contains 'real' consts at [i] insn, but may differ from what's actually
   // loaded in host reg as 'final' value is always loaded, see get_final_value()
@@ -289,7 +302,7 @@ static struct decoded_insn
 //#define FLOAT 19  // Floating point unit
 //#define FCONV 20  // Convert integer to float
 //#define FCOMP 21  // Floating point compare (sets FSREG)
-#define SYSCALL 22// SYSCALL
+#define SYSCALL 22// SYSCALL,BREAK
 #define OTHER 23  // Other
 #define SPAN 24   // Branch/delay slot spans 2 pages
 #define NI 25     // Not implemented
@@ -320,6 +333,10 @@ void verify_code_ds();
 void cc_interrupt();
 void fp_exception();
 void fp_exception_ds();
+void jump_syscall   (u_int u0, u_int u1, u_int pc);
+void jump_syscall_ds(u_int u0, u_int u1, u_int pc);
+void jump_break   (u_int u0, u_int u1, u_int pc);
+void jump_break_ds(u_int u0, u_int u1, u_int pc);
 void jump_to_new_pc();
 void call_gteStall();
 void new_dyna_leave();
@@ -586,10 +603,9 @@ void *get_addr_ht(u_int vaddr)
   return get_addr(vaddr);
 }
 
-void clear_all_regs(signed char regmap[])
+static void clear_all_regs(signed char regmap[])
 {
-  int hr;
-  for (hr=0;hr<HOST_REGS;hr++) regmap[hr]=-1;
+  memset(regmap, -1, sizeof(regmap[0]) * HOST_REGS);
 }
 
 static signed char get_reg(const signed char regmap[],int r)
@@ -918,6 +934,10 @@ static const struct {
   FUNCNAME(jump_handler_write32),
   FUNCNAME(invalidate_addr),
   FUNCNAME(jump_to_new_pc),
+  FUNCNAME(jump_break),
+  FUNCNAME(jump_break_ds),
+  FUNCNAME(jump_syscall),
+  FUNCNAME(jump_syscall_ds),
   FUNCNAME(call_gteStall),
   FUNCNAME(new_dyna_leave),
   FUNCNAME(pcsx_mtc0),
@@ -3927,9 +3947,16 @@ static void call_c_cpu_handler(int i, const struct regstat *i_regs, int ccadj_,
 
 static void syscall_assemble(int i, const struct regstat *i_regs, int ccadj_)
 {
-  emit_movimm(0x20,0); // cause code
-  emit_movimm(0,1);    // not in delay slot
-  call_c_cpu_handler(i, i_regs, ccadj_, start+i*4, psxException);
+  // 'break' tends to be littered around to catch things like
+  // division by 0 and is almost never executed, so don't emit much code here
+  void *func = (dops[i].opcode2 == 0x0C)
+    ? (is_delayslot ? jump_syscall_ds : jump_syscall)
+    : (is_delayslot ? jump_break_ds : jump_break);
+  signed char ccreg = get_reg(i_regs->regmap, CCREG);
+  assert(ccreg == HOST_CCREG);
+  emit_movimm(start + i*4, 2); // pc
+  emit_addimm(HOST_CCREG, ccadj_ + CLOCK_ADJUST(1), HOST_CCREG);
+  emit_far_jump(func);
 }
 
 static void hlecall_assemble(int i, const struct regstat *i_regs, int ccadj_)
@@ -6117,8 +6144,21 @@ static void pagespan_ds()
   load_regs_bt(regs[0].regmap,regs[0].dirty,start+4);
 }
 
+static void check_regmap(signed char *regmap)
+{
+#ifndef NDEBUG
+  int i,j;
+  for (i = 0; i < HOST_REGS; i++) {
+    if (regmap[i] < 0)
+      continue;
+    for (j = i + 1; j < HOST_REGS; j++)
+      assert(regmap[i] != regmap[j]);
+  }
+#endif
+}
+
 // Basic liveness analysis for MIPS registers
-void unneeded_registers(int istart,int iend,int r)
+static void unneeded_registers(int istart,int iend,int r)
 {
   int i;
   uint64_t u,gte_u,b,gte_b;
@@ -6844,7 +6884,7 @@ void new_dynarec_clear_full(void)
 
 void new_dynarec_init(void)
 {
-  SysPrintf("Init new dynarec\n");
+  SysPrintf("Init new dynarec, ndrc size %x\n", (int)sizeof(*ndrc));
 
 #ifdef _3DS
   check_rosalina();
@@ -6852,11 +6892,11 @@ void new_dynarec_init(void)
 #ifdef BASE_ADDR_DYNAMIC
   #ifdef VITA
   sceBlock = getVMBlock(); //sceKernelAllocMemBlockForVM("code", sizeof(*ndrc));
-  if (sceBlock < 0)
-    SysPrintf("sceKernelAllocMemBlockForVM failed\n");
+  if (sceBlock <= 0)
+    SysPrintf("sceKernelAllocMemBlockForVM failed: %x\n", sceBlock);
   int ret = sceKernelGetMemBlockBase(sceBlock, (void **)&ndrc);
   if (ret < 0)
-    SysPrintf("sceKernelGetMemBlockBase failed\n");
+    SysPrintf("sceKernelGetMemBlockBase failed: %x\n", ret);
   sceKernelOpenVMDomain();
   sceClibPrintf("translation_cache = 0x%08lx\n ", (long)ndrc->translation_cache);
   #elif defined(_MSC_VER)
@@ -6904,6 +6944,7 @@ void new_dynarec_cleanup(void)
   int n;
 #ifdef BASE_ADDR_DYNAMIC
   #ifdef VITA
+  // sceBlock is managed by retroarch's bootstrap code
   //sceKernelFreeMemBlock(sceBlock);
   //sceBlock = -1;
   #else
@@ -7191,7 +7232,7 @@ int new_recompile_block(u_int addr)
           case 0x08: strcpy(insn[i],"JR"); type=RJUMP; break;
           case 0x09: strcpy(insn[i],"JALR"); type=RJUMP; break;
           case 0x0C: strcpy(insn[i],"SYSCALL"); type=SYSCALL; break;
-          case 0x0D: strcpy(insn[i],"BREAK"); type=OTHER; break;
+          case 0x0D: strcpy(insn[i],"BREAK"); type=SYSCALL; break;
           case 0x0F: strcpy(insn[i],"SYNC"); type=OTHER; break;
           case 0x10: strcpy(insn[i],"MFHI"); type=MOV; break;
           case 0x11: strcpy(insn[i],"MTHI"); type=MOV; break;
@@ -7637,9 +7678,9 @@ int new_recompile_block(u_int addr)
       // Don't get too close to the limit
       if(i>MAXBLOCK/2) done=1;
     }
-    if(dops[i].itype==SYSCALL&&stop_after_jal) done=1;
-    if(dops[i].itype==HLECALL||dops[i].itype==INTCALL) done=2;
-    if(done==2) {
+    if (dops[i].itype == SYSCALL || dops[i].itype == HLECALL || dops[i].itype == INTCALL)
+      done = stop_after_jal ? 1 : 2;
+    if (done == 2) {
       // Does the block continue due to a branch?
       for(j=i-1;j>=0;j--)
       {
@@ -7675,14 +7716,16 @@ int new_recompile_block(u_int addr)
   /* Pass 3 - Register allocation */
 
   struct regstat current; // Current register allocations/status
-  current.dirty=0;
-  current.u=unneeded_reg[0];
+  clear_all_regs(current.regmap_entry);
   clear_all_regs(current.regmap);
-  alloc_reg(&current,0,CCREG);
-  dirty_reg(&current,CCREG);
-  current.isconst=0;
-  current.wasconst=0;
-  current.waswritten=0;
+  current.wasdirty = current.dirty = 0;
+  current.u = unneeded_reg[0];
+  alloc_reg(&current, 0, CCREG);
+  dirty_reg(&current, CCREG);
+  current.wasconst = 0;
+  current.isconst = 0;
+  current.loadedconst = 0;
+  current.waswritten = 0;
   int ds=0;
   int cc=0;
   int hr=-1;
@@ -7713,6 +7756,9 @@ int new_recompile_block(u_int addr)
     memcpy(regmap_pre[i],current.regmap,sizeof(current.regmap));
     regs[i].wasconst=current.isconst;
     regs[i].wasdirty=current.dirty;
+    regs[i].dirty=0;
+    regs[i].u=0;
+    regs[i].isconst=0;
     regs[i].loadedconst=0;
     if (!dops[i].is_jump) {
       if(i+1<slen) {
@@ -8475,6 +8521,8 @@ int new_recompile_block(u_int addr)
           {
             regs[i].regmap[hr]=-1;
             regs[i].isconst&=~(1<<hr);
+            regs[i].dirty&=~(1<<hr);
+            regs[i+1].wasdirty&=~(1<<hr);
             if((branch_regs[i].regmap[hr]&63)!=dops[i].rs1 && (branch_regs[i].regmap[hr]&63)!=dops[i].rs2 &&
                (branch_regs[i].regmap[hr]&63)!=dops[i].rt1 && (branch_regs[i].regmap[hr]&63)!=dops[i].rt2 &&
                (branch_regs[i].regmap[hr]&63)!=dops[i+1].rt1 && (branch_regs[i].regmap[hr]&63)!=dops[i+1].rt2 &&
@@ -8528,6 +8576,8 @@ int new_recompile_block(u_int addr)
               }
               regs[i].regmap[hr]=-1;
               regs[i].isconst&=~(1<<hr);
+              regs[i].dirty&=~(1<<hr);
+              regs[i+1].wasdirty&=~(1<<hr);
             }
           }
         }
@@ -8613,11 +8663,8 @@ int new_recompile_block(u_int addr)
                   //printf("Hit %x -> %x, %x %d/%d\n",start+i*4,ba[i],start+j*4,hr,r);
                   int k;
                   if(regs[i].regmap[hr]==-1&&branch_regs[i].regmap[hr]==-1) {
+                    if(get_reg(regs[i].regmap,f_regmap[hr])>=0) break;
                     if(get_reg(regs[i+2].regmap,f_regmap[hr])>=0) break;
-                    if(r>63) {
-                      if(get_reg(regs[i].regmap,r&63)<0) break;
-                      if(get_reg(branch_regs[i].regmap,r&63)<0) break;
-                    }
                     k=i;
                     while(k>1&&regs[k-1].regmap[hr]==-1) {
                       if(count_free_regs(regs[k-1].regmap)<=minimum_free_regs[k-1]) {
@@ -8636,7 +8683,6 @@ int new_recompile_block(u_int addr)
                       if(k>2&&(dops[k-3].itype==UJUMP||dops[k-3].itype==RJUMP)&&dops[k-3].rt1==31) {
                         break;
                       }
-                      assert(r < 64);
                       k--;
                     }
                     if(regs[k-1].regmap[hr]==f_regmap[hr]&&regmap_pre[k][hr]==f_regmap[hr]) {
@@ -8915,7 +8961,10 @@ int new_recompile_block(u_int addr)
             if(get_reg(regs[i+1].regmap,dops[i+1].rs1)<0) {
               hr=get_reg2(regs[i].regmap,regs[i+1].regmap,-1);
               if(hr<0) hr=get_reg(regs[i+1].regmap,-1);
-              else {regs[i+1].regmap[hr]=AGEN1+((i+1)&1);regs[i+1].isconst&=~(1<<hr);}
+              else {
+                regs[i+1].regmap[hr]=AGEN1+((i+1)&1);
+                regs[i+1].isconst&=~(1<<hr);
+              }
               assert(hr>=0);
               if(regs[i].regmap[hr]<0&&regs[i+1].regmap_entry[hr]<0)
               {
@@ -9012,7 +9061,7 @@ int new_recompile_block(u_int addr)
     dops[slen-1].bt=1; // Mark as a branch target so instruction can restart after exception
   }
 
-#ifdef DISASM
+#ifdef REG_ALLOC_PRINT
   /* Debug/disassembly */
   for(i=0;i<slen;i++)
   {
@@ -9144,7 +9193,7 @@ int new_recompile_block(u_int addr)
       #endif
     }
   }
-#endif // DISASM
+#endif // REG_ALLOC_PRINT
 
   /* Pass 8 - Assembly */
   linkcount=0;stubcount=0;
@@ -9177,6 +9226,9 @@ int new_recompile_block(u_int addr)
   }
   for(i=0;i<slen;i++)
   {
+    check_regmap(regmap_pre[i]);
+    check_regmap(regs[i].regmap_entry);
+    check_regmap(regs[i].regmap);
     //if(ds) printf("ds: ");
     disassemble_inst(i);
     if(ds) {