/[gxemul]/trunk/src/cpus/cpu_dyntrans.c
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /trunk/src/cpus/cpu_dyntrans.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 43 by dpavlin, Mon Oct 8 16:22:32 2007 UTC revision 44 by dpavlin, Mon Oct 8 16:22:56 2007 UTC
# Line 25  Line 25 
25   *  SUCH DAMAGE.   *  SUCH DAMAGE.
26   *   *
27   *   *
28   *  $Id: cpu_dyntrans.c,v 1.165 2007/06/15 21:43:53 debug Exp $   *  $Id: cpu_dyntrans.c,v 1.186 2007/07/20 09:03:33 debug Exp $
29   *   *
30   *  Common dyntrans routines. Included from cpu_*.c.   *  Common dyntrans routines. Included from cpu_*.c.
31     *
32     *  Note: This might be a bit hard to follow, if you are reading this source
33     *  code for the first time. It is basically a hack to implement "templates"
34     *  with normal C code, by using suitable defines/macros, and then including
35     *  this file.
36   */   */
37    
38    
# Line 45  static void gather_statistics(struct cpu Line 50  static void gather_statistics(struct cpu
50          int low_pc = ((size_t)cpu->cd.DYNTRANS_ARCH.next_ic - (size_t)          int low_pc = ((size_t)cpu->cd.DYNTRANS_ARCH.next_ic - (size_t)
51              cpu->cd.DYNTRANS_ARCH.cur_ic_page) / sizeof(struct DYNTRANS_IC);              cpu->cd.DYNTRANS_ARCH.cur_ic_page) / sizeof(struct DYNTRANS_IC);
52    
53          if (cpu->machine->statistics_file == NULL) {          if (cpu->machine->statistics.file == NULL) {
54                  fatal("statistics gathering with no filename set is"                  fatal("statistics gathering with no filename set is"
55                      " meaningless\n");                      " meaningless\n");
56                  return;                  return;
# Line 57  static void gather_statistics(struct cpu Line 62  static void gather_statistics(struct cpu
62    
63          buf[0] = '\0';          buf[0] = '\0';
64    
65          while ((ch = cpu->machine->statistics_fields[i]) != '\0') {          while ((ch = cpu->machine->statistics.fields[i]) != '\0') {
66                  if (i != 0)                  if (i != 0)
67                          strlcat(buf, " ", sizeof(buf));                          strlcat(buf, " ", sizeof(buf));
68    
# Line 98  static void gather_statistics(struct cpu Line 103  static void gather_statistics(struct cpu
103                  i++;                  i++;
104          }          }
105    
106          fprintf(cpu->machine->statistics_file, "%s\n", buf);          fprintf(cpu->machine->statistics.file, "%s\n", buf);
107  }  }
108    
109    
# Line 161  static void gather_statistics(struct cpu Line 166  static void gather_statistics(struct cpu
166    
167    
168    
169  #ifdef  DYNTRANS_RUN_INSTR  #ifdef  DYNTRANS_RUN_INSTR_DEF
170  /*  /*
171   *  XXX_run_instr():   *  XXX_run_instr():
172   *   *
# Line 171  static void gather_statistics(struct cpu Line 176  static void gather_statistics(struct cpu
176   *  Return value is the number of instructions executed during this call,   *  Return value is the number of instructions executed during this call,
177   *  0 if no instructions were executed.   *  0 if no instructions were executed.
178   */   */
179  int DYNTRANS_RUN_INSTR(struct cpu *cpu)  int DYNTRANS_RUN_INSTR_DEF(struct cpu *cpu)
180  {  {
181          MODE_uint_t cached_pc;          MODE_uint_t cached_pc;
182          int low_pc, n_instrs;          int low_pc, n_instrs;
# Line 199  int DYNTRANS_RUN_INSTR(struct cpu *cpu) Line 204  int DYNTRANS_RUN_INSTR(struct cpu *cpu)
204          if (cpu->cd.arm.irq_asserted && !(cpu->cd.arm.cpsr & ARM_FLAG_I))          if (cpu->cd.arm.irq_asserted && !(cpu->cd.arm.cpsr & ARM_FLAG_I))
205                  arm_exception(cpu, ARM_EXCEPTION_IRQ);                  arm_exception(cpu, ARM_EXCEPTION_IRQ);
206  #endif  #endif
207    #ifdef DYNTRANS_M88K
208            if (cpu->cd.m88k.irq_asserted &&
209                !(cpu->cd.m88k.cr[M88K_CR_PSR] & M88K_PSR_IND))
210                    m88k_exception(cpu, M88K_EXCEPTION_INTERRUPT, 0);
211    #endif
212  #ifdef DYNTRANS_MIPS  #ifdef DYNTRANS_MIPS
213          {          {
214                  int enabled, mask;                  int enabled, mask;
# Line 294  int DYNTRANS_RUN_INSTR(struct cpu *cpu) Line 304  int DYNTRANS_RUN_INSTR(struct cpu *cpu)
304                          }                          }
305                  }                  }
306    
307                  if (cpu->machine->statistics_enabled)                  if (cpu->machine->statistics.enabled)
308                          S;                          S;
309    
310                  /*  Execute just one instruction:  */                  /*  Execute just one instruction:  */
311                  I;                  I;
312    
313                  n_instrs = 1;                  n_instrs = 1;
314          } else if (cpu->machine->statistics_enabled) {          } else if (cpu->machine->statistics.enabled) {
315                  /*  Gather statistics while executing multiple instructions:  */                  /*  Gather statistics while executing multiple instructions:  */
316                  n_instrs = 0;                  n_instrs = 0;
317                  for (;;) {                  for (;;) {
# Line 325  int DYNTRANS_RUN_INSTR(struct cpu *cpu) Line 335  int DYNTRANS_RUN_INSTR(struct cpu *cpu)
335                   *  (This is the core dyntrans loop.)                   *  (This is the core dyntrans loop.)
336                   */                   */
337                  n_instrs = 0;                  n_instrs = 0;
                 cpu->sampling = 1;  
338    
339                  for (;;) {                  for (;;) {
340                          struct DYNTRANS_IC *ic;                          struct DYNTRANS_IC *ic;
# Line 350  int DYNTRANS_RUN_INSTR(struct cpu *cpu) Line 359  int DYNTRANS_RUN_INSTR(struct cpu *cpu)
359                          if (cpu->n_translated_instrs >= N_SAFE_DYNTRANS_LIMIT)                          if (cpu->n_translated_instrs >= N_SAFE_DYNTRANS_LIMIT)
360                                  break;                                  break;
361                  }                  }
   
                 cpu->sampling = 0;  
362          }          }
363    
364          n_instrs += cpu->n_translated_instrs;          n_instrs += cpu->n_translated_instrs;
# Line 423  int DYNTRANS_RUN_INSTR(struct cpu *cpu) Line 430  int DYNTRANS_RUN_INSTR(struct cpu *cpu)
430    
431          cpu->ninstrs += n_instrs;          cpu->ninstrs += n_instrs;
432    
         /*  
          *  Check if there are enough samples to decide whether or not to  
          *  perform native code generation:  
          */  
         if (cpu->sampling_curindex == N_PADDR_SAMPLES) {  
                 /*  TODO: Check against known blocks, etc.  */  
   
                 cpu->sampling_curindex = 0;  
         }  
   
433          /*  Return the nr of instructions executed:  */          /*  Return the nr of instructions executed:  */
434          return n_instrs;          return n_instrs;
435  }  }
# Line 440  int DYNTRANS_RUN_INSTR(struct cpu *cpu) Line 437  int DYNTRANS_RUN_INSTR(struct cpu *cpu)
437    
438    
439    
440  #ifdef DYNTRANS_FUNCTION_TRACE  #ifdef DYNTRANS_FUNCTION_TRACE_DEF
441  /*  /*
442   *  XXX_cpu_functioncall_trace():   *  XXX_cpu_functioncall_trace():
443   *   *
# Line 448  int DYNTRANS_RUN_INSTR(struct cpu *cpu) Line 445  int DYNTRANS_RUN_INSTR(struct cpu *cpu)
445   *  like    <f()>  or  <0x1234()>   on a function call. It is up to this   *  like    <f()>  or  <0x1234()>   on a function call. It is up to this
446   *  function to print the arguments passed.   *  function to print the arguments passed.
447   */   */
448  void DYNTRANS_FUNCTION_TRACE(struct cpu *cpu, uint64_t f, int n_args)  void DYNTRANS_FUNCTION_TRACE_DEF(struct cpu *cpu, uint64_t f, int n_args)
449  {  {
450          int show_symbolic_function_name = 1;          int show_symbolic_function_name = 1;
451          char strbuf[50];          char strbuf[50];
# Line 504  void DYNTRANS_FUNCTION_TRACE(struct cpu Line 501  void DYNTRANS_FUNCTION_TRACE(struct cpu
501  #ifdef DYNTRANS_MIPS  #ifdef DYNTRANS_MIPS
502                      gpr[MIPS_GPR_A0                      gpr[MIPS_GPR_A0
503  #endif  #endif
504    #ifdef DYNTRANS_M32R
505                        r[0         /*  r0..r3?  */
506    #endif
507  #ifdef DYNTRANS_M88K  #ifdef DYNTRANS_M88K
508                      r[2         /*  r2..r9  */                      r[2         /*  r2..r9  */
509  #endif  #endif
# Line 543  void DYNTRANS_FUNCTION_TRACE(struct cpu Line 543  void DYNTRANS_FUNCTION_TRACE(struct cpu
543          if (print_dots)          if (print_dots)
544                  fatal(",..");                  fatal(",..");
545  }  }
546  #endif  #endif  /*  DYNTRANS_FUNCTION_TRACE_DEF  */
   
   
   
 #ifdef DYNTRANS_TIMER_SAMPLE_TICK  
 /*  
  *  XXX_timer_sample_tick():  
  *  
  *  Gathers statistics about which translation blocks are being executed.  
  *  This can then be used to calculate if it is worth the effort to perform  
  *  native code generation (which is assumed to have a large overhead, but  
  *  will result in faster code).  
  */  
 void DYNTRANS_TIMER_SAMPLE_TICK(struct timer *timer, void *extra)  
 {  
         struct cpu *cpu = extra;  
         struct DYNTRANS_IC *next_ic;  
         size_t low_pc;  
         uint64_t paddr;  
   
         /*  
          *  Don't sample if:  
          *  
          *  1)  Sampling is not enabled. It should only be enabled during  
          *      the core dyntrans loop.  
          *  2)  Enough samples have already been gathered.  
          */  
   
         if (!cpu->sampling || cpu->sampling_curindex == N_PADDR_SAMPLES)  
                 return;  
   
         /*  Get the physical address of the program counter:  */  
   
         next_ic = cpu->cd.DYNTRANS_ARCH.next_ic;  
         low_pc = ((size_t)next_ic - (size_t)cpu->cd.DYNTRANS_ARCH.cur_ic_page)  
             / sizeof(struct DYNTRANS_IC);  
   
         /*  Not possible to represent as a physical address? Then abort.  */  
         if (low_pc > DYNTRANS_IC_ENTRIES_PER_PAGE)  
                 return;  
   
         cpu->cd.DYNTRANS_ARCH.cur_physpage = (void *)  
             cpu->cd.DYNTRANS_ARCH.cur_ic_page;  
         paddr = cpu->cd.DYNTRANS_ARCH.cur_physpage->physaddr;  
         paddr &= ~((DYNTRANS_IC_ENTRIES_PER_PAGE-1) <<  
             DYNTRANS_INSTR_ALIGNMENT_SHIFT);  
         paddr += low_pc << DYNTRANS_INSTR_ALIGNMENT_SHIFT;  
   
         /*  ... and finally add the sample to the sampling array:  */  
         cpu->sampling_paddr[cpu->sampling_curindex ++] = paddr;  
 }  
 #endif  /*  DYNTRANS_TIMER_SAMPLE_TICK  */  
547    
548    
549    
550  #ifdef DYNTRANS_TC_ALLOCATE_DEFAULT_PAGE  #ifdef DYNTRANS_TC_ALLOCATE_DEFAULT_PAGE_DEF
551  /*  /*
552   *  XXX_tc_allocate_default_page():   *  XXX_tc_allocate_default_page():
553   *   *
554   *  Create a default page (with just pointers to instr(to_be_translated)   *  Create a default page (with just pointers to instr(to_be_translated)
555   *  at cpu->translation_cache_cur_ofs.   *  at cpu->translation_cache_cur_ofs.
556   */   */
557  static void DYNTRANS_TC_ALLOCATE_DEFAULT_PAGE(struct cpu *cpu,  static void DYNTRANS_TC_ALLOCATE_DEFAULT_PAGE_DEF(struct cpu *cpu,
558          uint64_t physaddr)          uint64_t physaddr)
559  {  {
560          struct DYNTRANS_TC_PHYSPAGE *ppp;          struct DYNTRANS_TC_PHYSPAGE *ppp;
# Line 622  static void DYNTRANS_TC_ALLOCATE_DEFAULT Line 571  static void DYNTRANS_TC_ALLOCATE_DEFAULT
571          cpu->translation_cache_cur_ofs += sizeof(struct DYNTRANS_TC_PHYSPAGE);          cpu->translation_cache_cur_ofs += sizeof(struct DYNTRANS_TC_PHYSPAGE);
572    
573          cpu->translation_cache_cur_ofs --;          cpu->translation_cache_cur_ofs --;
574          cpu->translation_cache_cur_ofs |= 127;          cpu->translation_cache_cur_ofs |= 63;
575          cpu->translation_cache_cur_ofs ++;          cpu->translation_cache_cur_ofs ++;
576  }  }
577  #endif  /*  DYNTRANS_TC_ALLOCATE_DEFAULT_PAGE  */  #endif  /*  DYNTRANS_TC_ALLOCATE_DEFAULT_PAGE_DEF  */
578    
579    
580    
# Line 838  void DYNTRANS_PC_TO_POINTERS_GENERIC(str Line 787  void DYNTRANS_PC_TO_POINTERS_GENERIC(str
787           *  as non-writable. If there are already translations, then it           *  as non-writable. If there are already translations, then it
788           *  should already have been marked as non-writable.           *  should already have been marked as non-writable.
789           */           */
790          if (ppp->translations == 0) {          if (ppp->translations_bitmap == 0) {
791                  cpu->invalidate_translation_caches(cpu, physaddr,                  cpu->invalidate_translation_caches(cpu, physaddr,
792                      JUST_MARK_AS_NON_WRITABLE | INVALIDATE_PADDR);                      JUST_MARK_AS_NON_WRITABLE | INVALIDATE_PADDR);
793          }          }
# Line 928  static void instr32(to_be_translated)(st Line 877  static void instr32(to_be_translated)(st
877  static void instr32(end_of_page)(struct cpu *,struct DYNTRANS_IC *);  static void instr32(end_of_page)(struct cpu *,struct DYNTRANS_IC *);
878  #endif  #endif
879    
880    #ifdef DYNTRANS_DUALMODE_32
881    #define TO_BE_TRANSLATED    ( cpu->is_32bit? instr32(to_be_translated) : \
882                                  instr(to_be_translated) )
883    #else
884    #define TO_BE_TRANSLATED    ( instr(to_be_translated) )
885    #endif
886    
887  #ifdef DYNTRANS_DELAYSLOT  #ifdef DYNTRANS_DELAYSLOT
888  static void instr(end_of_page2)(struct cpu *,struct DYNTRANS_IC *);  static void instr(end_of_page2)(struct cpu *,struct DYNTRANS_IC *);
889  #ifdef DYNTRANS_DUALMODE_32  #ifdef DYNTRANS_DUALMODE_32
# Line 954  void DYNTRANS_INIT_TABLES(struct cpu *cp Line 910  void DYNTRANS_INIT_TABLES(struct cpu *cp
910          CHECK_ALLOCATION(ppp = malloc(sizeof(struct DYNTRANS_TC_PHYSPAGE)));          CHECK_ALLOCATION(ppp = malloc(sizeof(struct DYNTRANS_TC_PHYSPAGE)));
911    
912          ppp->next_ofs = 0;          ppp->next_ofs = 0;
913          ppp->translations = 0;          ppp->translations_bitmap = 0;
914            ppp->translation_ranges_ofs = 0;
915          /*  ppp->physaddr is filled in by the page allocator  */          /*  ppp->physaddr is filled in by the page allocator  */
916    
917          for (i=0; i<DYNTRANS_IC_ENTRIES_PER_PAGE; i++) {          for (i=0; i<DYNTRANS_IC_ENTRIES_PER_PAGE; i++)
918                  ppp->ics[i].f =                  ppp->ics[i].f = TO_BE_TRANSLATED;
 #ifdef DYNTRANS_DUALMODE_32  
                     cpu->is_32bit? instr32(to_be_translated) :  
 #endif  
                     instr(to_be_translated);  
         }  
919    
920          /*  End-of-page:  */          /*  End-of-page:  */
921          ppp->ics[DYNTRANS_IC_ENTRIES_PER_PAGE + 0].f =          ppp->ics[DYNTRANS_IC_ENTRIES_PER_PAGE + 0].f =
# Line 1343  void DYNTRANS_INVALIDATE_TC_CODE(struct Line 1295  void DYNTRANS_INVALIDATE_TC_CODE(struct
1295                   *  it might be faster since we don't risk wasting cache                   *  it might be faster since we don't risk wasting cache
1296                   *  memory as quickly (which would force unnecessary Restarts).                   *  memory as quickly (which would force unnecessary Restarts).
1297                   */                   */
1298                  if (ppp != NULL && ppp->translations != 0) {                  if (ppp != NULL && ppp->translations_bitmap != 0) {
1299                          uint32_t x = ppp->translations; /*  TODO:                          uint32_t x = ppp->translations_bitmap;  /*  TODO:
1300                                  urk Should be same type as ppp->translations */                                  urk Should be same type as the bitmap */
1301                          int i, j, n, m;                          int i, j, n, m;
1302                          n = 8 * sizeof(x);                          n = 8 * sizeof(x);
1303                          m = DYNTRANS_IC_ENTRIES_PER_PAGE / n;                          m = DYNTRANS_IC_ENTRIES_PER_PAGE / n;
# Line 1354  void DYNTRANS_INVALIDATE_TC_CODE(struct Line 1306  void DYNTRANS_INVALIDATE_TC_CODE(struct
1306                                  if (x & 1) {                                  if (x & 1) {
1307                                          for (j=0; j<m; j++)                                          for (j=0; j<m; j++)
1308                                                  ppp->ics[i*m + j].f =                                                  ppp->ics[i*m + j].f =
1309  #ifdef DYNTRANS_DUALMODE_32                                                      TO_BE_TRANSLATED;
                                                     cpu->is_32bit?  
                                                     instr32(to_be_translated) :  
 #endif  
                                                     instr(to_be_translated);  
1310                                  }                                  }
1311    
1312                                  x >>= 1;                                  x >>= 1;
1313                          }                          }
1314    
1315                          ppp->translations = 0;                          ppp->translations_bitmap = 0;
1316    
1317                            /*  Clear the list of translatable ranges:  */
1318                            if (ppp->translation_ranges_ofs != 0) {
1319                                    struct physpage_ranges *physpage_ranges =
1320                                        (struct physpage_ranges *)
1321                                        (cpu->translation_cache +
1322                                        ppp->translation_ranges_ofs);
1323                                    physpage_ranges->next_ofs = 0;
1324                                    physpage_ranges->n_entries_used = 0;
1325                            }
1326                  }                  }
1327  #endif  #endif
1328          }          }
# Line 1746  cpu->cd.DYNTRANS_ARCH.vph_tlb_entry[r].v Line 1704  cpu->cd.DYNTRANS_ARCH.vph_tlb_entry[r].v
1704          {          {
1705                  int x = addr & (DYNTRANS_PAGESIZE - 1);                  int x = addr & (DYNTRANS_PAGESIZE - 1);
1706                  int addr_per_translation_range = DYNTRANS_PAGESIZE / (8 *                  int addr_per_translation_range = DYNTRANS_PAGESIZE / (8 *
1707                      sizeof(cpu->cd.DYNTRANS_ARCH.cur_physpage->translations));                      sizeof(cpu->cd.DYNTRANS_ARCH.cur_physpage->
1708                        translations_bitmap));
1709                  x /= addr_per_translation_range;                  x /= addr_per_translation_range;
1710    
1711                  cpu->cd.DYNTRANS_ARCH.cur_physpage->translations |= (1 << x);                  cpu->cd.DYNTRANS_ARCH.cur_physpage->
1712                        translations_bitmap |= (1 << x);
1713          }          }
1714    
1715    
1716          /*          /*
1717           *  Now it is time to check for combinations of instructions that can           *  Now it is time to check for combinations of instructions that can
1718           *  be converted into a single function call.           *  be converted into a single function call.
# Line 1774  cpu->cd.DYNTRANS_ARCH.vph_tlb_entry[r].v Line 1735  cpu->cd.DYNTRANS_ARCH.vph_tlb_entry[r].v
1735          cpu->cd.DYNTRANS_ARCH.combination_check = NULL;          cpu->cd.DYNTRANS_ARCH.combination_check = NULL;
1736    
1737          /*  An additional check, to catch some bugs:  */          /*  An additional check, to catch some bugs:  */
1738          if (ic->f == (          if (ic->f == TO_BE_TRANSLATED) {
 #ifdef DYNTRANS_DUALMODE_32  
             cpu->is_32bit? instr32(to_be_translated) :  
 #endif  
             instr(to_be_translated))) {  
1739                  fatal("INTERNAL ERROR: ic->f not set!\n");                  fatal("INTERNAL ERROR: ic->f not set!\n");
1740                  goto bad;                  goto bad;
1741          }          }
# Line 1787  cpu->cd.DYNTRANS_ARCH.vph_tlb_entry[r].v Line 1744  cpu->cd.DYNTRANS_ARCH.vph_tlb_entry[r].v
1744                  goto bad;                  goto bad;
1745          }          }
1746    
1747          /*  ... and finally execute the translated instruction:  */  
1748            /*
1749             *  ... and finally execute the translated instruction:
1750             */
1751    
1752          /*  (Except when doing read-ahead!)  */          /*  (Except when doing read-ahead!)  */
1753          if (cpu->translation_readahead)          if (cpu->translation_readahead)
# Line 1805  cpu->cd.DYNTRANS_ARCH.vph_tlb_entry[r].v Line 1765  cpu->cd.DYNTRANS_ARCH.vph_tlb_entry[r].v
1765              ) {              ) {
1766                  single_step_breakpoint = 0;                  single_step_breakpoint = 0;
1767                  ic->f(cpu, ic);                  ic->f(cpu, ic);
1768                  ic->f =                  ic->f = TO_BE_TRANSLATED;
 #ifdef DYNTRANS_DUALMODE_32  
                     cpu->is_32bit? instr32(to_be_translated) :  
 #endif  
                     instr(to_be_translated);  
   
1769                  return;                  return;
1770          }          }
1771    
1772          /*  Translation read-ahead:  */          /*  Translation read-ahead:  */
1773          if (!single_step && !cpu->machine->instruction_trace) {          if (!single_step && !cpu->machine->instruction_trace) {
                 /*  Do readahead:  */  
                 int i = 1;  
                 uint64_t pagenr = DYNTRANS_ADDR_TO_PAGENR(cpu->pc);  
1774                  uint64_t baseaddr = cpu->pc;                  uint64_t baseaddr = cpu->pc;
1775                    uint64_t pagenr = DYNTRANS_ADDR_TO_PAGENR(baseaddr);
1776                    int i = 1;
1777    
1778                  cpu->translation_readahead = MAX_DYNTRANS_READAHEAD;                  cpu->translation_readahead = MAX_DYNTRANS_READAHEAD;
1779    
# Line 1830  cpu->cd.DYNTRANS_ARCH.vph_tlb_entry[r].v Line 1784  cpu->cd.DYNTRANS_ARCH.vph_tlb_entry[r].v
1784                              struct DYNTRANS_IC *) = ic[i].f;                              struct DYNTRANS_IC *) = ic[i].f;
1785    
1786                          /*  Already translated? Then abort:  */                          /*  Already translated? Then abort:  */
1787                          if (old_f != (                          if (old_f != TO_BE_TRANSLATED)
 #ifdef DYNTRANS_DUALMODE_32  
                             cpu->is_32bit? instr32(to_be_translated) :  
 #endif  
                             instr(to_be_translated)))  
