summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2018-03-05 10:07:03 -0700
committerBrian Paul <[email protected]>2018-03-23 09:03:26 -0600
commit9413d1c0fec74d2a7bd8f09049c2aaef8a232a9d (patch)
tree39b06bd65aac9514608a0de987e82ee1a9f3b759 /src
parent7df96826f80231b988e8712f5bce7c9edb358360 (diff)
gallivm: use enum tgis_opcode
Reviewed-by: Eric Anholt <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/gallium/auxiliary/gallivm/lp_bld_tgsi.c8
-rw-r--r--src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c12
2 files changed, 12 insertions, 8 deletions
diff --git a/src/gallium/auxiliary/gallivm/lp_bld_tgsi.c b/src/gallium/auxiliary/gallivm/lp_bld_tgsi.c
index 079a6eed496..64d2cd703be 100644
--- a/src/gallium/auxiliary/gallivm/lp_bld_tgsi.c
+++ b/src/gallium/auxiliary/gallivm/lp_bld_tgsi.c
@@ -198,7 +198,7 @@ void lp_build_fetch_args(
* - map dst x,z to src xy;
* - map dst y,w to src zw;
*/
-static int get_src_chan_idx(unsigned opcode,
+static int get_src_chan_idx(enum tgsi_opcode opcode,
int dst_chan_index)
{
enum tgsi_opcode_type dtype = tgsi_opcode_infer_dst_type(opcode, 0);
@@ -232,10 +232,10 @@ lp_build_tgsi_inst_llvm(
struct lp_build_tgsi_context * bld_base,
const struct tgsi_full_instruction * inst)
{
- unsigned tgsi_opcode = inst->Instruction.Opcode;
- const struct tgsi_opcode_info * info = tgsi_get_opcode_info(tgsi_opcode);
+ enum tgsi_opcode opcode = inst->Instruction.Opcode;
+ const struct tgsi_opcode_info * info = tgsi_get_opcode_info(opcode);
const struct lp_build_tgsi_action * action =
- &bld_base->op_actions[tgsi_opcode];
+ &bld_base->op_actions[opcode];
struct lp_build_emit_data emit_data;
unsigned chan_index;
LLVMValueRef val;
diff --git a/src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c b/src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c
index fad74c68014..e411f906c7a 100644
--- a/src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c
+++ b/src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c
@@ -368,7 +368,8 @@ static void lp_exec_break(struct lp_exec_mask *mask,
exec_mask, "break_full");
}
else {
- unsigned opcode = bld_base->instructions[bld_base->pc + 1].Instruction.Opcode;
+ enum tgsi_opcode opcode =
+ bld_base->instructions[bld_base->pc + 1].Instruction.Opcode;
boolean break_always = (opcode == TGSI_OPCODE_ENDSWITCH ||
opcode == TGSI_OPCODE_CASE);
@@ -630,7 +631,7 @@ static boolean default_analyse_is_last(struct lp_exec_mask *mask,
}
while (pc != ~0u && pc < bld_base->num_instructions) {
- unsigned opcode = bld_base->instructions[pc].Instruction.Opcode;
+ enum tgsi_opcode opcode = bld_base->instructions[pc].Instruction.Opcode;
switch (opcode) {
case TGSI_OPCODE_CASE:
if (curr_switch_stack == ctx->switch_stack_size) {
@@ -648,6 +649,8 @@ static boolean default_analyse_is_last(struct lp_exec_mask *mask,
}
curr_switch_stack--;
break;
+ default:
+ ; /* nothing */
}
pc++;
}
@@ -700,7 +703,8 @@ static void lp_exec_default(struct lp_exec_mask *mask,
* which just gets rid of all case statements appearing together with
* default (or could do switch analysis at switch start time instead).
*/
- unsigned opcode = bld_base->instructions[bld_base->pc - 1].Instruction.Opcode;
+ enum tgsi_opcode opcode =
+ bld_base->instructions[bld_base->pc - 1].Instruction.Opcode;
boolean ft_into = (opcode != TGSI_OPCODE_BRK &&
opcode != TGSI_OPCODE_SWITCH);
/*
@@ -2610,7 +2614,7 @@ near_end_of_shader(struct lp_build_tgsi_soa_context *bld,
unsigned i;
for (i = 0; i < 5; i++) {
- unsigned opcode;
+ enum tgsi_opcode opcode;
if (pc + i >= bld->bld_base.info->num_instructions)
return TRUE;