/[gxemul]/trunk/experiments/new_test_x.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/experiments/new_test_x.c

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

revision 9 by dpavlin, Mon Oct 8 16:18:11 2007 UTC revision 10 by dpavlin, Mon Oct 8 16:18:27 2007 UTC
# Line 4  Line 4 
4  #include <sys/time.h>  #include <sys/time.h>
5  #include <sys/resource.h>  #include <sys/resource.h>
6    
7  #define N_CALLS_PER_PAGE        1024  /*  #define     N_CALLS_PER_PAGE        1024  */
8    #define N_CALLS_PER_PAGE        128
9    
10  #define MHZ     533  #define MHZ     533
11    
# Line 12  struct cpu; Line 13  struct cpu;
13    
14  struct instr_call {  struct instr_call {
15          void    (*f)(struct cpu *cpu, struct instr_call *ic);          void    (*f)(struct cpu *cpu, struct instr_call *ic);
16          int     instr_len;  /*      int     instr_len;  */
17          void    *arg[3];          void    *arg[3];
18  };  };
19    
# Line 58  void r(struct cpu *cpu) Line 59  void r(struct cpu *cpu)
59    
60  void f_add(struct cpu *cpu, struct instr_call *ic)  void f_add(struct cpu *cpu, struct instr_call *ic)
61  {  {
62    #if 0
63    #if 0
64          int *a = (int *) ic->arg[0];          int *a = (int *) ic->arg[0];
65          int *b = (int *) ic->arg[1];          int *b = (int *) ic->arg[1];
66          int *c = (int *) ic->arg[2];          int *c = (int *) ic->arg[2];
67    
68          *a = (*b) + (*c);          *a = (*b) + (*c);
69    #else
70            int *a = (int *) ic->arg[0];
71            int *b = (int *) ic->arg[1];
72            int *c = (int *) ic->arg[2];
73            int *d, *e, *f;
74    
 #if 0  
75          ic = cpu->next_instr_call++;          ic = cpu->next_instr_call++;
76            d = (int *) ic->arg[0];
77          a = (int *) ic->arg[0];          e = (int *) ic->arg[1];
78          b = (int *) ic->arg[1];          f = (int *) ic->arg[2];
         c = (int *) ic->arg[2];  
79    
80          *a = (*b) + (*c);          *a = (*b) + (*c);
81            *d = (*e) + (*f);
82    #endif
83  #endif  #endif
84  }  }
85    
# Line 150  int main(int argc, char *argv[]) Line 158  int main(int argc, char *argv[])
158                  if (i == ncalls-1) {                  if (i == ncalls-1) {
159                          call_array[i].f = f_end;                          call_array[i].f = f_end;
160                  } else {                  } else {
161    #if 0
162                          switch (i & 3) {                          switch (i & 3) {
163                          case 0: call_array[i].f = f_add;                          case 0: call_array[i].f = f_add;
164                          case 1: call_array[i].f = f_sub;                          case 1: call_array[i].f = f_sub;
165                          case 2: call_array[i].f = f_and;                          case 2: call_array[i].f = f_and;
166                          case 3: call_array[i].f = f_or;                          case 3: call_array[i].f = f_or;
167                          }                          }
168    #else
169                            call_array[i].f = f_add;
170    #endif
171    
172                          call_array[i].arg[0] = &tmp_a;                          call_array[i].arg[0] = &tmp_a;
173                          call_array[i].arg[1] = &tmp_b;                          call_array[i].arg[1] = &tmp_b;

Legend:
Removed from v.9  
changed lines
  Added in v.10

  ViewVC Help
Powered by ViewVC 1.1.26