move.py revision 7087:fb8d5786ff30
1# Copyright (c) 2007 The Hewlett-Packard Development Company
2# All rights reserved.
3#
4# The license below extends only to copyright in the software and shall
5# not be construed as granting a license to any other intellectual
6# property including but not limited to intellectual property relating
7# to a hardware implementation of the functionality of the software
8# licensed hereunder.  You may use the software subject to the license
9# terms below provided that you ensure that this notice is replicated
10# unmodified and in its entirety in all distributions of the software,
11# modified or unmodified, in source code or in binary form.
12#
13# Redistribution and use in source and binary forms, with or without
14# modification, are permitted provided that the following conditions are
15# met: redistributions of source code must retain the above copyright
16# notice, this list of conditions and the following disclaimer;
17# redistributions in binary form must reproduce the above copyright
18# notice, this list of conditions and the following disclaimer in the
19# documentation and/or other materials provided with the distribution;
20# neither the name of the copyright holders nor the names of its
21# contributors may be used to endorse or promote products derived from
22# this software without specific prior written permission.
23#
24# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
25# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
26# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
27# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
28# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
29# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
30# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
31# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
32# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
33# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
34# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
35#
36# Authors: Gabe Black
37
38microcode = '''
39def macroop MOVAPS_XMM_M {
40    # Check low address.
41    ldfp xmmh, seg, sib, "DISPLACEMENT + 8", dataSize=8
42    ldfp xmml, seg, sib, disp, dataSize=8
43};
44
45def macroop MOVAPS_XMM_P {
46    rdip t7
47    # Check low address.
48    ldfp xmmh, seg, riprel, "DISPLACEMENT + 8", dataSize=8
49    ldfp xmml, seg, riprel, disp, dataSize=8
50};
51
52def macroop MOVAPS_M_XMM {
53    # Check low address.
54    stfp xmmh, seg, sib, "DISPLACEMENT + 8", dataSize=8
55    stfp xmml, seg, sib, disp, dataSize=8
56};
57
58def macroop MOVAPS_P_XMM {
59    rdip t7
60    # Check low address.
61    stfp xmmh, seg, riprel, "DISPLACEMENT + 8", dataSize=8
62    stfp xmml, seg, riprel, disp, dataSize=8
63};
64
65def macroop MOVAPS_XMM_XMM {
66    # Check low address.
67    movfp xmml, xmmlm, dataSize=8
68    movfp xmmh, xmmhm, dataSize=8
69};
70
71def macroop MOVAPD_XMM_XMM {
72    movfp xmml, xmmlm, dataSize=8
73    movfp xmmh, xmmhm, dataSize=8
74};
75
76def macroop MOVAPD_XMM_M {
77    ldfp xmml, seg, sib, "DISPLACEMENT", dataSize=8
78    ldfp xmmh, seg, sib, "DISPLACEMENT + 8", dataSize=8
79};
80
81def macroop MOVAPD_XMM_P {
82    rdip t7
83    ldfp xmml, seg, riprel, "DISPLACEMENT", dataSize=8
84    ldfp xmmh, seg, riprel, "DISPLACEMENT + 8", dataSize=8
85};
86
87def macroop MOVAPD_M_XMM {
88    stfp xmml, seg, sib, "DISPLACEMENT", dataSize=8
89    stfp xmmh, seg, sib, "DISPLACEMENT + 8", dataSize=8
90};
91
92def macroop MOVAPD_P_XMM {
93    rdip t7
94    stfp xmml, seg, riprel, "DISPLACEMENT", dataSize=8
95    stfp xmmh, seg, riprel, "DISPLACEMENT + 8", dataSize=8
96};
97
98def macroop MOVUPS_XMM_XMM {
99    movfp xmml, xmmlm, dataSize=8
100    movfp xmmh, xmmhm, dataSize=8
101};
102
103def macroop MOVUPS_XMM_M {
104    ldfp xmml, seg, sib, "DISPLACEMENT", dataSize=8
105    ldfp xmmh, seg, sib, "DISPLACEMENT + 8", dataSize=8
106};
107
108def macroop MOVUPS_XMM_P {
109    rdip t7
110    ldfp xmml, seg, riprel, "DISPLACEMENT", dataSize=8
111    ldfp xmmh, seg, riprel, "DISPLACEMENT + 8", dataSize=8
112};
113
114def macroop MOVUPS_M_XMM {
115    stfp xmml, seg, sib, "DISPLACEMENT", dataSize=8
116    stfp xmmh, seg, sib, "DISPLACEMENT + 8", dataSize=8
117};
118
119def macroop MOVUPS_P_XMM {
120    rdip t7
121    stfp xmml, seg, riprel, "DISPLACEMENT", dataSize=8
122    stfp xmmh, seg, riprel, "DISPLACEMENT + 8", dataSize=8
123};
124
125def macroop MOVUPD_XMM_XMM {
126    movfp xmml, xmmlm, dataSize=8
127    movfp xmmh, xmmhm, dataSize=8
128};
129
130def macroop MOVUPD_XMM_M {
131    ldfp xmml, seg, sib, "DISPLACEMENT", dataSize=8
132    ldfp xmmh, seg, sib, "DISPLACEMENT + 8", dataSize=8
133};
134
135def macroop MOVUPD_XMM_P {
136    rdip t7
137    ldfp xmml, seg, riprel, "DISPLACEMENT", dataSize=8
138    ldfp xmmh, seg, riprel, "DISPLACEMENT + 8", dataSize=8
139};
140
141def macroop MOVUPD_M_XMM {
142    stfp xmml, seg, sib, "DISPLACEMENT", dataSize=8
143    stfp xmmh, seg, sib, "DISPLACEMENT + 8", dataSize=8
144};
145
146def macroop MOVUPD_P_XMM {
147    rdip t7
148    stfp xmml, seg, riprel, "DISPLACEMENT", dataSize=8
149    stfp xmmh, seg, riprel, "DISPLACEMENT + 8", dataSize=8
150};
151
152def macroop MOVHPS_XMM_M {
153    ldfp xmmh, seg, sib, disp, dataSize=8
154};
155
156def macroop MOVHPS_XMM_P {
157    rdip t7
158    ldfp xmmh, seg, riprel, disp, dataSize=8
159};
160
161def macroop MOVHPS_M_XMM {
162    stfp xmmh, seg, sib, disp, dataSize=8
163};
164
165def macroop MOVHPS_P_XMM {
166    rdip t7
167    stfp xmmh, seg, riprel, disp, dataSize=8
168};
169
170def macroop MOVHPD_XMM_M {
171    ldfp xmmh, seg, sib, disp, dataSize=8
172};
173
174def macroop MOVHPD_XMM_P {
175    rdip t7
176    ldfp xmmh, seg, riprel, disp, dataSize=8
177};
178
179def macroop MOVHPD_M_XMM {
180    stfp xmmh, seg, sib, disp, dataSize=8
181};
182
183def macroop MOVHPD_P_XMM {
184    rdip t7
185    stfp xmmh, seg, riprel, disp, dataSize=8
186};
187
188def macroop MOVLPS_XMM_M {
189    ldfp xmml, seg, sib, disp, dataSize=8
190};
191
192def macroop MOVLPS_XMM_P {
193    rdip t7
194    ldfp xmml, seg, riprel, disp, dataSize=8
195};
196
197def macroop MOVLPS_M_XMM {
198    stfp xmml, seg, sib, disp, dataSize=8
199};
200
201def macroop MOVLPS_P_XMM {
202    rdip t7
203    stfp xmml, seg, riprel, disp, dataSize=8
204};
205
206def macroop MOVLPD_XMM_M {
207    ldfp xmml, seg, sib, disp, dataSize=8
208};
209
210def macroop MOVLPD_XMM_P {
211    rdip t7
212    ldfp xmml, seg, riprel, disp, dataSize=8
213};
214
215def macroop MOVLPD_M_XMM {
216    stfp xmml, seg, sib, disp, dataSize=8
217};
218
219def macroop MOVLPD_P_XMM {
220    rdip t7
221    stfp xmml, seg, riprel, disp, dataSize=8
222};
223
224def macroop MOVHLPS_XMM_XMM {
225    movfp xmml, xmmhm, dataSize=8
226};
227
228def macroop MOVLHPS_XMM_XMM {
229    movfp xmmh, xmmlm, dataSize=8
230};
231
232def macroop MOVSS_XMM_XMM {
233    movfp xmml, xmmlm, dataSize=4
234};
235
236def macroop MOVSS_XMM_M {
237    lfpimm xmml, 0
238    lfpimm xmmh, 0
239    ldfp xmml, seg, sib, disp, dataSize=4
240};
241
242def macroop MOVSS_XMM_P {
243    rdip t7
244    lfpimm xmml, 0
245    lfpimm xmmh, 0
246    ldfp xmml, seg, riprel, disp, dataSize=4
247};
248
249def macroop MOVSS_M_XMM {
250    stfp xmml, seg, sib, disp, dataSize=4
251};
252
253def macroop MOVSS_P_XMM {
254    rdip t7
255    stfp xmml, seg, riprel, disp, dataSize=4
256};
257
258def macroop MOVSD_XMM_M {
259    # Zero xmmh
260    ldfp xmml, seg, sib, disp, dataSize=8
261};
262
263def macroop MOVSD_XMM_P {
264    rdip t7
265    # Zero xmmh
266    ldfp xmml, seg, riprel, disp, dataSize=8
267};
268
269def macroop MOVSD_M_XMM {
270    stfp xmml, seg, sib, disp, dataSize=8
271};
272
273def macroop MOVSD_P_XMM {
274    rdip t7
275    stfp xmml, seg, riprel, disp, dataSize=8
276};
277
278def macroop MOVSD_XMM_XMM {
279    movfp xmml, xmmlm, dataSize=8
280};
281'''
282