summaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/dri/i965/brw_eu_validate.c
diff options
context:
space:
mode:
authorFrancisco Jerez <currojerez@riseup.net>2016-04-28 00:19:14 -0700
committerMatt Turner <mattst88@gmail.com>2016-05-03 22:32:40 -0700
commit1530e27534831a8d1c82e0a82fe15cd9c70e61e6 (patch)
tree0cc9e88a5cf3e806452b58a27aaa682bcfcebc4a /src/mesa/drivers/dri/i965/brw_eu_validate.c
parent1cc7573162a7f0e8346d7abab50890c58a0dce9a (diff)
downloadexternal_mesa3d-1530e27534831a8d1c82e0a82fe15cd9c70e61e6.zip
external_mesa3d-1530e27534831a8d1c82e0a82fe15cd9c70e61e6.tar.gz
external_mesa3d-1530e27534831a8d1c82e0a82fe15cd9c70e61e6.tar.bz2
i965/disasm: Wrap opcode_desc look-up in a function.
The function takes a device info struct as argument in addition to the opcode number in order to disambiguate between multiple opcode_desc entries for different instructions with the same opcode number. Reviewed-by: Iago Toral Quiroga <itoral@igalia.com> [v1] [v2] mattst88: Put brw_opcode_desc() in brw_eu.c instead of moving it there in a later patch. Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> [v2] [v3] mattst88: Return NULL if opcode >= ARRAY_SIZE(opcode_descs) Reviewed-by: Matt Turner <mattst88@gmail.com>
Diffstat (limited to 'src/mesa/drivers/dri/i965/brw_eu_validate.c')
-rw-r--r--src/mesa/drivers/dri/i965/brw_eu_validate.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_eu_validate.c b/src/mesa/drivers/dri/i965/brw_eu_validate.c
index 2de2ea1..75e161b 100644
--- a/src/mesa/drivers/dri/i965/brw_eu_validate.c
+++ b/src/mesa/drivers/dri/i965/brw_eu_validate.c
@@ -300,6 +300,8 @@ static unsigned
num_sources_from_inst(const struct brw_device_info *devinfo,
const brw_inst *inst)
{
+ const struct opcode_desc *desc =
+ brw_opcode_desc(devinfo, brw_inst_opcode(devinfo, inst));
unsigned math_function;
if (brw_inst_opcode(devinfo, inst) == BRW_OPCODE_MATH) {
@@ -314,8 +316,10 @@ num_sources_from_inst(const struct brw_device_info *devinfo,
*/
return 0;
}
+ } else if (desc) {
+ return desc->nsrc;
} else {
- return opcode_descs[brw_inst_opcode(devinfo, inst)].nsrc;
+ return 0;
}
switch (math_function) {