Skip to content

Commit 1b2120e

Browse files
DianaChenigcbot
authored andcommitted
IGA: fix src1 flat region
- Fix allowed flat regions for 3-src src1. Allowed regions are <0;0>, <1;0>, <4;2>, <8;4> - For 2-src region format, <16;1,0> is a valid region on src1. For example: add (8) r10.0<4>:q r20.0<16;1,0>:w r30.0<16;1,0>:w Fix Region::isFlat check to allow it.
1 parent 3e2559b commit 1b2120e

File tree

4 files changed

+30
-32
lines changed

4 files changed

+30
-32
lines changed

visa/iga/IGALibrary/Backend/GED/Decoder.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -939,9 +939,8 @@ static Region retrieveReducedRegionTernary(Type srcType, Type dstType,
939939
dstRegion.h * TypeSizeInBits(dstType) / TypeSizeInBits(srcType);
940940
switch (sVertStride) {
941941
case 1: return Region::SRC1X0;
942-
case 2: return Region::SRC2X0;
943-
case 4: return Region::SRC4X0;
944-
case 8: return Region::SRC8X0;
942+
case 2: return Region::SRC4X2;
943+
case 4: return Region::SRC8X4;
945944
default:
946945
break;
947946
}
@@ -1756,10 +1755,11 @@ static Region retrieveReducedRegionVWH(Type srcType, Type dstType,
17561755
auto sVertStride =
17571756
dstRegion.h * TypeSizeInBits(dstType) / TypeSizeInBits(srcType);
17581757
switch (sVertStride) {
1759-
case 1: return Region::SRC110;
1760-
case 2: return Region::SRC210;
1761-
case 4: return Region::SRC410;
1762-
case 8: return Region::SRC810;
1758+
case 1: return Region::SRC110;
1759+
case 2: return Region::SRC210;
1760+
case 4: return Region::SRC410;
1761+
case 8: return Region::SRC810;
1762+
case 16: return Region::SRC1610;
17631763
default:
17641764
break;
17651765
}

visa/iga/IGALibrary/IR/Checker/IRChecker.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -214,6 +214,7 @@ struct SemanticChecker : LOCChecker {
214214
}
215215
}
216216

217+
217218
void checkRegRegioningRestrictions(ExecSize es, const Operand &dst,
218219
const Operand &src) {
219220
// only for the form:

visa/iga/IGALibrary/IR/Types.cpp

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -26,25 +26,24 @@ const Region Region::DST1 = REGION_VWH(VT_INVALID, WI_INVALID, HZ_1);
2626
const Region Region::DST2 = REGION_VWH(VT_INVALID, WI_INVALID, HZ_2);
2727
const Region Region::DST4 = REGION_VWH(VT_INVALID, WI_INVALID, HZ_4);
2828
// basic srcs
29-
const Region Region::SRC010 = REGION_VWH(VT_0, WI_1, HZ_0);
30-
const Region Region::SRC110 = REGION_VWH(VT_1, WI_1, HZ_0);
31-
const Region Region::SRC210 = REGION_VWH(VT_2, WI_1, HZ_0);
32-
const Region Region::SRC410 = REGION_VWH(VT_4, WI_1, HZ_0);
33-
const Region Region::SRC810 = REGION_VWH(VT_8, WI_1, HZ_0);
34-
const Region Region::SRC221 = REGION_VWH(VT_2, WI_2, HZ_1);
35-
const Region Region::SRC441 = REGION_VWH(VT_4, WI_4, HZ_1);
36-
const Region Region::SRC881 = REGION_VWH(VT_8, WI_8, HZ_1);
37-
const Region Region::SRCFF1 = REGION_VWH(VT_16, WI_16, HZ_1);
29+
const Region Region::SRC010 = REGION_VWH(VT_0, WI_1, HZ_0);
30+
const Region Region::SRC110 = REGION_VWH(VT_1, WI_1, HZ_0);
31+
const Region Region::SRC210 = REGION_VWH(VT_2, WI_1, HZ_0);
32+
const Region Region::SRC410 = REGION_VWH(VT_4, WI_1, HZ_0);
33+
const Region Region::SRC810 = REGION_VWH(VT_8, WI_1, HZ_0);
34+
const Region Region::SRC1610 = REGION_VWH(VT_16, WI_1, HZ_0);
35+
const Region Region::SRC221 = REGION_VWH(VT_2, WI_2, HZ_1);
36+
const Region Region::SRC441 = REGION_VWH(VT_4, WI_4, HZ_1);
37+
const Region Region::SRC881 = REGION_VWH(VT_8, WI_8, HZ_1);
38+
const Region Region::SRCFF1 = REGION_VWH(VT_16, WI_16, HZ_1);
3839
// ternary align1 src0 and src1
3940
const Region Region::SRC0X0 = REGION_VWH(VT_0, WI_INVALID, HZ_0);
4041
const Region Region::SRC1X0 = REGION_VWH(VT_1, WI_INVALID, HZ_0);
4142
const Region Region::SRC2X1 = REGION_VWH(VT_2, WI_INVALID, HZ_1);
4243
const Region Region::SRC4X1 = REGION_VWH(VT_4, WI_INVALID, HZ_1);
4344
const Region Region::SRC8X1 = REGION_VWH(VT_8, WI_INVALID, HZ_1);
44-
// ternery flat src1
45-
const Region Region::SRC2X0 = REGION_VWH(VT_2, WI_INVALID, HZ_0);
46-
const Region Region::SRC4X0 = REGION_VWH(VT_4, WI_INVALID, HZ_0);
47-
const Region Region::SRC8X0 = REGION_VWH(VT_8, WI_INVALID, HZ_0);
45+
const Region Region::SRC4X2 = REGION_VWH(VT_4, WI_INVALID, HZ_2);
46+
const Region Region::SRC8X4 = REGION_VWH(VT_8, WI_INVALID, HZ_4);
4847
// ternary align src2
4948
const Region Region::SRCXX0 = REGION_VWH(VT_INVALID, WI_INVALID, HZ_0);
5049
const Region Region::SRCXX1 = REGION_VWH(VT_INVALID, WI_INVALID, HZ_1);

visa/iga/IGALibrary/IR/Types.hpp

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -245,10 +245,9 @@ struct Region {
245245
}
246246

247247
bool isFlat() const {
248-
if (bits == SRC1X0.bits || bits == SRC2X0.bits || bits == SRC4X0.bits ||
249-
bits == SRC8X0.bits ||
248+
if (bits == SRC1X0.bits || bits == SRC4X2.bits || bits == SRC8X4.bits ||
250249
bits == SRC110.bits || bits == SRC210.bits || bits == SRC410.bits ||
251-
bits == SRC810.bits)
250+
bits == SRC810.bits || bits == SRC1610.bits)
252251
return true;
253252
return false;
254253
}
@@ -269,11 +268,12 @@ struct Region {
269268
static const Region DST4; // <4>
270269
//
271270
// generalized src regions
272-
static const Region SRC010; // <0;1,0> (broadcast scalar)
273-
static const Region SRC110; // <1;1,0> (packed access)
274-
static const Region SRC210; // <2;1,0> (even strided access)
275-
static const Region SRC410; // <4;1,0> (quarter stided access)
276-
static const Region SRC810; // <8;1,0>
271+
static const Region SRC010; // <0;1,0> (broadcast scalar)
272+
static const Region SRC110; // <1;1,0> (packed access)
273+
static const Region SRC210; // <2;1,0> (even strided access)
274+
static const Region SRC410; // <4;1,0> (quarter stided access)
275+
static const Region SRC810; // <8;1,0>
276+
static const Region SRC1610; // <16;1,0>
277277
//
278278
// older src regions
279279
static const Region SRC221; // <2;2,1>
@@ -287,10 +287,8 @@ struct Region {
287287
static const Region SRC2X1; // <2;1> (ternary align1 src0 and src1)
288288
static const Region SRC1X0; // <1;0> XE_LP changes 2 to 1 in encoding
289289
static const Region SRC4X1; // <4;1> (ternary align1 src0 and src1)
290-
// ternery flat src1
291-
static const Region SRC2X0; // <2;0>
292-
static const Region SRC4X0; // <4;0>
293-
static const Region SRC8X0; // <8;0>
290+
static const Region SRC4X2; // <4;2> single-stride 2
291+
static const Region SRC8X4; // <8;4> single-stride 4
294292
// ternary src2
295293
static const Region SRC8X1; // <8;1> (ternary align1 src0 and src1)
296294
static const Region SRCXX0; // <0> (ternary align1 src2)

0 commit comments

Comments
 (0)