* 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.
This commit is contained in:
David Edelsohn
1996-02-21 05:50:03 +00:00
parent 38399547ba
commit e86d5cf30f

View File

@ -760,7 +760,7 @@ BSR (val, amount)
} }
/* Parse an argument that can be expressed as a keyword. /* Parse an argument that can be expressed as a keyword.
(eg: #StoreStore). (eg: #StoreStore or %ccfr).
The result is a boolean indicating success. The result is a boolean indicating success.
If successful, INPUT_POINTER is updated. */ If successful, INPUT_POINTER is updated. */
@ -774,7 +774,7 @@ parse_keyword_arg (lookup_fn, input_pointerP, valueP)
char c, *p, *q; char c, *p, *q;
p = *input_pointerP; p = *input_pointerP;
for (q = p + (*p == '#'); isalpha (*q) || *q == '_'; ++q) for (q = p + (*p == '#' || *p == '%'); isalpha (*q) || *q == '_'; ++q)
continue; continue;
c = *q; c = *q;
*q = 0; *q = 0;
@ -1008,11 +1008,22 @@ sparc_ip (str)
++s; ++s;
} }
if (current_architecture >= SPARC_OPCODE_ARCH_V9)
{
if (num < 16 || 31 < num) if (num < 16 || 31 < num)
{ {
error_message = ": asr number must be between 15 and 31"; error_message = ": asr number must be between 16 and 31";
goto error; goto error;
} /* out of range */ }
}
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)); opcode |= (*args == 'M' ? RS1 (num) : RD (num));
continue; continue;
@ -1021,8 +1032,7 @@ sparc_ip (str)
{ {
error_message = ": expecting %asrN"; error_message = ": expecting %asrN";
goto error; goto error;
} /* if %asr followed by a number. */ }
} /* if %asr */ } /* if %asr */
break; break;
@ -1744,6 +1754,20 @@ sparc_ip (str)
s += 2; s += 2;
continue; 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: default:
as_fatal ("failed sanity check."); as_fatal ("failed sanity check.");
} /* switch on arg code */ } /* switch on arg code */