From e596e524985cfb1f4d46aceebe69bb7fcd94cf04 Mon Sep 17 00:00:00 2001 From: Nilay Vaish Date: Mon, 13 Apr 2015 17:33:57 -0500 Subject: x86: implements x87 mult/div instructions --- src/arch/x86/isa/insts/x87/arithmetic/division.py | 59 +++++++++++++++++++++- .../x86/isa/insts/x87/arithmetic/multiplication.py | 59 +++++++++++++++++++++- 2 files changed, 114 insertions(+), 4 deletions(-) (limited to 'src/arch/x86/isa/insts/x87/arithmetic') diff --git a/src/arch/x86/isa/insts/x87/arithmetic/division.py b/src/arch/x86/isa/insts/x87/arithmetic/division.py index 3e4108d18..fe9829913 100644 --- a/src/arch/x86/isa/insts/x87/arithmetic/division.py +++ b/src/arch/x86/isa/insts/x87/arithmetic/division.py @@ -36,8 +36,63 @@ # Authors: Gabe Black microcode = ''' -# FDIV -# FDIVP +def macroop FDIV1_R +{ + divfp st(0), st(0), sti +}; + + +def macroop FDIV1_M +{ + ldfp87 ufp1, seg, sib, disp + divfp st(0), st(0), ufp1 +}; + +def macroop FDIV1_P +{ + rdip t7 + ldfp87 ufp1, seg, riprel, disp + divfp st(0), st(0), ufp1 +}; + +def macroop FDIV2_R +{ + divfp sti, sti, st(0) +}; + +def macroop FDIV2_M +{ + ldfp87 ufp1, seg, sib, disp + divfp st(0), st(0), ufp1 +}; + +def macroop FDIV2_P +{ + rdip t7 + ldfp87 ufp1, seg, riprel, disp + divfp st(0), st(0), ufp1 +}; + +def macroop FDIVP +{ + divfp st(1), st(1), st(0), spm=1 +}; + +def macroop FDIVP_R +{ + divfp sti, sti, st(0), spm=1 +}; + +def macroop FDIVP_M +{ + fault "std::make_shared()" +}; + +def macroop FDIVP_P +{ + fault "std::make_shared()" +}; + # FIDIV # FDIVR # FDIVRP diff --git a/src/arch/x86/isa/insts/x87/arithmetic/multiplication.py b/src/arch/x86/isa/insts/x87/arithmetic/multiplication.py index d47f3fa6c..543896f3c 100644 --- a/src/arch/x86/isa/insts/x87/arithmetic/multiplication.py +++ b/src/arch/x86/isa/insts/x87/arithmetic/multiplication.py @@ -36,7 +36,62 @@ # Authors: Gabe Black microcode = ''' -# FMUL -# FMULP +def macroop FMUL1_R +{ + mulfp st(0), sti, st(0) +}; + + +def macroop FMUL1_M +{ + ldfp87 ufp1, seg, sib, disp + mulfp st(0), st(0), ufp1 +}; + +def macroop FMUL1_P +{ + rdip t7 + ldfp87 ufp1, seg, riprel, disp + mulfp st(0), st(0), ufp1 +}; + +def macroop FMUL2_R +{ + mulfp sti, sti, st(0) +}; + +def macroop FMUL2_M +{ + ldfp87 ufp1, seg, sib, disp + mulfp st(0), st(0), ufp1 +}; + +def macroop FMUL2_P +{ + rdip t7 + ldfp87 ufp1, seg, riprel, disp + mulfp st(0), st(0), ufp1 +}; + +def macroop FMULP +{ + mulfp st(1), st(0), st(1), spm=1 +}; + +def macroop FMULP_R +{ + mulfp sti, sti, st(0), spm=1 +}; + +def macroop FMULP_M +{ + fault "std::make_shared()" +}; + +def macroop FMULP_P +{ + fault "std::make_shared()" +}; + # FIMUL ''' -- cgit v1.2.3