Skip to content

Commit

Permalink
gpu: jit: ngen: fix swsb edge case
Browse files Browse the repository at this point in the history
  • Loading branch information
petercad authored and karturov committed Dec 4, 2023
1 parent 79bc6cc commit 69cef84
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/gpu/jit/ngen/ngen_gen12.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -945,7 +945,9 @@ bool Instruction12::getOperandRegion(autoswsb::DependencyRegion &region, int opN
auto sub = base[sr / getBytes(base.getType())];
auto hs = (1 << o.direct.hs);
if (opNum >= 0) hs >>= 1;
if ((opNum < 0) || (opNum == 2))
if (opNum < 0)
rd = sub(hs, 1, 0);
else if (opNum == 2)
rd = sub(hs);
else
rd = sub((1 << vs) >> 1, hs);
Expand Down Expand Up @@ -987,7 +989,7 @@ bool Instruction12::getOperandRegion(autoswsb::DependencyRegion &region, int opN
auto sub = base[sr / getBytes(base.getType())];
auto hs = (1 << o.direct.hs) >> 1;
if (opNum < 0)
rd = sub(hs);
rd = sub(hs, 1, 0);
else
rd = sub((1 << vs) >> 1, 1 << o.direct.width, hs);

Expand Down

0 comments on commit 69cef84

Please sign in to comment.