ac/llvm: implement nir_op_unpack_32_4x8

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19399>
This commit is contained in:
Marek Olšák
2022-11-03 13:41:19 -04:00
committed by Marge Bot
parent 6aee999131
commit 1a424fee4a
3 changed files with 6 additions and 0 deletions
+1
View File
@@ -85,6 +85,7 @@ void ac_llvm_context_init(struct ac_llvm_context *ctx, struct ac_llvm_compiler *
ctx->f16 = LLVMHalfTypeInContext(ctx->context);
ctx->f32 = LLVMFloatTypeInContext(ctx->context);
ctx->f64 = LLVMDoubleTypeInContext(ctx->context);
ctx->v4i8 = LLVMVectorType(ctx->i8, 4);
ctx->v2i16 = LLVMVectorType(ctx->i16, 2);
ctx->v4i16 = LLVMVectorType(ctx->i16, 4);
ctx->v2f16 = LLVMVectorType(ctx->f16, 2);
+1
View File
@@ -96,6 +96,7 @@ struct ac_llvm_context {
LLVMTypeRef f16;
LLVMTypeRef f32;
LLVMTypeRef f64;
LLVMTypeRef v4i8;
LLVMTypeRef v2i16;
LLVMTypeRef v4i16;
LLVMTypeRef v2f16;
+4
View File
@@ -543,6 +543,7 @@ static bool visit_alu(struct ac_nir_context *ctx, const nir_alu_instr *instr)
case nir_op_vec5:
case nir_op_vec8:
case nir_op_vec16:
case nir_op_unpack_32_4x8:
case nir_op_unpack_32_2x16:
case nir_op_unpack_64_2x32:
case nir_op_unpack_64_4x16:
@@ -1223,6 +1224,9 @@ static bool visit_alu(struct ac_nir_context *ctx, const nir_alu_instr *instr)
break;
}
case nir_op_unpack_32_4x8:
result = LLVMBuildBitCast(ctx->ac.builder, src[0], ctx->ac.v4i8, "");
break;
case nir_op_unpack_32_2x16: {
result = LLVMBuildBitCast(ctx->ac.builder, src[0],
ctx->ac.v2i16, "");