@@ -239,32 +239,35 @@ VISA_RawOpnd* rawOperandArray[16];
239
239
%token <align> ALIGN_KEYWORD
240
240
%token <atomic_op> ATOMIC_SUB_OP
241
241
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
254
256
%token ALIAS_EQ // .decl ... alias =...
255
257
%token ALIGN_EQ // .decl ... align =...
256
258
%token ATTR_EQ // .decl ... attr =...
257
259
%token OFFSET_EQ
258
260
%token NUM_ELTS_EQ
259
261
%token V_NAME_EQ
260
262
%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
+
266
269
267
- %token FUNC_DIRECTIVE_DECL // .funcdecl
270
+ %token CPS // .cps
268
271
%token NON_UNIFORM_SAMPLER // .divS
269
272
%token PIXEL_NULL_MASK // .pixel_null_mask
270
273
%token RAW_SENDC_STRING // raw_sendc
@@ -543,6 +546,7 @@ NewlinesOpt: %empty | Newlines
543
546
Statement :
544
547
DirectiveDecl
545
548
| DirectiveGlobalFunction
549
+ | DirectiveImplicitInput
546
550
| DirectiveInput
547
551
| DirectiveParameter
548
552
| DirectiveFunc
@@ -603,47 +607,47 @@ DirectiveDecl:
603
607
| DeclPredicate
604
608
| DeclSampler
605
609
| DeclSurface
606
- | DeclFunctions
610
+ | DeclFunction
607
611
608
- DeclFunctions : FUNC_DIRECTIVE_DECL STRING_LIT
612
+ DeclFunction : DIRECTIVE_FUNCDECL STRING_LIT
609
613
{
610
614
// do nothing as it's informational only
611
615
}
612
616
613
617
DeclVariable :
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
616
620
{
617
621
if (!pBuilder->CISA_general_variable_decl ($2 , (unsigned int )$6, $4, $7, $8.aliasname, $8.offset, $9, CISAlineno)) {
618
622
YYABORT; // error already reported
619
623
}
620
624
}
621
625
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
624
628
{
625
629
pBuilder->CISA_addr_variable_decl ($2 , (unsigned int )$5, ISA_TYPE_UW, $6, CISAlineno);
626
630
}
627
631
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
630
634
{
631
635
if (!pBuilder->CISA_predicate_variable_decl ($2 , (unsigned int )$5, $6, CISAlineno)) {
632
636
YYABORT; // error already reported
633
637
}
634
638
}
635
639
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
638
642
{
639
643
if (!pBuilder->CISA_sampler_variable_decl ($2 , (int )$5, $6, CISAlineno)) {
640
644
YYABORT; // error already reported
641
645
}
642
646
}
643
647
VNameEqOpt : %empty {$$ = " " ;} | V_NAME_EQ IDENT {$$ = $2 ;};
644
648
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
647
651
{
648
652
if (!pBuilder->CISA_surface_variable_decl ($2 , (int )$5, $6, $7, CISAlineno)) {
649
653
YYABORT; // error already reported
@@ -671,9 +675,33 @@ DirectiveInput:
671
675
}
672
676
}
673
677
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
+
674
701
InputOffset : %empty {$$ = 0 ;} | OFFSET_EQ IntExp {$$ = $2 ;}
675
702
InputSize : SIZE_EQ IntExp {$$ = $2 ;}
676
703
704
+ ///////////////////////////////////////////////////////////
677
705
// ----- .parameter ------
678
706
679
707
DirectiveParameter :
@@ -1199,19 +1227,19 @@ Gather43dInstruction: Predicate SAMPLE4_3D_OP PixelNullMaskEnableOpt SAMPLER_CHA
1199
1227
PixelNullMaskEnableOpt : %empty {$$ = false ;} | PIXEL_NULL_MASK {$$ = true ;}
1200
1228
1201
1229
// 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
1203
1231
{
1204
1232
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);
1207
1235
}
1208
1236
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
1211
1239
{
1212
1240
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);
1215
1243
}
1216
1244
1217
1245
RTWriteOperandParse:
0 commit comments