[Scummvm-cvs-logs] SF.net SVN: scummvm:[52017] tools/branches/gsoc2010-decompiler/decompiler

pidgeot at users.sourceforge.net pidgeot at users.sourceforge.net
Thu Aug 12 02:01:38 CEST 2010


Revision: 52017
          http://scummvm.svn.sourceforge.net/scummvm/?rev=52017&view=rev
Author:   pidgeot
Date:     2010-08-12 00:01:37 +0000 (Thu, 12 Aug 2010)

Log Message:
-----------
DECOMPILER: Merge kBinaryOp and kComparison

Modified Paths:
--------------
    tools/branches/gsoc2010-decompiler/decompiler/codegen.cpp
    tools/branches/gsoc2010-decompiler/decompiler/instruction.h
    tools/branches/gsoc2010-decompiler/decompiler/kyra/disassembler.cpp
    tools/branches/gsoc2010-decompiler/decompiler/scummv6/disassembler.cpp
    tools/branches/gsoc2010-decompiler/decompiler/test/disassembler/pasc.cpp

Modified: tools/branches/gsoc2010-decompiler/decompiler/codegen.cpp
===================================================================
--- tools/branches/gsoc2010-decompiler/decompiler/codegen.cpp	2010-08-11 23:57:51 UTC (rev 52016)
+++ tools/branches/gsoc2010-decompiler/decompiler/codegen.cpp	2010-08-12 00:01:37 UTC (rev 52017)
@@ -258,7 +258,6 @@
 				_stack.push(new UnaryOpEntry(_stack.pop(), it->_codeGenData));
 				break;
 			case kBinaryOp:
