X86: Implement the instructions that convert between forms of floating point.
authorGabe Black <gblack@eecs.umich.edu>
Tue, 18 Aug 2009 03:04:02 +0000 (20:04 -0700)
committerGabe Black <gblack@eecs.umich.edu>
Tue, 18 Aug 2009 03:04:02 +0000 (20:04 -0700)
src/arch/x86/isa/decoder/two_byte_opcodes.isa
src/arch/x86/isa/insts/simd128/floating_point/data_conversion/convert_floating_point_to_floating_point.py

index 2fdb6371db752e9920b3e0a8bdc385a172160ce8..200f130dcd406eea76332bdd180161fe32fa6aa3 100644 (file)
                 0x0: decode OPCODE_OP_BOTTOM3 {
                     0x0: Inst::ADDPS(Vo,Wo);
                     0x1: Inst::MULPS(Vo,Wo);
-                    0x2: cvtps2pd_Vo_Wq();
+                    0x2: Inst::CVTPS2PD(Vo,Wq);
                     0x3: Inst::CVTDQ2PS(Vo,Wo);
                     0x4: Inst::SUBPS(Vo,Wo);
                     0x5: Inst::MINPS(Vo,Wo);
                 0x4: decode OPCODE_OP_BOTTOM3 {
                     0x0: Inst::ADDSS(Vd,Wd);
                     0x1: Inst::MULSS(Vd,Wd);
-                    0x2: cvtss2sd_Vq_Wd();
+                    0x2: Inst::CVTSS2SD(Vq,Wd);
                     0x3: cvttps2dq_Vo_Wo();
                     0x4: Inst::SUBSS(Vd,Wd);
                     0x5: Inst::MINSS(Vd,Wd);
                 0x1: decode OPCODE_OP_BOTTOM3 {
                     0x0: Inst::ADDPD(Vo,Wo);
                     0x1: Inst::MULPD(Vo,Wo);
-                    0x2: cvtpd2ps_Vo_Wo();
+                    0x2: Inst::CVTPD2PS(Vo,Wo);
                     0x3: cvtps2dq_Vo_Wo();
                     0x4: Inst::SUBPD(Vo,Wo);
                     0x5: Inst::MINPD(Vo,Wo);
                 0x8: decode OPCODE_OP_BOTTOM3 {
                     0x0: Inst::ADDSD(Vq,Wq);
                     0x1: Inst::MULSD(Vq,Wq);
-                    0x2: cvtsd2ss_Vd_Wq();
+                    0x2: Inst::CVTSD2SS(Vd,Wq);
                     0x4: Inst::SUBSD(Vq,Wq);
                     0x5: Inst::MINSD(Vq,Wq);
                     0x6: Inst::DIVSD(Vq,Wq);
index 2de33efa2b5bcad5c1f0b3a880b0ea96a63b4d65..1c36f7e4503a3a0dd6e9ac64607eae8d839f928f 100644 (file)
 # Authors: Gabe Black
 
 microcode = '''
-# CVTPS2PD
-# CVTPD2PS
-# CVTSS2SD
-# CVTSD2SS
+def macroop CVTSS2SD_XMM_XMM {
+    cvtf2f xmml, xmmlm, destSize=8, srcSize=4, ext=1
+};
+
+def macroop CVTSS2SD_XMM_M {
+    ldfp ufp1, seg, sib, disp, dataSize=8
+    cvtf2f xmml, ufp1, destSize=8, srcSize=4, ext=1
+};
+
+def macroop CVTSS2SD_XMM_P {
+    rdip t7
+    ldfp ufp1, seg, riprel, disp, dataSize=8
+    cvtf2f xmml, ufp1, destSize=8, srcSize=4, ext=1
+};
+
+def macroop CVTSD2SS_XMM_XMM {
+    cvtf2f xmml, xmmlm, destSize=4, srcSize=8, ext=1
+};
+
+def macroop CVTSD2SS_XMM_M {
+    ldfp ufp1, seg, sib, disp, dataSize=8
+    cvtf2f xmml, ufp1, destSize=4, srcSize=8, ext=1
+};
+
+def macroop CVTSD2SS_XMM_P {
+    rdip t7
+    ldfp ufp1, seg, riprel, disp, dataSize=8
+    cvtf2f xmml, ufp1, destSize=4, srcSize=8, ext=1
+};
+
+def macroop CVTPS2PD_XMM_XMM {
+    cvtf2f xmmh, xmmlm, destSize=8, srcSize=4, ext=2
+    cvtf2f xmml, xmmlm, destSize=8, srcSize=4, ext=0
+};
+
+def macroop CVTPS2PD_XMM_M {
+    ldfp ufp1, seg, sib, disp, dataSize=8
+    cvtf2f xmmh, ufp1, destSize=8, srcSize=4, ext=2
+    cvtf2f xmml, ufp1, destSize=8, srcSize=4, ext=0
+};
+
+def macroop CVTPS2PD_XMM_P {
+    rdip t7
+    ldfp ufp1, seg, riprel, disp, dataSize=8
+    cvtf2f xmmh, ufp1, destSize=8, srcSize=4, ext=2
+    cvtf2f xmml, ufp1, destSize=8, srcSize=4, ext=0
+};
+
+def macroop CVTPD2PS_XMM_XMM {
+    cvtf2f xmml, xmmlm, destSize=4, srcSize=8, ext=0
+    cvtf2f xmml, xmmhm, destSize=4, srcSize=8, ext=2
+    lfpimm xmmh, 0
+};
+
+def macroop CVTPD2PS_XMM_M {
+    ldfp ufp1, seg, sib, "DISPLACEMENT", dataSize=8
+    ldfp ufp2, seg, sib, "DISPLACEMENT + 8", dataSize=8
+    cvtf2f xmml, ufp1, destSize=4, srcSize=8, ext=0
+    cvtf2f xmml, ufp2, destSize=4, srcSize=8, ext=2
+    lfpimm xmmh, 0
+};
+
+def macroop CVTPD2PS_XMM_P {
+    rdip t7
+    ldfp ufp1, seg, riprel, "DISPLACEMENT", dataSize=8
+    ldfp ufp2, seg, riprel, "DISPLACEMENT + 8", dataSize=8
+    cvtf2f xmml, ufp1, destSize=4, srcSize=8, ext=0
+    cvtf2f xmml, ufp2, destSize=4, srcSize=8, ext=2
+    lfpimm xmmh, 0
+};
 '''