summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/freedreno/ir3/ir3_legalize.c
Commit message (Collapse)AuthorAgeFilesLines
* freedreno/ir3: remove a couple redundant is_flow()sRob Clark2016-05-041-1/+1
| | | | | | | Now that the opc's encode the instruction category (making them unique) we no longer need to check the category in addition to the opc. Signed-off-by: Rob Clark <robclark@freedesktop.org>
* freedreno/ir3: use (ss) instead of (sy) for ldlvRob Clark2016-04-131-1/+7
| | | | | | | Fixes a bunch of flat-varying fail on a4xx (where we need to use ldlv to read the un-interpolated varying). Signed-off-by: Rob Clark <robclark@freedesktop.org>
* freedreno/ir3: drop unused instr category argRob Clark2016-04-041-1/+1
| | | | | | No longer used, so drop the extra arg to ir3_instr_create() Signed-off-by: Rob Clark <robclark@freedesktop.org>
* freedreno/ir3: remove ir3_instruction::categoryRob Clark2016-04-041-2/+2
| | | | Signed-off-by: Rob Clark <robclark@freedesktop.org>
* freedreno/ir3: add support for store instructionsRob Clark2015-07-271-2/+2
| | | | | | | | | | For store instructions, the "dst" register is a read register, not a written register. (Ie. it is the address to store to.) Lets not confuse register allocation, scheduling, etc, with these details. Instead just leave a dummy instr->regs[0], and take "dst" from instr->regs[1] and srcs following. Signed-off-by: Rob Clark <robclark@freedesktop.org>
* freedreno/ir3: block reshuffling and loops!Rob Clark2015-06-211-8/+176
| | | | | | | | | | | | | | | | This shuffles things around to allow the shader to have multiple basic blocks. We drop the entire CFG structure from nir and just preserve the blocks. At scheduling we know whether to schedule conditional branches or unconditional jumps at the end of the block based on the # of block successors. (Dropping jumps to the following instruction, etc.) One slight complication is that variables (load_var/store_var, ie. arrays) are not in SSA form, so we have to figure out where to put the phi's ourself. For this, we use the predecessor set information from nir_block. (We could perhaps use NIR's dominance frontier information to help with this?) Signed-off-by: Rob Clark <robclark@freedesktop.org>
* freedreno/ir3: move inputs/outputs to shaderRob Clark2015-06-211-5/+5
| | | | | | | | | These belong in the shader, rather than the block. Mostly a lot of churn and nothing too interesting. But splitting this out from the rest of ir3_block reshuffling to cut down the noise in the later patch. Signed-off-by: Rob Clark <robclark@freedesktop.org>
* freedreno/ir3: use standard list implementationRob Clark2015-06-211-39/+26
| | | | | | | | | | Use standard list_head double-linked list and related iterators, helpers, etc, rather than weird combo of instruction array and next pointers depending on stage. Now block has an instrs_list. In certain stages where we want to remove and re-add to the blocks list we just use list_replace() to copy the list to a new list_head. Signed-off-by: Rob Clark <robclark@freedesktop.org>
* freedreno/ir3: more builder helpersRob Clark2015-06-211-2/+2
| | | | | | | | Use ir3_MOV() builder in a couple of spots, rather than open-coding the instruction construction. Also add ir3_NOP() builder and use that instead of open coding. Signed-off-by: Rob Clark <robclark@freedesktop.org>
* freedreno/a3xx: add UBO supportIlia Mirkin2015-04-051-1/+1
| | | | Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
* freedreno/ir3: helpful iterator macrosRob Clark2015-03-081-2/+1
| | | | | | | | | I remembered that we are using c99.. which makes some sugary iterator macros easier. So introduce iterator macros to iterate all src registers and all SSA src instructions. The _n variants also return the src #, since there are a handful of places that need this. Signed-off-by: Rob Clark <robclark@freedesktop.org>
* freedreno/ir3: handle flat bypass for a4xxRob Clark2015-03-031-1/+37
| | | | | | | | | | | We may not need this for later a4xx patchlevels, but we do at least need this for patchlevel 0. Bypass bary.f for fetching varyings when flat shading is needed (rather than configure via cmdstream). This requires a special dummy bary.f w/ (ei) flag to signal to scheduler when all varyings are consumed. And requires shader variants based on rasterizer flatshade state to handle TGSI_INTERPOLATE_COLOR. Signed-off-by: Rob Clark <robclark@freedesktop.org>
* freedreno/ir3: add support for memory (cat6) instructionsRob Clark2015-03-031-0/+2
| | | | | | | Scheduled basically the same as texture (cat5) instructions, using (sy) flag for synchronization. Signed-off-by: Rob Clark <robclark@freedesktop.org>
* freedreno/ir3: legalize vs unused sam dst componentsRob Clark2015-01-071-1/+7
| | | | | | | | We probably could be more clever elsewhere and mask out components that are not used. But either way, legalize should realize that there is also a write-after-write hazard with texture sample instructions. Signed-off-by: Rob Clark <robclark@freedesktop.org>
* freedreno/ir3: split out legalize passRob Clark2014-12-231-0/+205
Signed-off-by: Rob Clark <robclark@freedesktop.org>