From 79724a07562dae79f00005b61bda4664287989ee Mon Sep 17 00:00:00 2001 From: Jason Ekstrand Date: Wed, 14 Nov 2018 22:38:23 -0600 Subject: [PATCH] intel/fs: Properly handle 64-bit types in LOAD_PAYLOAD By just assigning dst.type to src[i].type, we ensure that the offset at the end of the loop actually offsets it by the right number of registers. Otherwise, we'll get into a case where we copy with a Q type and then offset with a D type and things get out of sync. Reviewed-by: Kenneth Graunke --- src/intel/compiler/brw_fs.cpp | 8 ++++++-- src/intel/compiler/brw_fs_cse.cpp | 1 + 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/intel/compiler/brw_fs.cpp b/src/intel/compiler/brw_fs.cpp index 8dd3b94fbd5..303b1c1b272 100644 --- a/src/intel/compiler/brw_fs.cpp +++ b/src/intel/compiler/brw_fs.cpp @@ -3799,8 +3799,12 @@ fs_visitor::lower_load_payload() } for (uint8_t i = inst->header_size; i < inst->sources; i++) { - if (inst->src[i].file != BAD_FILE) - ibld.MOV(retype(dst, inst->src[i].type), inst->src[i]); + if (inst->src[i].file != BAD_FILE) { + dst.type = inst->src[i].type; + ibld.MOV(dst, inst->src[i]); + } else { + dst.type = BRW_REGISTER_TYPE_UD; + } dst = offset(dst, ibld, 1); } diff --git a/src/intel/compiler/brw_fs_cse.cpp b/src/intel/compiler/brw_fs_cse.cpp index bd917baaa6d..6efa111b1a4 100644 --- a/src/intel/compiler/brw_fs_cse.cpp +++ b/src/intel/compiler/brw_fs_cse.cpp @@ -216,6 +216,7 @@ create_copy_instr(const fs_builder &bld, fs_inst *inst, fs_reg src, bool negate) src.offset += REG_SIZE; } for (int i = inst->header_size; i < inst->sources; i++) { + src.type = inst->src[i].type; payload[i] = src; src = offset(src, bld, 1); } -- 2.30.2