Mesa (master): i965/fs: emit DIM instruction to load 64-bit immediates in HSW

Samuel Iglesias Gonsálvez samuelig at kemper.freedesktop.org
Thu Jul 14 06:12:20 UTC 2016


Module: Mesa
Branch: master
Commit: 94135e8736f2741684e978afac9d34c368f7bcb1
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=94135e8736f2741684e978afac9d34c368f7bcb1

Author: Samuel Iglesias Gonsálvez <siglesias at igalia.com>
Date:   Thu Jul  7 09:19:43 2016 +0200

i965/fs: emit DIM instruction to load 64-bit immediates in HSW

v2 (Matt):
- Use brw_imm_df() as source argument of DIM instruction.

Signed-off-by: Samuel Iglesias Gonsálvez <siglesias at igalia.com>
Reviewed-by: Matt Turner <mattst88 at gmail.com>

---

 src/mesa/drivers/dri/i965/brw_fs_nir.cpp | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/src/mesa/drivers/dri/i965/brw_fs_nir.cpp b/src/mesa/drivers/dri/i965/brw_fs_nir.cpp
index a65c273..129984a 100644
--- a/src/mesa/drivers/dri/i965/brw_fs_nir.cpp
+++ b/src/mesa/drivers/dri/i965/brw_fs_nir.cpp
@@ -4558,6 +4558,16 @@ setup_imm_df(const fs_builder &bld, double v)
    if (devinfo->gen >= 8)
       return brw_imm_df(v);
 
+   /* gen7.5 does not support DF immediates straighforward but the DIM
+    * instruction allows to set the 64-bit immediate value.
+    */
+   if (devinfo->is_haswell) {
+      const fs_builder ubld = bld.exec_all();
+      fs_reg dst = ubld.vgrf(BRW_REGISTER_TYPE_DF, 1);
+      ubld.DIM(dst, brw_imm_df(v));
+      return component(dst, 0);
+   }
+
    /* gen7 does not support DF immediates, so we generate a 64-bit constant by
     * writing the low 32-bit of the constant to suboffset 0 of a VGRF and
     * the high 32-bit to suboffset 4 and then applying a stride of 0.




More information about the mesa-commit mailing list