aboutsummaryrefslogtreecommitdiff
path: root/sim/ppc/igen.c
diff options
context:
space:
mode:
authorMichael Meissner <gnu@the-meissners.org>1995-11-21 21:41:25 +0000
committerMichael Meissner <gnu@the-meissners.org>1995-11-21 21:41:25 +0000
commit4a0351ab45fc3772a1c16f8f0efc0f1037df6414 (patch)
treeb067b5b83d609c3999f4a9bdc217fabd44007827 /sim/ppc/igen.c
parent83dcdc61682f4a7a3be7387c8e1527a84e714dcd (diff)
downloadgdb-4a0351ab45fc3772a1c16f8f0efc0f1037df6414.zip
gdb-4a0351ab45fc3772a1c16f8f0efc0f1037df6414.tar.gz
gdb-4a0351ab45fc3772a1c16f8f0efc0f1037df6414.tar.bz2
Add floating point model specific support; Redo method model specific support is done; Add remaining floating add/subtract-multiply
Diffstat (limited to 'sim/ppc/igen.c')
-rw-r--r--sim/ppc/igen.c58
1 files changed, 20 insertions, 38 deletions
diff --git a/sim/ppc/igen.c b/sim/ppc/igen.c
index 79010ed..57211db 100644
--- a/sim/ppc/igen.c
+++ b/sim/ppc/igen.c
@@ -634,6 +634,9 @@ static insn *last_model_function;
static insn *model_internal;
static insn *last_model_internal;
+static insn *model_static;
+static insn *last_model_static;
+
static insn *model_data;
static insn *last_model_data;
@@ -1033,6 +1036,9 @@ insn_table_load_insns(char *file_name)
else if (it_is("model-internal", file_entry->fields[insn_flags])) {
model_table_insert_specific(table, file_entry, &model_internal, &last_model_internal);
}
+ else if (it_is("model-static", file_entry->fields[insn_flags])) {
+ model_table_insert_specific(table, file_entry, &model_static, &last_model_static);
+ }
else if (it_is("model-data", file_entry->fields[insn_flags])) {
model_table_insert_specific(table, file_entry, &model_data, &last_model_data);
}
@@ -1316,6 +1322,12 @@ lf_print_my_prefix(lf *file,
(idecode ? "idecode" : "semantics"),
file_entry->fields[insn_name],
file_entry->line_nr);
+ lf_printf(file, "const itable_index my_index = ");
+ lf_print_function_name(file,
+ file_entry->fields[insn_name],
+ NULL,
+ function_name_prefix_itable);
+ lf_printf(file, ";\n");
}
@@ -2133,16 +2145,6 @@ lf_print_c_semantic(lf *file,
NULL,
function_name_prefix_itable);
lf_printf(file, ", processor, cia);\n");
- lf_printf(file, "\n");
- lf_printf(file, " if (WITH_MODEL_ISSUE)\n");
- lf_printf(file, " model_issue(");
- lf_print_function_name(file,
- instruction->file_entry->fields[insn_name],
- NULL,
- function_name_prefix_itable);
- lf_printf(file, ", cpu_model(processor), cia, %s);\n",
- ((idecode_cache) ? "cache_entry, 0" : "(idecode_cache *)0, instruction"));
-
lf_printf(file, "}\n");
lf_printf(file, "\n");
@@ -2177,7 +2179,6 @@ lf_print_c_semantic(lf *file,
lf_printf(file, "\n");
}
- /* the function footer */
lf_printf(file, "return nia;\n");
lf_indent(file, -2);
lf_printf(file, "}\n");
@@ -2979,7 +2980,6 @@ gen_model_h(insn_table *table, lf *file)
int model_create_p = 0;
int model_init_p = 0;
int model_halt_p = 0;
- int model_issue_p = 0;
int model_mon_info_p = 0;
int model_mon_info_free_p = 0;
@@ -3040,8 +3040,6 @@ gen_model_h(insn_table *table, lf *file)
model_init_p = 1;
else if (strcmp (name, "model_halt") == 0)
model_halt_p = 1;
- else if (strcmp (name, "model_issue") == 0)
- model_issue_p = 1;
else if (strcmp (name, "model_mon_info") == 0)
model_mon_info_p = 1;
else if (strcmp (name, "model_mon_info_free") == 0)
@@ -3066,16 +3064,6 @@ gen_model_h(insn_table *table, lf *file)
lf_printf(file, "\n");
}
- if (!model_issue_p) {
- lf_printf(file, "INLINE_MODEL void model_issue\n");
- lf_printf(file, "(itable_index index,\n");
- lf_printf(file, " model_data *model_ptr,\n");
- lf_printf(file, " unsigned_word cia,\n");
- lf_printf(file, " idecode_cache *cache_entry,\n");
- lf_printf(file, " instruction_word instruction);\n");
- lf_printf(file, "\n");
- }
-
if (!model_mon_info_p) {
lf_printf(file, "INLINE_MODEL model_print *model_mon_info\n");
lf_printf(file, "(model_data *model_ptr);\n");
@@ -3170,7 +3158,6 @@ gen_model_c(insn_table *table, lf *file)
int model_create_p = 0;
int model_init_p = 0;
int model_halt_p = 0;
- int model_issue_p = 0;
int model_mon_info_p = 0;
int model_mon_info_free_p = 0;
@@ -3191,10 +3178,18 @@ gen_model_c(insn_table *table, lf *file)
model_c_or_h_data(table, file, insn_ptr->file_entry);
}
+ for(insn_ptr = model_static; insn_ptr; insn_ptr = insn_ptr->next) {
+ model_c_or_h_function(table, file, insn_ptr->file_entry, "STATIC_MODEL");
+ }
+
for(insn_ptr = model_internal; insn_ptr; insn_ptr = insn_ptr->next) {
model_c_or_h_function(table, file, insn_ptr->file_entry, "STATIC_INLINE_MODEL");
}
+ for(insn_ptr = model_static; insn_ptr; insn_ptr = insn_ptr->next) {
+ model_c_function(table, file, insn_ptr->file_entry, "STATIC_MODEL");
+ }
+
for(insn_ptr = model_internal; insn_ptr; insn_ptr = insn_ptr->next) {
model_c_function(table, file, insn_ptr->file_entry, "STATIC_INLINE_MODEL");
}
@@ -3208,8 +3203,6 @@ gen_model_c(insn_table *table, lf *file)
model_init_p = 1;
else if (strcmp (name, "model_halt") == 0)
model_halt_p = 1;
- else if (strcmp (name, "model_issue") == 0)
- model_issue_p = 1;
else if (strcmp (name, "model_mon_info") == 0)
model_mon_info_p = 1;
else if (strcmp (name, "model_mon_info_free") == 0)
@@ -3238,17 +3231,6 @@ gen_model_c(insn_table *table, lf *file)
lf_printf(file, "\n");
}
- if (!model_issue_p) {
- lf_printf(file, "INLINE_MODEL void model_issue(itable_index index,\n");
- lf_printf(file, " model_data *model_ptr,\n");
- lf_printf(file, " unsigned_word cia,\n");
- lf_printf(file, " idecode_cache *cache_entry,\n");
- lf_printf(file, " instruction_word instruction)\n");
- lf_printf(file, "{\n");
- lf_printf(file, "}\n");
- lf_printf(file, "\n");
- }
-
if (!model_mon_info_p) {
lf_printf(file, "INLINE_MODEL model_print *model_mon_info(model_data *model_ptr)\n");
lf_printf(file, "{\n");