Skip to content

Commit

Permalink
gpu: jit: codegen: handle 64-bit reg/imm addition
Browse files Browse the repository at this point in the history
  • Loading branch information
echeresh committed May 12, 2023
1 parent ff209f9 commit 7c23d9e
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/gpu/jit/codegen/kernel.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,14 @@ class ir_kernel_t : public jit_generator<hw> {
if (src1.is_reg_data()) {
eadd(mod, dst.reg_data(), src0.reg_data(), src1.reg_data());
} else {
eadd(mod, dst.reg_data(), src0.reg_data(), src1.immediate());
if (ngen_is_qw(src1.type())) {
auto tmp = ra_.alloc_sub(src1.type());
emov(1, tmp, src1.immediate());
eadd(mod, dst.reg_data(), src0.reg_data(), tmp);
ra_.safeRelease(tmp);
} else {
eadd(mod, dst.reg_data(), src0.reg_data(), src1.immediate());
}
}
}

Expand Down

0 comments on commit 7c23d9e

Please sign in to comment.