X86: Implement the instructions that compare fp values and write masks as the result.

This commit is contained in:
Gabe Black 2009-08-17 20:04:02 -07:00
parent f122c93faa
commit 35b0983ca9
3 changed files with 220 additions and 24 deletions

View file

@ -549,9 +549,9 @@
0x1: Inst::PUNPCKLWD(Pq,Qd);
0x2: Inst::PUNPCKLDQ(Pq,Qd);
0x3: Inst::PACKSSWB(Pq,Qq);
0x4: pcmpgtb_Pq_Qq();
0x5: pcmpgtw_Pq_Qq();
0x6: pcmpgtd_Pq_Qq();
0x4: Inst::PCMPGTB(Pq,Qq);
0x5: Inst::PCMPGTW(Pq,Qq);
0x6: Inst::PCMPGTD(Pq,Qq);
0x7: Inst::PACKUSWB(Pq,Qq);
}
// operand size (0x66)
@ -560,9 +560,9 @@
0x1: Inst::PUNPCKLWD(Vo,Wq);
0x2: Inst::PUNPCKLDQ(Vo,Wq);
0x3: Inst::PACKSSWB(Vo,Wo);
0x4: pcmpgtb_Vo_Wo();
0x5: pcmpgtw_Vo_Wo();
0x6: pcmpgtd_Vo_Wo();
0x4: Inst::PCMPGTB(Vo,Wo);
0x5: Inst::PCMPGTW(Vo,Wo);
0x6: Inst::PCMPGTD(Vo,Wo);
0x7: Inst::PACKUSWB(Vo,Wo);
}
default: Inst::UD2();
@ -652,9 +652,9 @@
}
default: Inst::UD2();
}
0x4: pcmpeqb_Pq_Qq();
0x5: pcmpeqw_Pq_Qq();
0x6: pcmpeqd_Pq_Qq();
0x4: Inst::PCMPEQB(Pq,Qq);
0x5: Inst::PCMPEQW(Pq,Qq);
0x6: Inst::PCMPEQD(Pq,Qq);
0x7: emms();
}
// repe (0xF3)
@ -717,9 +717,9 @@
}
default: Inst::UD2();
}
0x4: pcmpeqb_Vo_Wo();
0x5: pcmpeqw_Vo_Wo();
0x6: pcmpeqd_Vo_Wo();
0x4: Inst::PCMPEQB(Vo,Wo);
0x5: Inst::PCMPEQW(Vo,Wo);
0x6: Inst::PCMPEQD(Vo,Wo);
default: Inst::UD2();
}
// repne (0xF2)

View file

