Mesa (master): i965/fs: Move the failure for gen7 16-wide intdiv to emit_math().

Eric Anholt anholt at kemper.freedesktop.org
Fri Dec 14 23:37:13 UTC 2012


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

Author: Eric Anholt <eric at anholt.net>
Date:   Wed Dec  5 14:56:32 2012 -0800

i965/fs: Move the failure for gen7 16-wide intdiv to emit_math().

The cube map array code adds another caller of emit_math(), which
needs this check.

Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>

---

 src/mesa/drivers/dri/i965/brw_fs.cpp         |    5 ++++-
 src/mesa/drivers/dri/i965/brw_fs_visitor.cpp |    6 ------
 2 files changed, 4 insertions(+), 7 deletions(-)

diff --git a/src/mesa/drivers/dri/i965/brw_fs.cpp b/src/mesa/drivers/dri/i965/brw_fs.cpp
index b7cdadf..5d765e0 100644
--- a/src/mesa/drivers/dri/i965/brw_fs.cpp
+++ b/src/mesa/drivers/dri/i965/brw_fs.cpp
@@ -1139,9 +1139,12 @@ fs_visitor::emit_math(enum opcode opcode, fs_reg dst, fs_reg src0, fs_reg src1)
    fs_inst *inst;
 
    switch (opcode) {
-   case SHADER_OPCODE_POW:
    case SHADER_OPCODE_INT_QUOTIENT:
    case SHADER_OPCODE_INT_REMAINDER:
+      if (intel->gen >= 7 && dispatch_width == 16)
+	 fail("16-wide INTDIV unsupported\n");
+      break;
+   case SHADER_OPCODE_POW:
       break;
    default:
       assert(!"not reached: unsupported binary math opcode.");
diff --git a/src/mesa/drivers/dri/i965/brw_fs_visitor.cpp b/src/mesa/drivers/dri/i965/brw_fs_visitor.cpp
index 708677f..0959e47 100644
--- a/src/mesa/drivers/dri/i965/brw_fs_visitor.cpp
+++ b/src/mesa/drivers/dri/i965/brw_fs_visitor.cpp
@@ -416,17 +416,11 @@ fs_visitor::visit(ir_expression *ir)
       }
       break;
    case ir_binop_div:
-      if (intel->gen >= 7 && dispatch_width == 16)
-	 fail("16-wide INTDIV unsupported\n");
-
       /* Floating point should be lowered by DIV_TO_MUL_RCP in the compiler. */
       assert(ir->type->is_integer());
       emit_math(SHADER_OPCODE_INT_QUOTIENT, this->result, op[0], op[1]);
       break;
    case ir_binop_mod:
-      if (intel->gen >= 7 && dispatch_width == 16)
-	 fail("16-wide INTDIV unsupported\n");
-
       /* Floating point should be lowered by MOD_TO_FRACT in the compiler. */
       assert(ir->type->is_integer());
       emit_math(SHADER_OPCODE_INT_REMAINDER, this->result, op[0], op[1]);




More information about the mesa-commit mailing list