summaryrefslogtreecommitdiff
path: root/src/arch/x86/isa/insts/x87/arithmetic
diff options
context:
space:
mode:
Diffstat (limited to 'src/arch/x86/isa/insts/x87/arithmetic')
-rw-r--r--src/arch/x86/isa/insts/x87/arithmetic/addition.py59
-rw-r--r--src/arch/x86/isa/insts/x87/arithmetic/subtraction.py59
2 files changed, 114 insertions, 4 deletions
diff --git a/src/arch/x86/isa/insts/x87/arithmetic/addition.py b/src/arch/x86/isa/insts/x87/arithmetic/addition.py
index 62d1b0fcd..a7e427c62 100644
--- a/src/arch/x86/isa/insts/x87/arithmetic/addition.py
+++ b/src/arch/x86/isa/insts/x87/arithmetic/addition.py
@@ -36,7 +36,62 @@
# Authors: Gabe Black
microcode = '''
-# FADD
-# FADDP
+def macroop FADD1_R
+{
+ addfp st(0), sti, st(0)
+};
+
+
+def macroop FADD1_M
+{
+ ldfp ufp1, seg, sib, disp
+ addfp st(0), st(0), ufp1
+};
+
+def macroop FADD1_P
+{
+ rdip t7
+ ldfp ufp1, seg, riprel, disp
+ addfp st(0), st(0), ufp1
+};
+
+def macroop FADD2_R
+{
+ addfp sti, sti, st(0)
+};
+
+def macroop FADD2_M
+{
+ ldfp ufp1, seg, sib, disp
+ addfp st(0), st(0), ufp1
+};
+
+def macroop FADD2_P
+{
+ rdip t7
+ ldfp ufp1, seg, riprel, disp
+ addfp st(0), st(0), ufp1
+};
+
+def macroop FADDP
+{
+ addfp st(1), st(0), st(1), spm=1
+};
+
+def macroop FADDP_R
+{
+ addfp sti, sti, st(0), spm=1
+};
+
+def macroop FADDP_M
+{
+ fault "new UnimpInstFault"
+};
+
+def macroop FADDP_P
+{
+ fault "new UnimpInstFault"
+};
+
# FIADD
'''
diff --git a/src/arch/x86/isa/insts/x87/arithmetic/subtraction.py b/src/arch/x86/isa/insts/x87/arithmetic/subtraction.py
index e6098ff1f..77db1e470 100644
--- a/src/arch/x86/isa/insts/x87/arithmetic/subtraction.py
+++ b/src/arch/x86/isa/insts/x87/arithmetic/subtraction.py
@@ -36,8 +36,63 @@
# Authors: Gabe Black
microcode = '''
-# FSUB
-# FSUBP
+def macroop FSUB1_R
+{
+ subfp st(0), st(0), sti
+};
+
+
+def macroop FSUB1_M
+{
+ ldfp ufp1, seg, sib, disp
+ subfp st(0), st(0), ufp1
+};
+
+def macroop FSUB1_P
+{
+ rdip t7
+ ldfp ufp1, seg, riprel, disp
+ subfp st(0), st(0), ufp1
+};
+
+def macroop FSUB2_R
+{
+ subfp sti, sti, st(0)
+};
+
+def macroop FSUB2_M
+{
+ ldfp ufp1, seg, sib, disp
+ subfp st(0), st(0), ufp1
+};
+
+def macroop FSUB2_P
+{
+ rdip t7
+ ldfp ufp1, seg, riprel, disp
+ subfp st(0), st(0), ufp1
+};
+
+def macroop FSUBP
+{
+ subfp st(1), st(1), st(0), spm=1
+};
+
+def macroop FSUBP_R
+{
+ subfp sti, sti, st(0), spm=1
+};
+
+def macroop FSUBP_M
+{
+ fault "new UnimpInstFault"
+};
+
+def macroop FSUBP_P
+{
+ fault "new UnimpInstFault"
+};
+
# FISUB
# FSUBR
# FSUBRP