Mesa (master): nir: mako all the intrinsics

Rob Clark robclark at kemper.freedesktop.org
Tue Mar 27 17:27:30 UTC 2018


Module: Mesa
Branch: master
Commit: 76dfed8ae2d5c6c509eb2661389be3c6a25077df
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=76dfed8ae2d5c6c509eb2661389be3c6a25077df

Author: Rob Clark <robdclark at gmail.com>
Date:   Thu Mar 15 18:42:44 2018 -0400

nir: mako all the intrinsics

I threatened to do this a long time ago.. I probably *should* have done
it a long time ago when there where many fewer intrinsics.  But the
system of macro/#include magic for dealing with intrinsics is a bit
annoying, and python has the nice property of optional fxn params,
making it possible to define new intrinsics while ignoring parameters
that are not applicable (and naming optional params).  And not having to
specify various array lengths explicitly is nice too.

I think the end result makes it easier to add new intrinsics.

v2: couple small fixes found with a test program to compare the old and
    new tables
v3: misc comments, don't rely on capture=true for meson.build, get rid
    of system_values table to avoid return value of intrinsic() and
    *mostly* remove side-effects, add autotools build support
v4: scons build

Signed-off-by: Rob Clark <robdclark at gmail.com>
Acked-by: Dylan Baker <dylan at pnwbakers.com>
Acked-by: Jason Ekstrand <jason at jlekstrand.net>

---

 src/compiler/Makefile.nir.am                       |  13 +-
 src/compiler/Makefile.sources                      |   4 +-
 src/compiler/SConscript.nir                        |  16 +
 src/compiler/nir/meson.build                       |  24 +-
 src/compiler/nir/nir.h                             |   9 -
 src/compiler/nir/nir_builder.h                     |  27 +-
 src/compiler/nir/nir_builder_opcodes_h.py          |  24 +-
 src/compiler/nir/nir_intrinsics.h                  | 540 --------------------
 src/compiler/nir/nir_intrinsics.py                 | 546 +++++++++++++++++++++
 src/compiler/nir/nir_intrinsics_c.py               |  68 +++
 .../nir/{nir_intrinsics.c => nir_intrinsics_h.py}  |  75 +--
 11 files changed, 727 insertions(+), 619 deletions(-)

Diff:   http://cgit.freedesktop.org/mesa/mesa/diff/?id=76dfed8ae2d5c6c509eb2661389be3c6a25077df



More information about the mesa-commit mailing list