result = nir_bcsel(&b, srcs[0], srcs[1], srcs[2]);
break;
case ir_triop_bitfield_extract:
- result = (out_type == GLSL_TYPE_INT) ?
- nir_ibitfield_extract(&b, srcs[0], srcs[1], srcs[2]) :
- nir_ubitfield_extract(&b, srcs[0], srcs[1], srcs[2]);
+ result = ir->type->is_int_16_32() ?
+ nir_ibitfield_extract(&b, nir_i2i32(&b, srcs[0]), nir_i2i32(&b, srcs[1]), nir_i2i32(&b, srcs[2])) :
+ nir_ubitfield_extract(&b, nir_u2u32(&b, srcs[0]), nir_i2i32(&b, srcs[1]), nir_i2i32(&b, srcs[2]));
break;
case ir_quadop_bitfield_insert:
- result = nir_bitfield_insert(&b, srcs[0], srcs[1], srcs[2], srcs[3]);
+ result = nir_bitfield_insert(&b,
+ nir_u2u32(&b, srcs[0]), nir_u2u32(&b, srcs[1]),
+ nir_i2i32(&b, srcs[2]), nir_i2i32(&b, srcs[3]));
break;
case ir_quadop_vector:
result = nir_vec(&b, srcs, ir->type->vector_elements);