From e678df6263ba9cc9e47e6705e276830d3decb15d Mon Sep 17 00:00:00 2001 From: Gabe Black Date: Mon, 17 Aug 2009 20:04:02 -0700 Subject: X86: Implement the media integer addition instructions. --- .../insts/simd64/integer/arithmetic/addition.py | 127 +++++++++++++++++++-- 1 file changed, 119 insertions(+), 8 deletions(-) (limited to 'src/arch/x86/isa/insts/simd64/integer/arithmetic') diff --git a/src/arch/x86/isa/insts/simd64/integer/arithmetic/addition.py b/src/arch/x86/isa/insts/simd64/integer/arithmetic/addition.py index 235a4fc7b..b663d15b7 100644 --- a/src/arch/x86/isa/insts/simd64/integer/arithmetic/addition.py +++ b/src/arch/x86/isa/insts/simd64/integer/arithmetic/addition.py @@ -54,12 +54,123 @@ # Authors: Gabe Black microcode = ''' -# PADDB -# PADDW -# PADDD -# PADDQ -# PADDSB -# PADDSW -# PADDUSB -# PADDUSW +def macroop PADDB_MMX_MMX { + maddi mmx, mmx, mmxm, size=1, ext=0 +}; + +def macroop PADDB_MMX_M { + ldfp ufp1, seg, sib, disp, dataSize=8 + maddi mmx, mmx, ufp1, size=1, ext=0 +}; + +def macroop PADDB_MMX_P { + rdip t7 + ldfp ufp1, seg, riprel, disp, dataSize=8 + maddi mmx, mmx, ufp1, size=1, ext=0 +}; + +def macroop PADDW_MMX_MMX { + maddi mmx, mmx, mmxm, size=2, ext=0 +}; + +def macroop PADDW_MMX_M { + ldfp ufp1, seg, sib, disp, dataSize=8 + maddi mmx, mmx, ufp1, size=2, ext=0 +}; + +def macroop PADDW_MMX_P { + rdip t7 + ldfp ufp1, seg, riprel, disp, dataSize=8 + maddi mmx, mmx, ufp1, size=2, ext=0 +}; + +def macroop PADDD_MMX_MMX { + maddi mmx, mmx, mmxm, size=4, ext=0 +}; + +def macroop PADDD_MMX_M { + ldfp ufp1, seg, sib, disp, dataSize=8 + maddi mmx, mmx, ufp1, size=4, ext=0 +}; + +def macroop PADDD_MMX_P { + rdip t7 + ldfp ufp1, seg, riprel, disp, dataSize=8 + maddi mmx, mmx, ufp1, size=4, ext=0 +}; + +def macroop PADDQ_MMX_MMX { + maddi mmx, mmx, mmxm, size=8, ext=0 +}; + +def macroop PADDQ_MMX_M { + ldfp ufp1, seg, sib, disp, dataSize=8 + maddi mmx, mmx, ufp1, size=8, ext=0 +}; + +def macroop PADDQ_MMX_P { + rdip t7 + ldfp ufp1, seg, riprel, disp, dataSize=8 + maddi mmx, mmx, ufp1, size=8, ext=0 +}; + +def macroop PADDSB_MMX_MMX { + maddi mmx, mmx, mmxm, size=1, ext=4 +}; + +def macroop PADDSB_MMX_M { + ldfp ufp1, seg, sib, disp, dataSize=8 + maddi mmx, mmx, ufp1, size=1, ext=4 +}; + +def macroop PADDSB_MMX_P { + rdip t7 + ldfp ufp1, seg, riprel, disp, dataSize=8 + maddi mmx, mmx, ufp1, size=1, ext=4 +}; + +def macroop PADDSW_MMX_MMX { + maddi mmx, mmx, mmxm, size=2, ext=4 +}; + +def macroop PADDSW_MMX_M { + ldfp ufp1, seg, sib, disp, dataSize=8 + maddi mmx, mmx, ufp1, size=2, ext=4 +}; + +def macroop PADDSW_MMX_P { + rdip t7 + ldfp ufp1, seg, riprel, disp, dataSize=8 + maddi mmx, mmx, ufp1, size=2, ext=4 +}; + +def macroop PADDUSB_MMX_MMX { + maddi mmx, mmx, mmxm, size=1, ext=2 +}; + +def macroop PADDUSB_MMX_M { + ldfp ufp1, seg, sib, disp, dataSize=8 + maddi mmx, mmx, ufp1, size=1, ext=2 +}; + +def macroop PADDUSB_MMX_P { + rdip t7 + ldfp ufp1, seg, riprel, disp, dataSize=8 + maddi mmx, mmx, ufp1, size=1, ext=2 +}; + +def macroop PADDUSW_MMX_MMX { + maddi mmx, mmx, mmxm, size=2, ext=2 +}; + +def macroop PADDUSW_MMX_M { + ldfp ufp1, seg, sib, disp, dataSize=8 + maddi mmx, mmx, ufp1, size=2, ext=2 +}; + +def macroop PADDUSW_MMX_P { + rdip t7 + ldfp ufp1, seg, riprel, disp, dataSize=8 + maddi mmx, mmx, ufp1, size=2, ext=2 +}; ''' -- cgit v1.2.3