Provide extNs_M instructions
[qemu/mini2440.git] / target-alpha / op_template.h
blobab589f21e81bf2e0ad94e5403002aceeab956b3d
1 /*
2 * Alpha emulation cpu micro-operations templates for qemu.
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 #if !defined(HOST_SPARC) && !defined(HOST_SPARC64)
30 void OPPROTO glue(op_reset_FT, REG) (void)
32 glue(FT, REG) = 0;
33 RETURN();
35 #else
36 void OPPROTO glue(op_reset_FT, REG) (void)
38 glue(helper_reset_FT, REG)();
39 RETURN();
41 #endif
43 /* XXX: This can be great on most RISC machines */
44 #if !defined(__i386__) && !defined(__x86_64__)
45 void OPPROTO glue(op_set_s16_T, REG) (void)
47 glue(T, REG) = (int16_t)PARAM(1);
48 RETURN();
51 void OPPROTO glue(op_set_u16_T, REG) (void)
53 glue(T, REG) = (uint16_t)PARAM(1);
54 RETURN();
56 #endif
58 void OPPROTO glue(op_set_s32_T, REG) (void)
60 glue(T, REG) = (int32_t)PARAM(1);
61 RETURN();
64 void OPPROTO glue(op_set_u32_T, REG) (void)
66 glue(T, REG) = (uint32_t)PARAM(1);
67 RETURN();
70 #if 0 // Qemu does not know how to do this...
71 void OPPROTO glue(op_set_64_T, REG) (void)
73 glue(T, REG) = (int64_t)PARAM(1);
74 RETURN();
76 #else
77 void OPPROTO glue(op_set_64_T, REG) (void)
79 glue(T, REG) = ((int64_t)PARAM(1) << 32) | (int64_t)PARAM(2);
80 RETURN();
82 #endif
84 #endif /* REG < 3 */
86 /* Fixed-point register moves */
87 #if REG < 31
88 void OPPROTO glue(op_load_T0_ir, REG) (void)
90 T0 = env->ir[REG];
91 RETURN();
94 void OPPROTO glue(op_load_T1_ir, REG) (void)
96 T1 = env->ir[REG];
97 RETURN();
100 void OPPROTO glue(op_load_T2_ir, REG) (void)
102 T2 = env->ir[REG];
103 RETURN();
106 void OPPROTO glue(op_store_T0_ir, REG) (void)
108 env->ir[REG] = T0;
109 RETURN();
112 void OPPROTO glue(op_store_T1_ir, REG) (void)
114 env->ir[REG] = T1;
115 RETURN();
118 void OPPROTO glue(op_store_T2_ir, REG) (void)
120 env->ir[REG] = T2;
121 RETURN();
124 void OPPROTO glue(op_cmov_ir, REG) (void)
126 if (T0)
127 env->ir[REG] = T1;
128 RETURN();
131 /* floating point registers moves */
132 void OPPROTO glue(op_load_FT0_fir, REG) (void)
134 FT0 = env->fir[REG];
135 RETURN();
138 void OPPROTO glue(op_load_FT1_fir, REG) (void)
140 FT1 = env->fir[REG];
141 RETURN();
144 void OPPROTO glue(op_load_FT2_fir, REG) (void)
146 FT2 = env->fir[REG];
147 RETURN();
150 void OPPROTO glue(op_store_FT0_fir, REG) (void)
152 env->fir[REG] = FT0;
153 RETURN();
156 void OPPROTO glue(op_store_FT1_fir, REG) (void)
158 env->fir[REG] = FT1;
159 RETURN();
162 void OPPROTO glue(op_store_FT2_fir, REG) (void)
164 env->fir[REG] = FT2;
165 RETURN();
168 void OPPROTO glue(op_cmov_fir, REG) (void)
170 helper_cmov_fir(REG);
171 RETURN();
173 #endif /* REG < 31 */
175 #undef REG