i965/vec4: fix get_nir_dest() to use DF type for 64-bit destinations
authorIago Toral Quiroga <itoral@igalia.com>
Fri, 12 Feb 2016 07:47:21 +0000 (08:47 +0100)
committerSamuel Iglesias Gonsálvez <siglesias@igalia.com>
Tue, 3 Jan 2017 10:26:50 +0000 (11:26 +0100)
v2: Make dst_reg_for_nir_reg() handle this for nir_register since we
    want to have the correct type set before we call offset().

Reviewed-by: Matt Turner <mattst88@gmail.com>
src/mesa/drivers/dri/i965/brw_vec4_nir.cpp

index f69c14d97213b6bdd38d11dc37d55c4b4540b1ff..67b6b32cfded1d0baec1c5da2efad2f4f32430d7 100644 (file)
@@ -259,6 +259,8 @@ dst_reg_for_nir_reg(vec4_visitor *v, nir_register *nir_reg,
    dst_reg reg;
 
    reg = v->nir_locals[nir_reg->index];
+   if (nir_reg->bit_size == 64)
+      reg.type = BRW_REGISTER_TYPE_DF;
    reg = offset(reg, 8, base_offset);
    if (indirect) {
       reg.reladdr =
@@ -275,6 +277,8 @@ vec4_visitor::get_nir_dest(const nir_dest &dest)
    if (dest.is_ssa) {
       dst_reg dst =
          dst_reg(VGRF, alloc.allocate(DIV_ROUND_UP(dest.ssa.bit_size, 32)));
+      if (dest.ssa.bit_size == 64)
+         dst.type = BRW_REGISTER_TYPE_DF;
       nir_ssa_values[dest.ssa.index] = dst;
       return dst;
    } else {