From 31d29ee3f8209a43e325cfe0373e9081a263ad36 Mon Sep 17 00:00:00 2001 From: Gabe Black Date: Mon, 17 Aug 2009 20:15:15 -0700 Subject: X86: Implement the media integer subtract instructions. --- .../simd128/integer/arithmetic/subtraction.py | 167 ++++++++++++++++++++- .../insts/simd64/integer/arithmetic/subtraction.py | 127 +++++++++++++++- 2 files changed, 278 insertions(+), 16 deletions(-) (limited to 'src/arch/x86/isa/insts') diff --git a/src/arch/x86/isa/insts/simd128/integer/arithmetic/subtraction.py b/src/arch/x86/isa/insts/simd128/integer/arithmetic/subtraction.py index 44781eb55..fdfb08667 100644 --- a/src/arch/x86/isa/insts/simd128/integer/arithmetic/subtraction.py +++ b/src/arch/x86/isa/insts/simd128/integer/arithmetic/subtraction.py @@ -54,12 +54,163 @@ # Authors: Gabe Black microcode = ''' -# PSUBB -# PSUBW -# PSUBD -# PSUBQ -# PSUBSB -# PSUBSW -# PSUBUSB -# PSUBUSW +def macroop PSUBB_XMM_XMM { + msubi xmml, xmml, xmmlm, size=1, ext=0 + msubi xmmh, xmmh, xmmhm, size=1, ext=0 +}; + +def macroop PSUBB_XMM_M { + ldfp ufp1, seg, sib, "DISPLACEMENT", dataSize=8 + ldfp ufp2, seg, sib, "DISPLACEMENT + 8", dataSize=8 + msubi xmml, xmml, ufp1, size=1, ext=0 + msubi xmmh, xmmh, ufp2, size=1, ext=0 +}; + +def macroop PSUBB_XMM_P { + rdip t7 + ldfp ufp1, seg, riprel, "DISPLACEMENT", dataSize=8 + ldfp ufp2, seg, riprel, "DISPLACEMENT + 8", dataSize=8 + msubi xmml, xmml, ufp1, size=1, ext=0 + msubi xmmh, xmmh, ufp2, size=1, ext=0 +}; + +def macroop PSUBW_XMM_XMM { + msubi xmml, xmml, xmmlm, size=2, ext=0 + msubi xmmh, xmmh, xmmhm, size=2, ext=0 +}; + +def macroop PSUBW_XMM_M { + ldfp ufp1, seg, sib, "DISPLACEMENT", dataSize=8 + ldfp ufp2, seg, sib, "DISPLACEMENT + 8", dataSize=8 + msubi xmml, xmml, ufp1, size=2, ext=0 + msubi xmmh, xmmh, ufp2, size=2, ext=0 +}; + +def macroop PSUBW_XMM_P { + rdip t7 + ldfp ufp1, seg, riprel, "DISPLACEMENT", dataSize=8 + ldfp ufp2, seg, riprel, "DISPLACEMENT + 8", dataSize=8 + msubi xmml, xmml, ufp1, size=2, ext=0 + msubi xmmh, xmmh, ufp2, size=2, ext=0 +}; + +def macroop PSUBD_XMM_XMM { + msubi xmml, xmml, xmmlm, size=4, ext=0 + msubi xmmh, xmmh, xmmhm, size=4, ext=0 +}; + +def macroop PSUBD_XMM_M { + ldfp ufp1, seg, sib, "DISPLACEMENT", dataSize=8 + ldfp ufp2, seg, sib, "DISPLACEMENT + 8", dataSize=8 + msubi xmml, xmml, ufp1, size=4, ext=0 + msubi xmmh, xmmh, ufp2, size=4, ext=0 +}; + +def macroop PSUBD_XMM_P { + rdip t7 + ldfp ufp1, seg, riprel, "DISPLACEMENT", dataSize=8 + ldfp ufp2, seg, riprel, "DISPLACEMENT + 8", dataSize=8 + msubi xmml, xmml, ufp1, size=4, ext=0 + msubi xmmh, xmmh, ufp2, size=4, ext=0 +}; + +def macroop PSUBQ_XMM_XMM { + msubi xmml, xmml, xmmlm, size=8, ext=0 + msubi xmmh, xmmh, xmmhm, size=8, ext=0 +}; + +def macroop PSUBQ_XMM_M { + ldfp ufp1, seg, sib, "DISPLACEMENT", dataSize=8 + ldfp ufp2, seg, sib, "DISPLACEMENT + 8", dataSize=8 + msubi xmml, xmml, ufp1, size=8, ext=0 + msubi xmmh, xmmh, ufp2, size=8, ext=0 +}; + +def macroop PSUBQ_XMM_P { + rdip t7 + ldfp ufp1, seg, riprel, "DISPLACEMENT", dataSize=8 + ldfp ufp2, seg, riprel, "DISPLACEMENT + 8", dataSize=8 + msubi xmml, xmml, ufp1, size=8, ext=0 + msubi xmmh, xmmh, ufp2, size=8, ext=0 +}; + +def macroop PSUBSB_XMM_XMM { + msubi xmml, xmml, xmmlm, size=1, ext=4 + msubi xmmh, xmmh, xmmhm, size=1, ext=4 +}; + +def macroop PSUBSB_XMM_M { + ldfp ufp1, seg, sib, "DISPLACEMENT", dataSize=8 + ldfp ufp2, seg, sib, "DISPLACEMENT + 8", dataSize=8 + msubi xmml, xmml, ufp1, size=1, ext=4 + msubi xmmh, xmmh, ufp2, size=1, ext=4 +}; + +def macroop PSUBSB_XMM_P { + rdip t7 + ldfp ufp1, seg, riprel, "DISPLACEMENT", dataSize=8 + ldfp ufp2, seg, riprel, "DISPLACEMENT + 8", dataSize=8 + msubi xmml, xmml, ufp1, size=1, ext=4 + msubi xmmh, xmmh, ufp2, size=1, ext=4 +}; + +def macroop PSUBSW_XMM_XMM { + msubi xmml, xmml, xmmlm, size=2, ext=4 + msubi xmmh, xmmh, xmmhm, size=2, ext=4 +}; + +def macroop PSUBSW_XMM_M { + ldfp ufp1, seg, sib, "DISPLACEMENT", dataSize=8 + ldfp ufp2, seg, sib, "DISPLACEMENT + 8", dataSize=8 + msubi xmml, xmml, ufp1, size=2, ext=4 + msubi xmmh, xmmh, ufp2, size=2, ext=4 +}; + +def macroop PSUBSW_XMM_P { + rdip t7 + ldfp ufp1, seg, riprel, "DISPLACEMENT", dataSize=8 + ldfp ufp2, seg, riprel, "DISPLACEMENT + 8", dataSize=8 + msubi xmml, xmml, ufp1, size=2, ext=4 + msubi xmmh, xmmh, ufp2, size=2, ext=4 +}; + +def macroop PSUBUSB_XMM_XMM { + msubi xmml, xmml, xmmlm, size=1, ext=2 + msubi xmmh, xmmh, xmmhm, size=1, ext=2 +}; + +def macroop PSUBUSB_XMM_M { + ldfp ufp1, seg, sib, "DISPLACEMENT", dataSize=8 + ldfp ufp2, seg, sib, "DISPLACEMENT + 8", dataSize=8 + msubi xmml, xmml, ufp1, size=1, ext=2 + msubi xmmh, xmmh, ufp2, size=1, ext=2 +}; + +def macroop PSUBUSB_XMM_P { + rdip t7 + ldfp ufp1, seg, riprel, "DISPLACEMENT", dataSize=8 + ldfp ufp2, seg, riprel, "DISPLACEMENT + 8", dataSize=8 + msubi xmml, xmml, ufp1, size=1, ext=2 + msubi xmmh, xmmh, ufp2, size=1, ext=2 +}; + +def macroop PSUBUSW_XMM_XMM { + msubi xmml, xmml, xmmlm, size=2, ext=2 + msubi xmmh, xmmh, xmmhm, size=2, ext=2 +}; + +def macroop PSUBUSW_XMM_M { + ldfp ufp1, seg, sib, "DISPLACEMENT", dataSize=8 + ldfp ufp2, seg, sib, "DISPLACEMENT + 8", dataSize=8 + msubi xmml, xmml, ufp1, size=2, ext=2 + msubi xmmh, xmmh, ufp2, size=2, ext=2 +}; + +def macroop PSUBUSW_XMM_P { + rdip t7 + ldfp ufp1, seg, riprel, "DISPLACEMENT", dataSize=8 + ldfp ufp2, seg, riprel, "DISPLACEMENT + 8", dataSize=8 + msubi xmml, xmml, ufp1, size=2, ext=2 + msubi xmmh, xmmh, ufp2, size=2, ext=2 +}; ''' diff --git a/src/arch/x86/isa/insts/simd64/integer/arithmetic/subtraction.py b/src/arch/x86/isa/insts/simd64/integer/arithmetic/subtraction.py index 44781eb55..a60c0b1a8 100644 --- a/src/arch/x86/isa/insts/simd64/integer/arithmetic/subtraction.py +++ b/src/arch/x86/isa/insts/simd64/integer/arithmetic/subtraction.py @@ -54,12 +54,123 @@ # Authors: Gabe Black microcode = ''' -# PSUBB -# PSUBW -# PSUBD -# PSUBQ -# PSUBSB -# PSUBSW -# PSUBUSB -# PSUBUSW +def macroop PSUBB_MMX_MMX { + msubi mmx, mmx, mmxm, size=1, ext=0 +}; + +def macroop PSUBB_MMX_M { + ldfp ufp1, seg, sib, disp, dataSize=8 + msubi mmx, mmx, ufp1, size=1, ext=0 +}; + +def macroop PSUBB_MMX_P { + rdip t7 + ldfp ufp1, seg, riprel, disp, dataSize=8 + msubi mmx, mmx, ufp1, size=1, ext=0 +}; + +def macroop PSUBW_MMX_MMX { + msubi mmx, mmx, mmxm, size=2, ext=0 +}; + +def macroop PSUBW_MMX_M { + ldfp ufp1, seg, sib, disp, dataSize=8 + msubi mmx, mmx, ufp1, size=2, ext=0 +}; + +def macroop PSUBW_MMX_P { + rdip t7 + ldfp ufp1, seg, riprel, disp, dataSize=8 + msubi mmx, mmx, ufp1, size=2, ext=0 +}; + +def macroop PSUBD_MMX_MMX { + msubi mmx, mmx, mmxm, size=4, ext=0 +}; + +def macroop PSUBD_MMX_M { + ldfp ufp1, seg, sib, disp, dataSize=8 + msubi mmx, mmx, ufp1, size=4, ext=0 +}; + +def macroop PSUBD_MMX_P { + rdip t7 + ldfp ufp1, seg, riprel, disp, dataSize=8 + msubi mmx, mmx, ufp1, size=4, ext=0 +}; + +def macroop PSUBQ_MMX_MMX { + msubi mmx, mmx, mmxm, size=8, ext=0 +}; + +def macroop PSUBQ_MMX_M { + ldfp ufp1, seg, sib, disp, dataSize=8 + msubi mmx, mmx, ufp1, size=8, ext=0 +}; + +def macroop PSUBQ_MMX_P { + rdip t7 + ldfp ufp1, seg, riprel, disp, dataSize=8 + msubi mmx, mmx, ufp1, size=8, ext=0 +}; + +def macroop PSUBSB_MMX_MMX { + msubi mmx, mmx, mmxm, size=1, ext=4 +}; + +def macroop PSUBSB_MMX_M { + ldfp ufp1, seg, sib, disp, dataSize=8 + msubi mmx, mmx, ufp1, size=1, ext=4 +}; + +def macroop PSUBSB_MMX_P { + rdip t7 + ldfp ufp1, seg, riprel, disp, dataSize=8 + msubi mmx, mmx, ufp1, size=1, ext=4 +}; + +def macroop PSUBSW_MMX_MMX { + msubi mmx, mmx, mmxm, size=2, ext=4 +}; + +def macroop PSUBSW_MMX_M { + ldfp ufp1, seg, sib, disp, dataSize=8 + msubi mmx, mmx, ufp1, size=2, ext=4 +}; + +def macroop PSUBSW_MMX_P { + rdip t7 + ldfp ufp1, seg, riprel, disp, dataSize=8 + msubi mmx, mmx, ufp1, size=2, ext=4 +}; + +def macroop PSUBUSB_MMX_MMX { + msubi mmx, mmx, mmxm, size=1, ext=2 +}; + +def macroop PSUBUSB_MMX_M { + ldfp ufp1, seg, sib, disp, dataSize=8 + msubi mmx, mmx, ufp1, size=1, ext=2 +}; + +def macroop PSUBUSB_MMX_P { + rdip t7 + ldfp ufp1, seg, riprel, disp, dataSize=8 + msubi mmx, mmx, ufp1, size=1, ext=2 +}; + +def macroop PSUBUSW_MMX_MMX { + msubi mmx, mmx, mmxm, size=2, ext=2 +}; + +def macroop PSUBUSW_MMX_M { + ldfp ufp1, seg, sib, disp, dataSize=8 + msubi mmx, mmx, ufp1, size=2, ext=2 +}; + +def macroop PSUBUSW_MMX_P { + rdip t7 + ldfp ufp1, seg, riprel, disp, dataSize=8 + msubi mmx, mmx, ufp1, size=2, ext=2 +}; ''' -- cgit v1.2.3