[PATCH v4 03/16] powerpc: Use a datatype for instructions
Jordan Niethe
jniethe5 at gmail.com
Mon Mar 23 20:28:50 AEDT 2020
On Mon, Mar 23, 2020 at 5:27 PM Nicholas Piggin <npiggin at gmail.com> wrote:
>
> Jordan Niethe's on March 20, 2020 3:17 pm:
> > Currently unsigned ints are used to represent instructions on powerpc.
> > This has worked well as instructions have always been 4 byte words.
> > However, a future ISA version will introduce some changes to
> > instructions that mean this scheme will no longer work as well. This
> > change is Prefixed Instructions. A prefixed instruction is made up of a
> > word prefix followed by a word suffix to make an 8 byte double word
> > instruction. No matter the endianess of the system the prefix always
> > comes first. Prefixed instructions are only planned for powerpc64.
> >
> > Introduce a ppc_inst type to represent both prefixed and word
> > instructions on powerpc64 while keeping it possible to exclusively have
> > word instructions on powerpc32, A latter patch will expand the type to
> > include prefixed instructions but for now just typedef it to a u32.
> >
> > Later patches will introduce helper functions and macros for
> > manipulating the instructions so that powerpc64 and powerpc32 might
> > maintain separate type definitions.
>
> ppc_inst_t I would slightly prefer for a typedef like this.
Are _t types meant to be reserved?
>
> Reviewed-by: Nicholas Piggin <npiggin at gmail.com>
>
> >
> > Signed-off-by: Jordan Niethe <jniethe5 at gmail.com>
More information about the Linuxppc-dev
mailing list