%left '+' '-'
%left '*' '/' '%'
%token <lval> LTYPE0 LTYPE1 LTYPE2 LTYPE3 LTYPE4
-%token <lval> LTYPEC LTYPED LTYPEN LTYPER LTYPET LTYPES LTYPEM LTYPEI LTYPEG
+%token <lval> LTYPEC LTYPED LTYPEN LTYPER LTYPET LTYPES LTYPEM LTYPEI LTYPEG LTYPEXC LTYPEX
%token <lval> LCONST LFP LPC LSB
-%token <lval> LBREG LLREG LSREG LFREG
+%token <lval> LBREG LLREG LSREG LFREG LMREG LXREG
%token <dval> LFCONST
%token <sval> LSCONST LSP
%token <sym> LNAME LLAB LVAR
%type <con2> con2
%type <gen> mem imm imm2 reg nam rel rem rim rom omem nmem
%type <gen2> nonnon nonrel nonrem rimnon rimrem remrim
-%type <gen2> spec1 spec2 spec3 spec4 spec5 spec6 spec7 spec8
+%type <gen2> spec1 spec2 spec3 spec4 spec5 spec6 spec7 spec8 spec9 spec10
%%
prog:
| prog line
| LTYPEM spec6 { outcode($1, &$2); }
| LTYPEI spec7 { outcode($1, &$2); }
| LTYPEG spec8 { outcode($1, &$2); }
+| LTYPEXC spec9 { outcode($1, &$2); }
+| LTYPEX spec10 { outcode($1, &$2); }
nonnon:
{
$$.from.scale = $3;
$$.to = $5;
}
+spec9: /* CMPPS/CMPPD */
+ reg ',' rem ',' con
+ {
+ $$.from = $1;
+ $$.to = $3;
+ $$.from.offset = $5;
+ }
+
+spec10: /* shufl */
+ imm ',' rem ',' reg
+ {
+ $$.from = $3;
+ $$.to = $5;
+ if($1.type != D_CONST)
+ yyerror("illegal constant");
+ $$.to.offset = $1.offset;
+ }
rem:
reg
$$ = nullgen;
$$.type = $1;
}
+| LMREG
+ {
+ $$ = nullgen;
+ $$.type = $1;
+ }
| LSP
{
$$ = nullgen;
$$ = nullgen;
$$.type = $1;
}
+| LXREG
+ {
+ $$ = nullgen;
+ $$.type = $1;
+ }
imm:
'$' con