root / target-ppc / op_template.h @ 86cc1ce0
History | View | Annotate | Download (3.8 kB)
1 |
/*
|
---|---|
2 |
* PowerPC emulation micro-operations for qemu.
|
3 |
*
|
4 |
* Copyright (c) 2003-2007 Jocelyn Mayer
|
5 |
*
|
6 |
* This library is free software; you can redistribute it and/or
|
7 |
* modify it under the terms of the GNU Lesser General Public
|
8 |
* License as published by the Free Software Foundation; either
|
9 |
* version 2 of the License, or (at your option) any later version.
|
10 |
*
|
11 |
* This library is distributed in the hope that it will be useful,
|
12 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
13 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
14 |
* Lesser General Public License for more details.
|
15 |
*
|
16 |
* You should have received a copy of the GNU Lesser General Public
|
17 |
* License along with this library; if not, write to the Free Software
|
18 |
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
19 |
*/
|
20 |
|
21 |
/* General purpose registers moves */
|
22 |
void OPPROTO glue(op_load_gpr_T0_gpr, REG) (void) |
23 |
{ |
24 |
T0 = regs->gpr[REG]; |
25 |
RETURN(); |
26 |
} |
27 |
|
28 |
void OPPROTO glue(op_load_gpr_T1_gpr, REG) (void) |
29 |
{ |
30 |
T1 = regs->gpr[REG]; |
31 |
RETURN(); |
32 |
} |
33 |
|
34 |
void OPPROTO glue(op_load_gpr_T2_gpr, REG) (void) |
35 |
{ |
36 |
T2 = regs->gpr[REG]; |
37 |
RETURN(); |
38 |
} |
39 |
|
40 |
void OPPROTO glue(op_store_T0_gpr_gpr, REG) (void) |
41 |
{ |
42 |
regs->gpr[REG] = T0; |
43 |
RETURN(); |
44 |
} |
45 |
|
46 |
void OPPROTO glue(op_store_T1_gpr_gpr, REG) (void) |
47 |
{ |
48 |
regs->gpr[REG] = T1; |
49 |
RETURN(); |
50 |
} |
51 |
|
52 |
#if 0 // unused
|
53 |
void OPPROTO glue(op_store_T2_gpr_gpr, REG) (void)
|
54 |
{
|
55 |
regs->gpr[REG] = T2;
|
56 |
RETURN();
|
57 |
}
|
58 |
#endif
|
59 |
|
60 |
#if defined(TARGET_PPCSPE)
|
61 |
void OPPROTO glue(op_load_gpr64_T0_gpr, REG) (void) |
62 |
{ |
63 |
T0_64 = regs->gpr[REG]; |
64 |
RETURN(); |
65 |
} |
66 |
|
67 |
void OPPROTO glue(op_load_gpr64_T1_gpr, REG) (void) |
68 |
{ |
69 |
T1_64 = regs->gpr[REG]; |
70 |
RETURN(); |
71 |
} |
72 |
|
73 |
#if 0 // unused
|
74 |
void OPPROTO glue(op_load_gpr64_T2_gpr, REG) (void)
|
75 |
{
|
76 |
T2_64 = regs->gpr[REG];
|
77 |
RETURN();
|
78 |
}
|
79 |
#endif
|
80 |
|
81 |
void OPPROTO glue(op_store_T0_gpr64_gpr, REG) (void) |
82 |
{ |
83 |
regs->gpr[REG] = T0_64; |
84 |
RETURN(); |
85 |
} |
86 |
|
87 |
void OPPROTO glue(op_store_T1_gpr64_gpr, REG) (void) |
88 |
{ |
89 |
regs->gpr[REG] = T1_64; |
90 |
RETURN(); |
91 |
} |
92 |
|
93 |
#if 0 // unused
|
94 |
void OPPROTO glue(op_store_T2_gpr64_gpr, REG) (void)
|
95 |
{
|
96 |
regs->gpr[REG] = T2_64;
|
97 |
RETURN();
|
98 |
}
|
99 |
#endif
|
100 |
#endif /* defined(TARGET_PPCSPE) */ |
101 |
|
102 |
#if REG <= 7 |
103 |
/* Condition register moves */
|
104 |
void OPPROTO glue(op_load_crf_T0_crf, REG) (void) |
105 |
{ |
106 |
T0 = regs->crf[REG]; |
107 |
RETURN(); |
108 |
} |
109 |
|
110 |
void OPPROTO glue(op_load_crf_T1_crf, REG) (void) |
111 |
{ |
112 |
T1 = regs->crf[REG]; |
113 |
RETURN(); |
114 |
} |
115 |
|
116 |
void OPPROTO glue(op_store_T0_crf_crf, REG) (void) |
117 |
{ |
118 |
regs->crf[REG] = T0; |
119 |
RETURN(); |
120 |
} |
121 |
|
122 |
void OPPROTO glue(op_store_T1_crf_crf, REG) (void) |
123 |
{ |
124 |
regs->crf[REG] = T1; |
125 |
RETURN(); |
126 |
} |
127 |
|
128 |
/* Floating point condition and status register moves */
|
129 |
void OPPROTO glue(op_load_fpscr_T0_fpscr, REG) (void) |
130 |
{ |
131 |
T0 = regs->fpscr[REG]; |
132 |
RETURN(); |
133 |
} |
134 |
|
135 |
#if REG == 0 |
136 |
void OPPROTO glue(op_store_T0_fpscr_fpscr, REG) (void) |
137 |
{ |
138 |
regs->fpscr[REG] = (regs->fpscr[REG] & 0x9) | (T0 & ~0x9); |
139 |
RETURN(); |
140 |
} |
141 |
|
142 |
void OPPROTO glue(op_clear_fpscr_fpscr, REG) (void) |
143 |
{ |
144 |
regs->fpscr[REG] = (regs->fpscr[REG] & 0x9);
|
145 |
RETURN(); |
146 |
} |
147 |
#else
|
148 |
void OPPROTO glue(op_store_T0_fpscr_fpscr, REG) (void) |
149 |
{ |
150 |
regs->fpscr[REG] = T0; |
151 |
RETURN(); |
152 |
} |
153 |
|
154 |
void OPPROTO glue(op_clear_fpscr_fpscr, REG) (void) |
155 |
{ |
156 |
regs->fpscr[REG] = 0x0;
|
157 |
RETURN(); |
158 |
} |
159 |
#endif
|
160 |
|
161 |
#endif /* REG <= 7 */ |
162 |
|
163 |
/* floating point registers moves */
|
164 |
void OPPROTO glue(op_load_fpr_FT0_fpr, REG) (void) |
165 |
{ |
166 |
FT0 = env->fpr[REG]; |
167 |
RETURN(); |
168 |
} |
169 |
|
170 |
void OPPROTO glue(op_store_FT0_fpr_fpr, REG) (void) |
171 |
{ |
172 |
env->fpr[REG] = FT0; |
173 |
RETURN(); |
174 |
} |
175 |
|
176 |
void OPPROTO glue(op_load_fpr_FT1_fpr, REG) (void) |
177 |
{ |
178 |
FT1 = env->fpr[REG]; |
179 |
RETURN(); |
180 |
} |
181 |
|
182 |
void OPPROTO glue(op_store_FT1_fpr_fpr, REG) (void) |
183 |
{ |
184 |
env->fpr[REG] = FT1; |
185 |
RETURN(); |
186 |
} |
187 |
|
188 |
void OPPROTO glue(op_load_fpr_FT2_fpr, REG) (void) |
189 |
{ |
190 |
FT2 = env->fpr[REG]; |
191 |
RETURN(); |
192 |
} |
193 |
|
194 |
#if 0 // unused
|
195 |
void OPPROTO glue(op_store_FT2_fpr_fpr, REG) (void)
|
196 |
{
|
197 |
env->fpr[REG] = FT2;
|
198 |
RETURN();
|
199 |
}
|
200 |
#endif
|
201 |
|
202 |
#undef REG
|