root / target-mips / op_template.c @ e04bcc69
History | View | Annotate | Download (1.8 kB)
1 | 6af0bf9c | bellard | /*
|
---|---|---|---|
2 | 6af0bf9c | bellard | * MIPS emulation micro-operations templates for reg load & store for qemu.
|
3 | 6af0bf9c | bellard | *
|
4 | 6af0bf9c | bellard | * Copyright (c) 2004-2005 Jocelyn Mayer
|
5 | 6af0bf9c | bellard | *
|
6 | 6af0bf9c | bellard | * This library is free software; you can redistribute it and/or
|
7 | 6af0bf9c | bellard | * modify it under the terms of the GNU Lesser General Public
|
8 | 6af0bf9c | bellard | * License as published by the Free Software Foundation; either
|
9 | 6af0bf9c | bellard | * version 2 of the License, or (at your option) any later version.
|
10 | 6af0bf9c | bellard | *
|
11 | 6af0bf9c | bellard | * This library is distributed in the hope that it will be useful,
|
12 | 6af0bf9c | bellard | * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
13 | 6af0bf9c | bellard | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
14 | 6af0bf9c | bellard | * Lesser General Public License for more details.
|
15 | 6af0bf9c | bellard | *
|
16 | 6af0bf9c | bellard | * You should have received a copy of the GNU Lesser General Public
|
17 | 6af0bf9c | bellard | * License along with this library; if not, write to the Free Software
|
18 | 6af0bf9c | bellard | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
19 | 6af0bf9c | bellard | */
|
20 | 6af0bf9c | bellard | |
21 | 6af0bf9c | bellard | #if defined(REG)
|
22 | 6af0bf9c | bellard | void glue(op_load_gpr_T0_gpr, REG) (void) |
23 | 6af0bf9c | bellard | { |
24 | 6af0bf9c | bellard | T0 = env->gpr[REG]; |
25 | 6af0bf9c | bellard | RETURN(); |
26 | 6af0bf9c | bellard | } |
27 | 6af0bf9c | bellard | |
28 | 6af0bf9c | bellard | void glue(op_store_T0_gpr_gpr, REG) (void) |
29 | 6af0bf9c | bellard | { |
30 | 6af0bf9c | bellard | env->gpr[REG] = T0; |
31 | 6af0bf9c | bellard | RETURN(); |
32 | 6af0bf9c | bellard | } |
33 | 6af0bf9c | bellard | |
34 | 6af0bf9c | bellard | void glue(op_load_gpr_T1_gpr, REG) (void) |
35 | 6af0bf9c | bellard | { |
36 | 6af0bf9c | bellard | T1 = env->gpr[REG]; |
37 | 6af0bf9c | bellard | RETURN(); |
38 | 6af0bf9c | bellard | } |
39 | 6af0bf9c | bellard | |
40 | 6af0bf9c | bellard | void glue(op_store_T1_gpr_gpr, REG) (void) |
41 | 6af0bf9c | bellard | { |
42 | 6af0bf9c | bellard | env->gpr[REG] = T1; |
43 | 6af0bf9c | bellard | RETURN(); |
44 | 6af0bf9c | bellard | } |
45 | 6af0bf9c | bellard | |
46 | 6af0bf9c | bellard | void glue(op_load_gpr_T2_gpr, REG) (void) |
47 | 6af0bf9c | bellard | { |
48 | 6af0bf9c | bellard | T2 = env->gpr[REG]; |
49 | 6af0bf9c | bellard | RETURN(); |
50 | 6af0bf9c | bellard | } |
51 | 6af0bf9c | bellard | #endif
|
52 | 6af0bf9c | bellard | |
53 | 6af0bf9c | bellard | #if defined (TN)
|
54 | c570fd16 | ths | #define SET_RESET(treg, tregname) \
|
55 | c570fd16 | ths | void glue(op_set, tregname)(void) \ |
56 | c570fd16 | ths | { \ |
57 | c570fd16 | ths | treg = PARAM1; \ |
58 | c570fd16 | ths | RETURN(); \ |
59 | c570fd16 | ths | } \ |
60 | c570fd16 | ths | void glue(op_reset, tregname)(void) \ |
61 | c570fd16 | ths | { \ |
62 | c570fd16 | ths | treg = 0; \
|
63 | c570fd16 | ths | RETURN(); \ |
64 | c570fd16 | ths | } \ |
65 | 6af0bf9c | bellard | |
66 | c570fd16 | ths | SET_RESET(T0, _T0) |
67 | c570fd16 | ths | SET_RESET(T1, _T1) |
68 | c570fd16 | ths | SET_RESET(T2, _T2) |
69 | c570fd16 | ths | |
70 | c570fd16 | ths | #undef SET_RESET
|
71 | 6af0bf9c | bellard | #endif |