aboutsummaryrefslogtreecommitdiffstats
path: root/src/panfrost/midgard
Commit message (Collapse)AuthorAgeFilesLines
* pan/bi: Paste over bi_has_argAlyssa Rosenzweig2020-03-111-1/+1
| | | | | | | While we're at it, cleanup the Midgard one. Signed-off-by: Alyssa Rosenzweig <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4150>
* panfrost: Sync Midgard/Bifrost control flowAlyssa Rosenzweig2020-03-113-32/+3
| | | | | | | | We can move e v e n more code to be shared and let bi_block inherit from pan_block, which will allow us to use the shared data flow analysis. Signed-off-by: Alyssa Rosenzweig <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4150>
* panfrost: Move liveness analysis to root panfrost/Alyssa Rosenzweig2020-03-112-189/+8
| | | | | | | This way we can share the code with Bifrost. Signed-off-by: Alyssa Rosenzweig <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4150>
* pan/midgard: Subclass midgard_block from pan_blockAlyssa Rosenzweig2020-03-119-87/+127
| | | | | | | | Promote as much as we feasibly can while keeping it Midgard/Bifrost agnostic. Signed-off-by: Alyssa Rosenzweig <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4150>
* pan/midgard: Sync midgard_block field names with BifrostAlyssa Rosenzweig2020-03-114-9/+9
| | | | | Signed-off-by: Alyssa Rosenzweig <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4150>
* pan/midgard: Decontextualize liveness analysis coreAlyssa Rosenzweig2020-03-111-11/+12
| | | | | | | We mostly just need the temp_count from it. Signed-off-by: Alyssa Rosenzweig <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4150>
* pan/midgard: Localize `visited` trackingAlyssa Rosenzweig2020-03-112-15/+11
| | | | | | | | Instead of a property on the block, just track it within the function to minimize IR dependencies. Signed-off-by: Alyssa Rosenzweig <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4150>
* panfrost: Move Midgard sysval code to common PanfrostAlyssa Rosenzweig2020-03-112-123/+2
| | | | | | | We'll use this all as-is in Bifrost. Signed-off-by: Alyssa Rosenzweig <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4150>
* pan/midgard: Remove dest_override sysval argumentAlyssa Rosenzweig2020-03-111-8/+5
| | | | | | | Unused, noticed while working on porting over to Bifrost. Signed-off-by: Alyssa Rosenzweig <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4150>
* pan/midgard: Decontextualize midgard_nir_assign_sysval_bodyAlyssa Rosenzweig2020-03-112-16/+18
| | | | | | | Now all sysval code should be fairly generic. Signed-off-by: Alyssa Rosenzweig <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4150>
* pan/midgard: Remove indexing dependency of sysvalsAlyssa Rosenzweig2020-03-111-4/+6
| | | | | | | | | Ideally we would sync the compilers to use the same indexing scheme but that's a lot more Midgard refactoring than I have time for right now. This is good enough honestly. Signed-off-by: Alyssa Rosenzweig <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4150>
* pan/midgard: Adjust sysval-related prototypesAlyssa Rosenzweig2020-03-113-14/+14
| | | | | | | | | We'd like to share this big chunk of code with Bifrost but that requires removing the compiler_context parameter... which is totally unused in fact! Signed-off-by: Alyssa Rosenzweig <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4150>
* pan/midgard: Remove unused iteratorsAlyssa Rosenzweig2020-03-111-6/+0
| | | | | Signed-off-by: Alyssa Rosenzweig <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4150>
* panfrost: Promote midgard_program to panfrost/utilAlyssa Rosenzweig2020-03-112-75/+3
| | | | | | | | We'll want Bifrost to reuse the same linking mechanisms for the most part. Signed-off-by: Alyssa Rosenzweig <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4150>
* panfrost: Move mir_to_bytemask to common codeAlyssa Rosenzweig2020-03-104-49/+5
| | | | | | | | ...also so we can start sharing code properly between the panfrost compilers. Signed-off-by: Alyssa Rosenzweig <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4139>
* pan/midgard: Use address analysis for globals, etcAlyssa Rosenzweig2020-02-273-37/+7
| | | | | | | | ..instead of opencoding for constants and doing the rest as ALU. Signed-off-by: Alyssa Rosenzweig <[email protected]> Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3978> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3978>
* pan/midgard: Add address analysis frameworkAlyssa Rosenzweig2020-02-271-0/+205
| | | | | | | | | | | | | | | Midgard has the ability to calculate addresses as part of the load/store pipeline. We'd like to make use of this to avoid doing this work on the ALU pipes. To do so, when emitting globals/SSBOs/shareds, we walk the tree looking for address arithmetic to try to parse out something the hardware can work with, letting the original instructions be DCE'd ideally. This analysis is done at the NIR level to properly account for some messy details of vectorization which we'd rather not poke at the backend level. (Originally I wrote this as a MIR pass but I'm fairly sure it was wrong.) Signed-off-by: Alyssa Rosenzweig <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3978>
* pan/midgard: Force address alignmentAlyssa Rosenzweig2020-02-271-0/+10
| | | | | | | I thought we already had this but... maybe not.. Signed-off-by: Alyssa Rosenzweig <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3978>
* pan/midgard: Round up bytemasks when promoting uniformsAlyssa Rosenzweig2020-02-271-1/+2
| | | | | | | | Fixes crashes with uniform promotion in certain mixed type circumstances. Signed-off-by: Alyssa Rosenzweig <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3978>
* pan/midgard: Fix load/store argument sizingAlyssa Rosenzweig2020-02-272-2/+14
| | | | | | | | | The swizzles are as-if they were 32-bit regardless of the bitness of the operation, but the source sizes can and do change depending on the flags. Account for this in the analysis. Signed-off-by: Alyssa Rosenzweig <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3978>
* pan/midgard: Add LDST_ADDRESS propertyAlyssa Rosenzweig2020-02-273-11/+15
| | | | | | | | | Many load/store ops (used for globals, SSBOs, shared memory, etc) have the ability to compute addresses directly. Mark off which ones behave like this. Signed-off-by: Alyssa Rosenzweig <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3978>
* pan/midgard: Extract nir_ssa_index helperAlyssa Rosenzweig2020-02-271-1/+7
| | | | | | | In case we don't have a nir_src. Signed-off-by: Alyssa Rosenzweig <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3978>
* pan/midgard: Partially fix 64-bit swizzle alignmentAlyssa Rosenzweig2020-02-272-3/+24
| | | | | | | | | | When mixing 32/64-bit, we need to align the 32-bit registers to get the required alignment. This isn't quite enough yet, though, since user swizzles could bypass and will need to be lowered to 32-bit moves (outstanding todo). Signed-off-by: Alyssa Rosenzweig <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3978>
* pan/midgard: Allow fusing inverted sources for inverted opsAlyssa Rosenzweig2020-02-271-1/+0
| | | | | | | | It doesn't make a difference to the actual algorithm, so let's get rid of them. Signed-off-by: Alyssa Rosenzweig <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3978>
* pan/midgard: Allow inverted inverted opsAlyssa Rosenzweig2020-02-271-1/+20
| | | | | | | We'd like to transform `inand.not` back to `iand` and so forth. Signed-off-by: Alyssa Rosenzweig <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3978>
* pan/midgard: Don't spill near a branchAlyssa Rosenzweig2020-02-271-0/+8
| | | | | | | | | | Fixes dEQP-GLES2.functional.shaders.indexing.varying_array.vec2_dynamic_loop_write_ static_read with register pressure forced down. Signed-off-by: Alyssa Rosenzweig <[email protected]> Reviewed-by: Tomeu Vizoso <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3950>
* nir: Drop nir_tex_instr::texture_array_sizeJason Ekstrand2020-02-261-1/+0
| | | | | | | | | | It's set by lots of things and we spend a lot of time maintaining it but no one actually uses the value for anything useful. Reviewed-by: Dave Airlie <[email protected]> Reviewed-by: Alyssa Rosenzweig <[email protected]> Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3940> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3940>
* panfrost: Remove some more prints to stdoutTomeu Vizoso2020-02-261-3/+3
| | | | | | | | They can confuse test runners. Signed-off-by: Tomeu Vizoso <[email protected]> Reviewed-by: Alyssa Rosenzweig <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3876>
* pan/midgard: Implement load/store_sharedAlyssa Rosenzweig2020-02-241-9/+36
| | | | | | | | | | | | Shared memory is implemented almost identically to global memory from an ISA perspective, so let's handle the new intrinsics. We include a code path for constant offsets, which doesn't come up for globals. Fixes dEQP-GLES31.functional.compute.basic.shared_var_single_invocation Signed-off-by: Alyssa Rosenzweig <[email protected]> Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3775> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3775>
* pan/midgard: Implement nir_intrinsic_get_buffer_sizeAlyssa Rosenzweig2020-02-242-9/+11
| | | | | | | We route it as a sysval. Fixes dEQP-GLES31.functional.compute.basic.ssbo_unsized_arr_single_invocation Signed-off-by: Alyssa Rosenzweig <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3775>
* pan/midgard: Lower SSBOs in NIRAlyssa Rosenzweig2020-02-241-64/+26
| | | | | | | | | We need to lower SSBOs to globals regardless. Rather than do this in our backend like we do now, use the common NIR pass, which will support bounds checking. Signed-off-by: Alyssa Rosenzweig <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3775>
* pan/midgard: Identify clamp(x, -1.0, 1.0) flagAlyssa Rosenzweig2020-02-202-4/+4
| | | | | | | | | | | So *that's* what's .unk2 was about :) We still need to add an opt pass for it, but we can do that further down the line. Signed-off-by: Alyssa Rosenzweig <[email protected]> Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3892> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3892>
* pan/midgard: Use fprintf instead of printf for constantsAlyssa Rosenzweig2020-02-161-9/+9
| | | | | | | | I was wondering where those constants disappeared to :-) Signed-off-by: Alyssa Rosenzweig <[email protected]> Fixes: 968f36d1fc0 ("pan/midgard: Support disassembling to a file") Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3835>
* pan/midgard: Don't crash with constants on unknown opsAlyssa Rosenzweig2020-02-161-0/+4
| | | | | | | | | | | | Just use a dummy name instead.. we can't know a priori what type an unknown op will consume, but we don't want to dereference a null pointer. Signed-off-by: Alyssa Rosenzweig <[email protected]> Fixes: 24360966ab3 ("panfrost/midgard: Prettify embedded constant prints") Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3835>
* pan/midgard: Identify stack barrier flagAlyssa Rosenzweig2020-02-162-2/+7
| | | | | | | In case thread local storage is used. Signed-off-by: Alyssa Rosenzweig <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3835>
* pan/midgard: Set xyzx swizzle for load_compute_argAlyssa Rosenzweig2020-02-161-0/+1
| | | | | | | | Probably harmless but the w component doesn't appear valid so let's match the blob... one less bit to be nervous about. Signed-off-by: Alyssa Rosenzweig <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3835>
* pan/midgard: Infer tags entirelyAlyssa Rosenzweig2020-02-161-5/+21
| | | | | | | | We're so close, again marking off a few edge cases is enough to allow us to omit this data entirely. Woot! Signed-off-by: Alyssa Rosenzweig <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3835>
* pan/midgard: Imply next tagsAlyssa Rosenzweig2020-02-161-10/+41
| | | | | | | | | As long as we can disambiguate a few edge cases, we can imply next tags entirely which cleans up the disassembly a fair bit (though not as much as implying tags entirely would -- we'll get there!) Signed-off-by: Alyssa Rosenzweig <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3835>
* pan/midgard: Overhaul tag handlingAlyssa Rosenzweig2020-02-168-113/+70
| | | | | | | | We unify disparate metadata about tags into a single structure to ensure information is not left out. Signed-off-by: Alyssa Rosenzweig <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3835>
* pan/midgard: Improve barrier disassemblyAlyssa Rosenzweig2020-02-163-8/+31
| | | | | | | Just move some state from unknowns to actual keywords. Signed-off-by: Alyssa Rosenzweig <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3835>
* pan/midgard: Fix 32/64 mixed swizzle packingAlyssa Rosenzweig2020-02-161-2/+7
| | | | | | | Occurs in SSBO address computation. Signed-off-by: Alyssa Rosenzweig <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3835>
* pan/midgard: Allow jumping out of a shaderAlyssa Rosenzweig2020-02-161-5/+5
| | | | | | | | | This comes up as a `return;` instruction in a compute shader. We need to use the special tag 1 to signify "break". Fixes numerous INSTR_INVALID_ENC faults in dEQP-GLES31.functional.compute.basic.* Signed-off-by: Alyssa Rosenzweig <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3835>
* pan/midgard: Implement barriersAlyssa Rosenzweig2020-02-166-2/+37
| | | | | | | | | | | | | Barriers execute on the texture pipeline on Midgard, so let's tentatively handle barrier() as conservatively as possible (forcing memory barriers of both buffers and shared memory). Implementation isn't quite there yet -- it doesn't look at interactions of adjacent barriers like it's supposed to -- but the core is there. Fixes dEQP-GLES31.functional.compute.basic.ssbo_local_barrier_single_invocation Signed-off-by: Alyssa Rosenzweig <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3835>
* pan/midgard: Fix swizzles harderAlyssa Rosenzweig2020-02-161-54/+46
| | | | | | | Just for disassembly for now~ Signed-off-by: Alyssa Rosenzweig <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3835>
* pan/midgard: Fix missing prefixesAlyssa Rosenzweig2020-02-161-1/+1
| | | | | | | | I was wondering where those were going... :) Signed-off-by: Alyssa Rosenzweig <[email protected]> Fixes: c1952779d68 ("pan/decode: Dump to a file") Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3835>
* pan/midgard: Track pressure when scheduling ld/stAlyssa Rosenzweig2020-02-161-0/+35
| | | | | | | | | Fixes RA failure in dEQP-GLES31.functional.shaders.builtin_functions.common.modf.* (which uses multiple indirect SSBO writes) Signed-off-by: Alyssa Rosenzweig <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3835>
* panfrost: Remove unused anonymous enum variables.Vinson Lee2020-02-111-2/+2
| | | | | | | | | | | | | | This patch fix these build errors with GCC 10. /usr/bin/ld: src/gallium/drivers/panfrost/libpanfrost.a(pan_resource.c.o):src/panfrost/midgard/midgard_compile.h:52: multiple definition of `pan_sysval'; src/gallium/drivers/panfrost/libpanfrost.a(pan_screen.c.o):src/panfrost/midgard/midgard_compile.h:52: first defined here /usr/bin/ld: src/gallium/drivers/panfrost/libpanfrost.a(pan_resource.c.o):src/panfrost/midgard/midgard_compile.h:68: multiple definition of `pan_special_attributes'; src/gallium/drivers/panfrost/libpanfrost.a(pan_screen.c.o):src/panfrost/midgard/midgard_compile.h:68: first defined here Fixes: 7e8de5a707f7 ("panfrost: Implement system values") Fixes: 306800d747bc ("pan/midgard: Lower gl_VertexID/gl_InstanceID to attributes") Signed-off-by: Vinson Lee <[email protected]> Reviewed-by: Alyssa Rosenzweig <[email protected]> Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3752> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3752>
* pan/midgard: Fix scheduling issue with csel + render target referenceAlyssa Rosenzweig2020-02-051-12/+18
| | | | | | | | | Fixes dEQP-GLES3.functional.shaders.fragdepth.write.dynamic_conditional_write Signed-off-by: Alyssa Rosenzweig <[email protected]> Signed-off-by: Boris Brezillon <[email protected]> Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3697> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3697>
* pan/midgard: Add nir_intrinsic_store_zs_output_pan supportBoris Brezillon2020-02-055-26/+73
| | | | | | | | | | | | | ZS fragment stores are done like color fragment stores, except it's using a different RT id (0xFF), the depth and stencil values are stored in r1.x and r1.y. Signed-off-by: Boris Brezillon <[email protected]> [Fix the scheduling part] Signed-off-by: Alyssa Rosenzweig <[email protected]> Reviewed-by: Alyssa Rosenzweig <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3697>
* pan/midgard: Turn Z/S stores into zs_output_pan intrinsicsBoris Brezillon2020-02-051-0/+98
| | | | | | | | | | | | | | Midgard can't write depth and stencil separately. It has to happen in a single store operation containing both. Let's add a panfrost specific intrinsic and turn all depth/stencil stores into a packed depth+stencil one. Note that this intrinsic is not yet handled in emit_intrinsic(), but we'll address that later. Signed-off-by: Boris Brezillon <[email protected]> Reviewed-by: Alyssa Rosenzweig <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3697>