PR gas/11395
authorDave Anglin <dave.anglin@nrc.ca>
Fri, 31 Dec 2010 16:43:46 +0000 (16:43 +0000)
committerDave Anglin <dave.anglin@nrc.ca>
Fri, 31 Dec 2010 16:43:46 +0000 (16:43 +0000)
* config/tc-hppa.c (pa_ip): Revert last change.  Add variable need_cond
to determine whether a 64-bit condition is needed for 'A' and 'S'
conditions.  Default to 32-bit never condition for logical and unit
instructions.  Add error message for missing branch on bit condition.

* hppa.h (pa_opcodes): Revert last change.  Exchange 32 and 64-bit
"bb" entries.

* hppa-dis.c (compare_cond_64_names): Change never condition to ",*".
(add_cond_64_names): Likewise.
(logical_cond_64_names): Likewise.
(unit_cond_64_names): Likewise.

gas/ChangeLog
gas/config/tc-hppa.c
include/opcode/ChangeLog
include/opcode/hppa.h
opcodes/ChangeLog
opcodes/hppa-dis.c

index b10467799a5bdde4e17cf5a01cec81ae8e9b29fa..8371afb2f5485ed7e732922741cf0e4549c07045 100644 (file)
@@ -1,3 +1,11 @@
+2010-12-31  John David Anglin  <dave.anglin@nrc-cnrc.gc.ca>
+
+       PR gas/11395
+       * config/tc-hppa.c (pa_ip): Revert last change.  Add variable need_cond
+       to determine whether a 64-bit condition is needed for 'A' and 'S'
+       conditions.  Default to 32-bit never condition for logical and unit
+       instructions.  Add error message for missing branch on bit condition.
+
 2010-12-31  Robert Millan  <rmh@gnu.org>
 
        * config/tc-mips.c (ELF_TARGET): New macro.  Generates target
index b2c5076fda5fc7b9d9d45d48dd3cdd48cca34065..e688f71fba7ea8a2b2b32e03bb9ea38550adfa6d 100644 (file)
@@ -3204,7 +3204,7 @@ pa_ip (char *str)
   const char *args;
   int match = FALSE;
   int comma = 0;
-  int cmpltr, nullif, flag, cond, num;
+  int cmpltr, nullif, flag, cond, need_cond, num;
   int immediate_check = 0, pos = -1, len = -1;
   unsigned long opcode;
   struct pa_opcode *insn;
@@ -3264,6 +3264,7 @@ pa_ip (char *str)
       opcode = insn->match;
       strict = (insn->flags & FLAG_STRICT);
       memset (&the_insn, 0, sizeof (the_insn));
+      need_cond = 1;
 
       the_insn.reloc = R_HPPA_NONE;
 
@@ -3758,8 +3759,8 @@ pa_ip (char *str)
                  else
                    break;
 
-                 /* Set doubleword carry bit.  */
-                 opcode |= 0x20;
+                 /* Condition is not required with "dc".  */
+                 need_cond = 0;
                  INSERT_FIELD_AND_CONTINUE (opcode, flag, 11);
 
                /* Handle 32 bit carry for ADD.  */
@@ -3828,8 +3829,8 @@ pa_ip (char *str)
                  else
                    break;
 
-                 /* Set doubleword borrow bit.  */
-                 opcode |= 0x20;
+                 /* Condition is not required with "db".  */
+                 need_cond = 0;
                  INSERT_FIELD_AND_CONTINUE (opcode, flag, 11);
 
                /* Handle 32 bit borrow for SUB.  */
@@ -3973,14 +3974,6 @@ pa_ip (char *str)
 
                  /* Handle an add condition.  */
                  case 'A':
-                   /* PR gas/11395
-                      If we don't have a ",*" condition or "dc" completer,
-                      then we have a doubleword carry match failure.  */
-                   if (*s != ',' && !(opcode & 0x20))
-                     break;
-                   opcode |= 0x20;
-                   /* Fall through.  */
-
                  case 'a':
                    cmpltr = 0;
                    flag = 0;
@@ -4063,6 +4056,11 @@ pa_ip (char *str)
                          as_bad (_("Invalid Add Condition: %s"), name);
                        *s = c;
                      }
+                   /* Except with "dc", we have a match failure with
+                      'A' if we don't have a doubleword condition.  */
+                   else if (*args == 'A' && need_cond)
+                     break;
+
                    opcode |= cmpltr << 13;
                    INSERT_FIELD_AND_CONTINUE (opcode, flag, 12);
 
@@ -4142,20 +4140,15 @@ pa_ip (char *str)
                            s += 2;
                          }
                        else
-                         as_bad (_("Invalid Bit Branch Condition: %c"), *s);
+                         as_bad (_("Invalid Branch On Bit Condition: %c"), *s);
                      }
+                   else
+                     as_bad (_("Missing Branch On Bit Condition"));
+
                    INSERT_FIELD_AND_CONTINUE (opcode, cmpltr, 15);
 
                  /* Handle a compare/subtract condition.  */
                  case 'S':
-                   /* PR gas/11395
-                      If we don't have a ",*" condition or "dc" completer,
-                      then we have a doubleword carry match failure.  */
-                   if (*s != ',' && !(opcode & 0x20))
-                     break;
-                   opcode |= 0x20;
-                   /* Fall through.  */
-
                  case 's':
                    cmpltr = 0;
                    flag = 0;
@@ -4239,6 +4232,11 @@ pa_ip (char *str)
                                  name);
                        *s = c;
                      }
+                   /* Except with "db", we have a match failure with
+                      'S' if we don't have a doubleword condition.  */
+                   else if (*args == 'S' && need_cond)
+                     break;
+
                    opcode |= cmpltr << 13;
                    INSERT_FIELD_AND_CONTINUE (opcode, flag, 12);
 
@@ -4297,7 +4295,7 @@ pa_ip (char *str)
 
                    INSERT_FIELD_AND_CONTINUE (opcode, cmpltr, 13);
 
-                   /* Handle a logical instruction condition.  */
+                 /* Handle a logical instruction condition.  */
                  case 'L':
                  case 'l':
                    cmpltr = 0;
@@ -4361,6 +4359,10 @@ pa_ip (char *str)
                          as_bad (_("Invalid Logical Instruction Condition."));
                        *s = c;
                      }
+                   /* 32-bit is default for no condition.  */
+                   else if (*args == 'L')
+                     break;
+
                    opcode |= cmpltr << 13;
                    INSERT_FIELD_AND_CONTINUE (opcode, flag, 12);
 
@@ -4419,6 +4421,7 @@ pa_ip (char *str)
                          as_bad (_("Invalid Shift/Extract/Deposit Condition."));
                        *s = c;
                      }
+
                    INSERT_FIELD_AND_CONTINUE (opcode, cmpltr, 13);
 
                  /* Handle a unit instruction condition.  */
@@ -4530,6 +4533,10 @@ pa_ip (char *str)
                        else if (*args != 'U' || (*s != ' ' && *s != '\t'))
                          as_bad (_("Invalid Unit Instruction Condition."));
                      }
+                   /* 32-bit is default for no condition.  */
+                   else if (*args == 'U')
+                     break;
+
                    opcode |= cmpltr << 13;
                    INSERT_FIELD_AND_CONTINUE (opcode, flag, 12);
 
index 5b2f5899967a81ec0ebbee256b2a04aec7d6e4af..8e07659aaaf3a732176e59e08ba1cfbcee7b2ec7 100644 (file)
@@ -1,3 +1,9 @@
+2010-12-31  John David Anglin  <dave.anglin@nrc-cnrc.gc.ca>
+
+       PR gas/11395
+       * hppa.h (pa_opcodes): Revert last change.  Exchange 32 and 64-bit
+       "bb" entries.
+
 2010-12-26  John David Anglin  <dave.anglin@nrc-cnrc.gc.ca>
 
        PR gas/11395
index 3927fcbc08a1ee8b0680bcdd8b54f71ff1324bd4..9073206449796d05bc8fc7b2b9808e5359c7847e 100644 (file)
@@ -594,10 +594,10 @@ static const struct pa_opcode pa_opcodes[] =
 { "addbf",     0xa8000000, 0xfc000000, "?dnx,b,w", pa10, 0},
 { "addibt",    0xa4000000, 0xfc000000, "?dn5,b,w", pa10, 0},
 { "addibf",    0xac000000, 0xfc000000, "?dn5,b,w", pa10, 0},
-{ "bb",                0xc0004000, 0xffe06000, "?bnx,!,w", pa10, FLAG_STRICT}, 
 { "bb",                0xc0006000, 0xffe06000, "?Bnx,!,w", pa20, FLAG_STRICT}, 
-{ "bb",                0xc4004000, 0xfc006000, "?bnx,Q,w", pa10, FLAG_STRICT}, 
+{ "bb",                0xc0004000, 0xffe06000, "?bnx,!,w", pa10, FLAG_STRICT}, 
 { "bb",                0xc4004000, 0xfc004000, "?Bnx,B,w", pa20, FLAG_STRICT}, 
+{ "bb",                0xc4004000, 0xfc006000, "?bnx,Q,w", pa10, FLAG_STRICT}, 
 { "bb",                0xc4004000, 0xfc006000, "?bnx,Q,w", pa10, 0}, 
 { "bvb",       0xc0004000, 0xffe04000, "?bnx,w", pa10, 0},
 { "clrbts",    0xe8004005, 0xffffffff, "", pa20, FLAG_STRICT},
@@ -634,20 +634,20 @@ static const struct pa_opcode pa_opcodes[] =
 { "addio",     0xb4000800, 0xfc000800, "?ai,b,x", pa10, 0},
 { "addit",     0xb0000000, 0xfc000800, "?ai,b,x", pa10, 0},
 { "addito",    0xb0000800, 0xfc000800, "?ai,b,x", pa10, 0},
-{ "add",       0x08000700, 0xfc0007e0, "cY?Ax,b,t", pa20, FLAG_STRICT},
+{ "add",       0x08000720, 0xfc0007e0, "cY?Ax,b,t", pa20, FLAG_STRICT},
 { "add",       0x08000700, 0xfc0007e0, "cy?ax,b,t", pa10, FLAG_STRICT},
-{ "add",       0x08000200, 0xfc0003e0, "ca?Ax,b,t", pa20, FLAG_STRICT},
+{ "add",       0x08000220, 0xfc0003e0, "ca?Ax,b,t", pa20, FLAG_STRICT},
 { "add",       0x08000200, 0xfc0003e0, "ca?ax,b,t", pa10, FLAG_STRICT},
 { "add",       0x08000600, 0xfc000fe0, "?ax,b,t", pa10, 0},
 { "addl",      0x08000a00, 0xfc000fe0, "?ax,b,t", pa10, 0},
 { "addo",      0x08000e00, 0xfc000fe0, "?ax,b,t", pa10, 0},
 { "addc",      0x08000700, 0xfc000fe0, "?ax,b,t", pa10, 0},
 { "addco",     0x08000f00, 0xfc000fe0, "?ax,b,t", pa10, 0},
-{ "sub",       0x080004c0, 0xfc0007e0, "ct?Sx,b,t", pa20, FLAG_STRICT},
+{ "sub",       0x080004e0, 0xfc0007e0, "ct?Sx,b,t", pa20, FLAG_STRICT},
 { "sub",       0x080004c0, 0xfc0007e0, "ct?sx,b,t", pa10, FLAG_STRICT},
-{ "sub",       0x08000500, 0xfc0007e0, "cB?Sx,b,t", pa20, FLAG_STRICT},
+{ "sub",       0x08000520, 0xfc0007e0, "cB?Sx,b,t", pa20, FLAG_STRICT},
 { "sub",       0x08000500, 0xfc0007e0, "cb?sx,b,t", pa10, FLAG_STRICT},
