From: Gabe Black Date: Tue, 18 Aug 2009 01:38:53 +0000 (-0700) Subject: X86: Implement the floating point media multiply instructions. X-Git-Tag: Calvin_Submission~94 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=fcb5b2226c540fd4a94d7a6eff62869c4ba234ea;p=gem5.git X86: Implement the floating point media multiply instructions. --- diff --git a/src/arch/x86/isa/decoder/two_byte_opcodes.isa b/src/arch/x86/isa/decoder/two_byte_opcodes.isa index 24349231c..aedf6bcfa 100644 --- a/src/arch/x86/isa/decoder/two_byte_opcodes.isa +++ b/src/arch/x86/isa/decoder/two_byte_opcodes.isa @@ -505,7 +505,7 @@ // no prefix 0x0: decode OPCODE_OP_BOTTOM3 { 0x0: Inst::ADDPS(Vo,Wo); - 0x1: mulps_Vo_Wo(); + 0x1: Inst::MULPS(Vo,Wo); 0x2: cvtps2pd_Vo_Wq(); 0x3: cvtdq2ps_Vo_Wo(); 0x4: Inst::SUBPS(Vo,Wo); @@ -516,7 +516,7 @@ // repe (0xF3) 0x4: decode OPCODE_OP_BOTTOM3 { 0x0: Inst::ADDSS(Vd,Wd); - 0x1: mulss_Vd_Wd(); + 0x1: Inst::MULSS(Vd,Wd); 0x2: cvtss2sd_Vq_Wd(); 0x3: cvttps2dq_Vo_Wo(); 0x4: Inst::SUBSS(Vd,Wd); @@ -527,7 +527,7 @@ // operand size (0x66) 0x1: decode OPCODE_OP_BOTTOM3 { 0x0: Inst::ADDPD(Vo,Wo); - 0x1: mulpd_Vo_Wo(); + 0x1: Inst::MULPD(Vo,Wo); 0x2: cvtpd2ps_Vo_Wo(); 0x3: cvtps2dq_Vo_Wo(); 0x4: Inst::SUBPD(Vo,Wo); diff --git a/src/arch/x86/isa/insts/simd128/floating_point/arithmetic/multiplication.py b/src/arch/x86/isa/insts/simd128/floating_point/arithmetic/multiplication.py index ba4f035d0..fc28fbda4 100644 --- a/src/arch/x86/isa/insts/simd128/floating_point/arithmetic/multiplication.py +++ b/src/arch/x86/isa/insts/simd128/floating_point/arithmetic/multiplication.py @@ -54,22 +54,73 @@ # Authors: Gabe Black microcode = ''' -# MULPS -# MULPD -# MULSS +def macroop MULSS_XMM_XMM { + mmulf xmml, xmml, xmmlm, size=4, ext=1 +}; + +def macroop MULSS_XMM_M { + ldfp ufp1, seg, sib, disp, dataSize=8 + mmulf xmml, xmml, ufp1, size=4, ext=1 +}; + +def macroop MULSS_XMM_P { + rdip t7 + ldfp ufp1, seg, riprel, disp, dataSize=8 + mmulf xmml, xmml, ufp1, size=4, ext=1 +}; def macroop MULSD_XMM_XMM { - mulfp xmml, xmml, xmmlm + mmulf xmml, xmml, xmmlm, size=8, ext=1 }; def macroop MULSD_XMM_M { ldfp ufp1, seg, sib, disp, dataSize=8 - mulfp xmml, xmml, ufp1 + mmulf xmml, xmml, ufp1, size=8, ext=1 }; def macroop MULSD_XMM_P { rdip t7 ldfp ufp1, seg, riprel, disp, dataSize=8 - mulfp xmml, xmml, ufp1 + mmulf xmml, xmml, ufp1, size=8, ext=1 +}; + +def macroop MULPS_XMM_XMM { + mmulf xmml, xmml, xmmlm, size=4, ext=0 + mmulf xmmh, xmmh, xmmhm, size=4, ext=0 +}; + +def macroop MULPS_XMM_M { + ldfp ufp1, seg, sib, "DISPLACEMENT", dataSize=8 + ldfp ufp2, seg, sib, "DISPLACEMENT + 8", dataSize=8 + mmulf xmml, xmml, ufp1, size=4, ext=0 + mmulf xmmh, xmmh, ufp2, size=4, ext=0 +}; + +def macroop MULPS_XMM_P { + rdip t7 + ldfp ufp1, seg, riprel, "DISPLACEMENT", dataSize=8 + ldfp ufp2, seg, riprel, "DISPLACEMENT + 8", dataSize=8 + mmulf xmml, xmml, ufp1, size=4, ext=0 + mmulf xmmh, xmmh, ufp2, size=4, ext=0 +}; + +def macroop MULPD_XMM_XMM { + mmulf xmml, xmml, xmmlm, size=8, ext=0 + mmulf xmmh, xmmh, xmmhm, size=8, ext=0 +}; + +def macroop MULPD_XMM_M { + ldfp ufp1, seg, sib, "DISPLACEMENT", dataSize=8 + ldfp ufp2, seg, sib, "DISPLACEMENT + 8", dataSize=8 + mmulf xmml, xmml, ufp1, size=8, ext=0 + mmulf xmmh, xmmh, ufp2, size=8, ext=0 +}; + +def macroop MULPD_XMM_P { + rdip t7 + ldfp ufp1, seg, riprel, "DISPLACEMENT", dataSize=8 + ldfp ufp2, seg, riprel, "DISPLACEMENT + 8", dataSize=8 + mmulf xmml, xmml, ufp1, size=8, ext=0 + mmulf xmmh, xmmh, ufp2, size=8, ext=0 }; ''' diff --git a/src/arch/x86/isa/insts/simd64/floating_point/arithmetic/multiplication.py b/src/arch/x86/isa/insts/simd64/floating_point/arithmetic/multiplication.py index 54047ec7c..f970018ac 100644 --- a/src/arch/x86/isa/insts/simd64/floating_point/arithmetic/multiplication.py +++ b/src/arch/x86/isa/insts/simd64/floating_point/arithmetic/multiplication.py @@ -54,5 +54,18 @@ # Authors: Gabe Black microcode = ''' -# PFMUL +def macroop PFMUL_MMX_MMX { + mmulf mmx, mmx, mmxm, size=4, ext=0 +}; + +def macroop PFMUL_MMX_M { + ldfp ufp1, seg, sib, disp, dataSize=8 + mmulf mmx, mmx, ufp1, size=4, ext=0 +}; + +def macroop PFMUL_MMX_P { + rdip t7 + ldfp ufp1, seg, riprel, disp, dataSize=8 + mmulf mmx, mmx, ufp1, size=4, ext=0 +}; '''