~ubuntu-branches/ubuntu/wily/mupen64plus/wily

« back to all changes in this revision

Viewing changes to r4300/x86_64/gcop1.c

  • Committer: Bazaar Package Importer
  • Author(s): Sven Eckelmann
  • Date: 2011-02-06 11:57:54 UTC
  • mfrom: (10.1.1 experimental)
  • Revision ID: james.westby@ubuntu.com-20110206115754-t3abbdfr1q3brszp
Tags: 1.5+dfsg1-15
* Upload to unstable
* Updated my maintainer e-mail address
* debian/patches:
  - Add inline_header.patch, Move inline list_empty to header to make it
    inlineable
* Keep dependencies on separate lines in debian/control

Show diffs side-by-side

added added

removed removed

Lines of Context:
36
36
void genmfc1(void)
37
37
{
38
38
#if defined(COUNT_INSTR)
39
 
   inc_m32abs(&instr_count[111]);
 
39
   inc_m32rel(&instr_count[111]);
40
40
#endif
41
41
#ifdef INTERPRET_MFC1
42
42
   gencallinterp((unsigned long long)MFC1, 0);
43
43
#else
44
44
   gencheck_cop1_unusable();
45
 
   mov_reg64_m64abs(RAX, (unsigned long long *)(&reg_cop1_simple[dst->f.r.nrd]));
 
45
   mov_xreg64_m64rel(RAX, (unsigned long long *)(&reg_cop1_simple[dst->f.r.nrd]));
46
46
   mov_reg32_preg64(EBX, RAX);
47
 
   mov_m32abs_reg32((unsigned int*)dst->f.r.rt, EBX);
 
47
   mov_m32rel_xreg32((unsigned int*)dst->f.r.rt, EBX);
48
48
   sar_reg32_imm8(EBX, 31);
49
 
   mov_m32abs_reg32(((unsigned int*)dst->f.r.rt)+1, EBX);
 
49
   mov_m32rel_xreg32(((unsigned int*)dst->f.r.rt)+1, EBX);
50
50
#endif
51
51
}
52
52
 
53
53
void gendmfc1(void)
54
54
{
55
55
#if defined(COUNT_INSTR)
56
 
   inc_m32abs(&instr_count[112]);
 
56
   inc_m32rel(&instr_count[112]);
57
57
#endif
58
58
#ifdef INTERPRET_DMFC1
59
59
   gencallinterp((unsigned long long)DMFC1, 0);
60
60
#else
61
61
   gencheck_cop1_unusable();
62
 
   mov_reg64_m64abs(RAX, (unsigned long long *) (&reg_cop1_double[dst->f.r.nrd]));
 
62
   mov_xreg64_m64rel(RAX, (unsigned long long *) (&reg_cop1_double[dst->f.r.nrd]));
63
63
   mov_reg32_preg64(EBX, RAX);
64
64
   mov_reg32_preg64pimm32(ECX, RAX, 4);
65
 
   mov_m32abs_reg32((unsigned int*)dst->f.r.rt, EBX);
66
 
   mov_m32abs_reg32(((unsigned int*)dst->f.r.rt)+1, ECX);
 
65
   mov_m32rel_xreg32((unsigned int*)dst->f.r.rt, EBX);
 
66
   mov_m32rel_xreg32(((unsigned int*)dst->f.r.rt)+1, ECX);
67
67
#endif
68
68
}
69
69
 
70
70
void gencfc1(void)
71
71
{
72
72
#if defined(COUNT_INSTR)
73
 
   inc_m32abs(&instr_count[113]);
 
73
   inc_m32rel(&instr_count[113]);
74
74
#endif
75
75
#ifdef INTERPRET_CFC1
76
76
   gencallinterp((unsigned long long)CFC1, 0);
77
77
#else
78
78
   gencheck_cop1_unusable();
79
 
   if(dst->f.r.nrd == 31) mov_reg32_m32abs(EAX, (unsigned int*)&FCR31);
80
 
   else mov_reg32_m32abs(EAX, (unsigned int*)&FCR0);
81
 
   mov_m32abs_reg32((unsigned int*)dst->f.r.rt, EAX);
 
79
   if(dst->f.r.nrd == 31) mov_xreg32_m32rel(EAX, (unsigned int*)&FCR31);
 
80
   else mov_xreg32_m32rel(EAX, (unsigned int*)&FCR0);
 
81
   mov_m32rel_xreg32((unsigned int*)dst->f.r.rt, EAX);
82
82
   sar_reg32_imm8(EAX, 31);
83
 
   mov_m32abs_reg32(((unsigned int*)dst->f.r.rt)+1, EAX);
 
83
   mov_m32rel_xreg32(((unsigned int*)dst->f.r.rt)+1, EAX);
84
84
#endif
85
85
}
86
86
 
