VirtualBox

source: vbox/trunk/src/recompiler/target-i386/opreg_template.h@ 36140

最後變更 在這個檔案從36140是 36140,由 vboxsync 提交於 14 年 前

rem: Re-synced to svn://svn.savannah.nongnu.org/qemu/trunk@5495 (repo UUID c046a42c-6fe2-441c-8c8c-71466251a162).

  • 屬性 svn:eol-style 設為 native
檔案大小: 4.3 KB
 
1/*
2 * i386 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/*
23 * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
24 * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
25 * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
26 * a choice of LGPL license versions is made available with the language indicating
27 * that LGPLv2 or any later version may be used, or where a choice of which version
28 * of the LGPL is applied is otherwise unspecified.
29 */
30
31#error "VBOX: obsolete file?"
32
33void OPPROTO glue(op_movl_A0,REGNAME)(void)
34{
35 A0 = (uint32_t)REG;
36}
37
38void OPPROTO glue(op_addl_A0,REGNAME)(void)
39{
40 A0 = (uint32_t)(A0 + REG);
41}
42
43void OPPROTO glue(glue(op_addl_A0,REGNAME),_s1)(void)
44{
45 A0 = (uint32_t)(A0 + (REG << 1));
46}
47
48void OPPROTO glue(glue(op_addl_A0,REGNAME),_s2)(void)
49{
50 A0 = (uint32_t)(A0 + (REG << 2));
51}
52
53void OPPROTO glue(glue(op_addl_A0,REGNAME),_s3)(void)
54{
55 A0 = (uint32_t)(A0 + (REG << 3));
56}
57
58#ifdef TARGET_X86_64
59void OPPROTO glue(op_movq_A0,REGNAME)(void)
60{
61 A0 = REG;
62}
63
64void OPPROTO glue(op_addq_A0,REGNAME)(void)
65{
66 A0 = (A0 + REG);
67}
68
69void OPPROTO glue(glue(op_addq_A0,REGNAME),_s1)(void)
70{
71 A0 = (A0 + (REG << 1));
72}
73
74void OPPROTO glue(glue(op_addq_A0,REGNAME),_s2)(void)
75{
76 A0 = (A0 + (REG << 2));
77}
78
79void OPPROTO glue(glue(op_addq_A0,REGNAME),_s3)(void)
80{
81 A0 = (A0 + (REG << 3));
82}
83#endif
84
85void OPPROTO glue(op_movl_T0,REGNAME)(void)
86{
87 T0 = REG;
88}
89
90void OPPROTO glue(op_movl_T1,REGNAME)(void)
91{
92 T1 = REG;
93}
94
95void OPPROTO glue(op_movh_T0,REGNAME)(void)
96{
97 T0 = REG >> 8;
98}
99
100void OPPROTO glue(op_movh_T1,REGNAME)(void)
101{
102 T1 = REG >> 8;
103}
104
105void OPPROTO glue(glue(op_movl,REGNAME),_T0)(void)
106{
107 REG = (uint32_t)T0;
108}
109
110void OPPROTO glue(glue(op_movl,REGNAME),_T1)(void)
111{
112 REG = (uint32_t)T1;
113}
114
115void OPPROTO glue(glue(op_movl,REGNAME),_A0)(void)
116{
117 REG = (uint32_t)A0;
118}
119
120#ifdef TARGET_X86_64
121void OPPROTO glue(glue(op_movq,REGNAME),_T0)(void)
122{
123 REG = T0;
124}
125
126void OPPROTO glue(glue(op_movq,REGNAME),_T1)(void)
127{
128 REG = T1;
129}
130
131void OPPROTO glue(glue(op_movq,REGNAME),_A0)(void)
132{
133 REG = A0;
134}
135#endif
136
137/* mov T1 to REG if T0 is true */
138void OPPROTO glue(glue(op_cmovw,REGNAME),_T1_T0)(void)
139{
140 if (T0)
141 REG = (REG & ~0xffff) | (T1 & 0xffff);
142 FORCE_RET();
143}
144
145void OPPROTO glue(glue(op_cmovl,REGNAME),_T1_T0)(void)
146{
147 if (T0)
148 REG = (uint32_t)T1;
149 FORCE_RET();
150}
151
152#ifdef TARGET_X86_64
153void OPPROTO glue(glue(op_cmovq,REGNAME),_T1_T0)(void)
154{
155 if (T0)
156 REG = T1;
157 FORCE_RET();
158}
159#endif
160
161/* NOTE: T0 high order bits are ignored */
162void OPPROTO glue(glue(op_movw,REGNAME),_T0)(void)
163{
164 REG = (REG & ~0xffff) | (T0 & 0xffff);
165}
166
167/* NOTE: T0 high order bits are ignored */
168void OPPROTO glue(glue(op_movw,REGNAME),_T1)(void)
169{
170 REG = (REG & ~0xffff) | (T1 & 0xffff);
171}
172
173/* NOTE: A0 high order bits are ignored */
174void OPPROTO glue(glue(op_movw,REGNAME),_A0)(void)
175{
176 REG = (REG & ~0xffff) | (A0 & 0xffff);
177}
178
179/* NOTE: T0 high order bits are ignored */
180void OPPROTO glue(glue(op_movb,REGNAME),_T0)(void)
181{
182 REG = (REG & ~0xff) | (T0 & 0xff);
183}
184
185/* NOTE: T0 high order bits are ignored */
186void OPPROTO glue(glue(op_movh,REGNAME),_T0)(void)
187{
188 REG = (REG & ~0xff00) | ((T0 & 0xff) << 8);
189}
190
191/* NOTE: T1 high order bits are ignored */
192void OPPROTO glue(glue(op_movb,REGNAME),_T1)(void)
193{
194 REG = (REG & ~0xff) | (T1 & 0xff);
195}
196
197/* NOTE: T1 high order bits are ignored */
198void OPPROTO glue(glue(op_movh,REGNAME),_T1)(void)
199{
200 REG = (REG & ~0xff00) | ((T1 & 0xff) << 8);
201}
202
注意: 瀏覽 TracBrowser 來幫助您使用儲存庫瀏覽器

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette