OSDN Git Service

* config/tc-hppa.c (pa_ip): Handle 'd', '#' and 'cq'.
authorlaw <law>
Sun, 19 Sep 1999 19:23:07 +0000 (19:23 +0000)
committerlaw <law>
Sun, 19 Sep 1999 19:23:07 +0000 (19:23 +0000)
gas/ChangeLog
gas/config/tc-hppa.c

index 6ec8c8d..913dd76 100644 (file)
@@ -1,5 +1,7 @@
 Sun Sep 19 10:43:31 1999  Jeffrey A Law  (law@cygnus.com)
 
+       * config/tc-hppa.c (pa_ip): Handle 'd', '#' and 'cq'.
+
        * config/tc-hppa.c (struct pa_it): New field "trunc".
        (pa_ip): Hadnle 'h', 'm', '=', '{', and '_' operands.
        (pa_parse_ftest_gfx_completer): New function
index e72da28..755585a 100644 (file)
@@ -1785,6 +1785,7 @@ pa_ip (str)
 
                /* Handle a short load/store completer.  */
                case 'm':
+               case 'q':
                  {
                    int a = 0;
                    int m = 0;
@@ -1809,8 +1810,18 @@ pa_ip (str)
                        s += 2;
                      }
 
-                   opcode |= m << 5;
-                   INSERT_FIELD_AND_CONTINUE (opcode, a, 13);
+                  /* 'm' and 'q' are the same, except for where they encode
+                      the before/after field.  */
+                  if (*args == 'm')
+                     {
+                       opcode |= m << 5;
+                       INSERT_FIELD_AND_CONTINUE (opcode, a, 13);
+                     }
+                   else if (*args == 'q')
+                     {
+                       opcode |= m << 3;
+                       INSERT_FIELD_AND_CONTINUE (opcode, a, 2);
+                     }
                  }
 
                /* Handle a stbys completer.  */
@@ -2789,6 +2800,64 @@ pa_ip (str)
                  continue;
                }
 
+           /* Handle 14 bit immediated, shifted left three times.  */
+           case '#':
+             the_insn.field_selector = pa_chk_field_selector (&s);
+             get_expression (s);
+             s = expr_end;
+             if (the_insn.exp.X_op == O_constant)
+               {
+                 num = evaluate_absolute (&the_insn);
+                 if (num & 0x7)
+                   break;
+                 CHECK_FIELD (num, 8191, -8192, 0);
+                 if (num < 0)
+                   opcode |= 1;
+                 num &= 0x1fff;
+                 num >>= 3;
+                 INSERT_FIELD_AND_CONTINUE (opcode, num, 4);
+               }
+             else
+               {
+                 if (is_DP_relative (the_insn.exp))
+                   the_insn.reloc = R_HPPA_GOTOFF;
+                 else if (is_PC_relative (the_insn.exp))
+                   the_insn.reloc = R_HPPA_PCREL_CALL;
+                 else
+                   the_insn.reloc = R_HPPA;
+                 the_insn.format = 14;
+                 continue;
+               }
+             break;
+
+           /* Handle 14 bit immediate, shifted left twice.  */
+           case 'd':
+             the_insn.field_selector = pa_chk_field_selector (&s);
+             get_expression (s);
+             s = expr_end;
+             if (the_insn.exp.X_op == O_constant)
+               {
+                 num = evaluate_absolute (&the_insn);
+                 if (num & 0x3)
+                   break;
+                 CHECK_FIELD (num, 8191, -8192, 0);
+                 if (num < 0)
+                   opcode |= 1;
+                 num &= 0x1fff;
+                 num >>= 2;
+                 INSERT_FIELD_AND_CONTINUE (opcode, num, 3);
+               }
+             else
+               {
+                 if (is_DP_relative (the_insn.exp))
+                   the_insn.reloc = R_HPPA_GOTOFF;
+                 else if (is_PC_relative (the_insn.exp))
+                   the_insn.reloc = R_HPPA_PCREL_CALL;
+                 else
+                   the_insn.reloc = R_HPPA;
+                 the_insn.format = 14;
+                 continue;
+               }
 
            /* Handle a 14 bit immediate at 31.  */
            case 'j':