convert_floating_point_to_xmm_integer.py revision 6606
15081Sgblack@eecs.umich.edu# Copyright (c) 2007 The Hewlett-Packard Development Company 25081Sgblack@eecs.umich.edu# All rights reserved. 35081Sgblack@eecs.umich.edu# 45081Sgblack@eecs.umich.edu# Redistribution and use of this software in source and binary forms, 55081Sgblack@eecs.umich.edu# with or without modification, are permitted provided that the 65081Sgblack@eecs.umich.edu# following conditions are met: 75081Sgblack@eecs.umich.edu# 85081Sgblack@eecs.umich.edu# The software must be used only for Non-Commercial Use which means any 95081Sgblack@eecs.umich.edu# use which is NOT directed to receiving any direct monetary 105081Sgblack@eecs.umich.edu# compensation for, or commercial advantage from such use. Illustrative 115081Sgblack@eecs.umich.edu# examples of non-commercial use are academic research, personal study, 125081Sgblack@eecs.umich.edu# teaching, education and corporate research & development. 135081Sgblack@eecs.umich.edu# Illustrative examples of commercial use are distributing products for 145081Sgblack@eecs.umich.edu# commercial advantage and providing services using the software for 155081Sgblack@eecs.umich.edu# commercial advantage. 165081Sgblack@eecs.umich.edu# 175081Sgblack@eecs.umich.edu# If you wish to use this software or functionality therein that may be 185081Sgblack@eecs.umich.edu# covered by patents for commercial use, please contact: 195081Sgblack@eecs.umich.edu# Director of Intellectual Property Licensing 205081Sgblack@eecs.umich.edu# Office of Strategy and Technology 215081Sgblack@eecs.umich.edu# Hewlett-Packard Company 225081Sgblack@eecs.umich.edu# 1501 Page Mill Road 235081Sgblack@eecs.umich.edu# Palo Alto, California 94304 245081Sgblack@eecs.umich.edu# 255081Sgblack@eecs.umich.edu# Redistributions of source code must retain the above copyright notice, 265081Sgblack@eecs.umich.edu# this list of conditions and the following disclaimer. Redistributions 275081Sgblack@eecs.umich.edu# in binary form must reproduce the above copyright notice, this list of 285081Sgblack@eecs.umich.edu# conditions and the following disclaimer in the documentation and/or 295081Sgblack@eecs.umich.edu# other materials provided with the distribution. Neither the name of 305081Sgblack@eecs.umich.edu# the COPYRIGHT HOLDER(s), HEWLETT-PACKARD COMPANY, nor the names of its 315081Sgblack@eecs.umich.edu# contributors may be used to endorse or promote products derived from 325081Sgblack@eecs.umich.edu# this software without specific prior written permission. No right of 335081Sgblack@eecs.umich.edu# sublicense is granted herewith. Derivatives of the software and 345081Sgblack@eecs.umich.edu# output created using the software may be prepared, but only for 355081Sgblack@eecs.umich.edu# Non-Commercial Uses. Derivatives of the software may be shared with 365081Sgblack@eecs.umich.edu# others provided: (i) the others agree to abide by the list of 375081Sgblack@eecs.umich.edu# conditions herein which includes the Non-Commercial Use restrictions; 385081Sgblack@eecs.umich.edu# and (ii) such Derivatives of the software include the above copyright 395081Sgblack@eecs.umich.edu# notice to acknowledge the contribution from this software where 405081Sgblack@eecs.umich.edu# applicable, this list of conditions and the disclaimer below. 415081Sgblack@eecs.umich.edu# 425081Sgblack@eecs.umich.edu# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 435081Sgblack@eecs.umich.edu# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 445081Sgblack@eecs.umich.edu# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 455081Sgblack@eecs.umich.edu# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 465081Sgblack@eecs.umich.edu# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 475081Sgblack@eecs.umich.edu# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 485081Sgblack@eecs.umich.edu# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 495081Sgblack@eecs.umich.edu# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 505081Sgblack@eecs.umich.edu# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 515081Sgblack@eecs.umich.edu# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 525081Sgblack@eecs.umich.edu# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 535081Sgblack@eecs.umich.edu# 545081Sgblack@eecs.umich.edu# Authors: Gabe Black 555081Sgblack@eecs.umich.edu 565081Sgblack@eecs.umich.edumicrocode = ''' 576606Sgblack@eecs.umich.edudef macroop CVTPS2DQ_XMM_XMM { 586606Sgblack@eecs.umich.edu cvtf2i xmml, xmmlm, size=4, ext=4 596606Sgblack@eecs.umich.edu cvtf2i xmmh, xmmhm, size=4, ext=4 606606Sgblack@eecs.umich.edu}; 616606Sgblack@eecs.umich.edu 626606Sgblack@eecs.umich.edudef macroop CVTPS2DQ_XMM_M { 636606Sgblack@eecs.umich.edu ldfp ufp1, seg, sib, "DISPLACEMENT", dataSize=8 646606Sgblack@eecs.umich.edu ldfp ufp2, seg, sib, "DISPLACEMENT + 8", dataSize=8 656606Sgblack@eecs.umich.edu cvtf2i xmml, ufp1, size=4, ext=4 666606Sgblack@eecs.umich.edu cvtf2i xmmh, ufp2, size=4, ext=4 676606Sgblack@eecs.umich.edu}; 686606Sgblack@eecs.umich.edu 696606Sgblack@eecs.umich.edudef macroop CVTPS2DQ_XMM_P { 706606Sgblack@eecs.umich.edu rdip t7 716606Sgblack@eecs.umich.edu ldfp ufp1, seg, riprel, "DISPLACEMENT", dataSize=8 726606Sgblack@eecs.umich.edu ldfp ufp2, seg, riprel, "DISPLACEMENT + 8", dataSize=8 736606Sgblack@eecs.umich.edu cvtf2i xmml, ufp1, size=4, ext=4 746606Sgblack@eecs.umich.edu cvtf2i xmmh, ufp2, size=4, ext=4 756606Sgblack@eecs.umich.edu}; 766606Sgblack@eecs.umich.edu 776606Sgblack@eecs.umich.edudef macroop CVTPD2DQ_XMM_XMM { 786606Sgblack@eecs.umich.edu cvtf2i xmml, xmmlm, srcSize=8, destSize=4, ext=4 796606Sgblack@eecs.umich.edu cvtf2i xmml, xmmhm, srcSize=8, destSize=4, ext=(4 | 2) 806606Sgblack@eecs.umich.edu lfpimm xmmh, 0 816606Sgblack@eecs.umich.edu}; 826606Sgblack@eecs.umich.edu 836606Sgblack@eecs.umich.edudef macroop CVTPD2DQ_XMM_M { 846606Sgblack@eecs.umich.edu ldfp ufp1, seg, sib, "DISPLACEMENT", dataSize=8 856606Sgblack@eecs.umich.edu ldfp ufp2, seg, sib, "DISPLACEMENT + 8", dataSize=8 866606Sgblack@eecs.umich.edu cvtf2i xmml, ufp1, srcSize=8, destSize=4, ext=4 876606Sgblack@eecs.umich.edu cvtf2i xmml, ufp2, srcSize=8, destSize=4, ext=(4 | 2) 886606Sgblack@eecs.umich.edu lfpimm xmmh, 0 896606Sgblack@eecs.umich.edu}; 906606Sgblack@eecs.umich.edu 916606Sgblack@eecs.umich.edudef macroop CVTPD2DQ_XMM_P { 926606Sgblack@eecs.umich.edu rdip t7 936606Sgblack@eecs.umich.edu ldfp ufp1, seg, riprel, "DISPLACEMENT", dataSize=8 946606Sgblack@eecs.umich.edu ldfp ufp2, seg, riprel, "DISPLACEMENT + 8", dataSize=8 956606Sgblack@eecs.umich.edu cvtf2i xmml, ufp1, srcSize=8, destSize=4, ext=4 966606Sgblack@eecs.umich.edu cvtf2i xmml, ufp2, srcSize=8, destSize=4, ext=(4 | 2) 976606Sgblack@eecs.umich.edu lfpimm xmmh, 0 986606Sgblack@eecs.umich.edu}; 996606Sgblack@eecs.umich.edu 1006606Sgblack@eecs.umich.edudef macroop CVTTPS2DQ_XMM_XMM { 1016606Sgblack@eecs.umich.edu cvtf2i xmml, xmmlm, size=4, ext=0 1026606Sgblack@eecs.umich.edu cvtf2i xmmh, xmmhm, size=4, ext=0 1036606Sgblack@eecs.umich.edu}; 1046606Sgblack@eecs.umich.edu 1056606Sgblack@eecs.umich.edudef macroop CVTTPS2DQ_XMM_M { 1066606Sgblack@eecs.umich.edu ldfp ufp1, seg, sib, "DISPLACEMENT", dataSize=8 1076606Sgblack@eecs.umich.edu ldfp ufp2, seg, sib, "DISPLACEMENT + 8", dataSize=8 1086606Sgblack@eecs.umich.edu cvtf2i xmml, ufp1, size=4, ext=0 1096606Sgblack@eecs.umich.edu cvtf2i xmmh, ufp2, size=4, ext=0 1106606Sgblack@eecs.umich.edu}; 1116606Sgblack@eecs.umich.edu 1126606Sgblack@eecs.umich.edudef macroop CVTTPS2DQ_XMM_P { 1136606Sgblack@eecs.umich.edu rdip t7 1146606Sgblack@eecs.umich.edu ldfp ufp1, seg, riprel, "DISPLACEMENT", dataSize=8 1156606Sgblack@eecs.umich.edu ldfp ufp2, seg, riprel, "DISPLACEMENT + 8", dataSize=8 1166606Sgblack@eecs.umich.edu cvtf2i xmml, ufp1, size=4, ext=0 1176606Sgblack@eecs.umich.edu cvtf2i xmmh, ufp2, size=4, ext=0 1186606Sgblack@eecs.umich.edu}; 1196606Sgblack@eecs.umich.edu 1206606Sgblack@eecs.umich.edudef macroop CVTTPD2DQ_XMM_XMM { 1216606Sgblack@eecs.umich.edu cvtf2i xmml, xmmlm, srcSize=8, destSize=4, ext=0 1226606Sgblack@eecs.umich.edu cvtf2i xmml, xmmhm, srcSize=8, destSize=4, ext=2 1236606Sgblack@eecs.umich.edu lfpimm xmmh, 0 1246606Sgblack@eecs.umich.edu}; 1256606Sgblack@eecs.umich.edu 1266606Sgblack@eecs.umich.edudef macroop CVTTPD2DQ_XMM_M { 1276606Sgblack@eecs.umich.edu ldfp ufp1, seg, sib, "DISPLACEMENT", dataSize=8 1286606Sgblack@eecs.umich.edu ldfp ufp2, seg, sib, "DISPLACEMENT + 8", dataSize=8 1296606Sgblack@eecs.umich.edu cvtf2i xmml, ufp1, srcSize=8, destSize=4, ext=0 1306606Sgblack@eecs.umich.edu cvtf2i xmml, ufp2, srcSize=8, destSize=4, ext=2 1316606Sgblack@eecs.umich.edu lfpimm xmmh, 0 1326606Sgblack@eecs.umich.edu}; 1336606Sgblack@eecs.umich.edu 1346606Sgblack@eecs.umich.edudef macroop CVTTPD2DQ_XMM_P { 1356606Sgblack@eecs.umich.edu rdip t7 1366606Sgblack@eecs.umich.edu ldfp ufp1, seg, riprel, "DISPLACEMENT", dataSize=8 1376606Sgblack@eecs.umich.edu ldfp ufp2, seg, riprel, "DISPLACEMENT + 8", dataSize=8 1386606Sgblack@eecs.umich.edu cvtf2i xmml, ufp1, srcSize=8, destSize=4, ext=0 1396606Sgblack@eecs.umich.edu cvtf2i xmml, ufp2, srcSize=8, destSize=4, ext=2 1406606Sgblack@eecs.umich.edu lfpimm xmmh, 0 1416606Sgblack@eecs.umich.edu}; 1425081Sgblack@eecs.umich.edu''' 143