nir: Rework conversion opcodes
[mesa.git] / src / amd / common / ac_nir_to_llvm.c
index 0aba6797e7c72ac627616cd63aa19f634369be17..58f512ea99724e9edcc8e2090b21f7f0eb97847d 100644 (file)
@@ -1449,41 +1449,37 @@ static void visit_alu(struct nir_to_llvm_context *ctx, nir_alu_instr *instr)
                        src[i] = to_integer(ctx, src[i]);
                result = ac_build_gather_values(&ctx->ac, src, num_components);
                break;
-       case nir_op_d2i:
-       case nir_op_f2i:
+       case nir_op_f2i32:
+       case nir_op_f2i64:
                src[0] = to_float(ctx, src[0]);
                result = LLVMBuildFPToSI(ctx->builder, src[0], def_type, "");
                break;
-       case nir_op_d2u:
-       case nir_op_f2u:
+       case nir_op_f2u32:
+       case nir_op_f2u64:
                src[0] = to_float(ctx, src[0]);
                result = LLVMBuildFPToUI(ctx->builder, src[0], def_type, "");
                break;
-       case nir_op_i2d:
-       case nir_op_i2f:
+       case nir_op_i2f32:
+       case nir_op_i2f64:
                result = LLVMBuildSIToFP(ctx->builder, src[0], to_float_type(ctx, def_type), "");
                break;
-       case nir_op_u2d:
-       case nir_op_u2f:
+       case nir_op_u2f32:
+       case nir_op_u2f64:
                result = LLVMBuildUIToFP(ctx->builder, src[0], to_float_type(ctx, def_type), "");
                break;
-       case nir_op_f2d:
+       case nir_op_f2f64:
                result = LLVMBuildFPExt(ctx->builder, src[0], to_float_type(ctx, def_type), "");
                break;
-       case nir_op_d2f:
+       case nir_op_f2f32:
                result = LLVMBuildFPTrunc(ctx->builder, src[0], to_float_type(ctx, def_type), "");
                break;
        case nir_op_u2u32:
        case nir_op_u2u64:
-       case nir_op_u2i32:
-       case nir_op_u2i64:
                if (get_elem_bits(ctx, LLVMTypeOf(src[0])) < get_elem_bits(ctx, def_type))
                        result = LLVMBuildZExt(ctx->builder, src[0], def_type, "");
                else
                        result = LLVMBuildTrunc(ctx->builder, src[0], def_type, "");
                break;
-       case nir_op_i2u32:
-       case nir_op_i2u64:
        case nir_op_i2i32:
        case nir_op_i2i64:
                if (get_elem_bits(ctx, LLVMTypeOf(src[0])) < get_elem_bits(ctx, def_type))