[Mesa-dev] [PATCH 3/3] nir: Add an ALU op builder kind of like ir_builder.h

Eric Anholt eric at anholt.net
Wed Jan 28 23:15:52 PST 2015


Connor Abbott <cwabbott0 at gmail.com> writes:

> Hi Eric,
>
> A general suggestion:
>
> I think that we should rename these functions to "nir_op_create()" so
> that we can make a more specific "nir_op()" function that takes and
> returns a nir_ssa_def *, so that we can do stuff like:
>
> nir_builder *b = ...
>
> nir_ssa_def *new_index = nir_iadd(b, nir_imul(b, old_index,
> nir_const_int(b, stride)), nir_const_int(b, offset));
>
> Similar to how the old IR builder works. Granted, it would only work
> with SSA, but most of the stuff we do only involves SSA until the very
> end anyways...

Yeah, when I first wrote this I wasn't doing SSA, but definitely worth
trying a rewrite that way.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 818 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20150128/89e7be8a/attachment.sig>


More information about the mesa-dev mailing list