summaryrefslogtreecommitdiffstats
path: root/src/glsl
Commit message (Collapse)AuthorAgeFilesLines
...
* nir: Validate that the SSA def and register indices are uniqueJason Ekstrand2015-01-151-0/+41
| | | | Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
* nir: Add a peephole select optimizationJason Ekstrand2015-01-153-0/+217
| | | | Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
* nir/nir: Patch up phi predecessors in move_successorsJason Ekstrand2015-01-151-2/+23
| | | | Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
* nir/nir: Use safe iterators when iterating over the CFGJason Ekstrand2015-01-151-8/+10
| | | | Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
* glsl/list: Add a foreach_list_typed_safe_reverse macroJason Ekstrand2015-01-151-0/+9
| | | | Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
* nir/nir: Fix a bug in move_successorsJason Ekstrand2015-01-151-1/+2
| | | | | | | | The unlink_blocks function moves successors around to make sure that, if there is a remaining successor, it is in the first successors slot and not the second. To fix this, we simply get both successors up front. Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
* nir: Differentiate between signed and unsigned versions of find_msbJason Ekstrand2015-01-152-5/+22
| | | | | | | | | | | We also make the return types match GLSL. The GLSL spec specifies that findMSB and findLSB return a signed integer. Previously, nir had them return unsigned. This updates nir's behavior to match what GLSL expects. We also update the nir-to-fs generator to take the new instructions. While we're at it, we fix the case where the input to findMSB is zero. Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
* nir/print: Don't reindex thingsJason Ekstrand2015-01-151-4/+0
| | | | | | | These indices should now be reasonably stable/consistent. Redoing the indices in the print functions makes it harder to debug problems. Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
* nir: Validate all lists in the validatorJason Ekstrand2015-01-151-0/+14
| | | | Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
* glsl/list: Fix the exec_list_validate functionJason Ekstrand2015-01-151-3/+1
| | | | | | | | | | Some time while refactoring things to make it look nicer before pushing to master, I completely broke the function. This fixes it to be correct. Just goes to show you why you souldn't push code that has no users yet... Signed-off-by: Jason Ekstrand <jason.ekstrand@intel.com> Reviewed-by: Connor Abbott <cwabbott0@gmail.com> Reviewed-by: Matt Turner <mattst88@gmail.com>
* nir: Add a better out-of-SSA passJason Ekstrand2015-01-151-73/+716
| | | | | | | | | This commit rewrites the out-of-SSA pass to not be nearly as naieve. It's based on "Revisiting Out-of-SSA Translation for Correctness, Code Quality, and Efficiency" by Boissinot et. al. It should be fairly close to state-of-the art. Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
* nir: Add a function for comparing two sourcesJason Ekstrand2015-01-152-0/+29
| | | | Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
* nir: Add a parallel copy instruction typeJason Ekstrand2015-01-153-1/+88
| | | | Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
* nir: Add a function for rewriting all the uses of a SSA defJason Ekstrand2015-01-152-0/+55
| | | | Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
* nir: Automatically handle SSA uses when an instruction is insertedJason Ekstrand2015-01-152-26/+6
| | | | Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
* nir: Add an initialization function for SSA definitionsJason Ekstrand2015-01-153-21/+25
| | | | Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
* nir: Add an SSA-based liveness analysis pass.Jason Ekstrand2015-01-154-0/+296
| | | | Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
* nir: set reg_alloc and ssa_alloc when indexing registers and SSA valuesJason Ekstrand2015-01-152-2/+5
| | | | Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
* nir: Add a function to detect if a block is immediately followed by an ifJason Ekstrand2015-01-154-13/+30
| | | | | | | | Since we don't actually have an "if" instruction, this is a very common pattern when iterating over instructions. This adds a helper function for it to make things a little less painful. Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
* nir: Add a foreach_block_reverse functionJason Ekstrand2015-01-152-25/+56
| | | | Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
* nir/foreach_block: Return false if the callback on the last block failsJason Ekstrand2015-01-151-3/+1
| | | | Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
* nir: Add a basic metadata management systemJason Ekstrand2015-01-155-17/+82
| | | | Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
* nir/lower_variables_scalar: Silence a compiler warningJason Ekstrand2015-01-151-0/+2
| | | | Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
* nir: Add a lower_vec_to_movs passJason Ekstrand2015-01-153-0/+99
| | | | Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
* nir: Add a naieve from-SSA passJason Ekstrand2015-01-153-0/+195
| | | | | | | This pass is kind of stupidly implemented but it should be enough to get us up and going. We probably want something better that doesn't generate all of the redundant moves eventually. However, the i965 backend should be able to handle the movs, so I'm not too worried about it in the short term.
* nir: Add intrinsics to do alternate interpolation on inputsJason Ekstrand2015-01-151-17/+35
| | | | Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
* nir: Add NIR_TRUE and NIR_FALSE constants and use them for boolean immediatesJason Ekstrand2015-01-152-4/+19
| | | | Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
* nir/lower_atomics: Multiply array offsets by ATOMIC_COUNTER_SIZEJason Ekstrand2015-01-151-1/+17
| | | | Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
* nir/glsl: Add support for coarse and fine derivativesJason Ekstrand2015-01-151-2/+6
| | | | Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
* nir: Add fine and coarse derivative opcodesJason Ekstrand2015-01-151-0/+4
| | | | Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
* nir/glsl: Add support for saturateJason Ekstrand2015-01-151-0/+5
| | | | Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
* Fix what I think are a few NIR typosJason Ekstrand2015-01-151-3/+3
| | | | Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
* nir: add an SSA-based dead code elimination passConnor Abbott2015-01-153-0/+191
| | | | | v2: Jason Ekstrand <jason.ekstrand@intel.com>: whitespace fixes
* nir: add an SSA-based copy propagation passConnor Abbott2015-01-153-0/+317
|
* nir: add a pass to convert to SSAConnor Abbott2015-01-153-0/+686
| | | | | v2: Jason Ekstrand <jason.ekstrand@intel.com>: whitespace fixes
* nir: calculate dominance informationConnor Abbott2015-01-154-1/+337
|
* nir: add an optimization to turn global registers into local registersConnor Abbott2015-01-153-0/+106
| | | | | After linking and inlining, this allows us to convert these registers into SSA values and optimise more code.
* nir: add a pass to lower atomicsConnor Abbott2015-01-153-0/+130
| | | | | v2: Jason Ekstrand <jason.ekstrand@intel.com> whitespace fixes
* nir: add a pass to lower system value readsConnor Abbott2015-01-153-0/+109
| | | | | v2: Jason Ekstrand <jason.ekstrand@intel.com>: whitespace fixes
* nir: add a pass to lower sampler instructionsConnor Abbott2015-01-153-0/+176
|
* nir: add a pass to remove unused variablesConnor Abbott2015-01-153-0/+141
| | | | | | | | After we lower variables, we want to delete them in order to free up some memory. v2: Jason Ekstrand <jason.ekstrand@intel.com>: whitespace fixes
* nir: keep track of the number of input, output, and uniform slotsConnor Abbott2015-01-153-4/+16
|
* nir: add a pass to lower variables for scalar backendsConnor Abbott2015-01-153-0/+1237
|
* nir: add a glsl-to-nir passConnor Abbott2015-01-153-1/+1797
| | | | | | v2: Jason Ekstrand <jason.ekstrand@intel.com>: Make glsl_to_nir build again fix whitespace
* nir: add a validation passConnor Abbott2015-01-153-0/+793
| | | | | | | This is similar to ir_validate.cpp. v2: Jason Ekstrand <jason.ekstrand@intel.com>: whitespace fixes
* nir: add a printerConnor Abbott2015-01-153-0/+915
| | | | | | | This is similar to ir_print_visitor.cpp. v2: Jason Ekstrand <jason.ekstrand@intel.com>: whitespace fixes
* SQUASH: Fix comments from ericJason Ekstrand2015-01-151-0/+3
| | | | Reviewed-by: Eric Anholt <eric@anholt.net>
* SQUASH: Add an assertJason Ekstrand2015-01-151-0/+1
|
* nir: add core helper functionsConnor Abbott2015-01-153-3/+1815
| | | | | | | | | These include functions for adding and removing various bits of IR and helpers for iterating over all the sources and destinations of an instruction. This is similar to ir.cpp. v2: Jason Ekstrand <jason.ekstrand@intel.com>: whitespace and automake fixes
* SQUASH: Use the enum for the variable modeJason Ekstrand2015-01-151-1/+1
|