Add support for more instruction options.

This commit is contained in:
Eric Anholt 2006-08-25 17:33:02 -07:00 committed by Damien Lespiau
parent 6db54d7465
commit 908f37d92d
2 changed files with 39 additions and 5 deletions

View File

@ -61,7 +61,8 @@
%token <integer> TYPE_UD, TYPE_D, TYPE_UW, TYPE_W, TYPE_UB, TYPE_B,
%token <integer> TYPE_VF, TYPE_HF, TYPE_V, TYPE_F
%token <integer> ALIGN1 ALIGN16 MASK_DISABLE EOT
%token ALIGN1 ALIGN16 SECHALF COMPR SWITCH ATOMIC NODDCHK NODDCLR
%token MASK_DISABLE BREAKPOINT EOT
%token <integer> GENREG MSGREG ADDRESSREG ACCREG FLAGREG
%token <integer> MASKREG AMASK IMASK LMASK CMASK
@ -834,7 +835,6 @@ conditionalmodifier: { $$ = 0; }
;
/* 1.4.13: Instruction options */
/* XXX: this is a comma-separated list, really. */
instoptions: LCURLY instoption_list RCURLY
{ $$ = $2; }
;
@ -849,9 +849,31 @@ instoption_list: instoption instoption_list
case ALIGN16:
$$.header.access_mode = BRW_ALIGN_16;
break;
case SECHALF:
$$.header.compression_control |= BRW_COMPRESSION_2NDHALF;
break;
case COMPR:
$$.header.compression_control |=
BRW_COMPRESSION_COMPRESSED;
break;
case SWITCH:
$$.header.thread_control |= BRW_THREAD_SWITCH;
break;
case ATOMIC:
$$.header.thread_control |= BRW_THREAD_ATOMIC;
break;
case NODDCHK:
$$.header.dependency_control |= BRW_DEPENDENCY_NOTCHECKED;
break;
case NODDCLR:
$$.header.dependency_control |= BRW_DEPENDENCY_NOTCLEARED;
break;
case MASK_DISABLE:
$$.header.mask_control = BRW_MASK_DISABLE;
break;
case BREAKPOINT:
$$.header.debug_control = BRW_DEBUG_BREAKPOINT;
break;
case EOT:
/* XXX: EOT shouldn't be an instoption, I don't think */
$$.bits3.generic.end_of_thread = 1;
@ -864,12 +886,16 @@ instoption_list: instoption instoption_list
}
;
/* XXX: fill me in. alignctrl, comprctrl, threadctrl, depctrl, maskctrl,
* debugctrl, sendctrl
*/
instoption: ALIGN1 { $$ = ALIGN1; }
| ALIGN16 { $$ = ALIGN16; }
| SECHALF { $$ = SECHALF; }
| COMPR { $$ = COMPR; }
| SWITCH { $$ = SWITCH; }
| ATOMIC { $$ = ATOMIC; }
| NODDCHK { $$ = NODDCHK; }
| NODDCLR { $$ = NODDCLR; }
| MASK_DISABLE { $$ = MASK_DISABLE; }
| BREAKPOINT { $$ = BREAKPOINT; }
| EOT { $$ = EOT; }
;

View File

@ -202,7 +202,15 @@ int saved_state = INITIAL;
"sat" { return SATURATE; }
"align1" { return ALIGN1; }
"align16" { return ALIGN16; }
"sechalf" { return SECHALF; }
"compr" { return COMPR; }
"switch" { return SWITCH; }
"atomic" { return ATOMIC; }
"noddchk" { return NODDCHK; }
"noddclr" { return NODDCLR; }
"mask_disable" { return MASK_DISABLE; }
"nomask" { return MASK_DISABLE; }
"breakpoint" { return BREAKPOINT; }
"EOT" { return EOT; }
/* extended math functions */