Add quotes missing from previous patch.
[qemu/mini2440.git] / target-ppc / op_template.h
blob1be640d6dec7303e91e42d5c1a99fb69c69baa45
1 /*
2 * PowerPC emulation micro-operations for qemu.
3 *
4 * Copyright (c) 2003-2005 Jocelyn Mayer
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.
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.
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
21 /* General purpose registers moves */
22 void OPPROTO glue(op_load_gpr_T0_gpr, REG)(void)
24 T0 = regs->gpr[REG];
25 RETURN();
28 void OPPROTO glue(op_load_gpr_T1_gpr, REG)(void)
30 T1 = regs->gpr[REG];
31 RETURN();
34 void OPPROTO glue(op_load_gpr_T2_gpr, REG)(void)
36 T2 = regs->gpr[REG];
37 RETURN();
40 void OPPROTO glue(op_store_T0_gpr_gpr, REG)(void)
42 regs->gpr[REG] = T0;
43 RETURN();
46 void OPPROTO glue(op_store_T1_gpr_gpr, REG)(void)
48 regs->gpr[REG] = T1;
49 RETURN();
52 void OPPROTO glue(op_store_T2_gpr_gpr, REG)(void)
54 regs->gpr[REG] = T2;
55 RETURN();
58 #if REG <= 7
59 /* Condition register moves */
60 void OPPROTO glue(op_load_crf_T0_crf, REG)(void)
62 T0 = regs->crf[REG];
63 RETURN();
66 void OPPROTO glue(op_load_crf_T1_crf, REG)(void)
68 T1 = regs->crf[REG];
69 RETURN();
72 void OPPROTO glue(op_store_T0_crf_crf, REG)(void)
74 regs->crf[REG] = T0;
75 RETURN();
78 void OPPROTO glue(op_store_T1_crf_crf, REG)(void)
80 regs->crf[REG] = T1;
81 RETURN();
84 /* Floating point condition and status register moves */
85 void OPPROTO glue(op_load_fpscr_T0_fpscr, REG)(void)
87 T0 = regs->fpscr[REG];
88 RETURN();
91 #if REG == 0
92 void OPPROTO glue(op_store_T0_fpscr_fpscr, REG)(void)
94 regs->fpscr[REG] = (regs->fpscr[REG] & 0x9) | (T0 & ~0x9);
95 RETURN();
98 void OPPROTO glue(op_store_T0_fpscri_fpscr, REG)(void)
100 regs->fpscr[REG] = (regs->fpscr[REG] & ~0x9) | (PARAM(1) & 0x9);
101 RETURN();
104 void OPPROTO glue(op_clear_fpscr_fpscr, REG)(void)
106 regs->fpscr[REG] = (regs->fpscr[REG] & 0x9);
107 RETURN();
109 #else
110 void OPPROTO glue(op_store_T0_fpscr_fpscr, REG)(void)
112 regs->fpscr[REG] = T0;
113 RETURN();
116 void OPPROTO glue(op_store_T0_fpscri_fpscr, REG)(void)
118 regs->fpscr[REG] = PARAM(1);
119 RETURN();
122 void OPPROTO glue(op_clear_fpscr_fpscr, REG)(void)
124 regs->fpscr[REG] = 0x0;
125 RETURN();
127 #endif
129 #endif /* REG <= 7 */
131 /* floating point registers moves */
132 void OPPROTO glue(op_load_fpr_FT0_fpr, REG)(void)
134 FT0 = env->fpr[REG];
135 RETURN();
138 void OPPROTO glue(op_store_FT0_fpr_fpr, REG)(void)
140 env->fpr[REG] = FT0;
141 RETURN();
144 void OPPROTO glue(op_load_fpr_FT1_fpr, REG)(void)
146 FT1 = env->fpr[REG];
147 RETURN();
150 void OPPROTO glue(op_store_FT1_fpr_fpr, REG)(void)
152 env->fpr[REG] = FT1;
153 RETURN();
156 void OPPROTO glue(op_load_fpr_FT2_fpr, REG)(void)
158 FT2 = env->fpr[REG];
159 RETURN();
162 void OPPROTO glue(op_store_FT2_fpr_fpr, REG)(void)
164 env->fpr[REG] = FT2;
165 RETURN();
168 #if REG <= 15
169 /* Segment register moves */
170 void OPPROTO glue(op_load_sr, REG)(void)
172 T0 = env->sr[REG];
173 RETURN();
176 void OPPROTO glue(op_store_sr, REG)(void)
178 do_store_sr(env, REG, T0);
179 RETURN();
181 #endif
183 #undef REG