case ir_unop_i2f:
case ir_unop_u2f:
case ir_unop_d2f:
+ case ir_unop_f162f:
case ir_unop_bitcast_i2f:
case ir_unop_bitcast_u2f:
case ir_unop_i642f:
op0->type->vector_elements, 1);
break;
+ case ir_unop_f2f16:
+ this->type = glsl_type::get_instance(GLSL_TYPE_FLOAT16,
+ op0->type->vector_elements, 1);
+ break;
+
case ir_unop_f2b:
case ir_unop_i2b:
case ir_unop_d2b:
operation("d2f", 1, source_types=(double_type,), dest_type=float_type, c_expression="{src0}"),
# Float-to-double conversion.
operation("f2d", 1, source_types=(float_type,), dest_type=double_type, c_expression="{src0}"),
+ # Half-float conversions. These all operate on and return float types,
+ # since the framework expands half to full float before calling in. We
+ # still have to handle them here so that we can constant propagate through
+ # them, but they are no-ops.
+ operation("f2f16", 1, source_types=(float_type,), dest_type=float_type, c_expression="{src0}"),
+ operation("f162f", 1, source_types=(float_type,), dest_type=float_type, c_expression="{src0}"),
# Double-to-integer conversion.
operation("d2i", 1, source_types=(double_type,), dest_type=int_type, c_expression="{src0}"),
# Integer-to-double conversion.
assert(ir->operands[0]->type->is_float());
assert(ir->type->is_double());
break;
+ case ir_unop_f162f:
+ assert(ir->operands[0]->type->base_type == GLSL_TYPE_FLOAT16);
+ assert(ir->type->is_float());
+ break;
+ case ir_unop_f2f16:
+ assert(ir->operands[0]->type->is_float());
+ assert(ir->type->base_type == GLSL_TYPE_FLOAT16);
+ break;
case ir_unop_d2i:
assert(ir->operands[0]->type->is_double());
assert(ir->type->base_type == GLSL_TYPE_INT);