summaryrefslogtreecommitdiffstats
path: root/src/glsl/Makefile.sources
diff options
context:
space:
mode:
authorJason Ekstrand <jason.ekstrand@intel.com>2015-01-23 13:38:46 -0800
committerJason Ekstrand <jason.ekstrand@intel.com>2015-01-24 21:35:35 -0800
commit89285e4d47a65e52547180dca46ecfd81b2996e9 (patch)
tree225a05167f500fe131f6780355122a714f0f2303 /src/glsl/Makefile.sources
parentfa4bc6c1309e8ece8c0f18e8031bf7c92064fc35 (diff)
downloadexternal_mesa3d-89285e4d47a65e52547180dca46ecfd81b2996e9.zip
external_mesa3d-89285e4d47a65e52547180dca46ecfd81b2996e9.tar.gz
external_mesa3d-89285e4d47a65e52547180dca46ecfd81b2996e9.tar.bz2
nir: add new constant folding infrastructure
Add a required field to the Opcode class, const_expr, that contains an expression or statement that computes the result of the opcode given known constant inputs. Then take those const_expr's and expand them into a function that takes an opcode and an array of constant inputs and spits out the constant result. This means that when adding opcodes, there's one less place to update, and almost all the opcodes are self-documenting since the information on how to compute the result is right next to the definition. The helper functions in nir_constant_expressions.c were taken from ir_constant_expressions.cpp. v3 Jason Ekstrand <jason.ekstrand@iastate.edu> - Use mako to generate one function per opcode instead of doing piles of string splicing v4 Jason Ekstrand <jason.ekstrand@iastate.edu> - More comments and better indentation in the mako - Add a description of the constant expression language in nir_opcodes.py - Added nir_constant_expressions.py to EXTRA_DIST in Makefile.am Signed-off-by: Jason Ekstrand <jason.ekstrand@intel.com> Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
Diffstat (limited to 'src/glsl/Makefile.sources')
-rw-r--r--src/glsl/Makefile.sources1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/glsl/Makefile.sources b/src/glsl/Makefile.sources
index 97c637e..face22e 100644
--- a/src/glsl/Makefile.sources
+++ b/src/glsl/Makefile.sources
@@ -11,6 +11,7 @@ LIBGLCPP_GENERATED_FILES = \
glcpp/glcpp-parse.c
NIR_GENERATED_FILES = \
+ nir/nir_constant_expressions.c \
nir/nir_opcodes.c \
nir/nir_opcodes.h \
nir/nir_opt_algebraic.c