aboutsummaryrefslogtreecommitdiff
path: root/gas/config
diff options
context:
space:
mode:
authorDavid Edelsohn <dje.gcc@gmail.com>1996-02-21 05:50:03 +0000
committerDavid Edelsohn <dje.gcc@gmail.com>1996-02-21 05:50:03 +0000
commite86d5cf30f28a748b17a42ecc9a2ad4119ef8c3d (patch)
treed2ce6fbca378ec89200d70ed60a4492e6c954de7 /gas/config
parent38399547ba2c39f90403fb8821b4d2903ce15ddd (diff)
downloadgdb-e86d5cf30f28a748b17a42ecc9a2ad4119ef8c3d.zip
gdb-e86d5cf30f28a748b17a42ecc9a2ad4119ef8c3d.tar.gz
gdb-e86d5cf30f28a748b17a42ecc9a2ad4119ef8c3d.tar.bz2
* config/tc-sparc.c (parse_keyword_arg): Accept leadling '%'.
(sparc_ip): Accept %asr[1..31] for v8 and %asr[%16..31] for v9. Recognize [uU] format args as sparclet cpregs.
Diffstat (limited to 'gas/config')
-rw-r--r--gas/config/tc-sparc.c42
1 files changed, 33 insertions, 9 deletions
diff --git a/gas/config/tc-sparc.c b/gas/config/tc-sparc.c
index 0cac1fe..d06d3b3 100644
--- a/gas/config/tc-sparc.c
+++ b/gas/config/tc-sparc.c
@@ -760,7 +760,7 @@ BSR (val, amount)
}
/* Parse an argument that can be expressed as a keyword.
- (eg: #StoreStore).
+ (eg: #StoreStore or %ccfr).
The result is a boolean indicating success.
If successful, INPUT_POINTER is updated. */
@@ -774,7 +774,7 @@ parse_keyword_arg (lookup_fn, input_pointerP, valueP)
char c, *p, *q;
p = *input_pointerP;
- for (q = p + (*p == '#'); isalpha (*q) || *q == '_'; ++q)
+ for (q = p + (*p == '#' || *p == '%'); isalpha (*q) || *q == '_'; ++q)
continue;
c = *q;
*q = 0;
@@ -1008,11 +1008,22 @@ sparc_ip (str)
++s;
}
- if (num < 16 || 31 < num)
+ if (current_architecture >= SPARC_OPCODE_ARCH_V9)
{
- error_message = ": asr number must be between 15 and 31";
- goto error;
- } /* out of range */
+ if (num < 16 || 31 < num)
+ {
+ error_message = ": asr number must be between 16 and 31";
+ goto error;
+ }
+ }
+ else
+ {
+ if (num < 1 || 31 < num)
+ {
+ error_message = ": asr number must be between 1 and 31";
+ goto error;
+ }
+ }
opcode |= (*args == 'M' ? RS1 (num) : RD (num));
continue;
@@ -1021,9 +1032,8 @@ sparc_ip (str)
{
error_message = ": expecting %asrN";
goto error;
- } /* if %asr followed by a number. */
-
- } /* if %asr */
+ }
+ } /* if %asr */
break;
case 'I':
@@ -1744,6 +1754,20 @@ sparc_ip (str)
s += 2;
continue;
+ case 'u':
+ case 'U':
+ {
+ /* Parse a sparclet cpreg. */
+ int cpreg;
+ if (! parse_keyword_arg (sparc_encode_sparclet_cpreg, &s, &cpreg))
+ {
+ error_message = ": invalid cpreg name";
+ goto error;
+ }
+ opcode |= (*args == 'U' ? RS1 (cpreg) : RD (cpreg));
+ continue;
+ }
+
default:
as_fatal ("failed sanity check.");
} /* switch on arg code */