@@ -510,6 +510,7 @@ void vISAVerifier::verifyRegion(const CISA_INST *inst, unsigned i) {
510
510
Common_ISA_Operand_Class operand_class = vect.getOperandClass ();
511
511
512
512
unsigned dstIndex = getDstIndex (inst);
513
+ bool isDst = (i == dstIndex);
513
514
514
515
unsigned numPreDefinedVars = Get_CISA_PreDefined_Var_Count ();
515
516
@@ -565,7 +566,7 @@ void vISAVerifier::verifyRegion(const CISA_INST *inst, unsigned i) {
565
566
REPORT_INSTRUCTION (options, false , " Invalid execution size" );
566
567
}
567
568
568
- if (i == dstIndex ) {
569
+ if (isDst ) {
569
570
REPORT_INSTRUCTION (
570
571
options, 0 != h_stride_val,
571
572
" Horizontal Stride should not be 0 for a destination operand." );
@@ -632,7 +633,7 @@ void vISAVerifier::verifyRegion(const CISA_INST *inst, unsigned i) {
632
633
" Legal CISA region vertical stride parameter values: "
633
634
" {0, 1, 2, 4, 8, 16, 32}." );
634
635
}
635
- } else if (dstIndex != i ) {
636
+ } else if (!isDst ) {
636
637
// check for out-of-bound addresses for VxH operand
637
638
int numAddr = exec_sz / width_val;
638
639
REPORT_INSTRUCTION (options, numAddr <= (int )irBuilder->getNumAddrRegisters (),
@@ -699,13 +700,14 @@ void vISAVerifier::verifyRegion(const CISA_INST *inst, unsigned i) {
699
700
firstElementIndex +
700
701
(((i * v_stride_val) + (j * h_stride_val)) * VN_size);
701
702
702
- // Madw instruction has both low and high results. So, need to check
703
- // the offset of high result.
704
- unsigned hiOffset = 0 ;
705
- if (inst->opcode == ISA_MADW) {
706
- hiOffset = (region_offset - firstElementIndex + 1 + grfSize - 1 ) &
703
+ // Madw instruction has both low and high results in dst. So, need
704
+ // to check the offset of high result.
705
+ unsigned dstHiOffset = 0 ;
706
+ if (inst->opcode == ISA_MADW && isDst) {
707
+ dstHiOffset =
708
+ (region_offset - firstElementIndex + 1 + grfSize - 1 ) &
707
709
(~(grfSize - 1 )); // GRF-aligned
708
- region_offset += hiOffset ;
710
+ region_offset += dstHiOffset ;
709
711
}
710
712
711
713
if (region_offset >= var_size) {
@@ -719,16 +721,16 @@ void vISAVerifier::verifyRegion(const CISA_INST *inst, unsigned i) {
719
721
std::cout << " The access fails the following check to determine "
720
722
" correct bounds (see CISA manual section 5.1 "
721
723
" Region-based Addressing):\n " ;
722
- if (inst->opcode == ISA_MADW) {
724
+ if (inst->opcode == ISA_MADW && isDst ) {
723
725
std::cout
724
726
<< " (row_offset * GRF_SIZE + col_offset * type_size) + "
725
727
" (((i * v_stride) + (j * h_stride)) * type_size) + "
726
- " high_offset < type_size * num_elements:\n " ;
728
+ " dstHiOffset < type_size * num_elements:\n " ;
727
729
std::cout << " (" << (int )row_offset << " * " << grfSize << " + "
728
730
<< (int )col_offset << " * " << VN_size << " ) + (((" << i
729
731
<< " * " << v_stride_val << " ) + (" << j << " * "
730
732
<< h_stride_val << " )) * " << VN_size << " ) + "
731
- << hiOffset << " < " << VN_size << " * "
733
+ << dstHiOffset << " < " << VN_size << " * "
732
734
<< num_elements << " \n " ;
733
735
} else {
734
736
std::cout
0 commit comments