} else if (strncmp (p, "src2:", 5) == 0) {
desc->spec [MONO_INST_SRC2] = p [5];
p += 6;
+ } else if (strncmp (p, "src3:", 5) == 0) {
+ desc->spec [MONO_INST_SRC3] = p [5];
+ p += 6;
} else if (strncmp (p, "clob:", 5) == 0) {
desc->spec [MONO_INST_CLOB] = p [5];
p += 6;
table = g_hash_table_new (g_str_hash, g_str_equal);
opcodes = g_new0 (OpDesc, OP_LAST);
-#ifndef MONO_ARCH_ENABLE_NORMALIZE_OPCODES
- for (i = 0; i < MONO_CEE_LAST; ++i) {
- desc = opcodes + i;
- desc->num = i;
- desc->name = mono_inst_name (i);
- g_hash_table_insert (table, (char *)desc->name, desc);
- }
-#endif
for (i = OP_LOAD; i < OP_LAST; ++i) {
desc = opcodes + i;
desc->num = i;
idx = 1;
g_string_append_printf (idx_array, "const guint16 %s_idx [] = {\n", name);
- for (i = 0; i < OP_LAST; ++i) {
+ for (i = OP_LOAD; i < OP_LAST; ++i) {
desc = opcodes + i;
if (!desc->desc)
g_string_append_printf (idx_array, "\t0,\t/* %s */\n", desc->name ? desc->name : "");
main (int argc, char* argv [])
{
init_table ();
- switch (argc) {
- case 2:
+ if (argc == 2) {
/* useful to get a new file when some opcodes are added: looses the comments, though */
load_file (argv [1]);
dump ();
- break;
- case 4:
- load_file (argv [1]);
- build_table (argv [2], argv [3]);
- break;
- default:
+ } else if (argc < 4) {
g_print ("Usage: genmdesc arguments\n");
- g_print ("\tgenmdesc desc Output to stdout the description file.\n");
- g_print ("\tgenmdesc desc output name Write to output the description in a table named 'name'.\n");
+ g_print ("\tgenmdesc desc Output to stdout the description file.\n");
+ g_print ("\tgenmdesc output name desc [desc1...] Write to output the description in a table named 'name'.\n");
return 1;
+ } else {
+ int i;
+ for (i = 3; i < argc; ++i)
+ load_file (argv [i]);
+ build_table (argv [1], argv [2]);
}
return 0;
}