summaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/dri/i965/brw_eu.h
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.h
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.h')
-rw-r--r--src/mesa/drivers/dri/i965/brw_eu.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_eu.h b/src/mesa/drivers/dri/i965/brw_eu.h
index 89b4e7f..563a105 100644
--- a/src/mesa/drivers/dri/i965/brw_eu.h
+++ b/src/mesa/drivers/dri/i965/brw_eu.h
@@ -545,10 +545,14 @@ next_offset(const struct brw_device_info *devinfo, void *store, int offset)
return offset + 16;
}
+const struct opcode_desc *
+brw_opcode_desc(const struct brw_device_info *devinfo, enum opcode opcode);
+
static inline bool
is_3src(const struct brw_device_info *devinfo, enum opcode opcode)
{
- return opcode_descs[opcode].nsrc == 3;
+ const struct opcode_desc *desc = brw_opcode_desc(devinfo, opcode);
+ return desc && desc->nsrc == 3;
}
/** Maximum SEND message length */