aboutsummaryrefslogtreecommitdiff
path: root/gas/config/m68k-parse.y
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2004-04-22 10:33:16 +0000
committerNick Clifton <nickc@redhat.com>2004-04-22 10:33:16 +0000
commitfd99574ba57795ede14cf8644ab4180facff4f17 (patch)
treef2d469228e9243e7d35a13b96290eb890898d271 /gas/config/m68k-parse.y
parent69b975477d1abc861452d7cb2c82190e44c47a94 (diff)
downloadgdb-fd99574ba57795ede14cf8644ab4180facff4f17.zip
gdb-fd99574ba57795ede14cf8644ab4180facff4f17.tar.gz
gdb-fd99574ba57795ede14cf8644ab4180facff4f17.tar.bz2
Add support for ColdFire MAC instructions and tidy up support for other m68k
variants.
Diffstat (limited to 'gas/config/m68k-parse.y')
-rw-r--r--gas/config/m68k-parse.y35
1 files changed, 30 insertions, 5 deletions
diff --git a/gas/config/m68k-parse.y b/gas/config/m68k-parse.y
index 813bfaa..c56ad23 100644
--- a/gas/config/m68k-parse.y
+++ b/gas/config/m68k-parse.y
@@ -98,6 +98,7 @@ static struct m68k_op *op;
struct m68k_exp exp;
unsigned long mask;
int onereg;
+ int trailing_ampersand;
}
%token <reg> DR AR FPR FPCR LPC ZAR ZDR LZPC CREG
@@ -109,6 +110,7 @@ static struct m68k_op *op;
%type <exp> optcexpr optexprc
%type <mask> reglist ireglist reglistpair
%type <onereg> reglistreg
+%type <trailing_ampersand> optional_ampersand
%%
@@ -116,14 +118,35 @@ static struct m68k_op *op;
operand:
generic_operand
- | motorola_operand
+ | motorola_operand optional_ampersand
+ {
+ op->trailing_ampersand = $2;
+ }
| mit_operand
;
+/* A trailing ampersand(for MAC/EMAC mask addressing). */
+optional_ampersand:
+ /* empty */
+ { $$ = 0; }
+ | '&'
+ { $$ = 1; }
+ ;
+
/* A generic operand. */
generic_operand:
- DR
+ '<' '<'
+ {
+ op->mode = LSH;
+ }
+
+ | '>' '>'
+ {
+ op->mode = RSH;
+ }
+
+ | DR
{
op->mode = DREG;
op->reg = $1;
@@ -757,12 +780,14 @@ yylex ()
case '/':
case '[':
case ']':
+ case '<':
+ case '>':
return *str++;
case '+':
/* It so happens that a '+' can only appear at the end of an
- operand. If it appears anywhere else, it must be a unary
- plus on an expression. */
- if (str[1] == '\0')
+ operand, or if it is trailed by an '&'(see mac load insn).
+ If it appears anywhere else, it must be a unary. */
+ if (str[1] == '\0' || (str[1] == '&' && str[2] == '\0'))
return *str++;
break;
case '-':