X86: Implement the instructions that compare fp values and write a mask as a result.
authorGabe Black <gblack@eecs.umich.edu>
Tue, 18 Aug 2009 03:25:14 +0000 (20:25 -0700)
committerGabe Black <gblack@eecs.umich.edu>
Tue, 18 Aug 2009 03:25:14 +0000 (20:25 -0700)
src/arch/x86/isa/decoder/two_byte_opcodes.isa
src/arch/x86/isa/insts/simd128/floating_point/compare/compare_and_write_mask.py

index b41f2b31dc147b1b5c7530205692ee63a8f96c88..11fc92abcaffe069c1f6f8252c986ab7f987dcd4 100644 (file)
                     default: decode LEGACY_DECODEVAL {
                         // no prefix
                         0x0: decode OPCODE_OP_BOTTOM3 {
-                            0x2: WarnUnimpl::cmpccps_Vo_Wo_Ib();
+                            0x2: CMPPS(Vo,Wo,Ib);
                             0x3: WarnUnimpl::movnti_Mdq_Gdq();
                             0x4: PINSRW(Pq,Ew,Ib);
                             0x5: PEXTRW(Gd,PRq,Ib);
                         }
                         // repe (0xF3)
                         0x4: decode OPCODE_OP_BOTTOM3 {
-                            0x2: WarnUnimpl::cmpccss_Vd_Wd_Ib();
+                            0x2: CMPSS(Vd,Wd,Ib);
                             default: UD2();
                         }
                         // operand size (0x66)
                         0x1: decode OPCODE_OP_BOTTOM3 {
-                            0x2: WarnUnimpl::cmpccpd_Vo_Wo_Ib();
+                            0x2: CMPPD(Vo,Wo,Ib);
                             0x4: PINSRW(Vdw,Ew,Ib);
                             0x5: PEXTRW(Gd,VRdq,Ib);
                             0x6: SHUFPD(Vpd,Wpd,Ib);
                         }
                         // repne (0xF2)
                         0x8: decode OPCODE_OP_BOTTOM3 {
-                            0x2: WarnUnimpl::cmpccsd_Vq_Wq_Ib();
+                            0x2: CMPSD(Vq,Wq,Ib);
                             default: UD2();
                         }
                         default: UD2();
index 705f64093d131ded754b7370ff2bcd8f8dd44ca9..09c34600bfe7b7005cf5af078740d5280bed000f 100644 (file)
 # Authors: Gabe Black
 
 microcode = '''
-# CMPPS
-# CMPPD
-# CMPSS
-# CMPSD
+def macroop CMPPS_XMM_XMM_I {
+    mcmpf2r xmml, xmml, xmmlm, size=4, ext="IMMEDIATE & mask(3)"
+    mcmpf2r xmmh, xmmh, xmmhm, size=4, ext="IMMEDIATE & mask(3)"
+};
+
+def macroop CMPPS_XMM_M_I {
+    ldfp ufp1, seg, sib, "DISPLACEMENT", dataSize=8
+    ldfp ufp2, seg, sib, "DISPLACEMENT + 8", dataSize=8
+    mcmpf2r xmml, xmml, ufp1, size=4, ext="IMMEDIATE & mask(3)"
+    mcmpf2r xmmh, xmmh, ufp2, size=4, ext="IMMEDIATE & mask(3)"
+};
+
+def macroop CMPPS_XMM_P_I {
+    rdip t7
+    ldfp ufp1, seg, riprel, "DISPLACEMENT", dataSize=8
+    ldfp ufp2, seg, riprel, "DISPLACEMENT + 8", dataSize=8
+    mcmpf2r xmml, xmml, ufp1, size=4, ext="IMMEDIATE & mask(3)"
+    mcmpf2r xmmh, xmmh, ufp2, size=4, ext="IMMEDIATE & mask(3)"
+};
+
+def macroop CMPPD_XMM_XMM_I {
+    mcmpf2r xmml, xmml, xmmlm, size=8, ext="IMMEDIATE & mask(3)"
+    mcmpf2r xmmh, xmmh, xmmhm, size=8, ext="IMMEDIATE & mask(3)"
+};
+
+def macroop CMPPD_XMM_M_I {
+    ldfp ufp1, seg, sib, "DISPLACEMENT", dataSize=8
+    ldfp ufp2, seg, sib, "DISPLACEMENT + 8", dataSize=8
+    mcmpf2r xmml, xmml, ufp1, size=8, ext="IMMEDIATE & mask(3)"
+    mcmpf2r xmmh, xmmh, ufp2, size=8, ext="IMMEDIATE & mask(3)"
+};
+
+def macroop CMPPD_XMM_P_I {
+    rdip t7
+    ldfp ufp1, seg, riprel, "DISPLACEMENT", dataSize=8
+    ldfp ufp2, seg, riprel, "DISPLACEMENT + 8", dataSize=8
+    mcmpf2r xmml, xmml, ufp1, size=8, ext="IMMEDIATE & mask(3)"
+    mcmpf2r xmmh, xmmh, ufp2, size=8, ext="IMMEDIATE & mask(3)"
+};
+
+def macroop CMPSS_XMM_XMM_I {
+    mcmpf2r xmml, xmml, xmmlm, size=4, ext="IMMEDIATE | 0x8"
+};
+
+def macroop CMPSS_XMM_M_I {
+    ldfp ufp1, seg, sib, "DISPLACEMENT", dataSize=8
+    mcmpf2r xmml, xmml, ufp1, size=4, ext="IMMEDIATE | 0x8"
+};
+
+def macroop CMPSS_XMM_P_I {
+    rdip t7
+    ldfp ufp1, seg, riprel, "DISPLACEMENT", dataSize=8
+    mcmpf2r xmml, xmml, ufp1, size=4, ext="IMMEDIATE | 0x8"
+};
+
+def macroop CMPSD_XMM_XMM_I {
+    mcmpf2r xmml, xmml, xmmlm, size=8, ext="IMMEDIATE | 0x8"
+};
+
+def macroop CMPSD_XMM_M_I {
+    ldfp ufp1, seg, sib, "DISPLACEMENT", dataSize=8
+    mcmpf2r xmml, xmml, ufp1, size=8, ext="IMMEDIATE | 0x8"
+};
+
+def macroop CMPSD_XMM_P_I {
+    rdip t7
+    ldfp ufp1, seg, riprel, "DISPLACEMENT", dataSize=8
+    mcmpf2r xmml, xmml, ufp1, size=8, ext="IMMEDIATE | 0x8"
+};
 '''