]> Git Repo - qemu.git/blame - target-mips/op_template.c
Formatting fix.
[qemu.git] / target-mips / op_template.c
CommitLineData
6af0bf9c
FB
1/*
2 * MIPS emulation micro-operations templates for reg load & store for qemu.
5fafdf24 3 *
6af0bf9c
FB
4 * Copyright (c) 2004-2005 Jocelyn Mayer
5 *
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.
10 *
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.
15 *
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
19 */
20
21#if defined(REG)
22void glue(op_load_gpr_T0_gpr, REG) (void)
23{
ead9360e 24 T0 = env->gpr[REG][env->current_tc];
6af0bf9c
FB
25 RETURN();
26}
27
28void glue(op_store_T0_gpr_gpr, REG) (void)
29{
ead9360e 30 env->gpr[REG][env->current_tc] = T0;
6af0bf9c
FB
31 RETURN();
32}
33
34void glue(op_load_gpr_T1_gpr, REG) (void)
35{
ead9360e 36 T1 = env->gpr[REG][env->current_tc];
6af0bf9c
FB
37 RETURN();
38}
39
40void glue(op_store_T1_gpr_gpr, REG) (void)
41{
ead9360e 42 env->gpr[REG][env->current_tc] = T1;
6af0bf9c
FB
43 RETURN();
44}
45
46void glue(op_load_gpr_T2_gpr, REG) (void)
47{
ead9360e
TS
48 T2 = env->gpr[REG][env->current_tc];
49 RETURN();
50}
51
52
53void glue(op_load_srsgpr_T0_gpr, REG) (void)
54{
55 T0 = env->gpr[REG][(env->CP0_SRSCtl >> CP0SRSCtl_PSS) & 0xf];
56 RETURN();
57}
58
59void glue(op_store_T0_srsgpr_gpr, REG) (void)
60{
61 env->gpr[REG][(env->CP0_SRSCtl >> CP0SRSCtl_PSS) & 0xf] = T0;
6af0bf9c
FB
62 RETURN();
63}
64#endif
65
66#if defined (TN)
c570fd16
TS
67#define SET_RESET(treg, tregname) \
68 void glue(op_set, tregname)(void) \
69 { \
c631c88c 70 treg = (int32_t)PARAM1; \
c570fd16
TS
71 RETURN(); \
72 } \
73 void glue(op_reset, tregname)(void) \
74 { \
75 treg = 0; \
76 RETURN(); \
77 } \
6af0bf9c 78
c570fd16
TS
79SET_RESET(T0, _T0)
80SET_RESET(T1, _T1)
81SET_RESET(T2, _T2)
82
83#undef SET_RESET
9b9e4393 84
540635ba 85#if defined(TARGET_MIPSN32) || defined(TARGET_MIPS64)
9b9e4393
TS
86#define SET64(treg, tregname) \
87 void glue(op_set64, tregname)(void) \
88 { \
89 treg = ((uint64_t)PARAM1 << 32) | (uint32_t)PARAM2; \
90 RETURN(); \
91 }
92
93SET64(T0, _T0)
94SET64(T1, _T1)
95SET64(T2, _T2)
96
97#undef SET64
98
99#endif
6af0bf9c 100#endif
This page took 0.125281 seconds and 4 git commands to generate.