summaryrefslogtreecommitdiffstats
path: root/src/mesa
diff options
context:
space:
mode:
authorMatt Turner <[email protected]>2015-10-08 14:19:10 -0700
committerMatt Turner <[email protected]>2015-11-12 11:00:10 -0800
commit903050694bd42b658145b96e501c803c3c21127e (patch)
tree34e156e39944b764520633e8436ab5cf87b612f8 /src/mesa
parent3e74038280319cf02c55f3879d95d7c1aec210fe (diff)
i965: Consolidate is_3src() functions.
Otherwise I'll have to add another later in this series.
Diffstat (limited to 'src/mesa')
-rw-r--r--src/mesa/drivers/dri/i965/brw_eu.h6
-rw-r--r--src/mesa/drivers/dri/i965/brw_eu_compact.c7
-rw-r--r--src/mesa/drivers/dri/i965/brw_shader.cpp2
3 files changed, 7 insertions, 8 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_eu.h b/src/mesa/drivers/dri/i965/brw_eu.h
index 0ac1ad9378b..1345db77c80 100644
--- a/src/mesa/drivers/dri/i965/brw_eu.h
+++ b/src/mesa/drivers/dri/i965/brw_eu.h
@@ -533,6 +533,12 @@ next_offset(const struct brw_device_info *devinfo, void *store, int offset)
return offset + 16;
}
+static inline bool
+is_3src(enum opcode opcode)
+{
+ return opcode_descs[opcode].nsrc == 3;
+}
+
#ifdef __cplusplus
}
#endif
diff --git a/src/mesa/drivers/dri/i965/brw_eu_compact.c b/src/mesa/drivers/dri/i965/brw_eu_compact.c
index 07ace6bfbcb..bca8a84154f 100644
--- a/src/mesa/drivers/dri/i965/brw_eu_compact.c
+++ b/src/mesa/drivers/dri/i965/brw_eu_compact.c
@@ -954,13 +954,6 @@ is_compactable_immediate(unsigned imm)
return imm == 0 || imm == 0xfffff000;
}
-/* Returns whether an opcode takes three sources. */
-static bool
-is_3src(uint32_t op)
-{
- return opcode_descs[op].nsrc == 3;
-}
-
/**
* Tries to compact instruction src into dst.
*
diff --git a/src/mesa/drivers/dri/i965/brw_shader.cpp b/src/mesa/drivers/dri/i965/brw_shader.cpp
index a6b57c3c3f1..481b69c6e18 100644
--- a/src/mesa/drivers/dri/i965/brw_shader.cpp
+++ b/src/mesa/drivers/dri/i965/brw_shader.cpp
@@ -782,7 +782,7 @@ backend_instruction::is_commutative() const
bool
backend_instruction::is_3src() const
{
- return opcode < ARRAY_SIZE(opcode_descs) && opcode_descs[opcode].nsrc == 3;
+ return ::is_3src(opcode);
}
bool