Commit Graph

132779 Commits

Author SHA1 Message Date
Eric Anholt 5dd5fb1926 softpipe: count CS invocations for pipeline stats queries.
Part of fixing KHR-GL33.pipeline_statistics_query_tests_ARB.
  functional_compute_shader_invocations

(also requires a test bugfix:
https://gitlab.khronos.org/Tracker/vk-gl-cts/-/issues/2694).

Fixes: e749c30ceb ("softpipe: add support for compute shaders. (v2)")
Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8065>
2020-12-23 19:55:49 +00:00
Alyssa Rosenzweig eb7e20b378 pan/bi: Add builder data structure
In preparation for builder routines.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8215>
2020-12-23 13:29:37 -05:00
Alyssa Rosenzweig e8c687b15b pan/bi: Add cursor data structures
To be used in conjunction with the builder.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8215>
2020-12-23 13:29:37 -05:00
Alyssa Rosenzweig dd11e5076e pan/bi: Add new bi_instr data structure
This models instructions closer to the hardware. We'll deduplicate by
the end of the series, but for now this will allow us to add routines
operating on bi_instr without regressing existing users of
bi_instruction.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8215>
2020-12-23 13:29:37 -05:00
Alyssa Rosenzweig e364e11020 pan/bi: Add bi_{abs, neg} helpers
Just conveniences.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8215>
2020-12-23 13:29:36 -05:00
Alyssa Rosenzweig 7e6be656d3 pan/bi: Add bi_imm_u{8, 16} helpers
Common compositions which make building for <32-bit types easier.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8215>
2020-12-23 13:29:36 -05:00
Alyssa Rosenzweig f4b1c12bab pan/bi: Add imm_f32 helper
Pattern comes up surprisingly often.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8215>
2020-12-23 13:29:36 -05:00
Alyssa Rosenzweig 372787020d pan/bi: Add bi_half and bi_byte selectors
Useful for extracting out part of an index, internally implemented via a
subword swizzle.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8215>
2020-12-23 13:29:36 -05:00
Alyssa Rosenzweig 06f52fe0b1 pan/bi: Add node_to_index helper
To invert index_to_node for RA.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8215>
2020-12-23 13:29:36 -05:00
Alyssa Rosenzweig b85f317017 pan/bi: Add a helper to convert to old-style nodes
RA, DCE, and liveness assume that SSA and non-SSA normal indices are
indexed from 1 in a shared address space, with a maximum given by
bi_max_temp. As a stop gap, let's translate bi_index to old style
node numbers so those passes can be updated cleanly.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8215>
2020-12-23 13:29:36 -05:00
Alyssa Rosenzweig 2d9147dae4 pan/bi: Add helpers to generate bi_index from NIR
Corresponding to the existing pan_{...}_index helpers, except returning
a new-style index instead.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8215>
2020-12-23 13:29:36 -05:00
Alyssa Rosenzweig fc760e7d66 pan/bi: Add bi_temp{_reg} for new-style bi_index
Variant of bi_make_temp{_reg} returning a bi_index.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8215>
2020-12-23 13:29:36 -05:00
Alyssa Rosenzweig 903a818f33 pan/bi: Add helper to extract a word from an index
This pattern comes up surprisingly often due to the prevalance of
vectors.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8215>
2020-12-23 13:29:36 -05:00
Alyssa Rosenzweig 3a63b5d7cf pan/bi: Add nullity/equality helpers for bi_index
We can no longer use the builtin equals, since they're structs now, but
these helpers are almost as convenient.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8215>
2020-12-23 13:29:36 -05:00
Alyssa Rosenzweig 5dd756afed pan/bi: Add bi_index constructors
These add succinct helpers to generate well-formed references.

Note for semantic that bi_zero represents the immediate value #0, while
bi_null represents a value that does not exist ("undefined").

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8215>
2020-12-23 13:15:10 -05:00
Alyssa Rosenzweig 99152b6045 pan/bi: Add bi_index data structure
Rather than open-coding indices with manual bit packing flying around,
let's add a data structure corresponding to a reference to some data.
(Think nir_src, ibc_ref, etc). In particular this allows us to pack in
more metadata, like an offset, for properly supporting limited vectors
(for I/O) without bloating the IR with swizzle fields.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8215>
2020-12-23 13:15:10 -05:00
Alyssa Rosenzweig f9cd6f0500 pan/bi: Add bi_swizzle enum
We need to represent subword swizzles at a somewhat higher level than
the hardware.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8215>
2020-12-23 13:15:10 -05:00
Alyssa Rosenzweig d93995fd2b pan/bi: Make BIR_INDEX_ZERO less special
It can be implemented as a constant that just shifts beyond the 64-bits
available for the instruction, and then we can avoid special handling in
a bunch of places.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8215>
2020-12-23 13:15:10 -05:00
Alyssa Rosenzweig 0f0bb87e9d pan/bi: Remove BIR_INDEX_UNIFORM
It too is a special case of BIR_INDEX_FAU, although its printing is
special-cased for readability.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8215>
2020-12-23 13:15:10 -05:00
Alyssa Rosenzweig 98fabee213 pan/bi: Merge BIR_INDEX_FAU and BIR_INDEX_BLEND
There's no reason to separate these, and it's more convenient not to.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8215>
2020-12-23 13:15:10 -05:00
Alyssa Rosenzweig 25c9946883 pan/bi: Generate bi_opcodes.c
So we can lookup various properties rather than generating piles of
switch statements.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8215>
2020-12-23 13:15:10 -05:00
Alyssa Rosenzweig 2d4597de2e pan/bi: Use autogenerated modifiers
Step in the right direction to deduplicate.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8215>
2020-12-23 13:15:10 -05:00
Alyssa Rosenzweig f9084b6c3f pan/bi: Generate bi_opcodes.h
A header for enums for each opcode and each modifier.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8215>
2020-12-23 13:15:09 -05:00
Alyssa Rosenzweig bfa1163980 pan/bi: Move modifier prints out of common code
These will get in the way of what we want and aren't used by the
disassembler.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8215>
2020-12-23 12:48:06 -05:00
Alyssa Rosenzweig 83d5dd4d1b pan/bi: Remove reference to 64-bit RA
Not something we plan to ever support on Bifrost. v7 needs 64-bit
lowered at the NIR level. The support for 64-bit clauses on v6 is iffy
and not worth worrying about at this point.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8215>
2020-12-23 12:48:06 -05:00
Erik Faye-Lund a22b85ce5e zink: document some more features for higher GL versions
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8212>
2020-12-23 17:20:49 +00:00
Alyssa Rosenzweig 93af193eeb pan/bi: Add helpers for manipulating the ISA
These will be used to generate various files for the IR.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8213>
2020-12-23 17:06:57 +00:00
Alyssa Rosenzweig 46584f2d46 pan/bi: Move copyright notice to common code
No reason to duplicate this all over the place.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8213>
2020-12-23 17:06:57 +00:00
Alyssa Rosenzweig 4d76a3d4a1 pan/bi: Add explicit meson dependency on the ISA helpers
This logic was slightly busted before.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8213>
2020-12-23 17:06:57 +00:00
Alyssa Rosenzweig c3625f4ca8 pan/bi: Rename isa_parse to bifrost_isa
We use this for non-parsing code as well. Make the name clear.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8213>
2020-12-23 17:06:57 +00:00
Alyssa Rosenzweig 27e37a7746 pan/bi: Add pseudo register formats to XML
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8213>
2020-12-23 17:06:57 +00:00
Alyssa Rosenzweig cffc1d90da pan/bi: Add staging register counts to ISA.xml
Message-passing instructions that read/write staging registers access
either:

* a fixed number of registers
* vecsize registers (/2 for LD/ST_CVT if register_format is 16-bit)
* a computed number for TEXC

This adds the fixed counts into the XML for the first type and space to
specify the latter types.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8213>
2020-12-23 17:06:57 +00:00
Alyssa Rosenzweig faa18708d1 pan/bi: Fix rounding name for HADD in XML
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8213>
2020-12-23 17:06:57 +00:00
Alyssa Rosenzweig 27f91eb66b pan/bi: Mark message types in ISA.xml
Message-passing instructions have an associated message type, which the
clause header needs to signal. Instead of open coding this, let's
annotate the XML. Instructions not otherwise marked do not generate
messages.

Three exceptions apply:

* UBO loads need to use the attribute message type.
* Tile buffer access to Z/S needs ZS message type
* LD_VAR_SPECIAL.fragz needs ZS message type

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8213>
2020-12-23 17:06:57 +00:00
Alyssa Rosenzweig 2b5cfd0df9 pan/bi: Use consistent neg naming
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8213>
2020-12-23 17:06:57 +00:00
Alyssa Rosenzweig 550bbcdcd1 pan/bi: Use canonical inactive result
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8213>
2020-12-23 17:06:57 +00:00
Alyssa Rosenzweig 5789bbfdbc pan/bi: Use canonical subgroup size
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8213>
2020-12-23 17:06:57 +00:00
Alyssa Rosenzweig c41cecd404 pan/bi: Use canonical lane ops
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8213>
2020-12-23 17:06:57 +00:00
Alyssa Rosenzweig 876f37ed59 pan/bi: Use canonical name for segments
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8213>
2020-12-23 17:06:57 +00:00
Alyssa Rosenzweig f47ec85ef6 pan/bi: Use canonical min/max semantics
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8213>
2020-12-23 17:06:57 +00:00
Alyssa Rosenzweig c7e494268e pan/bi: Use canonical update modes
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8213>
2020-12-23 17:06:57 +00:00
Alyssa Rosenzweig 3797fc9af9 pan/bi: Use canonical sample names
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8213>
2020-12-23 17:06:57 +00:00
Alyssa Rosenzweig 2e84a1b4d8 pan/bi: Use canonical varying names
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8213>
2020-12-23 17:06:57 +00:00
Alyssa Rosenzweig 030854a3b8 pan/bi: Use canonical names for rounding modes
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8213>
2020-12-23 17:06:56 +00:00
Alyssa Rosenzweig 6e481500d0 pan/bi: Use canonical names for clamps
Prepare to generate this enum by correctly naming the open-coded
variant.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8213>
2020-12-23 17:06:56 +00:00
Alyssa Rosenzweig 569886359b pan/bi: Don't treat extend as per-source
There is only one per instruction so it just complicates things.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8213>
2020-12-23 17:06:56 +00:00
Alyssa Rosenzweig aa91f9dcc0 pan/bi: Use consistent naming of lane/lane0
It's always a source modifier.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8213>
2020-12-23 17:06:56 +00:00
Alyssa Rosenzweig 2470a6bc9a pan/bi: Use consistent wls naming
Compare naming in the data structures.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8213>
2020-12-23 17:06:56 +00:00
Alyssa Rosenzweig 3b6ef4ef10 pan/bi: Use consistent negX/absX naming
We already use plain neg/abs for this, don't mix it. Will avoid weird
enums for abs/neg with a generated IR.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8213>
2020-12-23 17:06:56 +00:00
Alyssa Rosenzweig 258c1f5b24 pan/bi: Defer newline printing in disassembler
Easy reduction in generated code, while we're at it. Pretty obvious
change after working on similar fixes for the other generators.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8213>
2020-12-23 17:06:56 +00:00