From de1a889fe3554df47a6a751855ebae0cd1517e2f Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Tue, 29 Aug 2006 09:30:32 -0700 Subject: Avoid shift/reduce conflict in predicate by making flagreg and subreg 1 token. Thanks to keithp for pointing out where the conflict was. --- assembler/lex.l | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'assembler/lex.l') diff --git a/assembler/lex.l b/assembler/lex.l index 5deb3c95..e971360d 100644 --- a/assembler/lex.l +++ b/assembler/lex.l @@ -136,8 +136,16 @@ int saved_state = INITIAL; yylval.integer = atoi(yytext + 1); return NOTIFYREG; } -"f"[0-9]+ { - yylval.integer = atoi(yytext + 1); + /* Unlike other registers, flagreg returns the subreg number in the lvalue + * rather than the reg number, to avoid a shift/reduce conflict in the + * predicate control. + */ +"f0.[0-9]+" { + yylval.integer = atoi(yytext + 3); + return FLAGREG; +} +"f0" { + yylval.integer = 0; return FLAGREG; } [gr][0-9]+ { -- cgit v1.2.3