aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff Law <law@redhat.com>1999-09-19 20:07:01 +0000
committerJeff Law <law@redhat.com>1999-09-19 20:07:01 +0000
commit65fab780c5f93a6d2783a5b0a2689e5eaf1a52c1 (patch)
tree04dc558597d6f43775f917ecee08ebc3662decd3
parentd3ffb032491b6dcd5be6689edeaa00db903b1985 (diff)
downloadgdb-65fab780c5f93a6d2783a5b0a2689e5eaf1a52c1.zip
gdb-65fab780c5f93a6d2783a5b0a2689e5eaf1a52c1.tar.gz
gdb-65fab780c5f93a6d2783a5b0a2689e5eaf1a52c1.tar.bz2
* config/tc-hppa.c (pa_ip): Handle 'J', 'K' and 'cc'
operands.
-rw-r--r--gas/ChangeLog3
-rw-r--r--gas/config/tc-hppa.c74
2 files changed, 77 insertions, 0 deletions
diff --git a/gas/ChangeLog b/gas/ChangeLog
index 5fe9bbf..737b659 100644
--- a/gas/ChangeLog
+++ b/gas/ChangeLog
@@ -1,5 +1,8 @@
Sun Sep 19 10:43:31 1999 Jeffrey A Law (law@cygnus.com)
+ * config/tc-hppa.c (pa_ip): Handle 'J', 'K' and 'cc'
+ operands.
+
* config/tc-hppa.c (pa_ip); Handle "fe", and 'cJ'.
* config/tc-hppa.c (pa_ip): Handle 'd', '#' and 'cq'.
diff --git a/gas/config/tc-hppa.c b/gas/config/tc-hppa.c
index 191b6cd..63e87b4 100644
--- a/gas/config/tc-hppa.c
+++ b/gas/config/tc-hppa.c
@@ -1787,6 +1787,7 @@ pa_ip (str)
case 'm':
case 'q':
case 'J':
+ case 'c':
{
int a = 0;
int m = 0;
@@ -1810,6 +1811,10 @@ pa_ip (str)
as_bad (_("Invalid Short Load/Store Completer."));
s += 2;
}
+ /* If we did not get a ma/mb completer, then we do not
+ consider this a positive match for 'cc'. */
+ else if (*args == 'c')
+ break;
/* 'J', 'm' and 'q' are the same, except for where they
encode the before/after field. */
@@ -1828,6 +1833,14 @@ pa_ip (str)
/* M bit is explicit in the major opcode. */
INSERT_FIELD_AND_CONTINUE (opcode, a, 2);
}
+ else if (*args == 'c')
+ {
+ /* Gross! Hide these values in the immediate field
+ of the instruction, then pull them out later. */
+ opcode |= m << 8;
+ opcode |= a << 9;
+ continue;
+ }
}
/* Handle a stbys completer. */
@@ -2806,6 +2819,67 @@ pa_ip (str)
continue;
}
+ /* Handle a 14 bit immediate at 31. */
+ case 'J':
+ the_insn.field_selector = pa_chk_field_selector (&s);
+ get_expression (s);
+ s = expr_end;
+ if (the_insn.exp.X_op == O_constant)
+ {
+ int a, m;
+
+ /* XXX the completer stored away tibits of information
+ for us to extract. We need a cleaner way to do this.
+ Now that we have lots of letters again, it would be
+ good to rethink this. */
+ m = (opcode & (1 << 8)) != 0;
+ a = (opcode & (1 << 9)) != 0;
+ opcode &= ~ (3 << 8);
+ num = evaluate_absolute (&the_insn);
+ if (a == 1 && num >= 0 || (a == 0 && num < 0))
+ break;
+ CHECK_FIELD (num, 8191, -8192, 0);
+ low_sign_unext (num, 14, &num);
+ INSERT_FIELD_AND_CONTINUE (opcode, num, 0);
+ }
+ else
+ {
+ break;
+ }
+
+ /* Handle a 14 bit immediate at 31. */
+ case 'K':
+ the_insn.field_selector = pa_chk_field_selector (&s);
+ get_expression (s);
+ s = expr_end;
+ if (the_insn.exp.X_op == O_constant)
+ {
+ int a, m;
+
+ /* XXX the completer stored away tibits of information
+ for us to extract. We need a cleaner way to do this.
+ Now that we have lots of letters again, it would be
+ good to rethink this. */
+ m = (opcode & (1 << 8)) != 0;
+ a = (opcode & (1 << 9)) != 0;
+ opcode &= ~ (3 << 8);
+ num = evaluate_absolute (&the_insn);
+ if (a == 1 && num < 0 || (a == 0 && num > 0))
+ break;
+ if (num % 4)
+ break;
+ CHECK_FIELD (num, 8191, -8192, 0);
+ if (num < 0)
+ opcode |= 1;
+ num &= 0x1fff;
+ num >>= 2;
+ INSERT_FIELD_AND_CONTINUE (opcode, num, 3);
+ }
+ else
+ {
+ break;
+ }
+
/* Handle 14 bit immediated, shifted left three times. */
case '#':
the_insn.field_selector = pa_chk_field_selector (&s);