root / target-i386 / opreg_template.h @ 03857e31
History | View | Annotate | Download (2.9 kB)
1 | 2c0262af | bellard | /*
|
---|---|---|---|
2 | 2c0262af | bellard | * i386 micro operations (templates for various register related
|
3 | 2c0262af | bellard | * operations)
|
4 | 2c0262af | bellard | *
|
5 | 2c0262af | bellard | * Copyright (c) 2003 Fabrice Bellard
|
6 | 2c0262af | bellard | *
|
7 | 2c0262af | bellard | * This library is free software; you can redistribute it and/or
|
8 | 2c0262af | bellard | * modify it under the terms of the GNU Lesser General Public
|
9 | 2c0262af | bellard | * License as published by the Free Software Foundation; either
|
10 | 2c0262af | bellard | * version 2 of the License, or (at your option) any later version.
|
11 | 2c0262af | bellard | *
|
12 | 2c0262af | bellard | * This library is distributed in the hope that it will be useful,
|
13 | 2c0262af | bellard | * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
14 | 2c0262af | bellard | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
15 | 2c0262af | bellard | * Lesser General Public License for more details.
|
16 | 2c0262af | bellard | *
|
17 | 2c0262af | bellard | * You should have received a copy of the GNU Lesser General Public
|
18 | 2c0262af | bellard | * License along with this library; if not, write to the Free Software
|
19 | 2c0262af | bellard | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
20 | 2c0262af | bellard | */
|
21 | 2c0262af | bellard | void OPPROTO glue(op_movl_A0,REGNAME)(void) |
22 | 2c0262af | bellard | { |
23 | 2c0262af | bellard | A0 = REG; |
24 | 2c0262af | bellard | } |
25 | 2c0262af | bellard | |
26 | 2c0262af | bellard | void OPPROTO glue(op_addl_A0,REGNAME)(void) |
27 | 2c0262af | bellard | { |
28 | 2c0262af | bellard | A0 += REG; |
29 | 2c0262af | bellard | } |
30 | 2c0262af | bellard | |
31 | 2c0262af | bellard | void OPPROTO glue(glue(op_addl_A0,REGNAME),_s1)(void) |
32 | 2c0262af | bellard | { |
33 | 2c0262af | bellard | A0 += REG << 1;
|
34 | 2c0262af | bellard | } |
35 | 2c0262af | bellard | |
36 | 2c0262af | bellard | void OPPROTO glue(glue(op_addl_A0,REGNAME),_s2)(void) |
37 | 2c0262af | bellard | { |
38 | 2c0262af | bellard | A0 += REG << 2;
|
39 | 2c0262af | bellard | } |
40 | 2c0262af | bellard | |
41 | 2c0262af | bellard | void OPPROTO glue(glue(op_addl_A0,REGNAME),_s3)(void) |
42 | 2c0262af | bellard | { |
43 | 2c0262af | bellard | A0 += REG << 3;
|
44 | 2c0262af | bellard | } |
45 | 2c0262af | bellard | |
46 | 2c0262af | bellard | void OPPROTO glue(op_movl_T0,REGNAME)(void) |
47 | 2c0262af | bellard | { |
48 | 2c0262af | bellard | T0 = REG; |
49 | 2c0262af | bellard | } |
50 | 2c0262af | bellard | |
51 | 2c0262af | bellard | void OPPROTO glue(op_movl_T1,REGNAME)(void) |
52 | 2c0262af | bellard | { |
53 | 2c0262af | bellard | T1 = REG; |
54 | 2c0262af | bellard | } |
55 | 2c0262af | bellard | |
56 | 2c0262af | bellard | void OPPROTO glue(op_movh_T0,REGNAME)(void) |
57 | 2c0262af | bellard | { |
58 | 2c0262af | bellard | T0 = REG >> 8;
|
59 | 2c0262af | bellard | } |
60 | 2c0262af | bellard | |
61 | 2c0262af | bellard | void OPPROTO glue(op_movh_T1,REGNAME)(void) |
62 | 2c0262af | bellard | { |
63 | 2c0262af | bellard | T1 = REG >> 8;
|
64 | 2c0262af | bellard | } |
65 | 2c0262af | bellard | |
66 | 2c0262af | bellard | void OPPROTO glue(glue(op_movl,REGNAME),_T0)(void) |
67 | 2c0262af | bellard | { |
68 | 2c0262af | bellard | REG = T0; |
69 | 2c0262af | bellard | } |
70 | 2c0262af | bellard | |
71 | 2c0262af | bellard | void OPPROTO glue(glue(op_movl,REGNAME),_T1)(void) |
72 | 2c0262af | bellard | { |
73 | 2c0262af | bellard | REG = T1; |
74 | 2c0262af | bellard | } |
75 | 2c0262af | bellard | |
76 | 2c0262af | bellard | void OPPROTO glue(glue(op_movl,REGNAME),_A0)(void) |
77 | 2c0262af | bellard | { |
78 | 2c0262af | bellard | REG = A0; |
79 | 2c0262af | bellard | } |
80 | 2c0262af | bellard | |
81 | 2c0262af | bellard | /* mov T1 to REG if T0 is true */
|
82 | 2c0262af | bellard | void OPPROTO glue(glue(op_cmovw,REGNAME),_T1_T0)(void) |
83 | 2c0262af | bellard | { |
84 | 2c0262af | bellard | if (T0)
|
85 | 2c0262af | bellard | REG = (REG & 0xffff0000) | (T1 & 0xffff); |
86 | 128b346e | bellard | FORCE_RET(); |
87 | 2c0262af | bellard | } |
88 | 2c0262af | bellard | |
89 | 2c0262af | bellard | void OPPROTO glue(glue(op_cmovl,REGNAME),_T1_T0)(void) |
90 | 2c0262af | bellard | { |
91 | 2c0262af | bellard | if (T0)
|
92 | 2c0262af | bellard | REG = T1; |
93 | 128b346e | bellard | FORCE_RET(); |
94 | 2c0262af | bellard | } |
95 | 2c0262af | bellard | |
96 | 2c0262af | bellard | /* NOTE: T0 high order bits are ignored */
|
97 | 2c0262af | bellard | void OPPROTO glue(glue(op_movw,REGNAME),_T0)(void) |
98 | 2c0262af | bellard | { |
99 | 2c0262af | bellard | REG = (REG & 0xffff0000) | (T0 & 0xffff); |
100 | 2c0262af | bellard | } |
101 | 2c0262af | bellard | |
102 | 2c0262af | bellard | /* NOTE: T0 high order bits are ignored */
|
103 | 2c0262af | bellard | void OPPROTO glue(glue(op_movw,REGNAME),_T1)(void) |
104 | 2c0262af | bellard | { |
105 | 2c0262af | bellard | REG = (REG & 0xffff0000) | (T1 & 0xffff); |
106 | 2c0262af | bellard | } |
107 | 2c0262af | bellard | |
108 | 2c0262af | bellard | /* NOTE: A0 high order bits are ignored */
|
109 | 2c0262af | bellard | void OPPROTO glue(glue(op_movw,REGNAME),_A0)(void) |
110 | 2c0262af | bellard | { |
111 | 2c0262af | bellard | REG = (REG & 0xffff0000) | (A0 & 0xffff); |
112 | 2c0262af | bellard | } |
113 | 2c0262af | bellard | |
114 | 2c0262af | bellard | /* NOTE: T0 high order bits are ignored */
|
115 | 2c0262af | bellard | void OPPROTO glue(glue(op_movb,REGNAME),_T0)(void) |
116 | 2c0262af | bellard | { |
117 | 2c0262af | bellard | REG = (REG & 0xffffff00) | (T0 & 0xff); |
118 | 2c0262af | bellard | } |
119 | 2c0262af | bellard | |
120 | 2c0262af | bellard | /* NOTE: T0 high order bits are ignored */
|
121 | 2c0262af | bellard | void OPPROTO glue(glue(op_movh,REGNAME),_T0)(void) |
122 | 2c0262af | bellard | { |
123 | 2c0262af | bellard | REG = (REG & 0xffff00ff) | ((T0 & 0xff) << 8); |
124 | 2c0262af | bellard | } |
125 | 2c0262af | bellard | |
126 | 2c0262af | bellard | /* NOTE: T1 high order bits are ignored */
|
127 | 2c0262af | bellard | void OPPROTO glue(glue(op_movb,REGNAME),_T1)(void) |
128 | 2c0262af | bellard | { |
129 | 2c0262af | bellard | REG = (REG & 0xffffff00) | (T1 & 0xff); |
130 | 2c0262af | bellard | } |
131 | 2c0262af | bellard | |
132 | 2c0262af | bellard | /* NOTE: T1 high order bits are ignored */
|
133 | 2c0262af | bellard | void OPPROTO glue(glue(op_movh,REGNAME),_T1)(void) |
134 | 2c0262af | bellard | { |
135 | 2c0262af | bellard | REG = (REG & 0xffff00ff) | ((T1 & 0xff) << 8); |
136 | 2c0262af | bellard | } |