Add support for register-indirect access in destination registers.

This is untested.  Also, a few bits for source operand register-indirect access
sneak in with this commit.
This commit is contained in:
Eric Anholt
2006-08-29 18:31:34 -07:00
committed by Damien Lespiau
parent 2dac0a19a4
commit 3bcf6b29cd
3 changed files with 139 additions and 15 deletions
+17
View File
@@ -102,12 +102,23 @@ int saved_state = INITIAL;
">" { return RANGLE; }
"{" { return LCURLY; }
"}" { return RCURLY; }
"[" { return LSQUARE; }
"]" { return RSQUARE; }
"," { return COMMA; }
"." { return DOT; }
"+" { return PLUS; }
"-" { return MINUS; }
"(abs)" { return ABS; }
/* Most register accesses are lexed as REGFILE[0-9]+, to prevent the register
* with subreg from being lexed as REGFILE NUMBER instead of
* REGISTER INTEGER DOT INTEGER like we want. The alternative was to use a
* start condition, which wasn't very clean-looking.
*
* However, this means we need to lex the general and message register file
* characters as well, for register-indirect access which is formatted
* like g[a#.#] or m[a#.#].
*/
"acc"[0-9]+ {
yylval.integer = atoi(yytext + 1);
return ACCREG;
@@ -120,6 +131,9 @@ int saved_state = INITIAL;
yylval.integer = atoi(yytext + 1);
return MSGREG;
}
"m" {
return MSGREGFILE;
}
"mask"[0-9]+ {
yylval.integer = atoi(yytext + 1);
return MASKREG;
@@ -152,6 +166,9 @@ int saved_state = INITIAL;
yylval.integer = atoi(yytext + 1);
return GENREG;
}
[gr] {
return GENREGFILE;
}
"cr"[0-9]+ {
yylval.integer = atoi(yytext + 1);
return CONTROLREG;