Skip to content

Commit

Permalink
gpu: jit: codegen: workaround csel region bug
Browse files Browse the repository at this point in the history
  • Loading branch information
kealan-barbieri authored and karturov committed Oct 3, 2023
1 parent 955c849 commit dc66df7
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions src/gpu/jit/codegen/codegen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1250,8 +1250,17 @@ class expr_evaluator_t : public ir_visitor_t {
auto temp = scope_.alloc_reg_buf_data(regs).format(
off, ngen::DataType::f, esize);
host_->emul(mod, temp, dst, src1);
host_->csel(mod | host_->le, dst.reg_data(), temp,
dst.reg_data(), dst.reg_data());
// Workaround for regioning restriction.
if (esize == 2) {
host_->csel(mod | host_->le, dst.reg_data(),
temp.subregister(0)(1),
dst.reg_buf_data().subregister(0)(1),
dst.reg_buf_data().subregister(0)(1));
} else {
host_->csel(mod | host_->le, dst.reg_data(), temp,
dst.reg_data(), dst.reg_data());
}

break;
}
default:
Expand Down

0 comments on commit dc66df7

Please # to comment.