division.py revision 10784:2f1a0f6d5d77
16166Ssteve.reinhardt@amd.com# Copyright (c) 2007 The Hewlett-Packard Development Company
26166Ssteve.reinhardt@amd.com# All rights reserved.
36166Ssteve.reinhardt@amd.com#
46166Ssteve.reinhardt@amd.com# The license below extends only to copyright in the software and shall
56166Ssteve.reinhardt@amd.com# not be construed as granting a license to any other intellectual
66166Ssteve.reinhardt@amd.com# property including but not limited to intellectual property relating
76166Ssteve.reinhardt@amd.com# to a hardware implementation of the functionality of the software
86166Ssteve.reinhardt@amd.com# licensed hereunder.  You may use the software subject to the license
96166Ssteve.reinhardt@amd.com# terms below provided that you ensure that this notice is replicated
106166Ssteve.reinhardt@amd.com# unmodified and in its entirety in all distributions of the software,
116166Ssteve.reinhardt@amd.com# modified or unmodified, in source code or in binary form.
126166Ssteve.reinhardt@amd.com#
136166Ssteve.reinhardt@amd.com# Redistribution and use in source and binary forms, with or without
146166Ssteve.reinhardt@amd.com# modification, are permitted provided that the following conditions are
156166Ssteve.reinhardt@amd.com# met: redistributions of source code must retain the above copyright
166166Ssteve.reinhardt@amd.com# notice, this list of conditions and the following disclaimer;
176166Ssteve.reinhardt@amd.com# redistributions in binary form must reproduce the above copyright
186166Ssteve.reinhardt@amd.com# notice, this list of conditions and the following disclaimer in the
196166Ssteve.reinhardt@amd.com# documentation and/or other materials provided with the distribution;
206166Ssteve.reinhardt@amd.com# neither the name of the copyright holders nor the names of its
216166Ssteve.reinhardt@amd.com# contributors may be used to endorse or promote products derived from
226166Ssteve.reinhardt@amd.com# this software without specific prior written permission.
236166Ssteve.reinhardt@amd.com#
246166Ssteve.reinhardt@amd.com# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
256166Ssteve.reinhardt@amd.com# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
266166Ssteve.reinhardt@amd.com# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
276166Ssteve.reinhardt@amd.com# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
286166Ssteve.reinhardt@amd.com# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
296166Ssteve.reinhardt@amd.com# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
306166Ssteve.reinhardt@amd.com# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
316928SBrad.Beckmann@amd.com# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
326928SBrad.Beckmann@amd.com# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
336928SBrad.Beckmann@amd.com# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
346928SBrad.Beckmann@amd.com# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
356928SBrad.Beckmann@amd.com#
366928SBrad.Beckmann@amd.com# Authors: Gabe Black
376928SBrad.Beckmann@amd.com
386928SBrad.Beckmann@amd.commicrocode = '''
396928SBrad.Beckmann@amd.comdef macroop FDIV1_R
406928SBrad.Beckmann@amd.com{
416928SBrad.Beckmann@amd.com    divfp st(0), st(0), sti
428920Snilay@cs.wisc.edu};
436928SBrad.Beckmann@amd.com
446928SBrad.Beckmann@amd.com
456928SBrad.Beckmann@amd.comdef macroop FDIV1_M
468920Snilay@cs.wisc.edu{
476928SBrad.Beckmann@amd.com    ldfp87 ufp1, seg, sib, disp
487570SBrad.Beckmann@amd.com    divfp st(0), st(0), ufp1
497570SBrad.Beckmann@amd.com};
506928SBrad.Beckmann@amd.com
516928SBrad.Beckmann@amd.comdef macroop FDIV1_P
526166Ssteve.reinhardt@amd.com{
537570SBrad.Beckmann@amd.com    rdip t7
547570SBrad.Beckmann@amd.com    ldfp87 ufp1, seg, riprel, disp
557570SBrad.Beckmann@amd.com    divfp st(0), st(0), ufp1
567570SBrad.Beckmann@amd.com};
577570SBrad.Beckmann@amd.com
587570SBrad.Beckmann@amd.comdef macroop FDIV2_R
597570SBrad.Beckmann@amd.com{
607570SBrad.Beckmann@amd.com    divfp sti, sti, st(0)
617570SBrad.Beckmann@amd.com};
627570SBrad.Beckmann@amd.com
637570SBrad.Beckmann@amd.comdef macroop FDIV2_M
647570SBrad.Beckmann@amd.com{
657570SBrad.Beckmann@amd.com    ldfp87 ufp1, seg, sib, disp
666166Ssteve.reinhardt@amd.com    divfp st(0), st(0), ufp1
676166Ssteve.reinhardt@amd.com};
686166Ssteve.reinhardt@amd.com
696928SBrad.Beckmann@amd.comdef macroop FDIV2_P
706928SBrad.Beckmann@amd.com{
716289Snate@binkert.org    rdip t7
726166Ssteve.reinhardt@amd.com    ldfp87 ufp1, seg, riprel, disp
737570SBrad.Beckmann@amd.com    divfp st(0), st(0), ufp1
746166Ssteve.reinhardt@amd.com};
758436SBrad.Beckmann@amd.com
766166Ssteve.reinhardt@amd.comdef macroop FDIVP
778322Ssteve.reinhardt@amd.com{
786166Ssteve.reinhardt@amd.com    divfp st(1), st(1), st(0), spm=1
796928SBrad.Beckmann@amd.com};
806928SBrad.Beckmann@amd.com
816928SBrad.Beckmann@amd.comdef macroop FDIVP_R
826928SBrad.Beckmann@amd.com{
838322Ssteve.reinhardt@amd.com    divfp sti, sti, st(0), spm=1
848322Ssteve.reinhardt@amd.com};
856166Ssteve.reinhardt@amd.com
866166Ssteve.reinhardt@amd.comdef macroop FDIVP_M
876166Ssteve.reinhardt@amd.com{
886166Ssteve.reinhardt@amd.com    fault "std::make_shared<UnimpInstFault>()"
896166Ssteve.reinhardt@amd.com};
908801Sgblack@eecs.umich.edu
916166Ssteve.reinhardt@amd.comdef macroop FDIVP_P
926928SBrad.Beckmann@amd.com{
936928SBrad.Beckmann@amd.com   fault "std::make_shared<UnimpInstFault>()"
946928SBrad.Beckmann@amd.com};
95
96# FIDIV
97# FDIVR
98# FDIVRP
99# FIDIVR
100'''
101