From: Matt Turner Date: Thu, 8 Oct 2015 21:19:10 +0000 (-0700) Subject: i965: Consolidate is_3src() functions. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=903050694bd42b658145b96e501c803c3c21127e;p=mesa.git i965: Consolidate is_3src() functions. Otherwise I'll have to add another later in this series. --- 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