X86: Implement the fld, fst, and fstp instructions.

--HG--
extra : convert_revision : 7dd274bdc3c34839c17d9012a745d7c95dfcfdd8
This commit is contained in:
Gabe Black 2007-09-19 18:28:34 -07:00
parent a75b6f5106
commit 3cd95a2748
2 changed files with 35 additions and 6 deletions

View file

@ -242,14 +242,14 @@
0x5: decode MODRM_REG {
0x0: decode MODRM_MOD {
0x3: ffree();
default: fld();
default: Inst::FLD(Mq);
}
0x1: decode MODRM_MOD {
0x3: Inst::UD2();
default: fisttp();
}
0x2: fst();
0x3: fstp();
0x2: Inst::FST(Mq);
0x3: Inst::FSTP(Mq);
0x4: decode MODRM_MOD {
0x3: fucom();
default: frstor();

View file

@ -54,7 +54,36 @@
# Authors: Gabe Black
microcode = '''
# FLD
# FST
# FSTP
def macroop FLD_M {
ldfp ufp1, seg, sib, disp
movfp st(1), ufp1, spm=-1
};
def macroop FLD_P {
rdip t7
ldfp ufp1, seg, riprel, disp
movfp st(1), ufp1, spm=-1
};
def macroop FST_M {
movfp st(0), ufp1
stfp ufp1, seg, sib, disp
};
def macroop FST_P {
movfp st(0), ufp1
rdip t7
stfp ufp1, seg, riprel, disp
};
def macroop FSTP_M {
movfp st(0), ufp1, spm=1
stfp ufp1, seg, sib, disp
};
def macroop FSTP_P {
movfp st(0), ufp1, spm=1
rdip t7
stfp ufp1, seg, riprel, disp
};
'''