ac/nir: implement 8-bit conversions
authorRhys Perry <pendingchaos02@gmail.com>
Thu, 6 Dec 2018 14:38:52 +0000 (14:38 +0000)
committerSamuel Pitoiset <samuel.pitoiset@gmail.com>
Thu, 21 Mar 2019 08:02:25 +0000 (09:02 +0100)
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
src/amd/common/ac_nir_to_llvm.c

index a8564180a43dab1a75b06378e0abb7ded6dd7436..82def9ab20f8d1fd4defcf45f85b87bb6a078b81 100644 (file)
@@ -864,12 +864,14 @@ static void visit_alu(struct ac_nir_context *ctx, const nir_alu_instr *instr)
                        src[i] = ac_to_integer(&ctx->ac, src[i]);
                result = ac_build_gather_values(&ctx->ac, src, num_components);
                break;
+       case nir_op_f2i8:
        case nir_op_f2i16:
        case nir_op_f2i32:
        case nir_op_f2i64:
                src[0] = ac_to_float(&ctx->ac, src[0]);
                result = LLVMBuildFPToSI(ctx->ac.builder, src[0], def_type, "");
                break;
+       case nir_op_f2u8:
        case nir_op_f2u16:
        case nir_op_f2u32:
        case nir_op_f2u64:
@@ -906,6 +908,7 @@ static void visit_alu(struct ac_nir_context *ctx, const nir_alu_instr *instr)
                else
                        result = LLVMBuildFPTrunc(ctx->ac.builder, src[0], ac_to_float_type(&ctx->ac, def_type), "");
                break;
+       case nir_op_u2u8:
        case nir_op_u2u16:
        case nir_op_u2u32:
        case nir_op_u2u64:
@@ -915,6 +918,7 @@ static void visit_alu(struct ac_nir_context *ctx, const nir_alu_instr *instr)
                else
                        result = LLVMBuildTrunc(ctx->ac.builder, src[0], def_type, "");
                break;
+       case nir_op_i2i8:
        case nir_op_i2i16:
        case nir_op_i2i32:
        case nir_op_i2i64: