diff options
author | Nilay Vaish <nilay@cs.wisc.edu> | 2014-01-27 18:50:53 -0600 |
---|---|---|
committer | Nilay Vaish <nilay@cs.wisc.edu> | 2014-01-27 18:50:53 -0600 |
commit | 6a543b51344ef8d511f2b67fa0d657a9a78dd169 (patch) | |
tree | 1e2c3d0b4e15aec919fa49a4d9b3a085d82b5eb3 /src/arch/x86/isa/insts/x87/arithmetic | |
parent | 5be0b846b1ca0131fc6c67c1ff7dcf64791ebc73 (diff) | |
download | gem5-6a543b51344ef8d511f2b67fa0d657a9a78dd169.tar.xz |
x86: implements x87 add/sub instructions
Diffstat (limited to 'src/arch/x86/isa/insts/x87/arithmetic')
-rw-r--r-- | src/arch/x86/isa/insts/x87/arithmetic/addition.py | 59 | ||||
-rw-r--r-- | src/arch/x86/isa/insts/x87/arithmetic/subtraction.py | 59 |
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 |