public inbox for linuxppc-dev@ozlabs.org 
 help / color / mirror / Atom feed
From: Segher Boessenkool <segher@kernel•crashing.org>
To: Michael Ellerman <mpe@ellerman•id.au>
Cc: Matt Brown <matthew.brown.dev@gmail•com>, linuxppc-dev@lists•ozlabs.org
Subject: Re: [PATCH v2] powerpc/powernv: Use darn instr for random_seed on p9
Date: Tue, 1 Aug 2017 07:57:36 -0500	[thread overview]
Message-ID: <20170801125735.GJ13471@gate.crashing.org> (raw)
In-Reply-To: <87lgn555vs.fsf@concordia.ellerman.id.au>

On Mon, Jul 31, 2017 at 07:10:15PM +1000, Michael Ellerman wrote:
> And ___PPC_RA() is not quite right. The L field is only 2 bits wide, not
> the 5 that ___PPC_RA() allows.
> 
> We don't have a __PPC_L() macro, because L fields vary in size and
> location. So I think you're best of open coding it, eg:
> 
> +#define PPC_DARN(t, l)		stringify_in_c(.long PPC_INST_DARN |  \
> +						__PPC_RT(t)	   |  \
> +						(((l) & 0x3) << 16))

It would be better if you could do a compile-time error if the L value
is out of range.  Hrm, nothing else does such checking either?


Segher

  reply	other threads:[~2017-08-01 13:03 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-07  7:02 [PATCH v2] powerpc/powernv: Use darn instr for random_seed on p9 Matt Brown
2017-07-11  9:34 ` Daniel Axtens
2017-07-13  0:47   ` Matt Brown
2017-07-13  2:44     ` Michael Ellerman
2017-07-31  9:10 ` Michael Ellerman
2017-08-01 12:57   ` Segher Boessenkool [this message]
2017-08-04  1:10     ` Matt Brown

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170801125735.GJ13471@gate.crashing.org \
    --to=segher@kernel$(echo .)crashing.org \
    --cc=linuxppc-dev@lists$(echo .)ozlabs.org \
    --cc=matthew.brown.dev@gmail$(echo .)com \
    --cc=mpe@ellerman$(echo .)id.au \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox