[Mesa-dev] [PATCH v2 026/103] i965/vec4: fix get_nir_dest() to use DF type for 64-bit destinations

Iago Toral Quiroga itoral at igalia.com
Tue Oct 11 09:01:30 UTC 2016


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().
---
 src/mesa/drivers/dri/i965/brw_vec4_nir.cpp | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/src/mesa/drivers/dri/i965/brw_vec4_nir.cpp b/src/mesa/drivers/dri/i965/brw_vec4_nir.cpp
index c825aeb..fdd3cba 100644
--- a/src/mesa/drivers/dri/i965/brw_vec4_nir.cpp
+++ b/src/mesa/drivers/dri/i965/brw_vec4_nir.cpp
@@ -259,8 +259,10 @@ 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)
+   if (nir_reg->bit_size == 64) {
       base_offset *= 2;
+      reg.type = BRW_REGISTER_TYPE_DF;
+   }
    reg = offset(reg, base_offset);
    if (indirect) {
       reg.reladdr =
@@ -277,6 +279,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 {
-- 
2.7.4



More information about the mesa-dev mailing list