nir: mako all the intrinsics
authorRob Clark <robdclark@gmail.com>
Thu, 15 Mar 2018 22:42:44 +0000 (18:42 -0400)
committerRob Clark <robdclark@gmail.com>
Tue, 27 Mar 2018 12:36:37 +0000 (08:36 -0400)
commit76dfed8ae2d5c6c509eb2661389be3c6a25077df
treee811d58f7f277c7844c3421eab1203e7d55607a2
parentcc3a88e81dbceb12b79eb4ebe7a4ce5ba97fc291
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@gmail.com>
Acked-by: Dylan Baker <dylan@pnwbakers.com>
Acked-by: Jason Ekstrand <jason@jlekstrand.net>
12 files changed:
src/compiler/Makefile.nir.am
src/compiler/Makefile.sources
src/compiler/SConscript.nir
src/compiler/nir/meson.build
src/compiler/nir/nir.h
src/compiler/nir/nir_builder.h
src/compiler/nir/nir_builder_opcodes_h.py
src/compiler/nir/nir_intrinsics.c [deleted file]
src/compiler/nir/nir_intrinsics.h [deleted file]
src/compiler/nir/nir_intrinsics.py [new file with mode: 0644]
src/compiler/nir/nir_intrinsics_c.py [new file with mode: 0644]
src/compiler/nir/nir_intrinsics_h.py [new file with mode: 0644]