Fix typo in comment, by Andreas Faerber.
[qemu/dscho.git] / target-alpha / op_template.h
blobe96303ba3628789553395a4716972480f22226b4
1 /*
2 * Alpha emulation cpu micro-operations templates for qemu.
3 *
4 * Copyright (c) 2007 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 /* Optimized constant loads */
22 #if REG < 3
23 void OPPROTO glue(op_reset_T, REG) (void)
25 glue(T, REG) = 0;
26 RETURN();
29 void OPPROTO glue(op_reset_FT, REG) (void)
31 glue(FT, REG) = 0;
32 RETURN();
35 /* XXX: This can be great on most RISC machines */
36 #if !defined(__i386__) && !defined(__x86_64__)
37 void OPPROTO glue(op_set_s16_T, REG) (void)
39 glue(T, REG) = (int16_t)PARAM(1);
40 RETURN();
43 void OPPROTO glue(op_set_u16_T, REG) (void)
45 glue(T, REG) = (uint16_t)PARAM(1);
46 RETURN();
48 #endif
50 void OPPROTO glue(op_set_s32_T, REG) (void)
52 glue(T, REG) = (int32_t)PARAM(1);
53 RETURN();
56 void OPPROTO glue(op_set_u32_T, REG) (void)
58 glue(T, REG) = (uint32_t)PARAM(1);
59 RETURN();
62 #if 0 // Qemu does not know how to do this...
63 void OPPROTO glue(op_set_64_T, REG) (void)
65 glue(T, REG) = (int64_t)PARAM(1);
66 RETURN();
68 #else
69 void OPPROTO glue(op_set_64_T, REG) (void)
71 glue(T, REG) = ((int64_t)PARAM(1) << 32) | (int64_t)PARAM(2);
72 RETURN();
74 #endif
76 #endif /* REG < 3 */
78 /* Fixed-point register moves */
79 #if REG < 31
80 void OPPROTO glue(op_load_T0_ir, REG) (void)
82 T0 = env->ir[REG];
83 RETURN();
86 void OPPROTO glue(op_load_T1_ir, REG) (void)
88 T1 = env->ir[REG];
89 RETURN();
92 void OPPROTO glue(op_load_T2_ir, REG) (void)
94 T2 = env->ir[REG];
95 RETURN();
98 void OPPROTO glue(op_store_T0_ir, REG) (void)
100 env->ir[REG] = T0;
101 RETURN();
104 void OPPROTO glue(op_store_T1_ir, REG) (void)
106 env->ir[REG] = T1;
107 RETURN();
110 void OPPROTO glue(op_store_T2_ir, REG) (void)
112 env->ir[REG] = T2;
113 RETURN();
116 void OPPROTO glue(op_cmov_ir, REG) (void)
118 if (T0)
119 env->ir[REG] = T1;
120 RETURN();
123 /* floating point registers moves */
124 void OPPROTO glue(op_load_FT0_fir, REG) (void)
126 FT0 = env->fir[REG];
127 RETURN();
130 void OPPROTO glue(op_load_FT1_fir, REG) (void)
132 FT1 = env->fir[REG];
133 RETURN();
136 void OPPROTO glue(op_load_FT2_fir, REG) (void)
138 FT2 = env->fir[REG];
139 RETURN();
142 void OPPROTO glue(op_store_FT0_fir, REG) (void)
144 env->fir[REG] = FT0;
145 RETURN();
148 void OPPROTO glue(op_store_FT1_fir, REG) (void)
150 env->fir[REG] = FT1;
151 RETURN();
154 void OPPROTO glue(op_store_FT2_fir, REG) (void)
156 env->fir[REG] = FT2;
157 RETURN();
160 void OPPROTO glue(op_cmov_fir, REG) (void)
162 helper_cmov_fir(REG);
163 RETURN();
165 #endif /* REG < 31 */
167 #undef REG