@@ -239,32 +239,35 @@ VISA_RawOpnd* rawOperandArray[16];
239239%token <align> ALIGN_KEYWORD
240240%token <atomic_op> ATOMIC_SUB_OP
241241
242- %token CPS // .cps
243- %token DIRECTIVE_ATTR // .attr
244- %token DIRECTIVE_DECL // .decl
245- %token DIRECTIVE_FUNC // .function
246- %token DIRECTIVE_GLOBAL_FUNC // .global_function
247- %token DIRECTIVE_INPUT // .input
248- %token DIRECTIVE_KERNEL // .kernel
249- %token DIRECTIVE_KERNEL_ATTR // .kernel_attr
250- %token DIRECTIVE_PARAMETER // .parameter
251- %token DIRECTIVE_VERSION // .verions
252-
253-
242+ // directives
243+ %token DIRECTIVE_ATTR // .attr
244+ %token DIRECTIVE_DECL // .decl
245+ %token DIRECTIVE_FUNC // .function
246+ %token DIRECTIVE_FUNCDECL // .funcdecl
247+ %token DIRECTIVE_GLOBAL_FUNC // .global_function
248+ %token <string> DIRECTIVE_IMPLICIT // .implicit *
249+ %token DIRECTIVE_INPUT // .input
250+ %token DIRECTIVE_KERNEL // .kernel
251+ %token DIRECTIVE_KERNEL_ATTR // .kernel_attr
252+ %token DIRECTIVE_PARAMETER // .parameter
253+ %token DIRECTIVE_VERSION // .verions
254+
255+ // tokens to support .decl and .input
254256%token ALIAS_EQ // .decl ... alias =...
255257%token ALIGN_EQ // .decl ... align =...
256258%token ATTR_EQ // .decl ... attr =...
257259%token OFFSET_EQ
258260%token NUM_ELTS_EQ
259261%token V_NAME_EQ
260262%token SIZE_EQ
261- %token G_CLASS
262- %token P_CLASS
263- %token A_CLASS
264- %token S_CLASS
265- %token T_CLASS
263+ %token V_TYPE_EQ_G // v_type =G
264+ %token V_TYPE_EQ_P
265+ %token V_TYPE_EQ_A
266+ %token V_TYPE_EQ_S
267+ %token V_TYPE_EQ_T
268+
266269
267- %token FUNC_DIRECTIVE_DECL // .funcdecl
270+ %token CPS // .cps
268271%token NON_UNIFORM_SAMPLER // .divS
269272%token PIXEL_NULL_MASK // .pixel_null_mask
270273%token RAW_SENDC_STRING // raw_sendc
@@ -543,6 +546,7 @@ NewlinesOpt: %empty | Newlines
543546Statement :
544547 DirectiveDecl
545548 | DirectiveGlobalFunction
549+ | DirectiveImplicitInput
546550 | DirectiveInput
547551 | DirectiveParameter
548552 | DirectiveFunc
@@ -603,47 +607,47 @@ DirectiveDecl:
603607 | DeclPredicate
604608 | DeclSampler
605609 | DeclSurface
606- | DeclFunctions
610+ | DeclFunction
607611
608- DeclFunctions : FUNC_DIRECTIVE_DECL STRING_LIT
612+ DeclFunction : DIRECTIVE_FUNCDECL STRING_LIT
609613 {
610614 // do nothing as it's informational only
611615 }
612616
613617DeclVariable :
614- // 1 2 3 4 5 6 7 8 9
615- DIRECTIVE_DECL IDENT G_CLASS DECL_DATA_TYPE NUM_ELTS_EQ IntExp AlignAttrOpt AliasAttrOpt GenAttrOpt
618+ // 1 2 3 4 5 6 7 8 9
619+ DIRECTIVE_DECL IDENT V_TYPE_EQ_G DECL_DATA_TYPE NUM_ELTS_EQ IntExp AlignAttrOpt AliasAttrOpt GenAttrOpt
616620 {
617621 if (!pBuilder->CISA_general_variable_decl ($2 , (unsigned int )$6, $4, $7, $8.aliasname, $8.offset, $9, CISAlineno)) {
618622 YYABORT; // error already reported
619623 }
620624 }
621625
622- // 1 2 3 4 5 6
623- DeclAddress : DIRECTIVE_DECL IDENT A_CLASS NUM_ELTS_EQ IntExp GenAttrOpt
626+ // 1 2 3 4 5 6
627+ DeclAddress : DIRECTIVE_DECL IDENT V_TYPE_EQ_A NUM_ELTS_EQ IntExp GenAttrOpt
624628 {
625629 pBuilder->CISA_addr_variable_decl ($2 , (unsigned int )$5, ISA_TYPE_UW, $6, CISAlineno);
626630 }
627631
628- // 1 2 3 4 5 6
629- DeclPredicate : DIRECTIVE_DECL IDENT P_CLASS NUM_ELTS_EQ IntExp GenAttrOpt
632+ // 1 2 3 4 5 6
633+ DeclPredicate : DIRECTIVE_DECL IDENT V_TYPE_EQ_P NUM_ELTS_EQ IntExp GenAttrOpt
630634 {
631635 if (!pBuilder->CISA_predicate_variable_decl ($2 , (unsigned int )$5, $6, CISAlineno)) {
632636 YYABORT; // error already reported
633637 }
634638 }
635639
636- // 1 2 3 4 5 6 7
637- DeclSampler : DIRECTIVE_DECL IDENT S_CLASS NUM_ELTS_EQ IntExp VNameEqOpt GenAttrOpt
640+ // 1 2 3 4 5 6 7
641+ DeclSampler : DIRECTIVE_DECL IDENT V_TYPE_EQ_S NUM_ELTS_EQ IntExp VNameEqOpt GenAttrOpt
638642 {
639643 if (!pBuilder->CISA_sampler_variable_decl ($2 , (int )$5, $6, CISAlineno)) {
640644 YYABORT; // error already reported
641645 }
642646 }
643647VNameEqOpt : %empty {$$ = " " ;} | V_NAME_EQ IDENT {$$ = $2 ;};
644648
645- // 1 2 3 4 5 6 7
646- DeclSurface : DIRECTIVE_DECL IDENT T_CLASS NUM_ELTS_EQ IntExp VNameEqOpt GenAttrOpt
649+ // 1 2 3 4 5 6 7
650+ DeclSurface : DIRECTIVE_DECL IDENT V_TYPE_EQ_T NUM_ELTS_EQ IntExp VNameEqOpt GenAttrOpt
647651 {
648652 if (!pBuilder->CISA_surface_variable_decl ($2 , (int )$5, $6, $7, CISAlineno)) {
649653 YYABORT; // error already reported
@@ -671,9 +675,33 @@ DirectiveInput:
671675 }
672676 }
673677
678+ ///////////////////////////////////////////////////////////
679+ // ----- .implicit * inputs ------
680+ DirectiveImplicitInput :
681+ // 1 2 3 4 5
682+ DIRECTIVE_IMPLICIT IDENT InputOffset InputSize GenAttrOpt
683+ {
684+ pBuilder->CISA_implicit_input_directive (
685+ $1 , $2 , (short )$3, (unsigned short )$4, CISAlineno);
686+ }
687+ |
688+ // 1 2 3 4
689+ DIRECTIVE_IMPLICIT IDENT InputOffset GenAttrOpt
690+ {
691+ int64_t size = 0 ;
692+ if (!pBuilder->CISA_eval_sizeof_decl (CISAlineno, $2 , size)) {
693+ YYABORT; // error already reported
694+ }
695+ MUST_HOLD (size < 0x10000 , " declaration size is too large" );
696+ if (!pBuilder->CISA_input_directive ($2 , (short )$3, (unsigned short )size, CISAlineno)) {
697+ YYABORT; // error already reported
698+ }
699+ }
700+
674701InputOffset : %empty {$$ = 0 ;} | OFFSET_EQ IntExp {$$ = $2 ;}
675702InputSize : SIZE_EQ IntExp {$$ = $2 ;}
676703
704+ ///////////////////////////////////////////////////////////
677705// ----- .parameter ------
678706
679707DirectiveParameter :
@@ -1199,19 +1227,19 @@ Gather43dInstruction: Predicate SAMPLE4_3D_OP PixelNullMaskEnableOpt SAMPLER_CHA
11991227PixelNullMaskEnableOpt : %empty {$$ = false ;} | PIXEL_NULL_MASK {$$ = true ;}
12001228
12011229 // 1 2 3 4 5 6
1202- ResInfo3dInstruction : RESINFO_OP_3D ExecSize SAMPLER_CHANNEL Var RawOperand RawOperand
1230+ ResInfo3dInstruction : RESINFO_OP_3D SAMPLER_CHANNEL ExecSize Var RawOperand RawOperand
12031231 {
12041232 pBuilder->CISA_create_info_3d_instruction (
1205- VISA_3D_RESINFO, $2 .emask, $2 .exec_size,
1206- ChannelMask::createFromAPI ($3 ), $4, $5.cisa_gen_opnd, $6.cisa_gen_opnd, CISAlineno);
1233+ VISA_3D_RESINFO, $3 .emask, $3 .exec_size,
1234+ ChannelMask::createFromAPI ($2 ), $4, $5.cisa_gen_opnd, $6.cisa_gen_opnd, CISAlineno);
12071235 }
12081236
1209- // 1 2 3 4 5
1210- SampleInfo3dInstruction: SAMPLEINFO_OP_3D ExecSize SAMPLER_CHANNEL Var RawOperand
1237+ // 1 2 3 4 5
1238+ SampleInfo3dInstruction: SAMPLEINFO_OP_3D SAMPLER_CHANNEL ExecSize Var RawOperand
12111239 {
12121240 pBuilder->CISA_create_info_3d_instruction (
1213- VISA_3D_SAMPLEINFO, $2 .emask , $2 .exec_size ,
1214- ChannelMask::createFromAPI ($3 ), $4 , NULL , $5 .cisa_gen_opnd , CISAlineno);
1241+ VISA_3D_SAMPLEINFO, $3 .emask , $3 .exec_size ,
1242+ ChannelMask::createFromAPI ($2 ), $4 , NULL , $5 .cisa_gen_opnd , CISAlineno);
12151243 }
12161244
12171245RTWriteOperandParse:
0 commit comments