summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* nir: Use an integer index for specifying structure fieldsJason Ekstrand2015-01-159-83/+75
| | | | | | | Previously, we used a string name. It was nice for translating out of GLSL IR (which also does that) but cumbersome the rest of the time. Reviewed-by: Connor Abbott <[email protected]>
* nir: Add a concept of a wildcard array dereferenceJason Ekstrand2015-01-152-0/+12
| | | | Reviewed-by: Connor Abbott <[email protected]>
* nir: Make array deref direct vs. indirect an enumJason Ekstrand2015-01-158-15/+25
| | | | Reviewed-by: Connor Abbott <[email protected]>
* nir: Clean up nir_deref helper functionsJason Ekstrand2015-01-151-1/+4
| | | | Reviewed-by: Connor Abbott <[email protected]>
* nir/lower_samplers: Use the nir_instr_rewrite_src functionJason Ekstrand2015-01-151-1/+10
| | | | Reviewed-by: Connor Abbott <[email protected]>
* nir: Add a helper for rewriting an instruction sourceJason Ekstrand2015-01-152-0/+62
| | | | Reviewed-by: Connor Abbott <[email protected]>
* i965/fs_nir: Properly saturate multipliesJason Ekstrand2015-01-151-1/+1
| | | | Reviewed-by: Connor Abbott <[email protected]>
* nir/from_ssa: Don't lower constant SSA values to registersJason Ekstrand2015-01-151-8/+32
| | | | | | | | | | | Backends want to be able to do special things with constant values such as put them into immediates or make decisions based on whether or not a value is constant. Before, constants always got lowered to a load_const into a register and then a register use. Now we leave constants as SSA values so backends can special-case them if they want. Since handling constant SSA values is trivial, this shouldn't be a problem for backends. Reviewed-by: Connor Abbott <[email protected]>
* i965/fs_nir: Handle SSA constantsJason Ekstrand2015-01-151-17/+33
| | | | Reviewed-by: Connor Abbott <[email protected]>
* i965/fs_nir: Use an array rather than a hash table for register lookupJason Ekstrand2015-01-153-23/+30
| | | | Reviewed-by: Connor Abbott <[email protected]>
* i965/fs_nir: Add the CSE pass and actually run in a loopJason Ekstrand2015-01-151-13/+18
| | | | Reviewed-by: Connor Abbott <[email protected]>
* nir: Add a basic CSE passJason Ekstrand2015-01-153-0/+272
| | | | | | | This pass is still fairly basic. It only handles ALU operations, constant loads, and phi nodes. No texture ops or intrinsics yet. Reviewed-by: Connor Abbott <[email protected]>
* nir: Add a fused multiply-add peepholeJason Ekstrand2015-01-155-0/+196
|
* nir: Validate that the SSA def and register indices are uniqueJason Ekstrand2015-01-151-0/+41
| | | | Reviewed-by: Connor Abbott <[email protected]>
* i965/fs_nir: Turn on the peephole select optimizationJason Ekstrand2015-01-151-0/+2
| | | | Reviewed-by: Connor Abbott <[email protected]>
* nir: Add a peephole select optimizationJason Ekstrand2015-01-153-0/+217
| | | | Reviewed-by: Connor Abbott <[email protected]>
* nir/nir: Patch up phi predecessors in move_successorsJason Ekstrand2015-01-151-2/+23
| | | | Reviewed-by: Connor Abbott <[email protected]>
* nir/nir: Use safe iterators when iterating over the CFGJason Ekstrand2015-01-151-8/+10
| | | | Reviewed-by: Connor Abbott <[email protected]>
* glsl/list: Add a foreach_list_typed_safe_reverse macroJason Ekstrand2015-01-151-0/+9
| | | | Reviewed-by: Connor Abbott <[email protected]>
* 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 <[email protected]>
* i965/fs_nir: Validate optimization passesJason Ekstrand2015-01-151-8/+15
| | | | Reviewed-by: Connor Abbott <[email protected]>
* nir: Differentiate between signed and unsigned versions of find_msbJason Ekstrand2015-01-153-11/+30
| | | | | | | | | | | 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 <[email protected]>
* 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 <[email protected]>
* nir: Validate all lists in the validatorJason Ekstrand2015-01-151-0/+14
| | | | Reviewed-by: Connor Abbott <[email protected]>
* 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 <[email protected]> Reviewed-by: Connor Abbott <[email protected]> Reviewed-by: Matt Turner <[email protected]>
* i965/fs_nir: Do retyping for ALU srouces in get_nir_alu_srcJason Ekstrand2015-01-151-15/+8
| | | | Reviewed-by: Connor Abbott <[email protected]>
* 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 <[email protected]>
* nir: Add a function for comparing two sourcesJason Ekstrand2015-01-152-0/+29
| | | | Reviewed-by: Connor Abbott <[email protected]>
* nir: Add a parallel copy instruction typeJason Ekstrand2015-01-153-1/+88
| | | | Reviewed-by: Connor Abbott <[email protected]>
* nir: Add a function for rewriting all the uses of a SSA defJason Ekstrand2015-01-152-0/+55
| | | | Reviewed-by: Connor Abbott <[email protected]>
* nir: Automatically handle SSA uses when an instruction is insertedJason Ekstrand2015-01-152-26/+6
| | | | Reviewed-by: Connor Abbott <[email protected]>
* nir: Add an initialization function for SSA definitionsJason Ekstrand2015-01-153-21/+25
| | | | Reviewed-by: Connor Abbott <[email protected]>
* nir: Add an SSA-based liveness analysis pass.Jason Ekstrand2015-01-155-0/+297
| | | | Reviewed-by: Connor Abbott <[email protected]>
* nir: set reg_alloc and ssa_alloc when indexing registers and SSA valuesJason Ekstrand2015-01-152-2/+5
| | | | Reviewed-by: Connor Abbott <[email protected]>
* 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 <[email protected]>
* nir: Add a foreach_block_reverse functionJason Ekstrand2015-01-152-25/+56
| | | | Reviewed-by: Connor Abbott <[email protected]>
* nir/foreach_block: Return false if the callback on the last block failsJason Ekstrand2015-01-151-3/+1
| | | | Reviewed-by: Connor Abbott <[email protected]>
* nir: Add a basic metadata management systemJason Ekstrand2015-01-155-17/+82
| | | | Reviewed-by: Connor Abbott <[email protected]>
* nir/lower_variables_scalar: Silence a compiler warningJason Ekstrand2015-01-151-0/+2
| | | | Reviewed-by: Connor Abbott <[email protected]>
* i965/fs_nir: Convert the shader to/from SSAJason Ekstrand2015-01-151-0/+9
| | | | Reviewed-by: Connor Abbott <[email protected]>
* nir: Add a lower_vec_to_movs passJason Ekstrand2015-01-153-0/+99
| | | | Reviewed-by: Connor Abbott <[email protected]>
* 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.
* i965/fs_nir: Don't duplicate emit_general_interpolationJason Ekstrand2015-01-152-110/+4
| | | | Reviewed-by: Connor Abbott <[email protected]>
* i965/fs: Don't take an ir_variable for emit_general_interpolationJason Ekstrand2015-01-154-35/+41
| | | | | | | | | | Previously, emit_general_interpolation took an ir_variable and pulled the information it needed from that. This meant that in fs_fp, we were constructing a dummy ir_variable just to pass into it. This commit makes emit_general_interpolation take only the information it needs and gets rid of the fs_fp cruft. Reviewed-by: Connor Abbott <[email protected]>
* nir: Add intrinsics to do alternate interpolation on inputsJason Ekstrand2015-01-151-17/+35
| | | | Reviewed-by: Connor Abbott <[email protected]>
* nir: Add NIR_TRUE and NIR_FALSE constants and use them for boolean immediatesJason Ekstrand2015-01-152-4/+19
| | | | Reviewed-by: Connor Abbott <[email protected]>
* i965/fs_nir: Add atomic counters supportJason Ekstrand2015-01-151-3/+22
| | | | Reviewed-by: Connor Abbott <[email protected]>
* nir/lower_atomics: Multiply array offsets by ATOMIC_COUNTER_SIZEJason Ekstrand2015-01-151-1/+17
| | | | Reviewed-by: Connor Abbott <[email protected]>
* i965/fs_nir: Handle coarse/fine derivativesJason Ekstrand2015-01-151-0/+18
| | | | Reviewed-by: Connor Abbott <[email protected]>
* nir/glsl: Add support for coarse and fine derivativesJason Ekstrand2015-01-151-2/+6
| | | | Reviewed-by: Connor Abbott <[email protected]>