nir_op
vtn_nir_alu_op_for_spirv_opcode(struct vtn_builder *b,
SpvOp opcode, bool *swap,
- nir_alu_type src, nir_alu_type dst)
+ unsigned src_bit_size, unsigned dst_bit_size)
{
/* Indicates that the first two arguments should be swapped. This is
* used for implementing greater-than and less-than-or-equal.
default:
unreachable("Invalid opcode");
}
- src_type |= nir_alu_type_get_type_size(src);
- dst_type |= nir_alu_type_get_type_size(dst);
+ src_type |= src_bit_size;
+ dst_type |= dst_bit_size;
return nir_type_conversion_op(src_type, dst_type, nir_rounding_mode_undef);
}
/* Derivatives: */
case SpvOpFUnordLessThanEqual:
case SpvOpFUnordGreaterThanEqual: {
bool swap;
- nir_alu_type src_alu_type = nir_get_nir_type_for_glsl_type(vtn_src[0]->type);
- nir_alu_type dst_alu_type = nir_get_nir_type_for_glsl_type(type);
+ unsigned src_bit_size = glsl_get_bit_size(vtn_src[0]->type);
+ unsigned dst_bit_size = glsl_get_bit_size(type);
nir_op op = vtn_nir_alu_op_for_spirv_opcode(b, opcode, &swap,
- src_alu_type, dst_alu_type);
+ src_bit_size, dst_bit_size);
if (swap) {
nir_ssa_def *tmp = src[0];
case SpvOpFOrdLessThanEqual:
case SpvOpFOrdGreaterThanEqual: {
bool swap;
- nir_alu_type src_alu_type = nir_get_nir_type_for_glsl_type(vtn_src[0]->type);
- nir_alu_type dst_alu_type = nir_get_nir_type_for_glsl_type(type);
+ unsigned src_bit_size = glsl_get_bit_size(vtn_src[0]->type);
+ unsigned dst_bit_size = glsl_get_bit_size(type);
nir_op op = vtn_nir_alu_op_for_spirv_opcode(b, opcode, &swap,
- src_alu_type, dst_alu_type);
+ src_bit_size, dst_bit_size);
if (swap) {
nir_ssa_def *tmp = src[0];
default: {
bool swap;
- nir_alu_type src_alu_type = nir_get_nir_type_for_glsl_type(vtn_src[0]->type);
- nir_alu_type dst_alu_type = nir_get_nir_type_for_glsl_type(type);
+ unsigned src_bit_size = glsl_get_bit_size(vtn_src[0]->type);
+ unsigned dst_bit_size = glsl_get_bit_size(type);
nir_op op = vtn_nir_alu_op_for_spirv_opcode(b, opcode, &swap,
- src_alu_type, dst_alu_type);
+ src_bit_size, dst_bit_size);
if (swap) {
nir_ssa_def *tmp = src[0];