<div dir="ltr"><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Feb 12, 2019 at 5:56 AM Iago Toral Quiroga <<a href="mailto:itoral@igalia.com">itoral@igalia.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">---<br>
 src/intel/compiler/brw_eu_validate.c    | 10 +++++-<br>
 src/intel/compiler/test_eu_validate.cpp | 46 +++++++++++++++++++++++++<br>
 2 files changed, 55 insertions(+), 1 deletion(-)<br>
<br>
diff --git a/src/intel/compiler/brw_eu_validate.c b/src/intel/compiler/brw_eu_validate.c<br>
index 203641fecb9..b1fdd1ce941 100644<br>
--- a/src/intel/compiler/brw_eu_validate.c<br>
+++ b/src/intel/compiler/brw_eu_validate.c<br>
@@ -533,10 +533,18 @@ general_restrictions_based_on_operand_types(const struct gen_device_info *devinf<br>
<br>
    /* From the BDW+ PRM:<br>
     *<br>
-    *    "There is no direct conversion from HF to DF or DF to HF.<br>
+    *    "There is no direct conversion from B/UB to DF or DF to B/UB.<br>
+    *     There is no direct conversion from B/UB to Q/UQ or Q/UQ to B/UB.<br>
+    *     There is no direct conversion from HF to DF or DF to HF.<br>
     *     There is no direct conversion from HF to Q/UQ or Q/UQ to HF."<br>
     */<br>
    enum brw_reg_type src0_type = brw_inst_src0_type(devinfo, inst);<br>
+<br>
+   ERROR_IF(brw_inst_opcode(devinfo, inst) == BRW_OPCODE_MOV &&<br>
+            ((dst_type_size == 1 && type_sz(src0_type) == 8) ||<br>
+             (dst_type_size == 8 && type_sz(src0_type) == 1)),<br>
+            "There are no direct conversion between 64-bit types and B/UB");<br>
+<br>
    ERROR_IF(brw_inst_opcode(devinfo, inst) == BRW_OPCODE_MOV &&<br>
             ((dst_type == BRW_REGISTER_TYPE_HF && type_sz(src0_type) == 8) ||<br>
              (dst_type_size == 8 && src0_type == BRW_REGISTER_TYPE_HF)),<br>
diff --git a/src/intel/compiler/test_eu_validate.cpp b/src/intel/compiler/test_eu_validate.cpp<br>
index 1557b6d2452..06beb53eb5d 100644<br>
--- a/src/intel/compiler/test_eu_validate.cpp<br>
+++ b/src/intel/compiler/test_eu_validate.cpp<br>
@@ -848,6 +848,52 @@ TEST_P(validation_test, byte_destination_relaxed_alignment)<br>
    }<br>
 }<br>
<br>
+TEST_P(validation_test, byte_64bit_conversion)<br>
+{<br>
+   static const struct {<br>
+      enum brw_reg_type dst_type;<br>
+      enum brw_reg_type src_type;<br>
+      unsigned dst_stride;<br>
+      bool expected_result;<br>
+   } inst[] = {<br>
+#define INST(dst_type, src_type, dst_stride, expected_result)             \<br>
+      {                                                                   \<br>
+         BRW_REGISTER_TYPE_##dst_type,                                    \<br>
+         BRW_REGISTER_TYPE_##src_type,                                    \<br>
+         BRW_HORIZONTAL_STRIDE_##dst_stride,                              \<br>
+         expected_result,                                                 \<br>
+      }<br>
+<br>
+      INST(B,  Q, 1, false),<br>
+      INST(B, UQ, 1, false),<br>
+      INST(B, DF, 1, false),<br>
+<br>
+      INST(B,  Q, 2, false),<br>
+      INST(B, UQ, 2, false),<br>
+      INST(B, DF, 2, false),<br>
+<br>
+      INST(B,  Q, 4, false),<br>
+      INST(B, UQ, 4, false),<br>
+      INST(B, DF, 4, false),<br></blockquote><div><br></div><div>Probably want some tests with a B or UB source too. :-)  With those added,</div><div><br></div><div>Reviewed-by: Jason Ekstrand <<a href="mailto:jason@jlekstrand.net">jason@jlekstrand.net</a>><br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
+<br>
+#undef INST<br>
+   };<br>
+<br>
+   if (devinfo.gen < 8)<br>
+      return;<br>
+<br>
+   for (unsigned i = 0; i < sizeof(inst) / sizeof(inst[0]); i++) {<br>
+      if (!devinfo.has_64bit_types && type_sz(inst[i].src_type) == 8)<br>
+         continue;<br>
+<br>
+      brw_MOV(p, retype(g0, inst[i].dst_type), retype(g0, inst[i].src_type));<br>
+      brw_inst_set_dst_hstride(&devinfo, last_inst, inst[i].dst_stride);<br>
+      EXPECT_EQ(inst[i].expected_result, validate(p));<br>
+<br>
+      clear_instructions(p);<br>
+   }<br>
+}<br>
+<br>
 TEST_P(validation_test, half_float_conversion)<br>
 {<br>
    static const struct {<br>
-- <br>
2.17.1<br>
<br>
_______________________________________________<br>
mesa-dev mailing list<br>
<a href="mailto:mesa-dev@lists.freedesktop.org" target="_blank">mesa-dev@lists.freedesktop.org</a><br>
<a href="https://lists.freedesktop.org/mailman/listinfo/mesa-dev" rel="noreferrer" target="_blank">https://lists.freedesktop.org/mailman/listinfo/mesa-dev</a></blockquote></div></div>