From 6541f1b4d02b52e19c95dcfb07ef5e0e81a57955 Mon Sep 17 00:00:00 2001 From: Matt Turner Date: Wed, 9 Apr 2014 12:01:49 -0700 Subject: i965: Add reads_accumulator_implicitly() function. Reviewed-by: Kenneth Graunke --- src/mesa/drivers/dri/i965/brw_shader.cpp | 13 +++++++++++++ src/mesa/drivers/dri/i965/brw_shader.h | 1 + 2 files changed, 14 insertions(+) (limited to 'src/mesa/drivers/dri/i965') diff --git a/src/mesa/drivers/dri/i965/brw_shader.cpp b/src/mesa/drivers/dri/i965/brw_shader.cpp index c32e66c9f80..6e74803e988 100644 --- a/src/mesa/drivers/dri/i965/brw_shader.cpp +++ b/src/mesa/drivers/dri/i965/brw_shader.cpp @@ -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 { diff --git a/src/mesa/drivers/dri/i965/brw_shader.h b/src/mesa/drivers/dri/i965/brw_shader.h index 6bd7dc886cb..9ef08e58456 100644 --- a/src/mesa/drivers/dri/i965/brw_shader.h +++ b/src/mesa/drivers/dri/i965/brw_shader.h @@ -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 -- cgit v1.2.3