Samuel Iglesias Gonsálvez <[email protected]> writes: > From: "Juan A. Suarez Romero" <[email protected]> > > The execution data size is the biggest type size of any instruction > operand. > > We will use it to know if the instruction deals with DF, because in Ivy > we need to duplicate the execution size and regioning parameters. > --- > src/mesa/drivers/dri/i965/brw_fs.cpp | 19 ++++++++++++++----- > src/mesa/drivers/dri/i965/brw_ir_fs.h | 1 + > 2 files changed, 15 insertions(+), 5 deletions(-) > > diff --git a/src/mesa/drivers/dri/i965/brw_fs.cpp > b/src/mesa/drivers/dri/i965/brw_fs.cpp > index c8a0693..eb3b4aa 100644 > --- a/src/mesa/drivers/dri/i965/brw_fs.cpp > +++ b/src/mesa/drivers/dri/i965/brw_fs.cpp > @@ -340,6 +340,19 @@ fs_inst::has_source_and_destination_hazard() const > } > } > > +unsigned > +fs_inst::exec_data_size() const
Don't see any reason for this to be a method rather than an inline
function. Also the name seems kind of misleading -- Isn't this trying
to calculate the size of the execution type of the instruction? Why not
call it exec_type_size() in that case?
> +{
> + unsigned exec_data_size = 0;
> +
> + for (int i = 0; i < this->sources; i++) {
> + if (this->src[i].type != BAD_FILE)
> + exec_data_size = MAX2(exec_data_size, type_sz(this->src[i].type));
> + }
> +
> + return exec_data_size;
> +}
> +
> bool
> fs_inst::is_copy_payload(const brw::simple_allocator &grf_alloc) const
> {
> @@ -4577,11 +4590,7 @@ get_fpu_lowered_simd_width(const struct
> gen_device_info *devinfo,
> !inst->force_writemask_all) {
> const unsigned channels_per_grf = inst->exec_size /
> DIV_ROUND_UP(inst->size_written, REG_SIZE);
> - unsigned exec_type_size = 0;
> - for (int i = 0; i < inst->sources; i++) {
> - if (inst->src[i].file != BAD_FILE)
> - exec_type_size = MAX2(exec_type_size,
> type_sz(inst->src[i].type));
> - }
> + unsigned exec_type_size = inst->exec_data_size();
You can make this declaration const while you're at it.
> assert(exec_type_size);
>
> /* The hardware shifts exactly 8 channels per compressed half of the
> diff --git a/src/mesa/drivers/dri/i965/brw_ir_fs.h
> b/src/mesa/drivers/dri/i965/brw_ir_fs.h
> index cad3712..9875f2d 100644
> --- a/src/mesa/drivers/dri/i965/brw_ir_fs.h
> +++ b/src/mesa/drivers/dri/i965/brw_ir_fs.h
> @@ -349,6 +349,7 @@ public:
> bool can_change_types() const;
> bool has_side_effects() const;
> bool has_source_and_destination_hazard() const;
> + unsigned exec_data_size() const;
>
> /**
> * Return the subset of flag registers read by the instruction as a bitset
> --
> 2.9.3
>
> _______________________________________________
> mesa-dev mailing list
> [email protected]
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev
signature.asc
Description: PGP signature
_______________________________________________ mesa-dev mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/mesa-dev
