[Mesa-dev] [PATCH 09/11] i965/eu: Refactor jump distance scaling to use a helper function.

Kenneth Graunke kenneth at whitecape.org
Sun Aug 10 19:07:23 PDT 2014


On Sunday, August 10, 2014 01:47:31 AM Matt Turner wrote:
> On Sat, Aug 9, 2014 at 2:28 PM, Kenneth Graunke <kenneth at whitecape.org> wrote:
[snip]
> > diff --git a/src/mesa/drivers/dri/i965/brw_eu_emit.c b/src/mesa/drivers/dri/i965/brw_eu_emit.c
> > index 665fc07..3d9c96a 100644
> > --- a/src/mesa/drivers/dri/i965/brw_eu_emit.c
> > +++ b/src/mesa/drivers/dri/i965/brw_eu_emit.c
> > @@ -1170,6 +1170,27 @@ void brw_NOP(struct brw_compile *p)
> >   * Comparisons, if/else/endif
> >   */
> >
> > +/**
> > + * Return the generation-specific jump distance scaling factor.
> > + *
> > + * Given the number of instructions to jump, we need to scale by
> > + * some number to obtain the actual jump distance to program in an
> > + * instruction.
> > + */
> > +unsigned
> > +brw_jump_scale(const struct brw_context *brw)
> > +{
> > +   /* Ironlake and later measure jump targets in 64-bit data chunks (in order
> > +    * (to support compaction), so each 128-bit instruction requires 2 chunks.
> > +    */
> > +   if (brw->gen >= 5)
> > +      return 2;
> > +
> > +   /* Gen4 simply uses the number of 128-bit instructions. */
> > +   return 1;
> > +}
> 
> I'd probably put the body of the function in brw_eu.h and let it be
> inlined, since it's so simple.

Sure, I can do that.  Moved in v2.

--Ken
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20140810/474d3d71/attachment.sig>


More information about the mesa-dev mailing list