87
87
void genmtc1(void)
88
88
{
89
89
#if defined(COUNT_INSTR)
90
 
   inc_m32abs(&instr_count[114]);
 
90
   inc_m32rel(&instr_count[114]);
91
91
#endif
92
92
#ifdef INTERPRET_MTC1
93
93
   gencallinterp((unsigned long long)MTC1, 0);
94
94
#else
95
95
   gencheck_cop1_unusable();
96
 
   mov_reg32_m32abs(EAX, (unsigned int*)dst->f.r.rt);
97
 
   mov_reg64_m64abs(RBX, (unsigned long long *)(&reg_cop1_simple[dst->f.r.nrd]));
 
96
   mov_xreg32_m32rel(EAX, (unsigned int*)dst->f.r.rt);
 
97
   mov_xreg64_m64rel(RBX, (unsigned long long *)(&reg_cop1_simple[dst->f.r.nrd]));
98
98
   mov_preg64_reg32(RBX, EAX);
99
99
#endif
100
100
}
102
102
void gendmtc1(void)
103
103
{
104
104
#if defined(COUNT_INSTR)
105
 
   inc_m32abs(&instr_count[115]);
 
105
   inc_m32rel(&instr_count[115]);
106
106
#endif
107
107
#ifdef INTERPRET_DMTC1
108
108
   gencallinterp((unsigned long long)DMTC1, 0);
109
109
#else
110
110
   gencheck_cop1_unusable();
111
 
   mov_reg32_m32abs(EAX, (unsigned int*)dst->f.r.rt);
112
 
   mov_reg32_m32abs(EBX, ((unsigned int*)dst->f.r.rt)+1);
113
 
   mov_reg64_m64abs(RDX, (unsigned long long *)(&reg_cop1_double[dst->f.r.nrd]));
 
111
   mov_xreg32_m32rel(EAX, (unsigned int*)dst->f.r.rt);
 
112
   mov_xreg32_m32rel(EBX, ((unsigned int*)dst->f.r.rt)+1);
 
113
   mov_xreg64_m64rel(RDX, (unsigned long long *)(&reg_cop1_double[dst->f.r.nrd]));
114
114
   mov_preg64_reg32(RDX, EAX);
115
115
   mov_preg64pimm32_reg32(RDX, 4, EBX);
116
116
#endif
119
119
void genctc1(void)
120
120
{
121
121
#if defined(COUNT_INSTR)
122
 
   inc_m32abs(&instr_count[116]);
 
122
   inc_m32rel(&instr_count[116]);
123
123
#endif
124
124
#ifdef INTERPRET_CTC1
125
125
   gencallinterp((unsigned long long)CTC1, 0);
127
127
   gencheck_cop1_unusable();
128
128
   
129
129
   if (dst->f.r.nrd != 31) return;
130
 
   mov_reg32_m32abs(EAX, (unsigned int*)dst->f.r.rt);
131
 
   mov_m32abs_reg32((unsigned int*)&FCR31, EAX);
 
130
   mov_xreg32_m32rel(EAX, (unsigned int*)dst->f.r.rt);
 
131
   mov_m32rel_xreg32((unsigned int*)&FCR31, EAX);
132
132
   and_eax_imm32(3);
133
133
   
134
134
   cmp_eax_imm32(0);
135
135
   jne_rj(13);
136
 
   mov_m32abs_imm32((unsigned int*)&rounding_mode, 0x33F); // 11
 
136
   mov_m32rel_imm32((unsigned int*)&rounding_mode, 0x33F); // 11
137
137
   jmp_imm_short(51); // 2
138
138
   
139
139
   cmp_eax_imm32(1); // 5
140
140
   jne_rj(13); // 2
141
 
   mov_m32abs_imm32((unsigned int*)&rounding_mode, 0xF3F); // 11
 
141
   mov_m32rel_imm32((unsigned int*)&rounding_mode, 0xF3F); // 11
142
142
   jmp_imm_short(31); // 2
143
143
   
144
144
   cmp_eax_imm32(2); // 5
145
145
   jne_rj(13); // 2
146
 
   mov_m32abs_imm32((unsigned int*)&rounding_mode, 0xB3F); // 11
 
146
   mov_m32rel_imm32((unsigned int*)&rounding_mode, 0xB3F); // 11
147
147
   jmp_imm_short(11); // 2
148
148
   
149
 
   mov_m32abs_imm32((unsigned int*)&rounding_mode, 0x73F); // 11
 
149
   mov_m32rel_imm32((unsigned int*)&rounding_mode, 0x73F); // 11
150
150
   
151
 
   fldcw_m16abs((unsigned short*)&rounding_mode);
 
151
   fldcw_m16rel((unsigned short*)&rounding_mode);
152
152
#endif
153
153
}
154
154