move.py revision 6715:fb4a3a61bc74
1# Copyright (c) 2007 The Hewlett-Packard Development Company 2# All rights reserved. 3# 4# Redistribution and use of this software in source and binary forms, 5# with or without modification, are permitted provided that the 6# following conditions are met: 7# 8# The software must be used only for Non-Commercial Use which means any 9# use which is NOT directed to receiving any direct monetary 10# compensation for, or commercial advantage from such use. Illustrative 11# examples of non-commercial use are academic research, personal study, 12# teaching, education and corporate research & development. 13# Illustrative examples of commercial use are distributing products for 14# commercial advantage and providing services using the software for 15# commercial advantage. 16# 17# If you wish to use this software or functionality therein that may be 18# covered by patents for commercial use, please contact: 19# Director of Intellectual Property Licensing 20# Office of Strategy and Technology 21# Hewlett-Packard Company 22# 1501 Page Mill Road 23# Palo Alto, California 94304 24# 25# Redistributions of source code must retain the above copyright notice, 26# this list of conditions and the following disclaimer. Redistributions 27# in binary form must reproduce the above copyright notice, this list of 28# conditions and the following disclaimer in the documentation and/or 29# other materials provided with the distribution. Neither the name of 30# the COPYRIGHT HOLDER(s), HEWLETT-PACKARD COMPANY, nor the names of its 31# contributors may be used to endorse or promote products derived from 32# this software without specific prior written permission. No right of 33# sublicense is granted herewith. Derivatives of the software and 34# output created using the software may be prepared, but only for 35# Non-Commercial Uses. Derivatives of the software may be shared with 36# others provided: (i) the others agree to abide by the list of 37# conditions herein which includes the Non-Commercial Use restrictions; 38# and (ii) such Derivatives of the software include the above copyright 39# notice to acknowledge the contribution from this software where 40# applicable, this list of conditions and the disclaimer below. 41# 42# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 43# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 44# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 45# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 46# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 47# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 48# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 49# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 50# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 51# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 52# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 53# 54# Authors: Gabe Black 55 56microcode = ''' 57def macroop MOVAPS_XMM_M { 58 # Check low address. 59 ldfp xmmh, seg, sib, "DISPLACEMENT + 8", dataSize=8 60 ldfp xmml, seg, sib, disp, dataSize=8 61}; 62 63def macroop MOVAPS_XMM_P { 64 rdip t7 65 # Check low address. 66 ldfp xmmh, seg, riprel, "DISPLACEMENT + 8", dataSize=8 67 ldfp xmml, seg, riprel, disp, dataSize=8 68}; 69 70def macroop MOVAPS_M_XMM { 71 # Check low address. 72 stfp xmmh, seg, sib, "DISPLACEMENT + 8", dataSize=8 73 stfp xmml, seg, sib, disp, dataSize=8 74}; 75 76def macroop MOVAPS_P_XMM { 77 rdip t7 78 # Check low address. 79 stfp xmmh, seg, riprel, "DISPLACEMENT + 8", dataSize=8 80 stfp xmml, seg, riprel, disp, dataSize=8 81}; 82 83def macroop MOVAPS_XMM_XMM { 84 # Check low address. 85 movfp xmml, xmmlm, dataSize=8 86 movfp xmmh, xmmhm, dataSize=8 87}; 88 89def macroop MOVAPD_XMM_XMM { 90 movfp xmml, xmmlm, dataSize=8 91 movfp xmmh, xmmhm, dataSize=8 92}; 93 94def macroop MOVAPD_XMM_M { 95 ldfp xmml, seg, sib, "DISPLACEMENT", dataSize=8 96 ldfp xmmh, seg, sib, "DISPLACEMENT + 8", dataSize=8 97}; 98 99def macroop MOVAPD_XMM_P { 100 rdip t7 101 ldfp xmml, seg, riprel, "DISPLACEMENT", dataSize=8 102 ldfp xmmh, seg, riprel, "DISPLACEMENT + 8", dataSize=8 103}; 104 105def macroop MOVAPD_M_XMM { 106 stfp xmml, seg, sib, "DISPLACEMENT", dataSize=8 107 stfp xmmh, seg, sib, "DISPLACEMENT + 8", dataSize=8 108}; 109 110def macroop MOVAPD_P_XMM { 111 rdip t7 112 stfp xmml, seg, riprel, "DISPLACEMENT", dataSize=8 113 stfp xmmh, seg, riprel, "DISPLACEMENT + 8", dataSize=8 114}; 115 116def macroop MOVUPS_XMM_XMM { 117 movfp xmml, xmmlm, dataSize=8 118 movfp xmmh, xmmhm, dataSize=8 119}; 120 121def macroop MOVUPS_XMM_M { 122 ldfp xmml, seg, sib, "DISPLACEMENT", dataSize=8 123 ldfp xmmh, seg, sib, "DISPLACEMENT + 8", dataSize=8 124}; 125 126def macroop MOVUPS_XMM_P { 127 rdip t7 128 ldfp xmml, seg, riprel, "DISPLACEMENT", dataSize=8 129 ldfp xmmh, seg, riprel, "DISPLACEMENT + 8", dataSize=8 130}; 131 132def macroop MOVUPS_M_XMM { 133 stfp xmml, seg, sib, "DISPLACEMENT", dataSize=8 134 stfp xmmh, seg, sib, "DISPLACEMENT + 8", dataSize=8 135}; 136 137def macroop MOVUPS_P_XMM { 138 rdip t7 139 stfp xmml, seg, riprel, "DISPLACEMENT", dataSize=8 140 stfp xmmh, seg, riprel, "DISPLACEMENT + 8", dataSize=8 141}; 142 143def macroop MOVUPD_XMM_XMM { 144 movfp xmml, xmmlm, dataSize=8 145 movfp xmmh, xmmhm, dataSize=8 146}; 147 148def macroop MOVUPD_XMM_M { 149 ldfp xmml, seg, sib, "DISPLACEMENT", dataSize=8 150 ldfp xmmh, seg, sib, "DISPLACEMENT + 8", dataSize=8 151}; 152 153def macroop MOVUPD_XMM_P { 154 rdip t7 155 ldfp xmml, seg, riprel, "DISPLACEMENT", dataSize=8 156 ldfp xmmh, seg, riprel, "DISPLACEMENT + 8", dataSize=8 157}; 158 159def macroop MOVUPD_M_XMM { 160 stfp xmml, seg, sib, "DISPLACEMENT", dataSize=8 161 stfp xmmh, seg, sib, "DISPLACEMENT + 8", dataSize=8 162}; 163 164def macroop MOVUPD_P_XMM { 165 rdip t7 166 stfp xmml, seg, riprel, "DISPLACEMENT", dataSize=8 167 stfp xmmh, seg, riprel, "DISPLACEMENT + 8", dataSize=8 168}; 169 170def macroop MOVHPS_XMM_M { 171 ldfp xmmh, seg, sib, disp, dataSize=8 172}; 173 174def macroop MOVHPS_XMM_P { 175 rdip t7 176 ldfp xmmh, seg, riprel, disp, dataSize=8 177}; 178 179def macroop MOVHPS_M_XMM { 180 stfp xmmh, seg, sib, disp, dataSize=8 181}; 182 183def macroop MOVHPS_P_XMM { 184 rdip t7 185 stfp xmmh, seg, riprel, disp, dataSize=8 186}; 187 188def macroop MOVHPD_XMM_M { 189 ldfp xmmh, seg, sib, disp, dataSize=8 190}; 191 192def macroop MOVHPD_XMM_P { 193 rdip t7 194 ldfp xmmh, seg, riprel, disp, dataSize=8 195}; 196 197def macroop MOVHPD_M_XMM { 198 stfp xmmh, seg, sib, disp, dataSize=8 199}; 200 201def macroop MOVHPD_P_XMM { 202 rdip t7 203 stfp xmmh, seg, riprel, disp, dataSize=8 204}; 205 206def macroop MOVLPS_XMM_M { 207 ldfp xmml, seg, sib, disp, dataSize=8 208}; 209 210def macroop MOVLPS_XMM_P { 211 rdip t7 212 ldfp xmml, seg, riprel, disp, dataSize=8 213}; 214 215def macroop MOVLPS_M_XMM { 216 stfp xmml, seg, sib, disp, dataSize=8 217}; 218 219def macroop MOVLPS_P_XMM { 220 rdip t7 221 stfp xmml, seg, riprel, disp, dataSize=8 222}; 223 224def macroop MOVLPD_XMM_M { 225 ldfp xmml, seg, sib, disp, dataSize=8 226}; 227 228def macroop MOVLPD_XMM_P { 229 rdip t7 230 ldfp xmml, seg, riprel, disp, dataSize=8 231}; 232 233def macroop MOVLPD_M_XMM { 234 stfp xmml, seg, sib, disp, dataSize=8 235}; 236 237def macroop MOVLPD_P_XMM { 238 rdip t7 239 stfp xmml, seg, riprel, disp, dataSize=8 240}; 241 242def macroop MOVHLPS_XMM_XMM { 243 movfp xmml, xmmhm, dataSize=8 244}; 245 246def macroop MOVLHPS_XMM_XMM { 247 movfp xmmh, xmmlm, dataSize=8 248}; 249 250def macroop MOVSS_XMM_XMM { 251 movfp xmml, xmmlm, dataSize=4 252}; 253 254def macroop MOVSS_XMM_M { 255 lfpimm xmml, 0 256 lfpimm xmmh, 0 257 ldfp xmml, seg, sib, disp, dataSize=4 258}; 259 260def macroop MOVSS_XMM_P { 261 rdip t7 262 lfpimm xmml, 0 263 lfpimm xmmh, 0 264 ldfp xmml, seg, riprel, disp, dataSize=4 265}; 266 267def macroop MOVSS_M_XMM { 268 stfp xmml, seg, sib, disp, dataSize=4 269}; 270 271def macroop MOVSS_P_XMM { 272 rdip t7 273 stfp xmml, seg, riprel, disp, dataSize=4 274}; 275 276def macroop MOVSD_XMM_M { 277 # Zero xmmh 278 ldfp xmml, seg, sib, disp, dataSize=8 279}; 280 281def macroop MOVSD_XMM_P { 282 rdip t7 283 # Zero xmmh 284 ldfp xmml, seg, riprel, disp, dataSize=8 285}; 286 287def macroop MOVSD_M_XMM { 288 stfp xmml, seg, sib, disp, dataSize=8 289}; 290 291def macroop MOVSD_P_XMM { 292 rdip t7 293 stfp xmml, seg, riprel, disp, dataSize=8 294}; 295 296def macroop MOVSD_XMM_XMM { 297 movfp xmml, xmmlm, dataSize=8 298}; 299''' 300