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