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