[Backend] Fix for mov.u8 (#766)

Init a potential fix for mov.u8 which is not supported by ptx for now.
Use mov.u16 instead and cast it to u8.
This commit is contained in:
Keren Zhou
2022-10-12 14:32:27 -07:00
committed by GitHub
parent 71b46acc42
commit bc98aead33
2 changed files with 37 additions and 2 deletions

View File

@@ -1216,8 +1216,10 @@ void generator::visit_load_inst(ir::load_inst* x){
v = insert_elt(v, vals_[false_val][idxs[i + ii*size + s]], s);
}
v = bit_cast(v, IntegerType::get(*ctx_, width));
// PTX doesn't support mov.u8, so we need to use mov.u16
auto mov_width = width < 16 ? 16 : width;
asm_oss << "\n ";
asm_oss << "@!$" << n_words << " mov.u" << width;
asm_oss << "@!$" << n_words << " mov.u" << mov_width;
asm_oss << " $" << ii << ", ";
std::ios_base::fmtflags flags(asm_oss.flags());
if(ConstantInt* cst = dyn_cast<ConstantInt>(v))