@ -54,10 +54,123 @@
# Authors: Gabe Black
microcode = '''
# PCMPEQB
# PCMPEQW
# PCMPEQD
# PCMPGTB
# PCMPGTW
# PCMPGTD
def macroop PCMPEQB_XMM_XMM {
mcmpi2r xmml, xmml, xmmlm, size=1, ext=0
mcmpi2r xmmh, xmmh, xmmhm, size=1, ext=0
};
def macroop PCMPEQB_XMM_M {
ldfp ufp1, seg, sib, "DISPLACEMENT", dataSize=8
ldfp ufp2, seg, sib, "DISPLACEMENT + 8", dataSize=8
mcmpi2r xmml, xmml, ufp1, size=1, ext=0
mcmpi2r xmmh, xmmh, ufp2, size=1, ext=0
};
def macroop PCMPEQB_XMM_P {
rdip t7
ldfp ufp1, seg, riprel, "DISPLACEMENT", dataSize=8
ldfp ufp2, seg, riprel, "DISPLACEMENT + 8", dataSize=8
mcmpi2r xmml, xmml, ufp1, size=1, ext=0
mcmpi2r xmmh, xmmh, ufp2, size=1, ext=0
};
def macroop PCMPEQW_XMM_XMM {
mcmpi2r xmml, xmml, xmmlm, size=2, ext=0
mcmpi2r xmmh, xmmh, xmmhm, size=2, ext=0
};
def macroop PCMPEQW_XMM_M {
ldfp ufp1, seg, sib, "DISPLACEMENT", dataSize=8
ldfp ufp2, seg, sib, "DISPLACEMENT + 8", dataSize=8
mcmpi2r xmml, xmml, ufp1, size=2, ext=0
mcmpi2r xmmh, xmmh, ufp2, size=2, ext=0
};
def macroop PCMPEQW_XMM_P {
rdip t7
ldfp ufp1, seg, riprel, "DISPLACEMENT", dataSize=8
ldfp ufp2, seg, riprel, "DISPLACEMENT + 8", dataSize=8
mcmpi2r xmml, xmml, ufp1, size=2, ext=0
mcmpi2r xmmh, xmmh, ufp2, size=2, ext=0
};
def macroop PCMPEQD_XMM_XMM {
mcmpi2r xmml, xmml, xmmlm, size=4, ext=0
mcmpi2r xmmh, xmmh, xmmhm, size=4, ext=0
};
def macroop PCMPEQD_XMM_M {
ldfp ufp1, seg, sib, "DISPLACEMENT", dataSize=8
ldfp ufp2, seg, sib, "DISPLACEMENT + 8", dataSize=8
mcmpi2r xmml, xmml, ufp1, size=4, ext=0
mcmpi2r xmmh, xmmh, ufp2, size=4, ext=0
};
def macroop PCMPEQD_XMM_P {
rdip t7
ldfp ufp1, seg, riprel, "DISPLACEMENT", dataSize=8
ldfp ufp2, seg, riprel, "DISPLACEMENT + 8", dataSize=8
mcmpi2r xmml, xmml, ufp1, size=4, ext=0
mcmpi2r xmmh, xmmh, ufp2, size=4, ext=0
};
def macroop PCMPGTB_XMM_XMM {
mcmpi2r xmml, xmml, xmmlm, size=1, ext=2
mcmpi2r xmmh, xmmh, xmmhm, size=1, ext=2
};
def macroop PCMPGTB_XMM_M {
ldfp ufp1, seg, sib, "DISPLACEMENT", dataSize=8
ldfp ufp2, seg, sib, "DISPLACEMENT + 8", dataSize=8
mcmpi2r xmml, xmml, ufp1, size=1, ext=2
mcmpi2r xmmh, xmmh, ufp2, size=1, ext=2
};
def macroop PCMPGTB_XMM_P {
rdip t7
ldfp ufp1, seg, riprel, "DISPLACEMENT", dataSize=8
ldfp ufp2, seg, riprel, "DISPLACEMENT + 8", dataSize=8
mcmpi2r xmml, xmml, ufp1, size=1, ext=2
mcmpi2r xmmh, xmmh, ufp2, size=1, ext=2
};
def macroop PCMPGTW_XMM_XMM {
mcmpi2r xmml, xmml, xmmlm, size=2, ext=2
mcmpi2r xmmh, xmmh, xmmhm, size=2, ext=2
};
def macroop PCMPGTW_XMM_M {
ldfp ufp1, seg, sib, "DISPLACEMENT", dataSize=8
ldfp ufp2, seg, sib, "DISPLACEMENT + 8", dataSize=8
mcmpi2r xmml, xmml, ufp1, size=2, ext=2
mcmpi2r xmmh, xmmh, ufp2, size=2, ext=2
};
def macroop PCMPGTW_XMM_P {
rdip t7
ldfp ufp1, seg, riprel, "DISPLACEMENT", dataSize=8
ldfp ufp2, seg, riprel, "DISPLACEMENT + 8", dataSize=8
mcmpi2r xmml, xmml, ufp1, size=2, ext=2
mcmpi2r xmmh, xmmh, ufp2, size=2, ext=2
};
def macroop PCMPGTD_XMM_XMM {
mcmpi2r xmml, xmml, xmmlm, size=4, ext=2
mcmpi2r xmmh, xmmh, xmmhm, size=4, ext=2
};
def macroop PCMPGTD_XMM_M {
ldfp ufp1, seg, sib, "DISPLACEMENT", dataSize=8
ldfp ufp2, seg, sib, "DISPLACEMENT + 8", dataSize=8
mcmpi2r xmml, xmml, ufp1, size=4, ext=2
mcmpi2r xmmh, xmmh, ufp2, size=4, ext=2
};
def macroop PCMPGTD_XMM_P {
rdip t7
ldfp ufp1, seg, riprel, "DISPLACEMENT", dataSize=8
ldfp ufp2, seg, riprel, "DISPLACEMENT + 8", dataSize=8
mcmpi2r xmml, xmml, ufp1, size=4, ext=2
mcmpi2r xmmh, xmmh, ufp2, size=4, ext=2
};
'''

