case BI_CSEL: {
bool direct = ins->cond == BI_COND_ALWAYS;
- bool cond = direct ? srcs[0].u32 :
- bit_eval_cond(ins->cond, srcs[0], srcs[1], ins->src_types[0], 0, 0);
+ unsigned sz = nir_alu_type_get_type_size(ins->src_types[0]);
+
+ if (sz == 32) {
+ bool cond = direct ? srcs[0].u32 :
+ bit_eval_cond(ins->cond, srcs[0], srcs[1], ins->src_types[0], 0, 0);
+
+ dest = cond ? srcs[2] : srcs[3];
+ } else if (sz == 16) {
+ for (unsigned c = 0; c < 2; ++c) {
+ bool cond = direct ? srcs[0].u16[c] :
+ bit_eval_cond(ins->cond, srcs[0], srcs[1], ins->src_types[0], c, c);
+
+ dest.u16[c] = cond ? srcs[2].u16[c] : srcs[3].u16[c];
+ }
+ } else {
+ unreachable("Remaining types todo");
+ }
- dest = cond ? srcs[2] : srcs[3];
break;
}
bit_icmp_helper(dev, input, sz, nir_type_int, debug);
}
- for (unsigned sz = 32; sz <= 32; sz *= 2)
+ for (unsigned sz = 16; sz <= 32; sz *= 2)
bit_csel_helper(dev, sz, (uint32_t *) input32, debug);
float special[4] = { 0.9 };