i965/eu: Allow math on immediates on Broadwell.
authorKenneth Graunke <kenneth@whitecape.org>
Fri, 11 Jul 2014 22:54:11 +0000 (15:54 -0700)
committerKenneth Graunke <kenneth@whitecape.org>
Mon, 11 Aug 2014 02:32:34 +0000 (19:32 -0700)
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Matt Turner <mattst88@gmail.com>
src/mesa/drivers/dri/i965/brw_eu_emit.c

index 36ebed2dec88f0a768fddf52df14ce2eda7f0aaa..a39746fca2baac1116845f081c9e1bf2482181e4 100644 (file)
@@ -1818,7 +1818,8 @@ void gen6_math(struct brw_compile *p,
 
    assert(dest.file == BRW_GENERAL_REGISTER_FILE ||
           (brw->gen >= 7 && dest.file == BRW_MESSAGE_REGISTER_FILE));
-   assert(src0.file == BRW_GENERAL_REGISTER_FILE);
+   assert(src0.file == BRW_GENERAL_REGISTER_FILE ||
+          (brw->gen >= 8 && src0.file == BRW_IMMEDIATE_VALUE));
 
    assert(dest.hstride == BRW_HORIZONTAL_STRIDE_1);
    if (brw->gen == 6) {
@@ -1831,12 +1832,14 @@ void gen6_math(struct brw_compile *p,
        function == BRW_MATH_FUNCTION_INT_DIV_QUOTIENT_AND_REMAINDER) {
       assert(src0.type != BRW_REGISTER_TYPE_F);
       assert(src1.type != BRW_REGISTER_TYPE_F);
-      assert(src1.file == BRW_GENERAL_REGISTER_FILE);
+      assert(src1.file == BRW_GENERAL_REGISTER_FILE ||
+             (brw->gen >= 8 && src1.file == BRW_IMMEDIATE_VALUE));
    } else {
       assert(src0.type == BRW_REGISTER_TYPE_F);
       assert(src1.type == BRW_REGISTER_TYPE_F);
       if (function == BRW_MATH_FUNCTION_POW) {
-         assert(src1.file == BRW_GENERAL_REGISTER_FILE);
+         assert(src1.file == BRW_GENERAL_REGISTER_FILE ||
+                (brw->gen >= 8 && src1.file == BRW_IMMEDIATE_VALUE));
       } else {
          assert(src1.file == BRW_ARCHITECTURE_REGISTER_FILE &&
                 src1.nr == BRW_ARF_NULL);