View file

@ -54,10 +54,93 @@
# Authors: Gabe Black
microcode = '''
# PCMPEQB
# PCMPEQW
# PCMPEQD
# PCMPGTB
# PCMPGTW
# PCMPGTD
def macroop PCMPEQB_MMX_MMX {
mcmpi2r mmx, mmx, mmxm, size=1, ext=0
};
def macroop PCMPEQB_MMX_M {
ldfp ufp1, seg, sib, disp, dataSize=8
mcmpi2r mmx, mmx, ufp1, size=1, ext=0
};
def macroop PCMPEQB_MMX_P {
rdip t7
ldfp ufp1, seg, riprel, disp, dataSize=8
mcmpi2r mmx, mmx, ufp1, size=1, ext=0
};
def macroop PCMPEQW_MMX_MMX {
mcmpi2r mmx, mmx, mmxm, size=2, ext=0
};
def macroop PCMPEQW_MMX_M {
ldfp ufp1, seg, sib, disp, dataSize=8
mcmpi2r mmx, mmx, ufp1, size=2, ext=0
};
def macroop PCMPEQW_MMX_P {
rdip t7
ldfp ufp1, seg, riprel, disp, dataSize=8
mcmpi2r mmx, mmx, ufp1, size=2, ext=0
};
def macroop PCMPEQD_MMX_MMX {
mcmpi2r mmx, mmx, mmxm, size=4, ext=0
};
def macroop PCMPEQD_MMX_M {
ldfp ufp1, seg, sib, disp, dataSize=8
mcmpi2r mmx, mmx, ufp1, size=4, ext=0
};
def macroop PCMPEQD_MMX_P {
rdip t7
ldfp ufp1, seg, riprel, disp, dataSize=8
mcmpi2r mmx, mmx, ufp1, size=4, ext=0
};
def macroop PCMPGTB_MMX_MMX {
mcmpi2r mmx, mmx, mmxm, size=1, ext=2
};
def macroop PCMPGTB_MMX_M {
ldfp ufp1, seg, sib, disp, dataSize=8
mcmpi2r mmx, mmx, ufp1, size=1, ext=2
};
def macroop PCMPGTB_MMX_P {
rdip t7
ldfp ufp1, seg, riprel, disp, dataSize=8
mcmpi2r mmx, mmx, ufp1, size=1, ext=2
};
def macroop PCMPGTW_MMX_MMX {
mcmpi2r mmx, mmx, mmxm, size=2, ext=2
};
def macroop PCMPGTW_MMX_M {
ldfp ufp1, seg, sib, disp, dataSize=8
mcmpi2r mmx, mmx, ufp1, size=2, ext=2
};
def macroop PCMPGTW_MMX_P {
rdip t7
ldfp ufp1, seg, riprel, disp, dataSize=8
mcmpi2r mmx, mmx, ufp1, size=2, ext=2
};
def macroop PCMPGTD_MMX_MMX {
mcmpi2r mmx, mmx, mmxm, size=4, ext=2
};
def macroop PCMPGTD_MMX_M {
ldfp ufp1, seg, sib, disp, dataSize=8
mcmpi2r mmx, mmx, ufp1, size=4, ext=2
};
def macroop PCMPGTD_MMX_P {
rdip t7
ldfp ufp1, seg, riprel, disp, dataSize=8
mcmpi2r mmx, mmx, ufp1, size=4, ext=2
};
'''