i965: Add reads_accumulator_implicitly() function.
authorMatt Turner <mattst88@gmail.com>
Wed, 9 Apr 2014 19:01:49 +0000 (12:01 -0700)
committerMatt Turner <mattst88@gmail.com>
Thu, 17 Apr 2014 05:46:44 +0000 (22:46 -0700)
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
src/mesa/drivers/dri/i965/brw_shader.cpp
src/mesa/drivers/dri/i965/brw_shader.h

index c32e66c9f80ab87b9ff210e6babc61db60fc95c3..6e74803e988b739d263a49a6a8c96d114ab30ddc 100644 (file)
@@ -662,6 +662,19 @@ backend_instruction::can_do_saturate() const
    }
 }
 
+bool
+backend_instruction::reads_accumulator_implicitly() const
+{
+   switch (opcode) {
+   case BRW_OPCODE_MAC:
+   case BRW_OPCODE_MACH:
+   case BRW_OPCODE_SADA2:
+      return true;
+   default:
+      return false;
+   }
+}
+
 bool
 backend_instruction::has_side_effects() const
 {
index 6bd7dc886cb9fd3d61ac2d4b4d04716adcb2a403..9ef08e58456a413cfbbf456cbc257377c7a37ca5 100644 (file)
@@ -47,6 +47,7 @@ public:
    bool is_control_flow() const;
    bool can_do_source_mods() const;
    bool can_do_saturate() const;
+   bool reads_accumulator_implicitly() const;
 
    /**
     * True if the instruction has side effects other than writing to