1788                                  break;                                  break;
1789    
1790                          /*  Translate the instruction:  */                          /*  Translate the instruction:  */
# Line 1869  bad:   /* Line 1819  bad:   /*
1819           */           */
1820    
1821          /*  Clear the translation, in case it was "half-way" done:  */          /*  Clear the translation, in case it was "half-way" done:  */
1822          ic->f =          ic->f = TO_BE_TRANSLATED;
 #ifdef DYNTRANS_DUALMODE_32  
             cpu->is_32bit? instr32(to_be_translated) :  
 #endif  
             instr(to_be_translated);  
1823    
1824          if (cpu->translation_readahead)          if (cpu->translation_readahead)
1825                  return;                  return;
# Line 1881  bad:   /* Line 1827  bad:   /*
1827          quiet_mode = 0;          quiet_mode = 0;
1828          fatal("to_be_translated(): TODO: unimplemented instruction");          fatal("to_be_translated(): TODO: unimplemented instruction");
1829    
1830          if (cpu->machine->instruction_trace)          if (cpu->machine->instruction_trace) {
1831  #ifdef MODE32                  if (cpu->is_32bit)
1832                  fatal(" at 0x%"PRIx32"\n", (uint32_t)cpu->pc);                          fatal(" at 0x%"PRIx32"\n", (uint32_t)cpu->pc);
1833  #else                  else
1834                  fatal(" at 0x%"PRIx64"\n", (uint64_t)cpu->pc);                          fatal(" at 0x%"PRIx64"\n", (uint64_t)cpu->pc);
1835  #endif          } else {
         else {  
1836                  fatal(":\n");                  fatal(":\n");
1837                  DISASSEMBLE(cpu, ib, 1, 0);                  DISASSEMBLE(cpu, ib, 1, 0);
1838          }          }

Legend:
Removed from v.43  
changed lines
  Added in v.44

  ViewVC Help
Powered by ViewVC 1.1.26