Supporting bit field extract and bit field insert 2

Supporting two new operators, bfe and bfi2
bfe: Component-wise extracts a bit field from src2 using the bit field width from src0 and the bit field offset from src1.
bfi2: component-wise performs the bitfield insert operation on src1 and src2 based on the mask in src0.
This commit is contained in:
Homer Hsing 2012-09-13 11:05:50 +08:00 committed by Damien Lespiau
parent 210510cebb
commit 8ca55688ea
3 changed files with 6 additions and 2 deletions

View File

@ -568,6 +568,8 @@
#define BRW_OPCODE_ASR 12
#define BRW_OPCODE_CMP 16
#define BRW_OPCODE_CMPN 17
#define BRW_OPCODE_BFE 24
#define BRW_OPCODE_BFI2 26
#define BRW_OPCODE_JMPI 32
#define BRW_OPCODE_IF 34
#define BRW_OPCODE_IFF 35

View File

@ -118,7 +118,7 @@ void set_direct_src_operand(struct src_operand *src, struct direct_reg *reg,
%token <integer> SEND NOP JMPI IF IFF WHILE ELSE BREAK CONT HALT MSAVE
%token <integer> PUSH MREST POP WAIT DO ENDIF ILLEGAL
%token <integer> MATH_INST
%token <integer> MAD LRP
%token <integer> MAD LRP BFE BFI2
%token NULL_TOKEN MATH SAMPLER GATEWAY READ WRITE URB THREAD_SPAWNER VME DATA_PORT
@ -493,7 +493,7 @@ binaryaccinstruction:
binaryaccop: AVG | ADD | SEL | AND | OR | XOR | SHR | SHL | ASR | CMP | CMPN | PLN
;
trinaryop: MAD | LRP
trinaryop: MAD | LRP | BFE | BFI2
;
trinaryinstruction:

View File

@ -85,6 +85,8 @@ yylval.integer = BRW_CHANNEL_W;
"mad" { yylval.integer = BRW_OPCODE_MAD; return MAD; }
"lrp" { yylval.integer = BRW_OPCODE_LRP; return LRP; }
"bfe" { yylval.integer = BRW_OPCODE_BFE; return BFE; }
"bfi2" { yylval.integer = BRW_OPCODE_BFI2; return BFI2; }
"mul" { yylval.integer = BRW_OPCODE_MUL; return MUL; }
"mac" { yylval.integer = BRW_OPCODE_MAC; return MAC; }
"mach" { yylval.integer = BRW_OPCODE_MACH; return MACH; }