summaryrefslogtreecommitdiffstats
path: root/src/compiler
diff options
context:
space:
mode:
authorJason Ekstrand <[email protected]>2019-03-27 18:27:39 -0500
committerKarol Herbst <[email protected]>2019-04-14 22:25:56 +0200
commitb8197a01a96f5d15268ee5bab28637058f2f962a (patch)
tree8608443acd67d25be64223e97313bfe5085862de /src/compiler
parent14531d676b11999123c04fb7569ab80c9f150180 (diff)
nir/constant_folding: Get rid of a bit size switch statement
Now that nir_const_value is a scalar, we don't need the switch on bit size in order to swizzle them properly. Reviewed-by: Karol Herbst <[email protected]>
Diffstat (limited to 'src/compiler')
-rw-r--r--src/compiler/nir/nir_opt_constant_folding.c20
1 files changed, 1 insertions, 19 deletions
diff --git a/src/compiler/nir/nir_opt_constant_folding.c b/src/compiler/nir/nir_opt_constant_folding.c
index 60cec7ffda6..84dbce5ac30 100644
--- a/src/compiler/nir/nir_opt_constant_folding.c
+++ b/src/compiler/nir/nir_opt_constant_folding.c
@@ -75,25 +75,7 @@ constant_fold_alu_instr(nir_alu_instr *instr, void *mem_ctx)
for (unsigned j = 0; j < nir_ssa_alu_instr_src_components(instr, i);
j++) {
- switch(load_const->def.bit_size) {
- case 64:
- src[i][j].u64 = load_const->value[instr->src[i].swizzle[j]].u64;
- break;
- case 32:
- src[i][j].u32 = load_const->value[instr->src[i].swizzle[j]].u32;
- break;
- case 16:
- src[i][j].u16 = load_const->value[instr->src[i].swizzle[j]].u16;
- break;
- case 8:
- src[i][j].u8 = load_const->value[instr->src[i].swizzle[j]].u8;
- break;
- case 1:
- src[i][j].b = load_const->value[instr->src[i].swizzle[j]].b;
- break;
- default:
- unreachable("Invalid bit size");
- }
+ src[i][j] = load_const->value[instr->src[i].swizzle[j]];
}
/* We shouldn't have any source modifiers in the optimization loop. */