diff options
author | Nilay Vaish <nilay@cs.wisc.edu> | 2013-03-11 13:15:46 -0500 |
---|---|---|
committer | Nilay Vaish <nilay@cs.wisc.edu> | 2013-03-11 13:15:46 -0500 |
commit | 5c940fec0aebcce5f81063f195220184918b377b (patch) | |
tree | c9e754107957d63e7331ef13d2527a3874524393 /src/arch/x86/isa/insts/x87/load_constants | |
parent | 82f600e02ded4d7162dd9286f790462b9ab5d554 (diff) | |
download | gem5-5c940fec0aebcce5f81063f195220184918b377b.tar.xz |
x86: implement some of the x87 instructions
This patch implements ftan, fprem, fyl2x, fld* floating-point instructions.
Diffstat (limited to 'src/arch/x86/isa/insts/x87/load_constants')
-rw-r--r-- | src/arch/x86/isa/insts/x87/load_constants/load_0_1_or_pi.py | 21 | ||||
-rw-r--r-- | src/arch/x86/isa/insts/x87/load_constants/load_logarithm.py | 27 |
2 files changed, 41 insertions, 7 deletions
diff --git a/src/arch/x86/isa/insts/x87/load_constants/load_0_1_or_pi.py b/src/arch/x86/isa/insts/x87/load_constants/load_0_1_or_pi.py index 2e63f2593..cb8947312 100644 --- a/src/arch/x86/isa/insts/x87/load_constants/load_0_1_or_pi.py +++ b/src/arch/x86/isa/insts/x87/load_constants/load_0_1_or_pi.py @@ -1,4 +1,5 @@ # Copyright (c) 2007 The Hewlett-Packard Development Company +# Copyright (c) 2013 Mark D. Hill and David A. Wood # All rights reserved. # # The license below extends only to copyright in the software and shall @@ -34,9 +35,23 @@ # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # # Authors: Gabe Black +# Nilay Vaish microcode = ''' -# FLDZ -# FLD1 -# FLDPI + +def macroop FLDZ { + limm ufp1, "double(0)" + movfp st(-1), ufp1, spm=-1 +}; + +def macroop FLD1 { + limm ufp1, "double(1)" + movfp st(-1), ufp1, spm=-1 +}; + +def macroop FLDPI { + limm ufp1, "double(3.14159265359)" + movfp st(-1), ufp1, spm=-1 +}; + ''' diff --git a/src/arch/x86/isa/insts/x87/load_constants/load_logarithm.py b/src/arch/x86/isa/insts/x87/load_constants/load_logarithm.py index 939ab7543..7e71c4006 100644 --- a/src/arch/x86/isa/insts/x87/load_constants/load_logarithm.py +++ b/src/arch/x86/isa/insts/x87/load_constants/load_logarithm.py @@ -1,4 +1,5 @@ # Copyright (c) 2007 The Hewlett-Packard Development Company +# Copyright (c) 2013 Mark D. Hill and David A. Wood # All rights reserved. # # The license below extends only to copyright in the software and shall @@ -34,10 +35,28 @@ # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # # Authors: Gabe Black +# Nilay Vaish microcode = ''' -# FLDL2E -# FLDL2T -# FLDLG2 -# FLDLN2 + +def macroop FLDL2E { + limm ufp1, "double(1.44269504089)" + movfp st(-1), ufp1, spm=-1 +}; + +def macroop FLDL2T { + limm ufp1, "double(3.32192809489)" + movfp st(-1), ufp1, spm=-1 +}; + +def macroop FLDLG2 { + limm ufp1, "double(0.30102999566)" + movfp st(-1), ufp1, spm=-1 +}; + +def macroop FLDLN2 { + limm ufp1, "double(0.69314718056)" + movfp st(-1), ufp1, spm=-1 +}; + ''' |