Statistics
| Branch: | Revision:

root / target-mips / op_template.c @ 9b9e4393

History | View | Annotate | Download (2.2 kB)

1
/*
2
 *  MIPS emulation micro-operations templates for reg load & store for qemu.
3
 * 
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)
22
void glue(op_load_gpr_T0_gpr, REG) (void)
23
{
24
    T0 = env->gpr[REG];
25
    RETURN();
26
}
27

    
28
void glue(op_store_T0_gpr_gpr, REG) (void)
29
{
30
    env->gpr[REG] = T0;
31
    RETURN();
32
}
33

    
34
void glue(op_load_gpr_T1_gpr, REG) (void)
35
{
36
    T1 = env->gpr[REG];
37
    RETURN();
38
}
39

    
40
void glue(op_store_T1_gpr_gpr, REG) (void)
41
{
42
    env->gpr[REG] = T1;
43
    RETURN();
44
}
45

    
46
void glue(op_load_gpr_T2_gpr, REG) (void)
47
{
48
    T2 = env->gpr[REG];
49
    RETURN();
50
}
51
#endif
52

    
53
#if defined (TN)
54
#define SET_RESET(treg, tregname)        \
55
    void glue(op_set, tregname)(void)    \
56
    {                                    \
57
        treg = (int32_t)PARAM1;          \
58
        RETURN();                        \
59
    }                                    \
60
    void glue(op_reset, tregname)(void)  \
61
    {                                    \
62
        treg = 0;                        \
63
        RETURN();                        \
64
    }                                    \
65

    
66
SET_RESET(T0, _T0)
67
SET_RESET(T1, _T1)
68
SET_RESET(T2, _T2)
69

    
70
#undef SET_RESET
71

    
72
#ifdef TARGET_MIPS64
73
#define SET64(treg, tregname)                               \
74
    void glue(op_set64, tregname)(void)                     \
75
    {                                                       \
76
        treg = ((uint64_t)PARAM1 << 32) | (uint32_t)PARAM2; \
77
        RETURN();                                           \
78
    }
79

    
80
SET64(T0, _T0)
81
SET64(T1, _T1)
82
SET64(T2, _T2)
83

    
84
#undef SET64
85

    
86
#endif
87
#endif