some optimizations
[picodrive.git] / cpu / Cyclone / Main.cpp
index 80bbfd8..fce0c3d 100644 (file)
@@ -10,6 +10,7 @@ char *Narm[4]={ "b", "h","",""}; // Normal ARM Extensions for operand sizes 0,1,
 char *Sarm[4]={"sb","sh","",""}; // Sign-extend ARM Extensions for operand sizes 0,1,2\r
 int Cycles; // Current cycles for opcode\r
 int pc_dirty; // something changed PC during processing\r
+static int arm_op_count;\r
 \r
 \r
 void ot(const char *format, ...)\r
@@ -22,6 +23,9 @@ void ot(const char *format, ...)
   for(i=0, len=strlen(format); i < len && format[i] != '\n'; i++);\r
   if(i < len-1 && format[len-1] != '\n') printf("\nWARNING: possible improper newline placement:\n%s\n", format);\r
 \r
+  if (format[0] == ' ' && format[1] == ' ' && format[2] != ' ' && format[2] != '.')\r
+    arm_op_count++;\r
+\r
   va_start(valist,format);\r
   if (AsmFile) vfprintf(AsmFile,format,valist);\r
   va_end(valist);\r
@@ -441,7 +445,7 @@ int MemHandler(int type,int size,int addrreg)
 static void PrintOpcodes()\r
 {\r
   int op=0;\r
\r
+\r
   printf("Creating Opcodes: [");\r
 \r
   ot(";@ ---------------------------- Opcodes ---------------------------\n");\r
@@ -713,7 +717,9 @@ static int CycloneMake()
   ot("\n");\r
 \r
   PrintFramework();\r
+  arm_op_count = 0;\r
   PrintOpcodes();\r
+  printf("~%i ARM instructions used for opcode handlers\n", arm_op_count);\r
   PrintJumpTable();\r
 \r
   if (ms) ot("  END\n");\r