# 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
+};
'''
# 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
+};
'''