extract_and_insert.py revision 7087
14202Sbinkertn@umich.edu# Copyright (c) 2007 The Hewlett-Packard Development Company
24202Sbinkertn@umich.edu# All rights reserved.
34202Sbinkertn@umich.edu#
44202Sbinkertn@umich.edu# The license below extends only to copyright in the software and shall
54202Sbinkertn@umich.edu# not be construed as granting a license to any other intellectual
64202Sbinkertn@umich.edu# property including but not limited to intellectual property relating
74202Sbinkertn@umich.edu# to a hardware implementation of the functionality of the software
84202Sbinkertn@umich.edu# licensed hereunder.  You may use the software subject to the license
94202Sbinkertn@umich.edu# terms below provided that you ensure that this notice is replicated
104202Sbinkertn@umich.edu# unmodified and in its entirety in all distributions of the software,
114202Sbinkertn@umich.edu# modified or unmodified, in source code or in binary form.
124202Sbinkertn@umich.edu#
134202Sbinkertn@umich.edu# Redistribution and use in source and binary forms, with or without
144202Sbinkertn@umich.edu# modification, are permitted provided that the following conditions are
154202Sbinkertn@umich.edu# met: redistributions of source code must retain the above copyright
164202Sbinkertn@umich.edu# notice, this list of conditions and the following disclaimer;
174202Sbinkertn@umich.edu# redistributions in binary form must reproduce the above copyright
184202Sbinkertn@umich.edu# notice, this list of conditions and the following disclaimer in the
194202Sbinkertn@umich.edu# documentation and/or other materials provided with the distribution;
204202Sbinkertn@umich.edu# neither the name of the copyright holders nor the names of its
214202Sbinkertn@umich.edu# contributors may be used to endorse or promote products derived from
224202Sbinkertn@umich.edu# this software without specific prior written permission.
234202Sbinkertn@umich.edu#
244202Sbinkertn@umich.edu# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
254202Sbinkertn@umich.edu# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
264202Sbinkertn@umich.edu# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
274202Sbinkertn@umich.edu# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
284202Sbinkertn@umich.edu# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
294202Sbinkertn@umich.edu# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
304202Sbinkertn@umich.edu# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
314202Sbinkertn@umich.edu# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
324202Sbinkertn@umich.edu# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
335337Sstever@gmail.com# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
345337Sstever@gmail.com# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
355337Sstever@gmail.com#
365337Sstever@gmail.com# Authors: Gabe Black
374202Sbinkertn@umich.edu
38microcode = '''
39def macroop PEXTRW_R_XMM_I {
40    mov2int reg, xmmlm, "IMMEDIATE & mask(3)", size=2, ext=1
41    mov2int reg, xmmhm, "IMMEDIATE & mask(3)", size=2, ext=1
42};
43
44def macroop PINSRW_XMM_R_I {
45    mov2fp xmml, regm, "IMMEDIATE & mask(3)", size=2, ext=1
46    mov2fp xmmh, regm, "IMMEDIATE & mask(3)", size=2, ext=1
47};
48
49def macroop PINSRW_XMM_M_I {
50    ld t1, seg, sib, disp, dataSize=2
51    mov2fp xmml, t1, "IMMEDIATE & mask(3)", size=2, ext=1
52    mov2fp xmmh, t1, "IMMEDIATE & mask(3)", size=2, ext=1
53};
54
55def macroop PINSRW_XMM_P_I {
56    rdip t7
57    ld t1, seg, riprel, disp, dataSize=2
58    mov2fp xmml, t1, "IMMEDIATE & mask(3)", size=2, ext=1
59    mov2fp xmmh, t1, "IMMEDIATE & mask(3)", size=2, ext=1
60};
61'''
62