Rob Clark
c0d56efa31
freedreno/ir3: also precompile compute shaders for shaderdb
...
Similar as with draw shaders, nothing will trigger the final variant in
shader-db.
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4423 >
2020-04-04 00:07:10 +00:00
Rob Clark
37e052c8b0
freedreno: fix missing locking
...
Fixes: d0b3ccb060 ("freedreno: Fix detection of being in a blit for acc queries.")
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4423 >
2020-04-04 00:07:10 +00:00
Rob Clark
f8fc690d1c
freedreno/a6xx: add some compute logging
...
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4423 >
2020-04-04 00:07:10 +00:00
Rob Clark
629c0cee0a
freedreno/ir3/cf: use ssa-uses
...
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4423 >
2020-04-04 00:07:10 +00:00
Rob Clark
72f6b03aec
freedreno/ir3: add a pass to collect SSA uses
...
We don't really track these as the ir is transformed, but it would be a
useful thing for some passes to have. So add a pass to collect this
information. It uses instr->data (generic per-pass ptr), with the
hashsets hanging under a mem_ctx for easy disposal at the end of the
pass.
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4423 >
2020-04-04 00:07:10 +00:00
Rob Clark
67dbe8088f
freedreno/ir3/cf: skip array load/store
...
Don't fold conversions into array (incl phi lowered to regs/array).
These aren't SSA. Avoids crashes in particular in frag shaders with
flow control, which would leave a dangling array write disconnect from
the original cov src.
Possibly this could be slightly relaxed, if there is no other consumer
of the src, and it were in the same block. But it would require
updating block->keeps, and taking care of barrier state. Which isn't a
thing the cf pass does currently.
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4423 >
2020-04-04 00:07:10 +00:00
Rob Clark
c2d0cc8b8d
freedreno/ir3: fixup cat3 32b vs 16b
...
These should be keyed on src arg type.
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4423 >
2020-04-04 00:07:10 +00:00
Rob Clark
e73a8a9703
freedreno/ir3/cf: handle widening too
...
We can also fold f16->f32 conversions.
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4423 >
2020-04-04 00:07:10 +00:00
Rob Clark
bf64648864
nir: fix definition of imadsh_mix16 for vectors
...
Fixes: c27b3758fa ("nir/opcodes: Add new 'umul_low' and 'imadsh_mix16' opcodes")
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4423 >
2020-04-04 00:07:10 +00:00
Daniel Schürmann
1d293096d0
aco: use MUBUF to load subdword SSBO
...
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-By: Timur Kristóf <timur.kristof@gmail.com>
Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4002 >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4002 >
2020-04-03 23:13:15 +01:00
Daniel Schürmann
8cfddc9199
aco: implement 8bit/16bit store_ssbo
...
Currently without alignment check, so that
we can only use the _byte and _short versions
and multi-component stores are split.
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-By: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4002 >
2020-04-03 23:13:15 +01:00
Daniel Schürmann
3df0a41c75
aco: implement 8bit/16bit load_buffer
...
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-By: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4002 >
2020-04-03 23:13:15 +01:00
Daniel Schürmann
c70d014455
aco: implement storagePushConstant8 & storagePushConstant16
...
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-By: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4002 >
2020-04-03 23:13:15 +01:00
Daniel Schürmann
5718347c2b
aco: implement vec2/3/4 with subdword operands
...
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-By: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4002 >
2020-04-03 23:13:15 +01:00
Daniel Schürmann
85521061d6
aco: prepare helper functions for subdword handling
...
- get_alu_src()
- emit_extract_vector()
- emit_split_vector()
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-By: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4002 >
2020-04-03 23:13:15 +01:00
Daniel Schürmann
fe08f0ccf9
aco: add byte_align_scalar() & trim_subdword_vector() helper functions
...
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-By: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4002 >
2020-04-03 23:13:15 +01:00
Daniel Schürmann
23ac24f5b1
aco: add missing conversion operations for small bitsizes
...
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-By: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4002 >
2020-04-03 23:13:15 +01:00
Daniel Schürmann
d223e4e8de
aco: don't vectorize 8/16bit load/store_ssbo
...
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-By: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4002 >
2020-04-03 23:13:15 +01:00
Daniel Schürmann
0bb3537676
aco: don't assume split_vector(create_vector) has the same number of elements when optimizing
...
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-By: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4002 >
2020-04-03 23:13:15 +01:00
Daniel Schürmann
c436743b0c
aco: don't propagate SGPRs into subdword PSEUDO instructions
...
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-By: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4002 >
2020-04-03 23:13:15 +01:00
Daniel Schürmann
8f1712ba2f
aco: lower subdword shuffles correctly.
...
Note that subdword swaps are not yet implemented
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-By: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4002 >
2020-04-03 23:13:15 +01:00
Daniel Schürmann
ca38c1f1f1
aco: add builder function for subdword copy()
...
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-By: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4002 >
2020-04-03 23:13:15 +01:00
Daniel Schürmann
9f779a2518
aco: small refactoring of shuffle code lowering
...
Uses now bytes instead of 32bit size
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-By: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4002 >
2020-04-03 23:13:15 +01:00
Daniel Schürmann
0680b258f4
aco: align subdword registers during RA when necessary
...
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-By: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4002 >
2020-04-03 23:13:15 +01:00
Daniel Schürmann
031edbc4a5
aco: adapt register allocation for subdword registers
...
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-By: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4002 >
2020-04-03 23:13:15 +01:00
Daniel Schürmann
2c74fc98b8
aco: create helper function to collect variables from register area
...
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-By: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4002 >
2020-04-03 23:13:15 +01:00
Daniel Schürmann
aca2bbf975
aco: add notion of subdword registers to register allocator
...
To not having to split the register file into single bytes,
we maintain a map with registers which contain subdword variables.
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-By: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4002 >
2020-04-03 23:13:15 +01:00
Daniel Schürmann
90811554da
aco: remove unnecessary reg_file.fill() operation in get_reg_create_vector()
...
No pipelinedb changes
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-By: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4002 >
2020-04-03 23:13:15 +01:00
Daniel Schürmann
7de003473c
aco: fix Temp and assignment of renamed operands during RA
...
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-By: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4002 >
2020-04-03 23:13:15 +01:00
Daniel Schürmann
2d957311f1
aco: print subdword registers
...
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-By: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4002 >
2020-04-03 23:13:15 +01:00
Daniel Schürmann
3c0c28a1ff
aco: validate RA of subdword assignments
...
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-By: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4002 >
2020-04-03 23:13:15 +01:00
Daniel Schürmann
799bb10328
aco: validate uninitialized operands
...
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-By: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4002 >
2020-04-03 23:13:15 +01:00
Daniel Schürmann
9374659426
aco: validate register alignment of subdword operands and definitions
...
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-By: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4002 >
2020-04-03 23:13:15 +01:00
Daniel Schürmann
ad4e104bb9
aco: validate p_create_vector with subdword elements properly
...
Also allows for undef operands
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-By: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4002 >
2020-04-03 23:13:15 +01:00
Daniel Schürmann
f01bf51a2b
aco: refactor regClass setup for subdword VGPRs
...
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-By: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4002 >
2020-04-03 23:13:15 +01:00
Rhys Perry
c4223fa512
aco: add emission support for register-allocated sdwa sels
...
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Reviewed-By: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4002 >
2020-04-03 23:13:15 +01:00
Daniel Schürmann
8acb384471
aco: add sub-dword regclasses
...
Co-authored-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-By: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4002 >
2020-04-03 23:13:15 +01:00
Rhys Perry
9915af5ca1
aco: print and validate opsel
...
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Reviewed-By: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4002 >
2020-04-03 23:13:15 +01:00
Rhys Perry
b84d59af50
aco: add SDWA_instruction
...
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Reviewed-By: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4002 >
2020-04-03 23:13:15 +01:00
Daniel Schürmann
00312f3c95
aco: add comparison operators for PhysReg
...
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-By: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4002 >
2020-04-03 23:13:15 +01:00
Rhys Perry
34424b81df
aco: make PhysReg in units of bytes
...
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Reviewed-By: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4002 >
2020-04-03 23:13:15 +01:00
Daniel Schürmann
dc69738b0f
nir: fix unpack_64_4x16 in lower_alu_to_scalar()
...
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-By: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4002 >
2020-04-03 23:13:15 +01:00
Lionel Landwerlin
373f1eb9de
drm-shim: stub libdrm's use of realpath()
...
libdrm started using realpath to get the type of bus associated with a
given device. This stubs the very specific usage that prevents
drm-shim's device from being listed.
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4429 >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4429 >
2020-04-03 21:14:18 +00:00
Lionel Landwerlin
c3e305616c
drm-shim: return device platform as specified
...
v2: Embed the libdrm dependency inside the drm-shim dependency
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Acked-by: Eric Anholt <eric@anholt.net> (v1)
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4429 >
2020-04-03 21:14:18 +00:00
Jason Ekstrand
fa5a36dbd4
spirv: Rewrite CFG construction
...
This commit completely rewrites the way we extract a structured CFG from
SPIR-V. The new approach is different in a few ways:
1. It does a breadth-first search instead of depth-first. This means
that we've visited the merge node for a construct before we visit
any of the nodes inside the construct. This makes it easier to
validate things like loop and switch nesting.
2. We record more information in the CFG. Earlier commits added a
parent pointer to vtn_cf_node but we now record all of the merge and
other special blocks for each CFG node. This lets us validate
things more precisely.
3. It makes heavy use of merge blocks for walking the CFG. Previously,
we sort of used them as hints for trying to guess the CFG structure
but things got dicey whenever a merge was missing. We had some
heuristics for how to handle short-circuiting if statements but it
was a bunch of special cases.
Now, we make them a fundamental part of walking the CFG. When we
encounter a control-flow construct, we add the body components of
the construct to the BFS work list and then jump to the merge block
if one exists to continue scanning the current CFG nesting level.
If no merge block exists, we assume that means that control-flow
never re-converges in a normal way and that the only way to get back
to normality is with a direct jump such as a loop break or continue.
This should make things far more robust when trying to deal with the
more creative placement (or lack thereof) of merge instructions.
Reviewed-by: Alan Baker <alanbaker@google.com>
Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3820 >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3820 >
2020-04-03 20:54:00 +00:00
Jason Ekstrand
2de5a41595
spirv: Add a parent field to vtn_cf_node
...
This makes it easier to crawl up the CF tree when trying to validate the
incoming SPIR-V control-flow.
Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3820 >
2020-04-03 20:54:00 +00:00
Jason Ekstrand
d94e464a9f
spirv: Make vtn_function a vtn_cf_node
...
Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3820 >
2020-04-03 20:54:00 +00:00
Jason Ekstrand
255aacbec1
spirv: Make vtn_case a vtn_cf_node
...
Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3820 >
2020-04-03 20:54:00 +00:00
Jason Ekstrand
9d7fcf1de0
spirv: Add cast and loop helpers for vtn_cf_node
...
Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3820 >
2020-04-03 20:54:00 +00:00
Jason Ekstrand
8c5c65d0d6
spirv: Add a vtn_block() helper
...
Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3820 >
2020-04-03 20:54:00 +00:00