[libcpu] [425] x86: Fix opcode group decoding logic

6 views
Skip to first unread message

lib...@gh11.de

unread,
Apr 26, 2010, 12:16:29 PM4/26/10
to lib...@googlegroups.com
Revision
425
Author
penberg
Date
2010-04-26 09:16:27 -0700 (Mon, 26 Apr 2010)

Log Message

x86: Fix opcode group decoding logic

Signed-off-by: Pekka Enberg <pen...@cs.helsinki.fi>

Modified Paths

Diff

Modified: trunk/arch/x86/x86_decode.cpp (424 => 425)


--- trunk/arch/x86/x86_decode.cpp	2010-04-26 16:16:14 UTC (rev 424)
+++ trunk/arch/x86/x86_decode.cpp	2010-04-26 16:16:27 UTC (rev 425)
@@ -547,7 +547,7 @@
 		decode_modrm_byte(instr, RAM[pc++]);
 
 	/* Opcode groups */
-	switch (instr->flags) {
+	switch (instr->flags & GROUP_MASK) {
 	case GROUP_2:
 		instr->type	= shift_grp2_decode_table[instr->reg_opc];
 		break;

Modified: trunk/arch/x86/x86_decode.h (424 => 425)


--- trunk/arch/x86/x86_decode.h	2010-04-26 16:16:14 UTC (rev 424)
+++ trunk/arch/x86/x86_decode.h	2010-04-26 16:16:27 UTC (rev 425)
@@ -81,6 +81,8 @@
 	MEM_DISP_MASK		= SRC_MEM_DISP_BYTE|SRC_MEM_DISP_FULL|DST_MEM_DISP_BYTE|DST_MEM_DISP_FULL,
 
 	GROUP_2			= (1U << 27),
+
+	GROUP_MASK		= GROUP_2,
 };
 
 /*


 
--
Subscription settings: http://groups.google.com/group/libcpu/subscribe?hl=en
Reply all
Reply to author
Forward
0 new messages