diff options
author | Hans-Peter Nilsson <hp@axis.com> | 2011-07-08 08:37:27 +0000 |
---|---|---|
committer | Hans-Peter Nilsson <hp@axis.com> | 2011-07-08 08:37:27 +0000 |
commit | ae9cd41118fbb6452b2bcb361dcff34db8933e2e (patch) | |
tree | e8dec1897c932dafe80c470d11fac813d927ec24 /sim | |
parent | f72344f7a16b7f81fb1b574a494185646f00bd1c (diff) | |
download | gdb-ae9cd41118fbb6452b2bcb361dcff34db8933e2e.zip gdb-ae9cd41118fbb6452b2bcb361dcff34db8933e2e.tar.gz gdb-ae9cd41118fbb6452b2bcb361dcff34db8933e2e.tar.bz2 |
* ld-insn.c (print_insn_words): For fields, print conditionals.
Diffstat (limited to 'sim')
-rw-r--r-- | sim/igen/ChangeLog | 2 | ||||
-rw-r--r-- | sim/igen/ld-insn.c | 30 |
2 files changed, 32 insertions, 0 deletions
diff --git a/sim/igen/ChangeLog b/sim/igen/ChangeLog index 3b95d89..5a6ad48 100644 --- a/sim/igen/ChangeLog +++ b/sim/igen/ChangeLog @@ -1,5 +1,7 @@ 2011-07-08 Hans-Peter Nilsson <hp@axis.com> + * ld-insn.c (print_insn_words): For fields, print conditionals. + Correct handling of constant named fields. * gen.c (insn_field_cmp): Tweak comment about neither field being an insn_field_string with a cond_eq-to-value condition. diff --git a/sim/igen/ld-insn.c b/sim/igen/ld-insn.c index 86506ea..38c3b55 100644 --- a/sim/igen/ld-insn.c +++ b/sim/igen/ld-insn.c @@ -1289,6 +1289,8 @@ print_insn_words (lf *file, insn_entry * insn) insn_field_entry *field = word->first; while (1) { + insn_field_cond *cond; + if (options.insn_specifying_widths) lf_printf (file, "%d.", field->width); else @@ -1310,6 +1312,34 @@ print_insn_words (lf *file, insn_entry * insn) break; case insn_field_string: lf_printf (file, "%s", field->val_string); + + if (field->conditions == NULL) + break; + + if (field->conditions->test == insn_field_cond_eq) + { + if (field->conditions->type == insn_field_cond_value) + lf_printf (file, "=%ld", + (long) field->conditions->value); + else + lf_printf (file, "=%s", field->conditions->string); + + /* There can be only one equality condition. */ + ASSERT (field->conditions->next == NULL); + break; + } + + for (cond = field->conditions; + cond != NULL; + cond = cond->next) + { + ASSERT (cond->test == insn_field_cond_ne); + + if (cond->type == insn_field_cond_value) + lf_printf (file, "!%ld", (long) cond->value); + else + lf_printf (file, "!%s", cond->string); + } break; } if (field == word->last) |