]> git.lizzy.rs Git - plan9front.git/blobdiff - sys/src/cmd/8a/a.y
exec(2): fix prototypes
[plan9front.git] / sys / src / cmd / 8a / a.y
index 7c9487f642771b9f2f85ade8c3b60eb4f4c2e443..0ec5dd2633fd08534fb6dd49a6109945aaaf8a62 100644 (file)
@@ -20,9 +20,9 @@
 %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
@@ -30,7 +30,7 @@
 %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
@@ -79,6 +79,8 @@ inst:
 |      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:
        {
@@ -237,6 +239,23 @@ spec8:     /* GLOBL */
                $$.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
@@ -301,6 +320,11 @@ reg:
                $$ = nullgen;
                $$.type = $1;
        }
+|      LMREG
+       {
+               $$ = nullgen;
+               $$.type = $1;
+       }
 |      LSP
        {
                $$ = nullgen;
@@ -311,6 +335,11 @@ reg:
                $$ = nullgen;
                $$.type = $1;
        }
+|      LXREG
+       {
+               $$ = nullgen;
+               $$.type = $1;
+       }
 
 imm:
        '$' con