-			case kComparison:
 				{
 					EntryPtr op1 = _stack.pop();
 					EntryPtr op2 = _stack.pop();

Modified: tools/branches/gsoc2010-decompiler/decompiler/instruction.h
===================================================================
--- tools/branches/gsoc2010-decompiler/decompiler/instruction.h	2010-08-11 23:57:51 UTC (rev 52016)
+++ tools/branches/gsoc2010-decompiler/decompiler/instruction.h	2010-08-12 00:01:37 UTC (rev 52017)
@@ -34,9 +34,8 @@
  * Enumeration for categorizing the different kinds of instructions.
  */
 enum InstType {
-	kBinaryOp,    ///< Binary operation (e.g. +, &&, etc.), EXCLUDING comparisons.
+	kBinaryOp,    ///< Binary operation (e.g. +, &&, etc.), including comparisons.
 	kCall,        ///< Regular function call.
-	kComparison,  ///< Comparison instruction (==, !=, etc.)
 	kCondJump,    ///< Conditional jump (absolute address).
 	kCondJumpRel, ///< Conditional jump (relative address).
 	kDup,         ///< Instruction duplicates the most recent stack entry.

Modified: tools/branches/gsoc2010-decompiler/decompiler/kyra/disassembler.cpp
===================================================================
--- tools/branches/gsoc2010-decompiler/decompiler/kyra/disassembler.cpp	2010-08-11 23:57:51 UTC (rev 52016)
+++ tools/branches/gsoc2010-decompiler/decompiler/kyra/disassembler.cpp	2010-08-12 00:01:37 UTC (rev 52017)
@@ -504,22 +504,22 @@
 					OPCODE_MD("eval_bor", kBinaryOp, -1, false, false, "||");
 					break;
 				case 2:
-					OPCODE_MD("eval_eq", kComparison, -1, false, false, "==");
+					OPCODE_MD("eval_eq", kBinaryOp, -1, false, false, "==");
 					break;
 				case 3:
-					OPCODE_MD("eval_neq", kComparison, -1, false, false, "!=");
+					OPCODE_MD("eval_neq", kBinaryOp, -1, false, false, "!=");
 					break;
 				case 4:
-					OPCODE_MD("eval_leq", kComparison, -1, false, false, "<=");
+					OPCODE_MD("eval_leq", kBinaryOp, -1, false, false, "<=");
 					break;
 				case 5:
-					OPCODE_MD("eval_lt", kComparison, -1, false, false, "<");
+					OPCODE_MD("eval_lt", kBinaryOp, -1, false, false, "<");
 					break;
 				case 6:
-					OPCODE_MD("eval_geq", kComparison, -1, false, false, ">=");
+					OPCODE_MD("eval_geq", kBinaryOp, -1, false, false, ">=");
 					break;
 				case 7:
-					OPCODE_MD("eval_gt", kComparison, -1, false, false, ">");
+					OPCODE_MD("eval_gt", kBinaryOp, -1, false, false, ">");
 					break;
 				case 8:
 					OPCODE_MD("eval_add", kBinaryOp, -1, false, false, "+");

Modified: tools/branches/gsoc2010-decompiler/decompiler/scummv6/disassembler.cpp
===================================================================
--- tools/branches/gsoc2010-decompiler/decompiler/scummv6/disassembler.cpp	2010-08-11 23:57:51 UTC (rev 52016)
+++ tools/branches/gsoc2010-decompiler/decompiler/scummv6/disassembler.cpp	2010-08-12 00:01:37 UTC (rev 52017)
@@ -73,12 +73,12 @@
 		OPCODE(0x0B, "wordArrayIndexedRead", kLoad, -1, "w");
 		OPCODE(0x0C, "dup", kDup, 1, "");
 		OPCODE_MD(0x0D, "not", kUnaryOp, 0, "", "!");
-		OPCODE_MD(0x0E, "eq", kComparison, -1, "", "==");
-		OPCODE_MD(0x0F, "neq", kComparison, -1, "", "!=");
-		OPCODE_MD(0x10, "gt", kComparison, -1, "", ">");
-		OPCODE_MD(0x11, "lt", kComparison, -1, "", "<");
-		OPCODE_MD(0x12, "le", kComparison, -1, "", "<=");
-		OPCODE_MD(0x13, "ge", kComparison, -1, "", ">=");
+		OPCODE_MD(0x0E, "eq", kBinaryOp, -1, "", "==");
+		OPCODE_MD(0x0F, "neq", kBinaryOp, -1, "", "!=");
+		OPCODE_MD(0x10, "gt", kBinaryOp, -1, "", ">");
+		OPCODE_MD(0x11, "lt", kBinaryOp, -1, "", "<");
+		OPCODE_MD(0x12, "le", kBinaryOp, -1, "", "<=");
+		OPCODE_MD(0x13, "ge", kBinaryOp, -1, "", ">=");
 		OPCODE_MD(0x14, "add", kBinaryOp, -1, "", "+");
 		OPCODE_MD(0x15, "sub", kBinaryOp, -1, "", "-");
 		OPCODE_MD(0x16, "mul", kBinaryOp, -1, "", "*");

Modified: tools/branches/gsoc2010-decompiler/decompiler/test/disassembler/pasc.cpp
===================================================================
--- tools/branches/gsoc2010-decompiler/decompiler/test/disassembler/pasc.cpp	2010-08-11 23:57:51 UTC (rev 52016)
+++ tools/branches/gsoc2010-decompiler/decompiler/test/disassembler/pasc.cpp	2010-08-12 00:01:37 UTC (rev 52017)
@@ -68,8 +68,8 @@
 		OPCODE(0x8B, "ISTOREL", kStore, 0, "di");
 		OPCODE(0x8C, "ILOADA", kLoad, 4, "d");
 		OPCODE(0x8D, "ILOADL", kLoad, 0, "i");
-		OPCODE(0x8E, "ICMP", kComparison, -8, "");
-		OPCODE(0x8F, "UICMP", kComparison, -8, "");
+		OPCODE(0x8E, "ICMP", kBinaryOp, -8, "");
+		OPCODE(0x8F, "UICMP", kBinaryOp, -8, "");
 		OPCODE(0x90, "IDUP", kLoad, 4, "");
 		OPCODE(0x91, "IPRINT", kSpecial, -4, "");
 		OPCODE(0x92, "UIPRINT", kSpecial, -4, "");
@@ -93,8 +93,8 @@
 		OPCODE(0xAB, "SSTOREL", kStore, 0, "ds");
 		OPCODE(0xAC, "SLOADA", kLoad, 2, "d");
 		OPCODE(0xAD, "SLOADL", kLoad, 0, "s");
-		OPCODE(0xAE, "SCMP", kComparison, -4, "");
-		OPCODE(0xAF, "USCMP", kComparison, -4, "");
+		OPCODE(0xAE, "SCMP", kBinaryOp, -4, "");
+		OPCODE(0xAF, "USCMP", kBinaryOp, -4, "");
 		OPCODE(0xB0, "SDUP", kLoad, 2, "");
 		OPCODE(0xB1, "SPRINT", kSpecial, -2, "");
 		OPCODE(0xB2, "USPRINT", kSpecial, -2, "");
@@ -118,8 +118,8 @@
 		OPCODE(0xCB, "BSTOREL", kStore, 0, "dB");
 		OPCODE(0xCC, "BLOADA", kLoad, 1, "d");
 		OPCODE(0xCD, "BLOADL", kLoad, 0, "B");
-		OPCODE(0xCE, "SBCMP", kComparison, -2, "");
-		OPCODE(0xCF, "BCMP", kComparison, -2, "");
+		OPCODE(0xCE, "SBCMP", kBinaryOp, -2, "");
+		OPCODE(0xCF, "BCMP", kBinaryOp, -2, "");
 		OPCODE(0xD0, "BDUP", kLoad, 1, "");
 		OPCODE(0xD1, "SBPRINT", kSpecial, -1, "");
 		OPCODE(0xD2, "BPRINT", kSpecial, -1, "");


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list