pan/bi: Add format field to IR
To make register_format packing explicit, and possibly in the future support the auto mode. Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com> Reviewed-by: Daniel Stone <daniels@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6749>
This commit is contained in:
committed by
Marge Bot
parent
6f5b78874a
commit
8dd3a81c1d
@@ -293,6 +293,9 @@ bi_print_instruction(bi_instruction *ins, FILE *fp)
|
||||
if (ins->dest)
|
||||
pan_print_alu_type(ins->dest_type, fp);
|
||||
|
||||
if (ins->format && ins->dest != ins->format)
|
||||
pan_print_alu_type(ins->format, fp);
|
||||
|
||||
if (bi_has_outmod(ins))
|
||||
fprintf(fp, "%s", bi_output_mod_name(ins->outmod));
|
||||
|
||||
|
||||
@@ -111,6 +111,7 @@ bi_emit_ld_vary(bi_context *ctx, nir_intrinsic_instr *instr)
|
||||
ins.load_vary.reuse = false; /* TODO */
|
||||
ins.load_vary.flat = instr->intrinsic != nir_intrinsic_load_interpolated_input;
|
||||
ins.dest_type = nir_type_float | nir_dest_bit_size(instr->dest);
|
||||
ins.format = ins.dest_type;
|
||||
|
||||
if (nir_src_is_const(*nir_get_io_offset_src(instr))) {
|
||||
/* Zero it out for direct */
|
||||
@@ -187,6 +188,7 @@ bi_load_with_r61(enum bi_class T, nir_intrinsic_instr *instr)
|
||||
ld.src_types[1] = nir_type_uint32;
|
||||
ld.src_types[2] = nir_type_uint32;
|
||||
ld.src_types[3] = nir_intrinsic_type(instr);
|
||||
ld.format = nir_intrinsic_type(instr);
|
||||
return ld;
|
||||
}
|
||||
|
||||
@@ -333,6 +335,7 @@ bi_emit_ld_frag_coord(bi_context *ctx, nir_intrinsic_instr *instr)
|
||||
},
|
||||
.vector_channels = 1,
|
||||
.dest_type = nir_type_float32,
|
||||
.format = nir_type_float32,
|
||||
.dest = bi_make_temp(ctx),
|
||||
.src = { BIR_INDEX_CONSTANT, BIR_INDEX_ZERO },
|
||||
.src_types = { nir_type_uint32, nir_type_uint32 },
|
||||
|
||||
@@ -286,6 +286,9 @@ typedef struct {
|
||||
/* Source types if required by the class */
|
||||
nir_alu_type src_types[BIR_SRC_COUNT];
|
||||
|
||||
/* register_format if applicable */
|
||||
nir_alu_type format;
|
||||
|
||||
/* If the source type is 8-bit or 16-bit such that SIMD is possible,
|
||||
* and the class has BI_SWIZZLABLE, this is a swizzle in the usual
|
||||
* sense. On non-SIMD instructions, it can be used for component
|
||||
|
||||
@@ -65,6 +65,7 @@ bit_test_single(struct panfrost_device *dev,
|
||||
.vector_channels = 3,
|
||||
.dest = BIR_INDEX_REGISTER | 32,
|
||||
.dest_type = nir_type_uint32,
|
||||
.format = nir_type_uint32,
|
||||
.src = {
|
||||
BIR_INDEX_CONSTANT,
|
||||
BIR_INDEX_REGISTER | 61,
|
||||
|
||||
Reference in New Issue
Block a user