root / target-ppc / op_template.h @ 4f7de373
History | View | Annotate | Download (4.1 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 = env->gpr[REG]; |
25 |
RETURN(); |
26 |
} |
27 |
|
28 |
void OPPROTO glue(op_load_gpr_T1_gpr, REG) (void) |
29 |
{ |
30 |
T1 = env->gpr[REG]; |
31 |
RETURN(); |
32 |
} |
33 |
|
34 |
void OPPROTO glue(op_load_gpr_T2_gpr, REG) (void) |
35 |
{ |
36 |
T2 = env->gpr[REG]; |
37 |
RETURN(); |
38 |
} |
39 |
|
40 |
void OPPROTO glue(op_store_T0_gpr_gpr, REG) (void) |
41 |
{ |
42 |
env->gpr[REG] = T0; |
43 |
RETURN(); |
44 |
} |
45 |
|
46 |
void OPPROTO glue(op_store_T1_gpr_gpr, REG) (void) |
47 |
{ |
48 |
env->gpr[REG] = T1; |
49 |
RETURN(); |
50 |
} |
51 |
|
52 |
#if 0 // unused
|
53 |
void OPPROTO glue(op_store_T2_gpr_gpr, REG) (void)
|
54 |
{
|
55 |
env->gpr[REG] = T2;
|
56 |
RETURN();
|
57 |
}
|
58 |
#endif
|
59 |
|
60 |
/* General purpose registers containing vector operands moves */
|
61 |
#if !defined(TARGET_PPC64)
|
62 |
void OPPROTO glue(op_load_gpr64_T0_gpr, REG) (void) |
63 |
{ |
64 |
T0_64 = (uint64_t)env->gpr[REG] | ((uint64_t)env->gprh[REG] << 32);
|
65 |
RETURN(); |
66 |
} |
67 |
|
68 |
void OPPROTO glue(op_load_gpr64_T1_gpr, REG) (void) |
69 |
{ |
70 |
T1_64 = (uint64_t)env->gpr[REG] | ((uint64_t)env->gprh[REG] << 32);
|
71 |
RETURN(); |
72 |
} |
73 |
|
74 |
#if 0 // unused
|
75 |
void OPPROTO glue(op_load_gpr64_T2_gpr, REG) (void)
|
76 |
{
|
77 |
T2_64 = (uint64_t)env->gpr[REG] | ((uint64_t)env->gprh[REG] << 32);
|
78 |
RETURN();
|
79 |
}
|
80 |
#endif
|
81 |
|
82 |
void OPPROTO glue(op_store_T0_gpr64_gpr, REG) (void) |
83 |
{ |
84 |
env->gpr[REG] = T0_64; |
85 |
env->gprh[REG] = T0_64 >> 32;
|
86 |
RETURN(); |
87 |
} |
88 |
|
89 |
void OPPROTO glue(op_store_T1_gpr64_gpr, REG) (void) |
90 |
{ |
91 |
env->gpr[REG] = T1_64; |
92 |
env->gprh[REG] = T1_64 >> 32;
|
93 |
RETURN(); |
94 |
} |
95 |
|
96 |
#if 0 // unused
|
97 |
void OPPROTO glue(op_store_T2_gpr64_gpr, REG) (void)
|
98 |
{
|
99 |
env->gpr[REG] = T2_64;
|
100 |
env->gprh[REG] = T2_64 >> 32;
|
101 |
RETURN();
|
102 |
}
|
103 |
#endif
|
104 |
#endif /* !defined(TARGET_PPC64) */ |
105 |
|
106 |
/* Altivec registers moves */
|
107 |
void OPPROTO glue(op_load_avr_A0_avr, REG) (void) |
108 |
{ |
109 |
AVR0 = env->avr[REG]; |
110 |
RETURN(); |
111 |
} |
112 |
|
113 |
void OPPROTO glue(op_load_avr_A1_avr, REG) (void) |
114 |
{ |
115 |
AVR1 = env->avr[REG]; |
116 |
RETURN(); |
117 |
} |
118 |
|
119 |
void OPPROTO glue(op_load_avr_A2_avr, REG) (void) |
120 |
{ |
121 |
AVR2 = env->avr[REG]; |
122 |
RETURN(); |
123 |
} |
124 |
|
125 |
void OPPROTO glue(op_store_A0_avr_avr, REG) (void) |
126 |
{ |
127 |
env->avr[REG] = AVR0; |
128 |
RETURN(); |
129 |
} |
130 |
|
131 |
void OPPROTO glue(op_store_A1_avr_avr, REG) (void) |
132 |
{ |
133 |
env->avr[REG] = AVR1; |
134 |
RETURN(); |
135 |
} |
136 |
|
137 |
#if 0 // unused
|
138 |
void OPPROTO glue(op_store_A2_avr_avr, REG) (void)
|
139 |
{
|
140 |
env->avr[REG] = AVR2;
|
141 |
RETURN();
|
142 |
}
|
143 |
#endif
|
144 |
|
145 |
#if REG <= 7 |
146 |
/* Condition register moves */
|
147 |
void OPPROTO glue(op_load_crf_T0_crf, REG) (void) |
148 |
{ |
149 |
T0 = env->crf[REG]; |
150 |
RETURN(); |
151 |
} |
152 |
|
153 |
void OPPROTO glue(op_load_crf_T1_crf, REG) (void) |
154 |
{ |
155 |
T1 = env->crf[REG]; |
156 |
RETURN(); |
157 |
} |
158 |
|
159 |
void OPPROTO glue(op_store_T0_crf_crf, REG) (void) |
160 |
{ |
161 |
env->crf[REG] = T0; |
162 |
RETURN(); |
163 |
} |
164 |
|
165 |
#if 0 // Unused
|
166 |
void OPPROTO glue(op_store_T1_crf_crf, REG) (void)
|
167 |
{
|
168 |
env->crf[REG] = T1;
|
169 |
RETURN();
|
170 |
}
|
171 |
#endif
|
172 |
|
173 |
#endif /* REG <= 7 */ |
174 |
|
175 |
/* floating point registers moves */
|
176 |
void OPPROTO glue(op_load_fpr_FT0_fpr, REG) (void) |
177 |
{ |
178 |
FT0 = env->fpr[REG]; |
179 |
RETURN(); |
180 |
} |
181 |
|
182 |
void OPPROTO glue(op_store_FT0_fpr_fpr, REG) (void) |
183 |
{ |
184 |
env->fpr[REG] = FT0; |
185 |
RETURN(); |
186 |
} |
187 |
|
188 |
void OPPROTO glue(op_load_fpr_FT1_fpr, REG) (void) |
189 |
{ |
190 |
FT1 = env->fpr[REG]; |
191 |
RETURN(); |
192 |
} |
193 |
|
194 |
void OPPROTO glue(op_store_FT1_fpr_fpr, REG) (void) |
195 |
{ |
196 |
env->fpr[REG] = FT1; |
197 |
RETURN(); |
198 |
} |
199 |
|
200 |
void OPPROTO glue(op_load_fpr_FT2_fpr, REG) (void) |
201 |
{ |
202 |
FT2 = env->fpr[REG]; |
203 |
RETURN(); |
204 |
} |
205 |
|
206 |
#if 0 // unused
|
207 |
void OPPROTO glue(op_store_FT2_fpr_fpr, REG) (void)
|
208 |
{
|
209 |
env->fpr[REG] = FT2;
|
210 |
RETURN();
|
211 |
}
|
212 |
#endif
|
213 |
|
214 |
#undef REG
|