# Authors: Gabe Black
microcode = '''
-# PADDB
-# PADDW
-# PADDD
-# PADDQ
-# PADDSB
-# PADDSW
-# PADDUSB
-# PADDUSW
+def macroop PADDB_XMM_XMM {
+ maddi xmml, xmml, xmmlm, size=1, ext=0
+ maddi xmmh, xmmh, xmmhm, size=1, ext=0
+};
+
+def macroop PADDB_XMM_M {
+ ldfp ufp1, seg, sib, "DISPLACEMENT", dataSize=8
+ ldfp ufp2, seg, sib, "DISPLACEMENT + 8", dataSize=8
+ maddi xmml, xmml, ufp1, size=1, ext=0
+ maddi xmmh, xmmh, ufp2, size=1, ext=0
+};
+
+def macroop PADDB_XMM_P {
+ rdip t7
+ ldfp ufp1, seg, riprel, "DISPLACEMENT", dataSize=8
+ ldfp ufp2, seg, riprel, "DISPLACEMENT + 8", dataSize=8
+ maddi xmml, xmml, ufp1, size=1, ext=0
+ maddi xmmh, xmmh, ufp2, size=1, ext=0
+};
+
+def macroop PADDW_XMM_XMM {
+ maddi xmml, xmml, xmmlm, size=2, ext=0
+ maddi xmmh, xmmh, xmmhm, size=2, ext=0
+};
+
+def macroop PADDW_XMM_M {
+ ldfp ufp1, seg, sib, "DISPLACEMENT", dataSize=8
+ ldfp ufp2, seg, sib, "DISPLACEMENT + 8", dataSize=8
+ maddi xmml, xmml, ufp1, size=2, ext=0
+ maddi xmmh, xmmh, ufp2, size=2, ext=0
+};
+
+def macroop PADDW_XMM_P {
+ rdip t7
+ ldfp ufp1, seg, riprel, "DISPLACEMENT", dataSize=8
+ ldfp ufp2, seg, riprel, "DISPLACEMENT + 8", dataSize=8
+ maddi xmml, xmml, ufp1, size=2, ext=0
+ maddi xmmh, xmmh, ufp2, size=2, ext=0
+};
+
+def macroop PADDD_XMM_XMM {
+ maddi xmml, xmml, xmmlm, size=4, ext=0
+ maddi xmmh, xmmh, xmmhm, size=4, ext=0
+};
+
+def macroop PADDD_XMM_M {
+ ldfp ufp1, seg, sib, "DISPLACEMENT", dataSize=8
+ ldfp ufp2, seg, sib, "DISPLACEMENT + 8", dataSize=8
+ maddi xmml, xmml, ufp1, size=4, ext=0
+ maddi xmmh, xmmh, ufp2, size=4, ext=0
+};
+
+def macroop PADDD_XMM_P {
+ rdip t7
+ ldfp ufp1, seg, riprel, "DISPLACEMENT", dataSize=8
+ ldfp ufp2, seg, riprel, "DISPLACEMENT + 8", dataSize=8
+ maddi xmml, xmml, ufp1, size=4, ext=0
+ maddi xmmh, xmmh, ufp2, size=4, ext=0
+};
+
+def macroop PADDQ_XMM_XMM {
+ maddi xmml, xmml, xmmlm, size=8, ext=0
+ maddi xmmh, xmmh, xmmhm, size=8, ext=0
+};
+
+def macroop PADDQ_XMM_M {
+ ldfp ufp1, seg, sib, "DISPLACEMENT", dataSize=8
+ ldfp ufp2, seg, sib, "DISPLACEMENT + 8", dataSize=8
+ maddi xmml, xmml, ufp1, size=8, ext=0
+ maddi xmmh, xmmh, ufp2, size=8, ext=0
+};
+
+def macroop PADDQ_XMM_P {
+ rdip t7
+ ldfp ufp1, seg, riprel, "DISPLACEMENT", dataSize=8
+ ldfp ufp2, seg, riprel, "DISPLACEMENT + 8", dataSize=8
+ maddi xmml, xmml, ufp1, size=8, ext=0
+ maddi xmmh, xmmh, ufp2, size=8, ext=0
+};
+
+def macroop PADDSB_XMM_XMM {
+ maddi xmml, xmml, xmmlm, size=1, ext=4
+ maddi xmmh, xmmh, xmmhm, size=1, ext=4
+};
+
+def macroop PADDSB_XMM_M {
+ ldfp ufp1, seg, sib, "DISPLACEMENT", dataSize=8
+ ldfp ufp2, seg, sib, "DISPLACEMENT + 8", dataSize=8
+ maddi xmml, xmml, ufp1, size=1, ext=4
+ maddi xmmh, xmmh, ufp2, size=1, ext=4
+};
+
+def macroop PADDSB_XMM_P {
+ rdip t7
+ ldfp ufp1, seg, riprel, "DISPLACEMENT", dataSize=8
+ ldfp ufp2, seg, riprel, "DISPLACEMENT + 8", dataSize=8
+ maddi xmml, xmml, ufp1, size=1, ext=4
+ maddi xmmh, xmmh, ufp2, size=1, ext=4
+};
+
+def macroop PADDSW_XMM_XMM {
+ maddi xmml, xmml, xmmlm, size=2, ext=4
+ maddi xmmh, xmmh, xmmhm, size=2, ext=4
+};
+
+def macroop PADDSW_XMM_M {
+ ldfp ufp1, seg, sib, "DISPLACEMENT", dataSize=8
+ ldfp ufp2, seg, sib, "DISPLACEMENT + 8", dataSize=8
+ maddi xmml, xmml, ufp1, size=2, ext=4
+ maddi xmmh, xmmh, ufp2, size=2, ext=4
+};
+
+def macroop PADDSW_XMM_P {
+ rdip t7
+ ldfp ufp1, seg, riprel, "DISPLACEMENT", dataSize=8
+ ldfp ufp2, seg, riprel, "DISPLACEMENT + 8", dataSize=8
+ maddi xmml, xmml, ufp1, size=2, ext=4
+ maddi xmmh, xmmh, ufp2, size=2, ext=4
+};
+
+def macroop PADDUSB_XMM_XMM {
+ maddi xmml, xmml, xmmlm, size=1, ext=2
+ maddi xmmh, xmmh, xmmhm, size=1, ext=2
+};
+
+def macroop PADDUSB_XMM_M {
+ ldfp ufp1, seg, sib, "DISPLACEMENT", dataSize=8
+ ldfp ufp2, seg, sib, "DISPLACEMENT + 8", dataSize=8
+ maddi xmml, xmml, ufp1, size=1, ext=2
+ maddi xmmh, xmmh, ufp2, size=1, ext=2
+};
+
+def macroop PADDUSB_XMM_P {
+ rdip t7
+ ldfp ufp1, seg, riprel, "DISPLACEMENT", dataSize=8
+ ldfp ufp2, seg, riprel, "DISPLACEMENT + 8", dataSize=8
+ maddi xmml, xmml, ufp1, size=1, ext=2
+ maddi xmmh, xmmh, ufp2, size=1, ext=2
+};
+
+def macroop PADDUSW_XMM_XMM {
+ maddi xmml, xmml, xmmlm, size=2, ext=2
+ maddi xmmh, xmmh, xmmhm, size=2, ext=2
+};
+
+def macroop PADDUSW_XMM_M {
+ ldfp ufp1, seg, sib, "DISPLACEMENT", dataSize=8
+ ldfp ufp2, seg, sib, "DISPLACEMENT + 8", dataSize=8
+ maddi xmml, xmml, ufp1, size=2, ext=2
+ maddi xmmh, xmmh, ufp2, size=2, ext=2
+};
+
+def macroop PADDUSW_XMM_P {
+ rdip t7
+ ldfp ufp1, seg, riprel, "DISPLACEMENT", dataSize=8
+ ldfp ufp2, seg, riprel, "DISPLACEMENT + 8", dataSize=8
+ maddi xmml, xmml, ufp1, size=2, ext=2
+ maddi xmmh, xmmh, ufp2, size=2, ext=2
+};
'''
# 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
+};
'''