Daniel Schürmann
a3785e3481
nir/opt_vectorize: hash whether a swizzle accesses elements beyond the maximum vectorization factor
...
Swizzles that access components outside of the maximum
vector size cannot be vectorized with each other.
This patch creates different hash bins for this case.
For example accesses to .x and .y are considered different variables
compared to accesses to .z and .w for 16-bit vec2.
This prevents the vectorization of things like
vec2 16 ssa_3 = iadd ssa_1.xz, ssa_2.xz
Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6666 >
2020-12-31 16:44:58 +00:00
Daniel Schürmann
46e7428031
nir/opt_vectorize: rehash users of vectorized instructions
...
This ensures that chains of ALU instructions are vectorized
in a single iteration.
Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6666 >
2020-12-31 16:44:58 +00:00
Daniel Schürmann
8eaf9c61d1
nir/opt_vectorize: don't hash filtered instructions
...
This patch also changes nir_opt_vectorize_cb to
use only one instruction as parameter.
Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6666 >
2020-12-31 16:44:58 +00:00
Daniel Schürmann
23b2885514
nir/opt_vectorize: don't hash instructions which are already vectorized
...
This guarantees that the hashset contains exactly the instructions
which can be vectorized.
Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6666 >
2020-12-31 16:44:58 +00:00
Daniel Schürmann
ad37e4df73
nir/opt_vectorize: use a single instruction per hash entry instead of a vector
...
This drastically simplifies vectorization but may potentially
lead to slightly worse vectorizations.
Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6666 >
2020-12-31 16:44:58 +00:00
Samuel Pitoiset
0b503d8de9
nir: fix determining if an addition might overflow for phi sources
...
nir_addition_might_overflow() expects the parent instruction to be
an alu instr but it might be a phi instr. Fix it by assuming that
the addition might overflow.
This fixes compiler crashes with Horizon Zero Dawn.
No fossils-db changes.
Cc: mesa-stable
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8268 >
2020-12-31 16:17:08 +00:00
Alyssa Rosenzweig
129d390bd8
pan/mdg: Fix bound setting in RA for sources
...
The bound parameter allows us to prevent allocations from crossing
particular boundaries (typically 128-bit boundaries). For 16-bit, we
don't want to cross 64-bit boundaries, in order to keep swizzles
possible to encode. We already handle this for 16-bit destinations, but
it _also_ needs to be (redundantly) handled for 16-bit sources, in case
types don't match (for example, with a vectorized size conversion
instruction).
Fixes a few newer dEQP fails.
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8282 >
2020-12-31 10:50:49 -05:00
Boris Brezillon
469d74908c
pan/bi: Fix ATEST emission
...
The ATEST FAU index must point to the ATEST parameter datum slot
otherwise the cmdstream config is ignored.
(Rebased by Alyssa)
Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8135 >
2020-12-31 14:39:02 +00:00
Alyssa Rosenzweig
f6e128fb8f
pan/bi: Remove old IR
...
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8135 >
2020-12-31 14:39:02 +00:00
Alyssa Rosenzweig
e904bbb170
pan/bi: Use new instruction types
...
And remove now redundant casts
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8135 >
2020-12-31 14:39:02 +00:00
Alyssa Rosenzweig
cf5b2b8939
pan/bi: Remove old IR instruction emit
...
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8135 >
2020-12-31 14:39:02 +00:00
Alyssa Rosenzweig
b691aeaacf
pan/bi: Remove old IR opcode table
...
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8135 >
2020-12-31 14:39:02 +00:00
Alyssa Rosenzweig
f474e6a47c
pan/bi: Remove old IR helpers
...
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8135 >
2020-12-31 14:39:02 +00:00
Alyssa Rosenzweig
e5ec0dc183
pan/bi: Remove NIR->old IR
...
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8135 >
2020-12-31 14:39:02 +00:00
Alyssa Rosenzweig
fa465d52b9
pan/bi: Remove old IR scheduling
...
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8135 >
2020-12-31 14:39:02 +00:00
Alyssa Rosenzweig
029e928226
pan/bi: Remove old IR spill code
...
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8135 >
2020-12-31 14:39:02 +00:00
Alyssa Rosenzweig
4e4146c990
pan/bi: Remove old IR prints
...
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8135 >
2020-12-31 14:39:02 +00:00
Alyssa Rosenzweig
7e8022fa8a
pan/bi: Remove packing helpers
...
Support code for the old IR packing.
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8135 >
2020-12-31 14:39:02 +00:00
Alyssa Rosenzweig
a1e150fc4d
pan/bi: Remove old IR packs
...
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8135 >
2020-12-31 14:39:02 +00:00
Alyssa Rosenzweig
8b0d0a931b
pan/bi: Remove combine lowering
...
Unused.
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8135 >
2020-12-31 14:39:02 +00:00
Alyssa Rosenzweig
39aa8c4a5a
pan/bi: Switch to new IR
...
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8135 >
2020-12-31 14:39:02 +00:00
Alyssa Rosenzweig
73169aa0b4
pan/bi: Stub FAU lowering pass
...
A given tuple can only load a single entry from FAU-RAM, so we need a
lowering pass before scheduling to assign FAU and lower the other
sources to moves.
Right now this only handles constants. Uniforms and general FAU are
todo.
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8135 >
2020-12-31 14:39:02 +00:00
Alyssa Rosenzweig
239ef52216
pan/bi: Add bi_branch, bi_jump helpers
...
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8135 >
2020-12-31 14:39:02 +00:00
Alyssa Rosenzweig
0f6e317045
pan/bi: Schedule new instructions singletons
...
We'll let the routines coexist for a moment, just to keep the commits
digestible, but this is modified from bi_make_singleton.
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8135 >
2020-12-31 14:39:02 +00:00
Alyssa Rosenzweig
84f251c38a
pan/bi: Add bi_message_type_for_instr helper
...
Greatly simplified by the use of the table.
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8135 >
2020-12-31 14:39:02 +00:00
Alyssa Rosenzweig
26ce13f657
pan/bi: Add instruction emit for builder
...
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8135 >
2020-12-31 14:39:02 +00:00
Alyssa Rosenzweig
f7c2fc7eba
pan/bi: Add emit tex for builder
...
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8135 >
2020-12-31 14:39:02 +00:00
Alyssa Rosenzweig
26cbf559d6
pan/bi: Fix TEXS/TEXC check prototype
...
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8135 >
2020-12-31 14:39:02 +00:00
Alyssa Rosenzweig
70d6c5675d
pan/bi: Emit TEXC with builder
...
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8135 >
2020-12-31 14:39:02 +00:00
Alyssa Rosenzweig
e477de829f
pan/bi: Add builder-using helpers for TEXC structs
...
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8135 >
2020-12-31 14:39:02 +00:00
Alyssa Rosenzweig
6f048b5f95
pan/bi: Add TEXS emit with builder
...
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8135 >
2020-12-31 14:39:02 +00:00
Alyssa Rosenzweig
311d3d6015
pan/bi: Implement jumps with the builder
...
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8135 >
2020-12-31 14:39:01 +00:00
Alyssa Rosenzweig
f05174e5a5
pan/bi: Implement ALU with the builder
...
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8135 >
2020-12-31 14:39:01 +00:00
Alyssa Rosenzweig
8e82641cf5
pan/bi: Add bi_cmpf_nir helper
...
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8135 >
2020-12-31 14:39:01 +00:00
Alyssa Rosenzweig
8c99fed470
pan/bi: Add bi_nir_round helper
...
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8135 >
2020-12-31 14:39:01 +00:00
Alyssa Rosenzweig
95d62ee7cf
pan/bi: Add bi_alu_src_index helper
...
Generates bi_index from nir_alu_src, taking into account the applied
swizzle, and using (swizzle / 32-bit) portion as an offset, to be
applied later during RA. The sub 32-bit portion only applies for 8-bit
and 16-bit instructions, which need to either handle them explicitly as
a swizzle specifier, or lower to a swizzle explicitly.
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8135 >
2020-12-31 14:39:01 +00:00
Alyssa Rosenzweig
9c7efc4510
pan/bi: Add intrinsic emits for builder
...
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8135 >
2020-12-31 14:39:01 +00:00
Alyssa Rosenzweig
482cc273af
pan/bi: Implement load attribute with the builder
...
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8135 >
2020-12-31 14:39:01 +00:00
Alyssa Rosenzweig
0ae835499d
pan/bi: Implement frag coord with the builder
...
Much slicker :-)
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8135 >
2020-12-31 14:39:01 +00:00
Alyssa Rosenzweig
2e57684d2d
pan/bi: Implement load_ubo with the builder
...
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8135 >
2020-12-31 14:39:01 +00:00
Alyssa Rosenzweig
341e312cf4
pan/bi: Implement store_vary with the builder
...
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8135 >
2020-12-31 14:39:01 +00:00
Alyssa Rosenzweig
49f38aa9e7
pan/bi: Implement fragment_out by builder
...
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8135 >
2020-12-31 14:39:01 +00:00
Alyssa Rosenzweig
3c5097bbfd
pan/bi: Implement BLEND by builder
...
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8135 >
2020-12-31 14:39:01 +00:00
Alyssa Rosenzweig
20bfe9ee05
pan/bi: Implement load_vary via the builder
...
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8135 >
2020-12-31 14:39:01 +00:00
Alyssa Rosenzweig
baec458105
pan/bi: Implement bi_reg_fmt_for_nir helper
...
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8135 >
2020-12-31 14:39:01 +00:00
Alyssa Rosenzweig
279772b5ec
pan/bi: Implement load_blend_input via the builder
...
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8135 >
2020-12-31 14:39:01 +00:00
Alyssa Rosenzweig
63863de923
pan/bi: Implement bi_emit_load_const via the builder
...
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8135 >
2020-12-31 14:39:01 +00:00
Alyssa Rosenzweig
9841afad57
pan/bi: Implement bi_load_sysval via the builder
...
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8135 >
2020-12-31 14:39:01 +00:00
Alyssa Rosenzweig
feecf0a3d8
pan/bi: Implement bi_emit_ld_tile via the builder
...
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8135 >
2020-12-31 14:39:01 +00:00
Alyssa Rosenzweig
4de806a803
pan/bi: Add bi_make_vec_to helper
...
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8135 >
2020-12-31 14:39:01 +00:00