[PATCH v4 05/16] powerpc: Use a function for masking instructions

Jordan Niethe jniethe5 at gmail.com
Mon Mar 23 20:31:15 AEDT 2020


On Mon, Mar 23, 2020 at 5:40 PM Nicholas Piggin <npiggin at gmail.com> wrote:
>
> Jordan Niethe's on March 20, 2020 3:17 pm:
> > In preparation for using an instruction data type that can not be used
> > directly with the '&' operator, use a function to mask instructions.
>
> Hmm. ppc_inst_mask isn't such a good interface I think. It takes a
> ppc_inst and a mask, you would expect it to return a ppc_inst, probably
> with some part of its value anded with your mask value but not entirely
> clear.
>
> I would have a ppc_inst_val that is a more mechanical replacement and
> lets you do more things with it, although I like the other helpers you
> add later. Oh you've added ppc_inst_word further down. Why not use that
> here intead of ppc_inst_mask()?
ppc_inst_word() was what I started using first, but I started seeing a
whole lot of them immediately being &'d so I made ppc_inst_mask().
The ppc_inst_word() patch can come first, and I will just get rid of
the ppc_inst_mask() function - it is not very clear.
>
> Thanks,
> Nick
>


More information about the Linuxppc-dev mailing list