From: Stanislav S. <ssh...@us...> - 2010-01-29 10:16:40
|
Update of /cvsroot/bochs/bochs/cpu In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv9143 Modified Files: cpu.h fetchdecode.cc fetchdecode.h fetchdecode64.cc Log Message: Fix POPCNT decode tables Index: cpu.h =================================================================== RCS file: /cvsroot/bochs/bochs/cpu/cpu.h,v retrieving revision 1.635 retrieving revision 1.636 diff -u -d -r1.635 -r1.636 --- cpu.h 19 Jan 2010 14:43:46 -0000 1.635 +++ cpu.h 29 Jan 2010 10:16:28 -0000 1.636 @@ -3888,10 +3888,10 @@ #define BxGroupN 0x0010 // Group encoding: 0001 #define BxPrefixSSE 0x0020 // Group encoding: 0010 #define BxPrefixSSE66 0x0030 // Group encoding: 0011 -#define BxFPEscape 0x0040 // Group encoding: 0100 -#define Bx3ByteOp 0x0050 // Group encoding: 0101 -#define BxOSizeGrp 0x0060 // Group encoding: 0110 -// 0x0070 // Group encoding: 0111 +#define BxPrefixSSEF3 0x0040 // Group encoding: 0100 +#define BxFPEscape 0x0050 // Group encoding: 0101 +#define Bx3ByteOp 0x0060 // Group encoding: 0110 +#define BxOSizeGrp 0x0070 // Group encoding: 0111 #define BxLockable 0x0100 // bit 8 #define BxArithDstRM 0x0200 // bit 9 Index: fetchdecode.cc =================================================================== RCS file: /cvsroot/bochs/bochs/cpu/fetchdecode.cc,v retrieving revision 1.240 retrieving revision 1.241 diff -u -d -r1.240 -r1.241 --- fetchdecode.cc 9 Jan 2010 15:11:31 -0000 1.240 +++ fetchdecode.cc 29 Jan 2010 10:16:28 -0000 1.241 @@ -680,7 +680,7 @@ /* 0F B5 /wr */ { 0, BX_IA_ERROR }, // LGS /* 0F B6 /wr */ { 0, BX_IA_MOVZX_GwEbR }, /* 0F B7 /wr */ { 0, BX_IA_MOV_GwEwR }, // MOVZX_GwEw - /* 0F B8 /wr */ { BxPrefixSSE, BX_IA_ERROR, BxOpcodeGroupSSE_0fb8wR }, + /* 0F B8 /wr */ { BxPrefixSSEF3, BX_IA_POPCNT_GwEwR, BxOpcodeGroupSSE_ERR }, /* 0F B9 /wr */ { 0, BX_IA_UD2B }, /* 0F BA /wr */ { BxGroup8, BX_IA_ERROR, BxOpcodeInfoG8EwIbR }, /* 0F BB /wr */ { 0, BX_IA_BTC_EwGwR }, @@ -1243,7 +1243,7 @@ /* 0F B5 /dr */ { 0, BX_IA_ERROR }, // LGS /* 0F B6 /dr */ { 0, BX_IA_MOVZX_GdEbR }, /* 0F B7 /dr */ { 0, BX_IA_MOVZX_GdEwR }, - /* 0F B8 /dr */ { BxPrefixSSE, BX_IA_ERROR, BxOpcodeGroupSSE_0fb8dR }, + /* 0F B8 /dr */ { BxPrefixSSEF3, BX_IA_POPCNT_GdEdR, BxOpcodeGroupSSE_ERR }, /* 0F B9 /dr */ { BxTraceEnd, BX_IA_UD2B }, /* 0F BA /dr */ { BxGroup8, BX_IA_ERROR, BxOpcodeInfoG8EdIbR }, /* 0F BB /dr */ { 0, BX_IA_BTC_EdGdR }, @@ -1813,7 +1813,7 @@ /* 0F B5 /wm */ { 0, BX_IA_LGS_GwMp }, /* 0F B6 /wm */ { 0, BX_IA_MOVZX_GwEbM }, /* 0F B7 /wm */ { 0, BX_IA_MOV_GwEwM }, // MOVZX_GwEw - /* 0F B8 /wm */ { BxPrefixSSE, BX_IA_ERROR, BxOpcodeGroupSSE_0fb8wM }, + /* 0F B8 /wm */ { BxPrefixSSEF3, BX_IA_POPCNT_GwEwM, BxOpcodeGroupSSE_ERR }, /* 0F B9 /wm */ { BxTraceEnd, BX_IA_UD2B }, /* 0F BA /wm */ { BxGroup8, BX_IA_ERROR, BxOpcodeInfoG8EwIbM }, /* 0F BB /wm */ { BxLockable, BX_IA_BTC_EwGwM }, @@ -2376,7 +2376,7 @@ /* 0F B5 /dm */ { 0, BX_IA_LGS_GdMp }, /* 0F B6 /dm */ { 0, BX_IA_MOVZX_GdEbM }, /* 0F B7 /dm */ { 0, BX_IA_MOVZX_GdEwM }, - /* 0F B8 /dm */ { BxPrefixSSE, BX_IA_ERROR, BxOpcodeGroupSSE_0fb8dM }, + /* 0F B8 /dm */ { BxPrefixSSEF3, BX_IA_POPCNT_GdEdM, BxOpcodeGroupSSE_ERR }, /* 0F B9 /dm */ { BxTraceEnd, BX_IA_UD2B }, /* 0F BA /dm */ { BxGroup8, BX_IA_ERROR, BxOpcodeInfoG8EdIbM }, /* 0F BB /dm */ { BxLockable, BX_IA_BTC_EdGdM }, @@ -2775,6 +2775,12 @@ OpcodeInfoPtr = &(OpcodeInfoPtr->AnotherArray[0]); // BX_IA_ERROR } continue; + case BxPrefixSSEF3: + /* For SSE opcodes with prefix F3 only */ + if (sse_prefix != SSE_PREFIX_F3) { + OpcodeInfoPtr = &(OpcodeInfoPtr->AnotherArray[0]); // BX_IA_ERROR + } + continue; case BxFPEscape: OpcodeInfoPtr = &(OpcodeInfoPtr->AnotherArray[b2 & 0x3f]); break; Index: fetchdecode.h =================================================================== RCS file: /cvsroot/bochs/bochs/cpu/fetchdecode.h,v retrieving revision 1.94 retrieving revision 1.95 diff -u -d -r1.94 -r1.95 --- fetchdecode.h 20 Dec 2009 09:00:40 -0000 1.94 +++ fetchdecode.h 29 Jan 2010 10:16:28 -0000 1.95 @@ -1411,44 +1411,6 @@ /* F3 */ { 0, BX_IA_MOVDQU_WdqVdqM } }; -static const BxOpcodeInfo_t BxOpcodeGroupSSE_0fb8wR[3] = { - /* 66 */ { 0, BX_IA_ERROR }, - /* F2 */ { 0, BX_IA_ERROR }, - /* F3 */ { 0, BX_IA_POPCNT_GwEwR } -}; - -static const BxOpcodeInfo_t BxOpcodeGroupSSE_0fb8wM[3] = { - /* 66 */ { 0, BX_IA_ERROR }, - /* F2 */ { 0, BX_IA_ERROR }, - /* F3 */ { 0, BX_IA_POPCNT_GwEwM } -}; - -static const BxOpcodeInfo_t BxOpcodeGroupSSE_0fb8dR[3] = { - /* 66 */ { 0, BX_IA_ERROR }, - /* F2 */ { 0, BX_IA_ERROR }, - /* F3 */ { 0, BX_IA_POPCNT_GdEdR } -}; - -static const BxOpcodeInfo_t BxOpcodeGroupSSE_0fb8dM[3] = { - /* 66 */ { 0, BX_IA_ERROR }, - /* F2 */ { 0, BX_IA_ERROR }, - /* F3 */ { 0, BX_IA_POPCNT_GdEdM } -}; - -#if BX_SUPPORT_X86_64 -static const BxOpcodeInfo_t BxOpcodeGroupSSE_0fb8qR[3] = { - /* 66 */ { 0, BX_IA_ERROR }, - /* F2 */ { 0, BX_IA_ERROR }, - /* F3 */ { 0, BX_IA_POPCNT_GqEqR } -}; - -static const BxOpcodeInfo_t BxOpcodeGroupSSE_0fb8qM[3] = { - /* 66 */ { 0, BX_IA_ERROR }, - /* F2 */ { 0, BX_IA_ERROR }, - /* F3 */ { 0, BX_IA_POPCNT_GqEqM } -}; -#endif - static const BxOpcodeInfo_t BxOpcodeGroupSSE_0fc2[3] = { /* 66 */ { 0, BX_IA_CMPPD_VpdWpdIb }, /* F2 */ { 0, BX_IA_CMPSD_VsdWsdIb }, Index: fetchdecode64.cc =================================================================== RCS file: /cvsroot/bochs/bochs/cpu/fetchdecode64.cc,v retrieving revision 1.242 retrieving revision 1.243 diff -u -d -r1.242 -r1.243 --- fetchdecode64.cc 9 Jan 2010 15:11:32 -0000 1.242 +++ fetchdecode64.cc 29 Jan 2010 10:16:28 -0000 1.243 @@ -628,7 +628,7 @@ /* 0F B5 /wr */ { 0, BX_IA_ERROR }, // LGS /* 0F B6 /wr */ { 0, BX_IA_MOVZX_GwEbR }, /* 0F B7 /wr */ { 0, BX_IA_MOV_GwEwR }, // MOVZX_GwEw - /* 0F B8 /wr */ { BxPrefixSSE, BX_IA_ERROR, BxOpcodeGroupSSE_0fb8wR }, + /* 0F B8 /wr */ { BxPrefixSSEF3, BX_IA_POPCNT_GwEwR, BxOpcodeGroupSSE_ERR }, /* 0F B9 /wr */ { BxTraceEnd, BX_IA_UD2B }, /* 0F BA /wr */ { BxGroup8, BX_IA_ERROR, BxOpcodeInfoG8EwIbR }, /* 0F BB /wr */ { 0, BX_IA_BTC_EwGwR }, @@ -1155,7 +1155,7 @@ /* 0F B5 /dr */ { 0, BX_IA_ERROR }, // LFS /* 0F B6 /dr */ { 0, BX_IA_MOVZX_GdEbR }, /* 0F B7 /dr */ { 0, BX_IA_MOVZX_GdEwR }, - /* 0F B8 /dr */ { BxPrefixSSE, BX_IA_ERROR, BxOpcodeGroupSSE_0fb8dR }, + /* 0F B8 /dr */ { BxPrefixSSEF3, BX_IA_POPCNT_GdEdR, BxOpcodeGroupSSE_ERR }, /* 0F B9 /dr */ { BxTraceEnd, BX_IA_UD2B }, /* 0F BA /dr */ { BxGroup8, BX_IA_ERROR, BxOpcodeInfoG8EdIbR }, /* 0F BB /dr */ { 0, BX_IA_BTC_EdGdR }, @@ -1682,7 +1682,7 @@ /* 0F B5 /qr */ { 0, BX_IA_ERROR }, // LGS /* 0F B6 /qr */ { 0, BX_IA_MOVZX_GqEbR }, /* 0F B7 /qr */ { 0, BX_IA_MOVZX_GqEwR }, - /* 0F B8 /qr */ { BxPrefixSSE, BX_IA_ERROR, BxOpcodeGroupSSE_0fb8qR }, + /* 0F B8 /qr */ { BxPrefixSSEF3, BX_IA_POPCNT_GqEqR, BxOpcodeGroupSSE_ERR }, /* 0F B9 /qr */ { BxTraceEnd, BX_IA_UD2B }, /* 0F BA /qr */ { BxGroup8, BX_IA_ERROR, BxOpcodeInfo64G8EqIbR }, /* 0F BB /qr */ { 0, BX_IA_BTC_EqGqR }, @@ -2215,7 +2215,7 @@ /* 0F B5 /wm */ { 0, BX_IA_LGS_GwMp }, /* 0F B6 /wm */ { 0, BX_IA_MOVZX_GwEbM }, /* 0F B7 /wm */ { 0, BX_IA_MOV_GwEwM }, // MOVZX_GwEw - /* 0F B8 /wm */ { BxPrefixSSE, BX_IA_ERROR, BxOpcodeGroupSSE_0fb8wM }, + /* 0F B8 /wm */ { BxPrefixSSEF3, BX_IA_POPCNT_GwEwM, BxOpcodeGroupSSE_ERR }, /* 0F B9 /wm */ { BxTraceEnd, BX_IA_UD2B }, /* 0F BA /wm */ { BxGroup8, BX_IA_ERROR, BxOpcodeInfoG8EwIbM }, /* 0F BB /wm */ { BxLockable, BX_IA_BTC_EwGwM }, @@ -2742,7 +2742,7 @@ /* 0F B5 /dm */ { 0, BX_IA_LGS_GdMp }, /* 0F B6 /dm */ { 0, BX_IA_MOVZX_GdEbM }, /* 0F B7 /dm */ { 0, BX_IA_MOVZX_GdEwM }, - /* 0F B8 /dm */ { BxPrefixSSE, BX_IA_ERROR, BxOpcodeGroupSSE_0fb8dM }, + /* 0F B8 /dm */ { BxPrefixSSEF3, BX_IA_POPCNT_GdEdM, BxOpcodeGroupSSE_ERR }, /* 0F B9 /dm */ { BxTraceEnd, BX_IA_UD2B }, /* 0F BA /dm */ { BxGroup8, BX_IA_ERROR, BxOpcodeInfoG8EdIbM }, /* 0F BB /dm */ { BxLockable, BX_IA_BTC_EdGdM }, @@ -3269,7 +3269,7 @@ /* 0F B5 /qm */ { 0, BX_IA_LGS_GqMp }, // TODO: LGS_GdMp for AMD CPU /* 0F B6 /qm */ { 0, BX_IA_MOVZX_GqEbM }, /* 0F B7 /qm */ { 0, BX_IA_MOVZX_GqEwM }, - /* 0F B8 /qm */ { BxPrefixSSE, BX_IA_ERROR, BxOpcodeGroupSSE_0fb8qM }, + /* 0F B8 /qm */ { BxPrefixSSEF3, BX_IA_POPCNT_GqEqM, BxOpcodeGroupSSE_ERR }, /* 0F B9 /qm */ { BxTraceEnd, BX_IA_UD2B }, /* 0F BA /qm */ { BxGroup8, BX_IA_ERROR, BxOpcodeInfo64G8EqIbM }, /* 0F BB /qm */ { BxLockable, BX_IA_BTC_EqGqM }, @@ -3690,6 +3690,12 @@ OpcodeInfoPtr = &(OpcodeInfoPtr->AnotherArray[0]); // BX_IA_ERROR } continue; + case BxPrefixSSEF3: + /* For SSE opcodes with prefix F3 only */ + if (sse_prefix != SSE_PREFIX_F3) { + OpcodeInfoPtr = &(OpcodeInfoPtr->AnotherArray[0]); // BX_IA_ERROR + } + continue; case BxFPEscape: OpcodeInfoPtr = &(OpcodeInfoPtr->AnotherArray[b2 & 0x3f]); break; |