Commit Graph

160282 Commits

Author SHA1 Message Date
Rob Clark 8609d62e4d freedreno/a6xx: Drop "hardpin" support
The upstream kernel supported everything needed to stop doing
kernel-side relocs before the first things with a6xx were fully
supported in upstream kernel.  Take advantage to drop some extra
overhead in OUT_RELOC() and equiv in the pack macros.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18646>
2022-09-20 02:22:19 +00:00
Rob Clark 3fb60e9cef freedreno/drm: Add fd_ringbuffer_attach_bo()
Which does only the bo bookkeeping and skips all the extra legacy reloc
related overhead.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18646>
2022-09-20 02:22:19 +00:00
Rob Clark 07d9df0ce2 freedreno/drm: Inline fd_bo_get_iova()
The struct body was originally hidden to avoid it being part of the ABI
between libdrm_freedreno and mesa.  But that is no longer a problem.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18646>
2022-09-20 02:22:19 +00:00
Rob Clark 76953ca4bb freedreno/ir3: GC unused macro
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18646>
2022-09-20 02:22:19 +00:00
Rob Clark c00491d4ab freedreno: Update github wiki links
The github wiki isn't really maintained anymore.  Update references to
point to the gitlab wiki instead.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18646>
2022-09-20 02:22:19 +00:00
Bas Nieuwenhuizen b2972cf410 radv: Add scratch stack to reduce LDS stack in RT traversal.
The current stack size is a significant limiter for occupancy, and
hence we need smaller stacks in LDS.

Rhys earlier had a patch that just put the N entries closest to the
root in LDS and the rest in scratch. However, this is not ideal for
performance as most of the activity is happening away from the root,
near the leaves. Of course we can't just switch it around, as the
leaf activity likely isn't happening all the way at the end of the
stack.

So what we do is make the LDS stack kinda a ringbuffer by always
accessing it using the stack index modulo the buffer size (always
a power of two so we can efficiently mask). If we then do not have
free space in this buffer we evict the entries closest to the root
to scratch and if we hit the "bottom" of the LDS space we load from
scratch.

Some rough perf numbers for indication with Q2RTX:

| evicting | LDS entries | perf |
|----------|-------------|------|
|       no |          76 |  55% |
|       no |          32 | 100% |
|       no |          24 | 105% |
|      yes |          32 |  95% |
|      yes |          16 | 100% |
|      yes |           8 |  90% |
|      yes |           4 |  75% |

(For the case with 4 entries we need to do some extra accounting as
 a full batch may not be available to evict)

So an obvious choice is to use a stack of 16 entries.

One might wonder if Q2RTX perf is mainly good due to BVHs with very
little geometry and hence low depth, so I also did some profiling
with control. This is done with RGP instruction timing, so this is
instructions executed not weighted for enabled masks, i.e. divergence
effects included.

| game    | LDS entries | scratch action | fraction of iterations |
|---------|-------------|----------------|------------------------|
| Control |           8 |          store |                  10.3% |
| Control |           8 |          load  |                  34.8% |
| Control |          16 |          store |                  0.58% |
| Control |          16 |          load  |                  2.62% |
| Q2RTX   |          16 |          store |                  1.00% |
| Q2RTX   |          16 |          load  |                  3.07% |

So Q2RTX doesn't seem like an unreasonably good case for this
algorithm.

On the implementation side, we can always place the scratch stack at
address 0 by just reserving the scratch space, and in the case of fixed
callstack size moving that up. In the dynamic case the dynamic stack
base already takes any reserved scratch space into account.

Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18541>
2022-09-20 01:39:20 +00:00
Rhys Perry 7d26fafacf radv: fix dynamic RT stack size with VGPR spilling
VGPR spilling might cause VGPRs to be spilled at scratch offset 0, so we
can't use that.

