store_string.py revision 5420
11689SN/A# Copyright (c) 2007-2008 The Hewlett-Packard Development Company 22325SN/A# All rights reserved. 31689SN/A# 41689SN/A# Redistribution and use of this software in source and binary forms, 51689SN/A# with or without modification, are permitted provided that the 61689SN/A# following conditions are met: 71689SN/A# 81689SN/A# The software must be used only for Non-Commercial Use which means any 91689SN/A# use which is NOT directed to receiving any direct monetary 101689SN/A# compensation for, or commercial advantage from such use. Illustrative 111689SN/A# examples of non-commercial use are academic research, personal study, 121689SN/A# teaching, education and corporate research & development. 131689SN/A# Illustrative examples of commercial use are distributing products for 141689SN/A# commercial advantage and providing services using the software for 151689SN/A# commercial advantage. 161689SN/A# 171689SN/A# If you wish to use this software or functionality therein that may be 181689SN/A# covered by patents for commercial use, please contact: 191689SN/A# Director of Intellectual Property Licensing 201689SN/A# Office of Strategy and Technology 211689SN/A# Hewlett-Packard Company 221689SN/A# 1501 Page Mill Road 231689SN/A# Palo Alto, California 94304 241689SN/A# 251689SN/A# Redistributions of source code must retain the above copyright notice, 261689SN/A# this list of conditions and the following disclaimer. Redistributions 272665Ssaidi@eecs.umich.edu# in binary form must reproduce the above copyright notice, this list of 282665Ssaidi@eecs.umich.edu# conditions and the following disclaimer in the documentation and/or 292756Sksewell@umich.edu# other materials provided with the distribution. Neither the name of 301689SN/A# the COPYRIGHT HOLDER(s), HEWLETT-PACKARD COMPANY, nor the names of its 311689SN/A# contributors may be used to endorse or promote products derived from 321858SN/A# this software without specific prior written permission. No right of 332733Sktlim@umich.edu# sublicense is granted herewith. Derivatives of the software and 341858SN/A# output created using the software may be prepared, but only for 354762Snate@binkert.org# Non-Commercial Uses. Derivatives of the software may be shared with 364762Snate@binkert.org# others provided: (i) the others agree to abide by the list of 374762Snate@binkert.org# conditions herein which includes the Non-Commercial Use restrictions; 384762Snate@binkert.org# and (ii) such Derivatives of the software include the above copyright 394762Snate@binkert.org# notice to acknowledge the contribution from this software where 405595Sgblack@eecs.umich.edu# applicable, this list of conditions and the disclaimer below. 414762Snate@binkert.org# 424762Snate@binkert.org# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 434762Snate@binkert.org# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 444762Snate@binkert.org# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 451858SN/A# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 462356SN/A# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 471060SN/A# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 481060SN/A# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 491060SN/A# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 501060SN/A# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 511060SN/A# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 522794Sktlim@umich.edu# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 532794Sktlim@umich.edu# 542794Sktlim@umich.edu# Authors: Gabe Black 552794Sktlim@umich.edu 565529Snate@binkert.orgmicrocode = ''' 575529Snate@binkert.orgdef macroop STOS_M { 582669Sktlim@umich.edu # Find the constant we need to either add or subtract from rdi 591060SN/A ruflag t0, 10 605529Snate@binkert.org movi t3, t3, dsz, flags=(CEZF,), dataSize=asz 612292SN/A subi t4, t0, dsz, dataSize=asz 621060SN/A mov t3, t3, t4, flags=(nCEZF,), dataSize=asz 631060SN/A 641060SN/A st rax, es, [1, t0, rdi] 652292SN/A 662733Sktlim@umich.edu add rdi, rdi, t3, dataSize=asz 672292SN/A}; 682292SN/A 692292SN/Adef macroop STOS_E_M { 702292SN/A and t0, rcx, rcx, flags=(EZF,), dataSize=asz 711060SN/A bri t0, label("end"), flags=(CEZF,) 721755SN/A # Find the constant we need to either add or subtract from rdi 735606Snate@binkert.org ruflag t0, 10 741060SN/A movi t3, t3, dsz, flags=(CEZF,), dataSize=asz 751060SN/A subi t4, t0, dsz, dataSize=asz 761060SN/A mov t3, t3, t4, flags=(nCEZF,), dataSize=asz 771060SN/A 781060SN/AtopOfLoop: 791755SN/A st rax, es, [1, t0, rdi] 801060SN/A 811060SN/A subi rcx, rcx, 1, flags=(EZF,), dataSize=asz 821060SN/A add rdi, rdi, t3, dataSize=asz 831060SN/A bri t0, label("topOfLoop"), flags=(nCEZF,) 841060SN/Aend: 851060SN/A fault "NoFault" 865336Shines@cs.fsu.edu}; 871060SN/A''' 884873Sstever@eecs.umich.edu