i965: Add a brw_load_register_reg64 helper.
authorKenneth Graunke <kenneth@whitecape.org>
Thu, 5 May 2016 05:52:52 +0000 (22:52 -0700)
committerKenneth Graunke <kenneth@whitecape.org>
Mon, 9 May 2016 22:00:01 +0000 (15:00 -0700)
It appears that we can't do this in a single command (like we do for
MI_LOAD_REGISTER_IMM) - the Skylake simulator gets rather grumpy about
the command length if I try to combine them.  No matter.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
src/mesa/drivers/dri/i965/brw_context.h
src/mesa/drivers/dri/i965/intel_batchbuffer.c

index c216904adaaf7d1ece2ca08245799af2f96caeca..b620f14b39f841b50d096b66b62addcedabb1cfc 100644 (file)
@@ -1463,6 +1463,8 @@ void brw_load_register_imm64(struct brw_context *brw,
                              uint32_t reg, uint64_t imm);
 void brw_load_register_reg(struct brw_context *brw, uint32_t src,
                            uint32_t dest);
+void brw_load_register_reg64(struct brw_context *brw, uint32_t src,
+                             uint32_t dest);
 void brw_store_data_imm32(struct brw_context *brw, drm_intel_bo *bo,
                           uint32_t offset, uint32_t imm);
 void brw_store_data_imm64(struct brw_context *brw, drm_intel_bo *bo,
index 98b94854c2792c9497cd0b10742f265e5a28dcaa..77cdc0adfc2315664a20ec6ddcd13a4c2d9bf7f3 100644 (file)
@@ -648,6 +648,24 @@ brw_load_register_reg(struct brw_context *brw, uint32_t src, uint32_t dest)
    ADVANCE_BATCH();
 }
 
+/*
+ * Copies a 64-bit register.
+ */
+void
+brw_load_register_reg64(struct brw_context *brw, uint32_t src, uint32_t dest)
+{
+   assert(brw->gen >= 8 || brw->is_haswell);
+
+   BEGIN_BATCH(6);
+   OUT_BATCH(MI_LOAD_REGISTER_REG | (3 - 2));
+   OUT_BATCH(src);
+   OUT_BATCH(dest);
+   OUT_BATCH(MI_LOAD_REGISTER_REG | (3 - 2));
+   OUT_BATCH(src + sizeof(uint32_t));
+   OUT_BATCH(dest + sizeof(uint32_t));
+   ADVANCE_BATCH();
+}
+
 /*
  * Write 32-bits of immediate data to a GPU memory buffer.
  */