fossil-db (Sienna Cichlid, Q2RTX and Control):
Totals from 4 (0.26% of 1524) affected shaders:
Instrs: 8734 -> 8737 (+0.03%)
CodeSize: 48492 -> 48504 (+0.02%)
Latency: 384375 -> 384369 (-0.00%)
InvThroughput: 256250 -> 256246 (-0.00%)
Copies: 1312 -> 1313 (+0.08%)
Branches: 256 -> 258 (+0.78%)

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18541>
2022-09-20 01:39:20 +00:00
Dave Airlie b983fcb585 docs: add new llvmpipe/lavapipe atomic float extensions
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18636>
2022-09-20 01:10:36 +00:00
Dave Airlie 31695f81c9 lavapipe: export VK_KHR_shader_atomic_float
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18636>
2022-09-20 01:10:36 +00:00
Dave Airlie 64845cdfed llvmpipe: export GL_NV_shader_atomic_float
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18636>
2022-09-20 01:10:36 +00:00
Dave Airlie 203920d4c6 gallivm: add atomic 32-bit float support
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18636>
2022-09-20 01:10:36 +00:00
Mike Blumenkrantz 96a3136ddd zink: disable GPL when sample shading is in use
this seems impossible to handle as near as I can tell

Acked-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18671>
2022-09-20 00:39:24 +00:00
Bas Nieuwenhuizen ca04f968d9 radv: Use nested ifs for pushing child nodes in traversal loop.
Avoids a bunch of overhead costs if the previous child was empty
already.

Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18538>
2022-09-20 01:29:05 +02:00
Bas Nieuwenhuizen 91a4cd26b3 radv: Use constant for ray traversal exit condition.
Make the stack base ssa def dead in the loop, can save a register.

Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18538>
2022-09-20 01:29:04 +02:00
Bas Nieuwenhuizen 40a235c9a8 Revert "radv/rt: use derefs for the traversal stack"
This reverts commit 3750663c72.

Doing things with derefs adds extra instructions for multiplying the
index with the element size, e.g.

BBF0_13:
   s_waitcnt vmcnt(0)
   v_mov_b32_e32 v27, v55
   s_mov_b32 s23, exec_lo
   v_cmpx_ne_i32_e32 -1, v27
   s_cbranch_execz _L14
BBF0_14:
   v_lshlrev_b32_e32 v48, 2, v46  <--
   ds_write_b32 v48, v27
   v_add_nc_u32_e32 v46, 32, v46
_L14:
   s_mov_b32 exec_lo, s23
   v_mov_b32_e32 v27, v54
   s_mov_b32 s23, exec_lo
   v_cmpx_ne_i32_e32 -1, v27
   s_cbranch_execz _L15
BBF0_15:
   v_lshlrev_b32_e32 v48, 2, v46 <--
   ds_write_b32 v48, v27
   v_add_nc_u32_e32 v46, 32, v46

On Q2RTC indirect lighting this saves about 2.3 VALU instructions
per loop iteration, which is ~4% of VALU instructions (we're at
58 per iteration now according to RGP).

Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18538>
2022-09-20 01:29:04 +02:00
Bas Nieuwenhuizen 85ca0b12a2 radv: Store top of stack in a register.
Saves a bunch of processing and a lot of LDS traffic.

Improves perf of the indirect lighting RT pass in Q2RTX by ~3%. This
is mostly due to the -5% VALU instructions and -25% LDS instructions.

Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18538>
2022-09-20 01:29:04 +02:00
Bas Nieuwenhuizen f7f48251b0 radv: Don't flatten bottom AS exit if statement.
The flattening by ACO is more efficient than the nir condmask.

Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18538>
2022-09-20 01:29:04 +02:00
Kai Wasserbäch c26f83649c fix: frontends/va: unused variable ‘max_pipe_hevc_slices’ [-Wunused-variable]
Only used in debug builds.

