nak: Implement nir_op[iu]mul_2x32_64

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
This commit is contained in:
Faith Ekstrand 2023-04-20 13:12:14 -05:00 committed by Marge Bot
parent 392d3791a8
commit 6e5c960434
2 changed files with 7 additions and 1 deletions

View file

@ -116,7 +116,6 @@ fn nir_options(dev: &nv_device_info) -> nir_shader_compiler_options {
op.lower_usub_sat = true; // TODO
op.lower_iadd_sat = true; // TODO
op.use_interpolated_input_intrinsics = true;
op.lower_mul_2x32_64 = true; // TODO
op.lower_int64_options = !0; //nir_lower_iadd64;
op

View file

@ -451,6 +451,13 @@ impl<'a> ShaderFromNir<'a> {
signed: false,
})));
}
nir_op_imul_2x32_64 | nir_op_umul_2x32_64 => {
self.instrs.push(Instr::new(Op::IMad64(OpIMad64 {
dst: dst,
srcs: [srcs[0], srcs[1], Src::new_zero()],
signed: alu.op == nir_op_imul_2x32_64,
})));
}
nir_op_imul_high | nir_op_umul_high => {
let dst_hi = dst.as_ssa().unwrap()[0];
let dst_lo = self.alloc_ssa(RegFile::GPR);