more native FPU comparison functions - native FPU remainder
[qemu] / target-sparc / fop_template.h
1 /*
2  *  SPARC micro operations (templates for various register related
3  *  operations)
4  * 
5  *  Copyright (c) 2003 Fabrice Bellard
6  *
7  * This library is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU Lesser General Public
9  * License as published by the Free Software Foundation; either
10  * version 2 of the License, or (at your option) any later version.
11  *
12  * This library is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
15  * Lesser General Public License for more details.
16  *
17  * You should have received a copy of the GNU Lesser General Public
18  * License along with this library; if not, write to the Free Software
19  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20  */
21
22 /* floating point registers moves */
23 void OPPROTO glue(op_load_fpr_FT0_fpr, REGNAME)(void)
24 {
25     FT0 = REG;
26 }
27
28 void OPPROTO glue(op_store_FT0_fpr_fpr, REGNAME)(void)
29 {
30     REG = FT0;
31 }
32
33 void OPPROTO glue(op_load_fpr_FT1_fpr, REGNAME)(void)
34 {
35     FT1 = REG;
36 }
37
38 void OPPROTO glue(op_store_FT1_fpr_fpr, REGNAME)(void)
39 {
40     REG = FT1;
41 }
42
43 void OPPROTO glue(op_load_fpr_FT2_fpr, REGNAME)(void)
44 {
45     FT2 = REG;
46 }
47
48 void OPPROTO glue(op_store_FT2_fpr_fpr, REGNAME)(void)
49 {
50     REG = FT2;
51 }
52
53 /* double floating point registers moves */
54 void OPPROTO glue(op_load_fpr_DT0_fpr, REGNAME)(void)
55 {
56     CPU_DoubleU u;
57     uint32_t *p = (uint32_t *)®
58     u.l.lower = *(p +1);
59     u.l.upper = *p;
60     DT0 = u.d;
61 }
62
63 void OPPROTO glue(op_store_DT0_fpr_fpr, REGNAME)(void)
64 {
65     CPU_DoubleU u;
66     uint32_t *p = (uint32_t *)®
67     u.d = DT0;
68     *(p +1) = u.l.lower;
69     *p = u.l.upper;
70 }
71
72 void OPPROTO glue(op_load_fpr_DT1_fpr, REGNAME)(void)
73 {
74     CPU_DoubleU u;
75     uint32_t *p = (uint32_t *)®
76     u.l.lower = *(p +1);
77     u.l.upper = *p;
78     DT1 = u.d;
79 }
80
81 void OPPROTO glue(op_store_DT1_fpr_fpr, REGNAME)(void)
82 {
83     CPU_DoubleU u;
84     uint32_t *p = (uint32_t *)®
85     u.d = DT1;
86     *(p +1) = u.l.lower;
87     *p = u.l.upper;
88 }
89
90 void OPPROTO glue(op_load_fpr_DT2_fpr, REGNAME)(void)
91 {
92     CPU_DoubleU u;
93     uint32_t *p = (uint32_t *)®
94     u.l.lower = *(p +1);
95     u.l.upper = *p;
96     DT2 = u.d;
97 }
98
99 void OPPROTO glue(op_store_DT2_fpr_fpr, REGNAME)(void)
100 {
101     CPU_DoubleU u;
102     uint32_t *p = (uint32_t *)®
103     u.d = DT2;
104     *(p +1) = u.l.lower;
105     *p = u.l.upper;
106 }
107
108 #undef REG
109 #undef REGNAME