From 908f37d92d3d847aaf46ce825ef7e6568445ad33 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Fri, 25 Aug 2006 17:33:02 -0700 Subject: [PATCH] Add support for more instruction options. --- assembler/gram.y | 36 +++++++++++++++++++++++++++++++----- assembler/lex.l | 8 ++++++++ 2 files changed, 39 insertions(+), 5 deletions(-) diff --git a/assembler/gram.y b/assembler/gram.y index 5843de3..0c58b06 100644 --- a/assembler/gram.y +++ b/assembler/gram.y @@ -61,7 +61,8 @@ %token TYPE_UD, TYPE_D, TYPE_UW, TYPE_W, TYPE_UB, TYPE_B, %token TYPE_VF, TYPE_HF, TYPE_V, TYPE_F -%token ALIGN1 ALIGN16 MASK_DISABLE EOT +%token ALIGN1 ALIGN16 SECHALF COMPR SWITCH ATOMIC NODDCHK NODDCLR +%token MASK_DISABLE BREAKPOINT EOT %token GENREG MSGREG ADDRESSREG ACCREG FLAGREG %token 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; } ; diff --git a/assembler/lex.l b/assembler/lex.l index b5b4f72..b405149 100644 --- a/assembler/lex.l +++ b/assembler/lex.l @@ -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 */ -- 2.7.4