More TCG updates for CRIS
[qemu/qemu-JZ.git] / target-mips / op_template.c
blobe2802a3cc5fe5a7ad1e7433e43f5220a243012b6
1 /*
2 * MIPS emulation micro-operations templates for reg load & store for qemu.
4 * Copyright (c) 2004-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 #if defined(REG)
22 void glue(op_load_gpr_T0_gpr, REG) (void)
24 T0 = env->gpr[env->current_tc][REG];
25 FORCE_RET();
28 void glue(op_store_T0_gpr_gpr, REG) (void)
30 env->gpr[env->current_tc][REG] = T0;
31 FORCE_RET();
34 void glue(op_load_gpr_T1_gpr, REG) (void)
36 T1 = env->gpr[env->current_tc][REG];
37 FORCE_RET();
40 void glue(op_store_T1_gpr_gpr, REG) (void)
42 env->gpr[env->current_tc][REG] = T1;
43 FORCE_RET();
47 void glue(op_load_srsgpr_T0_gpr, REG) (void)
49 T0 = env->gpr[(env->CP0_SRSCtl >> CP0SRSCtl_PSS) & 0xf][REG];
50 FORCE_RET();
53 void glue(op_store_T0_srsgpr_gpr, REG) (void)
55 env->gpr[(env->CP0_SRSCtl >> CP0SRSCtl_PSS) & 0xf][REG] = T0;
56 FORCE_RET();
58 #endif
60 #if defined (TN)
61 #define SET_RESET(treg, tregname) \
62 void glue(op_set, tregname)(void) \
63 { \
64 treg = (int32_t)PARAM1; \
65 FORCE_RET(); \
66 } \
67 void glue(op_reset, tregname)(void) \
68 { \
69 treg = 0; \
70 FORCE_RET(); \
71 } \
73 SET_RESET(T0, _T0)
74 SET_RESET(T1, _T1)
76 #undef SET_RESET
78 #if defined(TARGET_MIPS64)
79 #define SET64(treg, tregname) \
80 void glue(op_set64, tregname)(void) \
81 { \
82 treg = ((uint64_t)PARAM1 << 32) | (uint32_t)PARAM2; \
83 FORCE_RET(); \
86 SET64(T0, _T0)
87 SET64(T1, _T1)
89 #undef SET64
91 #endif
92 #endif