summaryrefslogtreecommitdiff
path: root/src/arch/x86/isa/insts/x87/transcendental_functions
diff options
context:
space:
mode:
authorNilay Vaish <nilay@cs.wisc.edu>2013-03-11 13:15:46 -0500
committerNilay Vaish <nilay@cs.wisc.edu>2013-03-11 13:15:46 -0500
commit5c940fec0aebcce5f81063f195220184918b377b (patch)
treec9e754107957d63e7331ef13d2527a3874524393 /src/arch/x86/isa/insts/x87/transcendental_functions
parent82f600e02ded4d7162dd9286f790462b9ab5d554 (diff)
downloadgem5-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/transcendental_functions')
-rw-r--r--src/arch/x86/isa/insts/x87/transcendental_functions/logarithmic_functions.py6
-rw-r--r--src/arch/x86/isa/insts/x87/transcendental_functions/trigonometric_functions.py9
2 files changed, 13 insertions, 2 deletions
diff --git a/src/arch/x86/isa/insts/x87/transcendental_functions/logarithmic_functions.py b/src/arch/x86/isa/insts/x87/transcendental_functions/logarithmic_functions.py
index 5be460232..1078c491f 100644
--- a/src/arch/x86/isa/insts/x87/transcendental_functions/logarithmic_functions.py
+++ b/src/arch/x86/isa/insts/x87/transcendental_functions/logarithmic_functions.py
@@ -38,6 +38,10 @@
microcode = '''
# F2XM1
# FSCALE
-# FYL2X
+
+def macroop FYL2X {
+ yl2xfp st(1), st(0), st(1), spm=1
+};
+
# FYL2XP1
'''
diff --git a/src/arch/x86/isa/insts/x87/transcendental_functions/trigonometric_functions.py b/src/arch/x86/isa/insts/x87/transcendental_functions/trigonometric_functions.py
index ffdbcf150..cc2ae606b 100644
--- a/src/arch/x86/isa/insts/x87/transcendental_functions/trigonometric_functions.py
+++ b/src/arch/x86/isa/insts/x87/transcendental_functions/trigonometric_functions.py
@@ -1,4 +1,5 @@
# Copyright (c) 2007 The Hewlett-Packard Development Company
+# Copyright (c) 2012-13 Mark D. Hill and David A. Wood
# All rights reserved.
#
# The license below extends only to copyright in the software and shall
@@ -34,6 +35,7 @@
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
# Authors: Gabe Black
+# Nilay Vaish
microcode = '''
def macroop FSIN {
@@ -51,6 +53,11 @@ def macroop FSINCOS {
movfp st(-1), ufp2, spm=-1
};
-# FPTAN
+def macroop FPTAN {
+ tanfp st(0), st(0)
+ limm ufp1, "double(1)"
+ movfp st(-1), ufp1, spm=-1
+};
+
# FPATAN
'''