summaryrefslogtreecommitdiffstats
path: root/src/compiler/nir/nir_search.h
Commit message (Collapse)AuthorAgeFilesLines
* nir: Add asserts to the casting functionsJason Ekstrand2016-10-061-3/+6
| | | | | | | | | | | This makes calling nir_foo_as_bar a bit safer because we're no longer 100% trusting in the caller to ensure that it's safe. The caller still needs to do the right thing but this ensures that we catch invalid casts with an assert rather than by reading garbage data. The one downside is that we do use the casts a bit in nir_validate and it's not a validate_assert. Signed-off-by: Jason Ekstrand <jason@jlekstrand.net> Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
* nir/algebraic: support for power-of-two optimizationsRob Clark2016-06-031-0/+10
| | | | | | | | | | | | Some optimizations, like converting integer multiply/divide into left/ right shifts, have additional constraints on the search expression. Like requiring that a variable is a constant power of two. Support these cases by allowing a fxn name to be appended to the search var expression (ie. "a#32(is_power_of_two)"). Signed-off-by: Rob Clark <robclark@freedesktop.org> Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
* nir/search: fix typoRob Clark2016-05-091-1/+1
| | | | Signed-off-by: Rob Clark <robclark@freedesktop.org>
* nir/algebraic: Add a mechanism for specifying the bit size of a valueJason Ekstrand2016-04-271-0/+2
| | | | Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
* nir/algebraic: Allow for flagging operations as being inexactJason Ekstrand2016-03-231-0/+6
| | | | Reviewed-by: Francisco Jerez <currojerez@riseup.net>
* nir: propagate bitsize information in nir_searchConnor Abbott2016-03-171-3/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | When we replace an expresion we have to compute bitsize information for the replacement. We do this in two passes to validate that bitsize information is consistent and correct: first we propagate bitsize from child nodes to parent, then we do it the other way around, starting from the original's instruction destination bitsize. v2 (Iago): - Always use nir_type_bool32 instead of nir_type_bool when generating algebraic optimizations. Before we used nir_type_bool32 with constants and nir_type_bool with variables. - Fix bool comparisons in nir_search.c to account for bitsized types. v3 (Sam): - Unpack the double constant value as unsigned long long (8 bytes) in nir_algrebraic.py. v4 (Sam): - Use helpers to get type size and base type from nir_alu_type. Signed-off-by: Iago Toral Quiroga <itoral@igalia.com> Signed-off-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com> Reviewed-by: Jason Ekstrand <jason@jlekstrand.net> Reviewed-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com> Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
* nir: move to compiler/Emil Velikov2016-01-261-0/+99
Signed-off-by: Emil Velikov <emil.velikov@collabora.com> Acked-by: Matt Turner <mattst88@gmail.com> Acked-by: Jose Fonseca <jfonseca@vmware.com>