Signed-off-by: Kai Wasserbäch <kai@dev.carbon-project.org>
Reviewed-by: Mihai Preda <mhpreda@gmail.com>
Reviewed-by: Ruijing Dong <ruijing.dong@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18643>
2022-09-19 22:02:16 +00:00
Kai Wasserbäch a8ffe41d8c fix: zink: unused variable ‘intr’ [-Wunused-variable]
Only used in debug builds.

Signed-off-by: Kai Wasserbäch <kai@dev.carbon-project.org>
Reviewed-by: Mihai Preda <mhpreda@gmail.com>
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18643>
2022-09-19 22:02:16 +00:00
Kai Wasserbäch 1d41d31ad6 fix: iris: unused variable ‘devinfo’ [-Wunused-variable]
Only used in debug builds.

Signed-off-by: Kai Wasserbäch <kai@dev.carbon-project.org>
Reviewed-by: Mihai Preda <mhpreda@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18643>
2022-09-19 22:02:16 +00:00
Kai Wasserbäch 6aba6a57cc fix: r600/sfn: unused variable ‘spi_sid’ [-Wunused-variable]
Only used in debug builds.

Signed-off-by: Kai Wasserbäch <kai@dev.carbon-project.org>
Reviewed-by: Mihai Preda <mhpreda@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18643>
2022-09-19 22:02:16 +00:00
Kai Wasserbäch 2997f6957e fix: r600/sfn: variable ‘fail’ set but not used [-Wunused-but-set-variable]
Only used in debug builds.

Signed-off-by: Kai Wasserbäch <kai@dev.carbon-project.org>
Reviewed-by: Mihai Preda <mhpreda@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18643>
2022-09-19 22:02:16 +00:00
Kai Wasserbäch a50d8e62dc fix: r600/sfn: unused variable ‘{splitpos,param}’ [-Wunused-variable]
Only used in debug builds.

Signed-off-by: Kai Wasserbäch <kai@dev.carbon-project.org>
Reviewed-by: Mihai Preda <mhpreda@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18643>
2022-09-19 22:02:16 +00:00
Kai Wasserbäch dbf48d346c fix: r600/sfn: unused variable ‘splitpos’ [-Wunused-variable]
Only used in debug builds.

Signed-off-by: Kai Wasserbäch <kai@dev.carbon-project.org>
Reviewed-by: Mihai Preda <mhpreda@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18643>
2022-09-19 22:02:16 +00:00
Kai Wasserbäch 5efce78fd9 fix: r600/sb: warning: unused variable ‘{b,nl}’ [-Wunused-variable]
Only used in debug builds.

Signed-off-by: Kai Wasserbäch <kai@dev.carbon-project.org>
Reviewed-by: Mihai Preda <mhpreda@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18643>
2022-09-19 22:02:16 +00:00
Kai Wasserbäch 5224ee2d8f fix: r600/sfn: variable ‘opinfo’ set but not used [-Wunused-but-set-variable]
Only used in debug builds.

Signed-off-by: Kai Wasserbäch <kai@dev.carbon-project.org>
Reviewed-by: Mihai Preda <mhpreda@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18643>
2022-09-19 22:02:16 +00:00
Kai Wasserbäch 564fef23db fix: r600/sb: unused variable ‘r’ [-Wunused-variable]
Only used in debug builds.

Signed-off-by: Kai Wasserbäch <kai@dev.carbon-project.org>
Reviewed-by: Mihai Preda <mhpreda@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18643>
2022-09-19 22:02:16 +00:00
Kai Wasserbäch 1c2df5b051 fix: r600/sb: unused variable ‘fop’ [-Wunused-variable]
Only used in debug builds.

Signed-off-by: Kai Wasserbäch <kai@dev.carbon-project.org>
Reviewed-by: Mihai Preda <mhpreda@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18643>
2022-09-19 22:02:16 +00:00
Kai Wasserbäch 078569ae8c fix: r600/sb: unused variable ‘repdep2’ [-Wunused-variable]
Only used in debug builds.

