// 32-bit memory operand
default: Inst::FADD1(Md);
}
- 0x1: fmul();
+ 0x1: decode MODRM_MOD {
+ 0x3: Inst::FMUL1(Eq);
+ default: Inst::FMUL1(Md);
+ }
0x2: fcom();
0x3: fcomp();
0x4: decode MODRM_MOD {
default: Inst::FSUB1(Md);
}
0x5: fsubr();
- 0x6: fdiv();
+ 0x6: decode MODRM_MOD {
+ 0x3: Inst::FDIV1(Eq);
+ default: Inst::FDIV1(Md);
+ }
0x7: fdivr();
}
0x1: decode MODRM_REG {
0x3: Inst::FADD2(Eq);
default: Inst::FADD2(Mq);
}
- 0x1: fmul();
+ 0x1: decode MODRM_MOD {
+ 0x3: Inst::FMUL2(Eq);
+ default: Inst::FMUL2(Mq);
+ }
0x2: decode MODRM_MOD {
0x3: Inst::UD2();
default: fcom();
}
0x6: decode MODRM_MOD {
0x3: fdivr();
- default: fdiv();
+ default: Inst::FDIV2(Mq);
}
0x7: decode MODRM_MOD {
- 0x3: fdiv();
+ 0x3: Inst::FDIV2(Eq);
default: fdivr();
}
}
default: fiadd();
}
0x1: decode MODRM_MOD {
- 0x3: fmulp();
+ 0x3: Inst::FMULP(Eq);
default: fimul();
}
0x2: decode MODRM_MOD {
default: fidiv();
}
0x7: decode MODRM_MOD {
- 0x3: fdivp();
+ 0x3: Inst::FDIVP(Eq);
default: fidivr();
}
}
# Authors: Gabe Black
microcode = '''
-# FDIV
-# FDIVP
+def macroop FDIV1_R
+{
+ divfp st(0), st(0), sti
+};
+
+
+def macroop FDIV1_M
+{
+ ldfp87 ufp1, seg, sib, disp
+ divfp st(0), st(0), ufp1
+};
+
+def macroop FDIV1_P
+{
+ rdip t7
+ ldfp87 ufp1, seg, riprel, disp
+ divfp st(0), st(0), ufp1
+};
+
+def macroop FDIV2_R
+{
+ divfp sti, sti, st(0)
+};
+
+def macroop FDIV2_M
+{
+ ldfp87 ufp1, seg, sib, disp
+ divfp st(0), st(0), ufp1
+};
+
+def macroop FDIV2_P
+{
+ rdip t7
+ ldfp87 ufp1, seg, riprel, disp
+ divfp st(0), st(0), ufp1
+};
+
+def macroop FDIVP
+{
+ divfp st(1), st(1), st(0), spm=1
+};
+
+def macroop FDIVP_R
+{
+ divfp sti, sti, st(0), spm=1
+};
+
+def macroop FDIVP_M
+{
+ fault "std::make_shared<UnimpInstFault>()"
+};
+
+def macroop FDIVP_P
+{
+ fault "std::make_shared<UnimpInstFault>()"
+};
+
# FIDIV
# FDIVR
# FDIVRP
# Authors: Gabe Black
microcode = '''
-# FMUL
-# FMULP
+def macroop FMUL1_R
+{
+ mulfp st(0), sti, st(0)
+};
+
+
+def macroop FMUL1_M
+{
+ ldfp87 ufp1, seg, sib, disp
+ mulfp st(0), st(0), ufp1
+};
+
+def macroop FMUL1_P
+{
+ rdip t7
+ ldfp87 ufp1, seg, riprel, disp
+ mulfp st(0), st(0), ufp1
+};
+
+def macroop FMUL2_R
+{
+ mulfp sti, sti, st(0)
+};
+
+def macroop FMUL2_M
+{
+ ldfp87 ufp1, seg, sib, disp
+ mulfp st(0), st(0), ufp1
+};
+
+def macroop FMUL2_P
+{
+ rdip t7
+ ldfp87 ufp1, seg, riprel, disp
+ mulfp st(0), st(0), ufp1
+};
+
+def macroop FMULP
+{
+ mulfp st(1), st(0), st(1), spm=1
+};
+
+def macroop FMULP_R
+{
+ mulfp sti, sti, st(0), spm=1
+};
+
+def macroop FMULP_M
+{
+ fault "std::make_shared<UnimpInstFault>()"
+};
+
+def macroop FMULP_P
+{
+ fault "std::make_shared<UnimpInstFault>()"
+};
+
# FIMUL
'''