X86: Implement the floating point media add instructions.

This commit is contained in:
Gabe Black 2009-08-17 18:35:06 -07:00
parent df163284fc
commit 49c2610c04
2 changed files with 60 additions and 9 deletions

View file

@ -504,7 +504,7 @@
0x0B: decode LEGACY_DECODEVAL { 0x0B: decode LEGACY_DECODEVAL {
// no prefix // no prefix
0x0: decode OPCODE_OP_BOTTOM3 { 0x0: decode OPCODE_OP_BOTTOM3 {
0x0: addps_Vo_Wo(); 0x0: Inst::ADDPS(Vo,Wo);
0x1: mulps_Vo_Wo(); 0x1: mulps_Vo_Wo();
0x2: cvtps2pd_Vo_Wq(); 0x2: cvtps2pd_Vo_Wq();
0x3: cvtdq2ps_Vo_Wo(); 0x3: cvtdq2ps_Vo_Wo();
@ -515,7 +515,7 @@
} }
// repe (0xF3) // repe (0xF3)
0x4: decode OPCODE_OP_BOTTOM3 { 0x4: decode OPCODE_OP_BOTTOM3 {
0x0: addss_Vd_Wd(); 0x0: Inst::ADDSS(Vd,Wd);
0x1: mulss_Vd_Wd(); 0x1: mulss_Vd_Wd();
0x2: cvtss2sd_Vq_Wd(); 0x2: cvtss2sd_Vq_Wd();
0x3: cvttps2dq_Vo_Wo(); 0x3: cvttps2dq_Vo_Wo();
@ -526,7 +526,7 @@
} }
// operand size (0x66) // operand size (0x66)
0x1: decode OPCODE_OP_BOTTOM3 { 0x1: decode OPCODE_OP_BOTTOM3 {
0x0: addpd_Vo_Wo(); 0x0: Inst::ADDPD(Vo,Wo);
0x1: mulpd_Vo_Wo(); 0x1: mulpd_Vo_Wo();
0x2: cvtpd2ps_Vo_Wo(); 0x2: cvtpd2ps_Vo_Wo();
0x3: cvtps2dq_Vo_Wo(); 0x3: cvtps2dq_Vo_Wo();

View file

@ -54,22 +54,73 @@
# Authors: Gabe Black # Authors: Gabe Black
microcode = ''' microcode = '''
# ADDPS def macroop ADDSS_XMM_XMM {
# ADDPD maddf xmml, xmml, xmmlm, size=4, ext=1
# ADDSS };
def macroop ADDSS_XMM_M {
ldfp ufp1, seg, sib, disp, dataSize=8
maddf xmml, xmml, ufp1, size=4, ext=1
};
def macroop ADDSS_XMM_P {
rdip t7
ldfp ufp1, seg, riprel, disp, dataSize=8
maddf xmml, xmml, ufp1, size=4, ext=1
};
def macroop ADDSD_XMM_XMM { def macroop ADDSD_XMM_XMM {
addfp xmml, xmml, xmmlm maddf xmml, xmml, xmmlm, size=8, ext=1
}; };
def macroop ADDSD_XMM_M { def macroop ADDSD_XMM_M {
ldfp ufp1, seg, sib, disp, dataSize=8 ldfp ufp1, seg, sib, disp, dataSize=8
addfp xmml, xmml, ufp1 maddf xmml, xmml, ufp1, size=8, ext=1
}; };
def macroop ADDSD_XMM_P { def macroop ADDSD_XMM_P {
rdip t7 rdip t7
ldfp ufp1, seg, riprel, disp, dataSize=8 ldfp ufp1, seg, riprel, disp, dataSize=8
addfp xmml, xmml, ufp1 maddf xmml, xmml, ufp1, size=8, ext=1
};
def macroop ADDPS_XMM_XMM {
maddf xmml, xmml, xmmlm, size=4, ext=0
maddf xmmh, xmmh, xmmhm, size=4, ext=0
};
def macroop ADDPS_XMM_M {
ldfp ufp1, seg, sib, "DISPLACEMENT", dataSize=8
ldfp ufp2, seg, sib, "DISPLACEMENT + 8", dataSize=8
maddf xmml, xmml, ufp1, size=4, ext=0
maddf xmmh, xmmh, ufp2, size=4, ext=0
};
def macroop ADDPS_XMM_P {
rdip t7
ldfp ufp1, seg, riprel, "DISPLACEMENT", dataSize=8
ldfp ufp2, seg, riprel, "DISPLACEMENT + 8", dataSize=8
maddf xmml, xmml, ufp1, size=4, ext=0
maddf xmmh, xmmh, ufp2, size=4, ext=0
};
def macroop ADDPD_XMM_XMM {
maddf xmml, xmml, xmmlm, size=8, ext=0
maddf xmmh, xmmh, xmmhm, size=8, ext=0
};
def macroop ADDPD_XMM_M {
ldfp ufp1, seg, sib, "DISPLACEMENT", dataSize=8
ldfp ufp2, seg, sib, "DISPLACEMENT + 8", dataSize=8
maddf xmml, xmml, ufp1, size=8, ext=0
maddf xmmh, xmmh, ufp2, size=8, ext=0
};
def macroop ADDPD_XMM_P {
rdip t7
ldfp ufp1, seg, riprel, "DISPLACEMENT", dataSize=8
ldfp ufp2, seg, riprel, "DISPLACEMENT + 8", dataSize=8
maddf xmml, xmml, ufp1, size=8, ext=0
maddf xmmh, xmmh, ufp2, size=8, ext=0
}; };
''' '''