Signed-off-by: Kai Wasserbäch <kai@dev.carbon-project.org>
Reviewed-by: Mihai Preda <mhpreda@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18643>
2022-09-19 22:02:16 +00:00
Kai Wasserbäch 0746feaac0 fix: gallivm: variable ‘type_kind’ set but not used [-Wunused-but-set-variable]
Only used in debug builds.

Signed-off-by: Kai Wasserbäch <kai@dev.carbon-project.org>
Reviewed-by: Mihai Preda <mhpreda@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18643>
2022-09-19 22:02:16 +00:00
Kai Wasserbäch 0d46e6803c fix: mesa/st: unused variable ‘src’ [-Wunused-variable]
Only used in debug builds.

Signed-off-by: Kai Wasserbäch <kai@dev.carbon-project.org>
Reviewed-by: Mihai Preda <mhpreda@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18643>
2022-09-19 22:02:16 +00:00
Kai Wasserbäch 6771b89075 fix: mesa/st: variable ‘texobj’ set but not used [-Wunused-but-set-variable]
Only used in debug builds.

Signed-off-by: Kai Wasserbäch <kai@dev.carbon-project.org>
Reviewed-by: Mihai Preda <mhpreda@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18643>
2022-09-19 22:02:16 +00:00
Kai Wasserbäch a3c9c42549 fix: mesa: unused variable ‘ret’ [-Wunused-variable]
Only used in debug builds.

Signed-off-by: Kai Wasserbäch <kai@dev.carbon-project.org>
Reviewed-by: Mihai Preda <mhpreda@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18643>
2022-09-19 22:02:16 +00:00
Kai Wasserbäch 06504254ce fix: ac/llvm: unused variable ‘offset’ [-Wunused-variable]
Only used in debug builds.

Signed-off-by: Kai Wasserbäch <kai@dev.carbon-project.org>
Reviewed-by: Mihai Preda <mhpreda@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18643>
2022-09-19 22:02:16 +00:00
Kai Wasserbäch 452e5973de fix: nir: unused variable ‘else_block’ [-Wunused-variable]
Only used in debug builds.

Signed-off-by: Kai Wasserbäch <kai@dev.carbon-project.org>
Reviewed-by: Mihai Preda <mhpreda@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18643>
2022-09-19 22:02:16 +00:00
Kai Wasserbäch e52d3d5f1c fix: util/format: unused variable ‘desc’ [-Wunused-variable]
Only used in debug builds.

Signed-off-by: Kai Wasserbäch <kai@dev.carbon-project.org>
Reviewed-by: Mihai Preda <mhpreda@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18643>
2022-09-19 22:02:16 +00:00
Mike Blumenkrantz a96151f645 st/drawpixels: use normalized coords in samplers with lowered rects
cc: mesa-stable

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18614>
2022-09-19 20:52:35 +00:00
Mike Blumenkrantz 25c36c5caf st/bitmap: use normalized coords in samplers with lowered rects
cc: mesa-stable

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18614>
2022-09-19 20:52:35 +00:00
Mike Blumenkrantz e13e139bcb zink: fix atomic ssbo fadd offsets
Fixes: 99a4a9c6ff ("zink: fix atomic ssbo indexing with non-32bit values")

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18684>
2022-09-19 20:23:37 +00:00
Mike Blumenkrantz 00a4dc57ce zink: defer acquire semaphore destruction
these have noticeable overhead, so handle them in the submit thread

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18364>
2022-09-19 19:49:11 +00:00
Mike Blumenkrantz 513fcb7936 zink: fix/relax resolve geometry check
there's no requirement in the spec that the geometry for resolves must match,
only that the geometry must be positive (i.e., no flipped extents)

this avoids major perf issues for scaled resolves

