Fix incorrect calculation of conditional field when being extracted
authorAndrew Cagney <cagney@redhat.com>
Wed, 29 Jul 1998 00:14:29 +0000 (00:14 +0000)
committerAndrew Cagney <cagney@redhat.com>
Wed, 29 Jul 1998 00:14:29 +0000 (00:14 +0000)
from a previous decode.

sim/igen/ChangeLog
sim/igen/gen.c

index b5f637180d8054e3fefe00c5da89b27047e5441c..4040c6b152a7957d31de8409da8ca6d30c37b002 100644 (file)
@@ -1,3 +1,8 @@
+Wed Jul 29 10:07:27 1998  Andrew Cagney  <cagney@b1.cygnus.com>
+
+       * gen.c (gen_entry_expand_opcode): Extract the field value from an
+       opcode using the correct location bits.
+
 Tue Jul 28 11:19:43 1998  Andrew Cagney  <cagney@b1.cygnus.com>
 
        * ld-insn.c (parse_insn_word): For constant conditional strings,
index 5cc7e76ab901649eed07ae8fdcaaecfb9dad22c6..53b1c1fa3dbb823a906baca8071dde6e6ebce40c 100644 (file)
@@ -1039,8 +1039,17 @@ gen_entry_expand_opcode (gen_entry *table,
                                          /* the table entry fully
                                              specified the condition
                                              field's value */
+                                         /* extract the field's value
+                                             from the opcode */
                                          value = sub_val (t->opcode_nr, t->parent->opcode->last,
-                                                          first_pos, last_pos);
+                                                          condition->field->first, condition->field->last);
+                                         /* this is a requirement of
+                                             a conditonal field
+                                             refering to another field */
+                                         ASSERT ((condition->field->first - condition->field->last)
+                                                 == (first_pos - last_pos));
+printf ("value=%d, opcode_nr=%d, last=%d, [%d..%d]\n",
+       value, t->opcode_nr, t->parent->opcode->last, condition->field->first, condition->field->last);
                                        }
                                    }
                                }