Hi!

On Mon, Apr 27, 2020 at 03:57:59PM -0400, Michael Meissner wrote:
> +#ifndef SIZE
> +#define SIZE 50000
> +#endif
> +
> +struct foo {
> +  unsigned int field;
> +  char pad[SIZE];
> +};
> +
> +struct foo *inc_load (struct foo *p, unsigned int *q)
> +{
> +  *q = (++p)->field; /* PLWZ, PADDI, STW.  */
> +  return p;
> +}

This makes me wonder what we do if the struct is a multiple of 65536
bytes big, do we still generate a paddi, or will we do the (smaller,
faster) addis?  Not that that matters so very much...

  ...

Yeah, we do do addis, neat!  :-)

Is it better to do paddi and then stw on the modified pointer, or to do
pstw on the original pointer (and the paddi independently)?  In this
testcase, and in general?  The second sequence is lower latency (via the
store), but takes more space.  We probably should do the same tradeoff
as we do with non-prefixed code (or is there any significant difference?)
but maybe that should be looked at again as well.  (Maybe it doesn't
happen often enough to matter either way?)


Segher

Reply via email to