cc: mesa-stable

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18364>
2022-09-19 19:49:11 +00:00
Kuixi Ren 9c5edda3ca radeonsi/vcn: Add ability to encode with ltr
reads flags field from CurrPic struct in pps for VA_PICTURE_H264_LONG_TERM_REFERENCE. If found, Curr_pic.frame_idx wil be used for the long term reference index
In get_picture_storage, check if current frame is ltr, and whether its ref frame is ltr.
In radeon_enc_slice_header, adds the ref_pic_list_modification_flag_l0 and long_term_reference_flag for ltr

v2: fix code formatting issues

Reviewed-by: Ruijing Dong ruijing.dong@amd.com
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18219>
2022-09-19 18:22:38 +00:00
Alyssa Rosenzweig bf8c08a0df pan/bi: Implement unpack_64_2x32
This duplicates the lowering from nir_lower_packing. However, nir_lower_packing
also lowers a pile of other instructions that we do implement natively, and this
is easier than adding a bunch of knobs to nir_lower_packing to get just what we
need.

Fixes test-printf address_space_4.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18656>
2022-09-19 17:22:58 +00:00
Alyssa Rosenzweig e9b69c2f79 pan/bi: Stub out scoped_barrier
Implement like other workgroup barriers. No subgroup barriers yet, but that
doesn't seem needed yet.

Fixes test_basic.async_copy_global_to_local and a pile of other OpenCL tests.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18656>
2022-09-19 17:22:58 +00:00
Alyssa Rosenzweig bd8c9442f9 pan/bi: Fix 1D array indexing on Valhall
Array index always goes in the fourth 16-bit component on Valhall. I'm unsure
whether that should also apply to Bifrost. f256ec2a88 ("pan/bi: Fix 1DArray
image coordinate retrieval") says that it should be in the third component on
Bifrost, but I can't remember why that would be the case.

Fixes OpenCL test image_streams.write.1darray on Valhall.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18656>
2022-09-19 17:22:58 +00:00
Alyssa Rosenzweig 76d6bb4822 pan/bi: Use .auto for image stores
Works around LLVM/SPIR-V stupidity. In effect this means we always use typeless
image stores, which is good enough for both CL and GL.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18656>
2022-09-19 17:22:58 +00:00
Alyssa Rosenzweig 8b6611f4bf pan/bi: Call nir_lower_64bit_phis
Fixes test_basic.local_kernel_scope

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18656>
2022-09-19 17:22:58 +00:00
Alyssa Rosenzweig 1b03a04239 pan/bi: Scalarize phis before the opt loop
Scalarizing phis results in vector constructions (nir_op_vec) of the same size
as the phi, so a wide phi (>128-bit) will result in a wide vector op that the
backend can't handle. These wide vector ops can always be copypropped away, but
that relies on running NIR copy/prop after scalarizing phis, which was not
always happening before. By scalarizing phis before the opt loop instead of
after, we guarantee that copyprop and DCE run to completion and we get
appropriately lowered code in the backend.

Fixes parts of integer_ops.integer_divideAssign with longs.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18656>
2022-09-19 17:22:58 +00:00
Alyssa Rosenzweig 55837efe14 pan/bi: Lower fisnormal
Fixes test_bruteforce.isnormal. We don't implement fisnormal in the backend, but
actually lower_bool_to_bitsize was failing earlier since there's no fisnormal32
to lower to either.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18656>
2022-09-19 17:22:58 +00:00
Alyssa Rosenzweig ddcf4b1c7e pan/bi: Lower <32-bit bit_count
While we have a POPCOUNT.i32 instruction, we do not have v2i16/v4i8 variants.
The code generated by lower_to_bitsize doesn't seem any better than what we
could do ourselves, so let's use that.

While we're at it, give bitfield_reverse the same treatment as we have only
BITREV.i32. I don't think we can get <32-bit bitfield_reverse in either GL or
CL, but that seems likely to change in the future. (It looks to be valid SPIR-V,
at least.)

Fixes integer_ops.popcount.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18656>
2022-09-19 17:22:58 +00:00