diff options
author | Gabe Black <gblack@eecs.umich.edu> | 2009-08-17 18:35:06 -0700 |
---|---|---|
committer | Gabe Black <gblack@eecs.umich.edu> | 2009-08-17 18:35:06 -0700 |
commit | 49c2610c04e3bb1998355f0bc146ecd925eb8fca (patch) | |
tree | a36baced04eb3315e84b88b52214b39ea004a897 /src | |
parent | df163284fc29805d4eb3745b9a4dca49a3688b4c (diff) | |
download | gem5-49c2610c04e3bb1998355f0bc146ecd925eb8fca.tar.xz |
X86: Implement the floating point media add instructions.
Diffstat (limited to 'src')
-rw-r--r-- | src/arch/x86/isa/decoder/two_byte_opcodes.isa | 6 | ||||
-rw-r--r-- | src/arch/x86/isa/insts/simd128/floating_point/arithmetic/addition.py | 63 |
2 files changed, 60 insertions, 9 deletions
diff --git a/src/arch/x86/isa/decoder/two_byte_opcodes.isa b/src/arch/x86/isa/decoder/two_byte_opcodes.isa index faf9389a4..b8ccec760 100644 --- a/src/arch/x86/isa/decoder/two_byte_opcodes.isa +++ b/src/arch/x86/isa/decoder/two_byte_opcodes.isa @@ -504,7 +504,7 @@ 0x0B: decode LEGACY_DECODEVAL { // no prefix 0x0: decode OPCODE_OP_BOTTOM3 { - 0x0: addps_Vo_Wo(); + 0x0: Inst::ADDPS(Vo,Wo); 0x1: mulps_Vo_Wo(); 0x2: cvtps2pd_Vo_Wq(); 0x3: cvtdq2ps_Vo_Wo(); @@ -515,7 +515,7 @@ } // repe (0xF3) 0x4: decode OPCODE_OP_BOTTOM3 { - 0x0: addss_Vd_Wd(); + 0x0: Inst::ADDSS(Vd,Wd); 0x1: mulss_Vd_Wd(); 0x2: cvtss2sd_Vq_Wd(); 0x3: cvttps2dq_Vo_Wo(); @@ -526,7 +526,7 @@ } // operand size (0x66) 0x1: decode OPCODE_OP_BOTTOM3 { - 0x0: addpd_Vo_Wo(); + 0x0: Inst::ADDPD(Vo,Wo); 0x1: mulpd_Vo_Wo(); 0x2: cvtpd2ps_Vo_Wo(); 0x3: cvtps2dq_Vo_Wo(); diff --git a/src/arch/x86/isa/insts/simd128/floating_point/arithmetic/addition.py b/src/arch/x86/isa/insts/simd128/floating_point/arithmetic/addition.py index 7e0088c81..083d8775d 100644 --- a/src/arch/x86/isa/insts/simd128/floating_point/arithmetic/addition.py +++ b/src/arch/x86/isa/insts/simd128/floating_point/arithmetic/addition.py @@ -54,22 +54,73 @@ # Authors: Gabe Black microcode = ''' -# ADDPS -# ADDPD -# ADDSS +def macroop ADDSS_XMM_XMM { + maddf xmml, xmml, xmmlm, size=4, ext=1 +}; + +def macroop ADDSS_XMM_M { + ldfp ufp1, seg, sib, disp, dataSize=8 + maddf xmml, xmml, ufp1, size=4, ext=1 +}; + +def macroop ADDSS_XMM_P { + rdip t7 + ldfp ufp1, seg, riprel, disp, dataSize=8 + maddf xmml, xmml, ufp1, size=4, ext=1 +}; def macroop ADDSD_XMM_XMM { - addfp xmml, xmml, xmmlm + maddf xmml, xmml, xmmlm, size=8, ext=1 }; def macroop ADDSD_XMM_M { ldfp ufp1, seg, sib, disp, dataSize=8 - addfp xmml, xmml, ufp1 + maddf xmml, xmml, ufp1, size=8, ext=1 }; def macroop ADDSD_XMM_P { rdip t7 ldfp ufp1, seg, riprel, disp, dataSize=8 - addfp xmml, xmml, ufp1 + maddf xmml, xmml, ufp1, size=8, ext=1 +}; + +def macroop ADDPS_XMM_XMM { + maddf xmml, xmml, xmmlm, size=4, ext=0 + maddf xmmh, xmmh, xmmhm, size=4, ext=0 +}; + +def macroop ADDPS_XMM_M { + ldfp ufp1, seg, sib, "DISPLACEMENT", dataSize=8 + ldfp ufp2, seg, sib, "DISPLACEMENT + 8", dataSize=8 + maddf xmml, xmml, ufp1, size=4, ext=0 + maddf xmmh, xmmh, ufp2, size=4, ext=0 +}; + +def macroop ADDPS_XMM_P { + rdip t7 + ldfp ufp1, seg, riprel, "DISPLACEMENT", dataSize=8 + ldfp ufp2, seg, riprel, "DISPLACEMENT + 8", dataSize=8 + maddf xmml, xmml, ufp1, size=4, ext=0 + maddf xmmh, xmmh, ufp2, size=4, ext=0 +}; + +def macroop ADDPD_XMM_XMM { + maddf xmml, xmml, xmmlm, size=8, ext=0 + maddf xmmh, xmmh, xmmhm, size=8, ext=0 +}; + +def macroop ADDPD_XMM_M { + ldfp ufp1, seg, sib, "DISPLACEMENT", dataSize=8 + ldfp ufp2, seg, sib, "DISPLACEMENT + 8", dataSize=8 + maddf xmml, xmml, ufp1, size=8, ext=0 + maddf xmmh, xmmh, ufp2, size=8, ext=0 +}; + +def macroop ADDPD_XMM_P { + rdip t7 + ldfp ufp1, seg, riprel, "DISPLACEMENT", dataSize=8 + ldfp ufp2, seg, riprel, "DISPLACEMENT + 8", dataSize=8 + maddf xmml, xmml, ufp1, size=8, ext=0 + maddf xmmh, xmmh, ufp2, size=8, ext=0 }; ''' |