-{ "sub",       0x08000400, 0xfc0007e0, "cv?Sx,b,t", pa20, FLAG_STRICT},
+{ "sub",       0x08000420, 0xfc0007e0, "cv?Sx,b,t", pa20, FLAG_STRICT},
 { "sub",       0x08000400, 0xfc0007e0, "cv?sx,b,t", pa10, FLAG_STRICT},
 { "sub",       0x08000400, 0xfc000fe0, "?sx,b,t", pa10, 0},
 { "subo",      0x08000c00, 0xfc000fe0, "?sx,b,t", pa10, 0},
index a62a5d0a00fbac960eff01c536105fb92e930137..34a8d305423328a38afb67300b4e326d4f57dc82 100644 (file)
@@ -1,3 +1,11 @@
+2010-12-31  John David Anglin  <dave.anglin@nrc-cnrc.gc.ca>
+
+       PR gas/11395
+       * hppa-dis.c (compare_cond_64_names): Change never condition to ",*".
+       (add_cond_64_names): Likewise.
+       (logical_cond_64_names): Likewise.
+       (unit_cond_64_names): Likewise.
+
 2010-12-30  H.J. Lu  <hongjiu.lu@intel.com>
 
        * i386-dis.c (print_insn): Support bfd_mach_x64_32 and
index a1df7f5c62fafff95e3eedd2767f3b0a423cfaaa..74d9ece9f8a487fc44ab2ce22733b8490df2378a 100644 (file)
@@ -86,7 +86,7 @@ static const char *const compare_cond_names[] =
 };
 static const char *const compare_cond_64_names[] =
 {
-  "", ",*=", ",*<", ",*<=", ",*<<", ",*<<=", ",*sv", ",*od",
+  ",*", ",*=", ",*<", ",*<=", ",*<<", ",*<<=", ",*sv", ",*od",
   ",*tr", ",*<>", ",*>=", ",*>", ",*>>=", ",*>>", ",*nsv", ",*ev"
 };
 static const char *const cmpib_cond_64_names[] =
@@ -100,7 +100,7 @@ static const char *const add_cond_names[] =
 };
 static const char *const add_cond_64_names[] =
 {
-  "", ",*=", ",*<", ",*<=", ",*nuv", ",*znv", ",*sv", ",*od",
+  ",*", ",*=", ",*<", ",*<=", ",*nuv", ",*znv", ",*sv", ",*od",
   ",*tr", ",*<>", ",*>=", ",*>", ",*uv", ",*vnz", ",*nsv", ",*ev"
 };
 static const char *const wide_add_cond_names[] =
@@ -114,7 +114,7 @@ static const char *const logical_cond_names[] =
   ",tr", ",<>", ",>=", ",>", 0, 0, 0, ",ev"};
 static const char *const logical_cond_64_names[] =
 {
-  "", ",*=", ",*<", ",*<=", 0, 0, 0, ",*od",
+  ",*", ",*=", ",*<", ",*<=", 0, 0, 0, ",*od",
   ",*tr", ",*<>", ",*>=", ",*>", 0, 0, 0, ",*ev"};
 static const char *const unit_cond_names[] =
 {
@@ -123,7 +123,7 @@ static const char *const unit_cond_names[] =
 };
 static const char *const unit_cond_64_names[] =
 {
-  "", ",*swz", ",*sbz", ",*shz", ",*sdc", ",*swc", ",*sbc", ",*shc",
+  ",*", ",*swz", ",*sbz", ",*shz", ",*sdc", ",*swc", ",*sbc", ",*shc",
   ",*tr", ",*nwz", ",*nbz", ",*nhz", ",*ndc", ",*nwc", ",*nbc", ",*nhc"
 };
 static const char *const shift_cond_names[] =
@@ -132,7 +132,7 @@ static const char *const shift_cond_names[] =
 };
 static const char *const shift_cond_64_names[] =
 {
-  "", ",*=", ",*<", ",*od", ",*tr", ",*<>", ",*>=", ",*ev"
+  ",*", ",*=", ",*<", ",*od", ",*tr", ",*<>", ",*>=", ",*ev"
 };
 static const char *const bb_cond_64_names[] =
 {