Rhys Perry
8fc24f9a45
aco: fix copy statistic for 64-bit vgpr constant copy
...
The statistic is in units of instructions.
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4469 >
2020-04-22 13:25:17 +00:00
Daniel Schürmann
c3c1f4d6bc
aco: move src1 to vgpr instead of using VOP3 for VOP2 instructions during isel
...
Is simpler and helps a couple of shaders.
Totals from affected shaders: (Vega)
Code Size: 16341296 -> 16335460 (-0.04 %) bytes
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4642 >
2020-04-20 15:12:50 +00:00
Daniel Schürmann
be0bb7e101
aco: fix 64bit fsub
...
Fixes: 425558bfd5 ('aco: use v_subrev_f32 for fsub with an sgpr operand in src1')
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4642 >
2020-04-20 15:12:50 +00:00
Daniel Schürmann
425558bfd5
aco: use v_subrev_f32 for fsub with an sgpr operand in src1
...
This fixes an accidentally introduced regression.
Fixes: 9be4be515f ('aco: implement 16-bit nir_op_fsub/nir_op_fadd')
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4633 >
2020-04-19 16:16:27 +00:00
Samuel Pitoiset
c4ca9e66dd
aco: fix exporting the viewport index if the fragment shader needs it
...
It's like the layer, it has to be exported via the pos and also
as a varying if the fragment shader reads it.
Fixes dEQP-VK.draw.shader_viewport_index.fragment_shader_*
Cc: <mesa-stable@lists.freedesktop.org>
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4564 >
2020-04-17 16:23:24 +00:00
Rhys Perry
839c886b34
aco: add missing scc clobber to nir_op_unpack_32_2x16_split_y
...
The ISA doc is inconsistent whether this instruction writes SCC. It does.
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4552 >
2020-04-16 17:04:53 +01:00
Rhys Perry
ac74367bef
aco: implement various 8/16-bit conversions
...
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4552 >
2020-04-16 17:04:45 +01:00
Samuel Pitoiset
11faaf646d
aco: fix emitting stream output with tess eval shaders
...
Fixes dEQP-VK.transform_feedback.simple.winding_patch_list_12.
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4553 >
2020-04-16 07:57:39 +00:00
Samuel Pitoiset
91aa596ca7
aco: implement nir_op_f2i8/nir_op_f2u8
...
I think we should really refactor the conversions path.
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/4551 >
2020-04-16 08:47:49 +02:00
Rhys Perry
c818b5c089
aco: fix 1D textureGrad() on GFX9
...
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Fixes: 6f718edced ('aco: simplify gathering of MIMG address components')
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4550 >
2020-04-15 10:45:07 +00:00
Samuel Pitoiset
08a396033b
aco: fix nir_op_frexp_exp with 16-bit floats and negative exponents
...
v_frexp_exp_i16_f16 returns the two's complement for negative
exponents. For example, with 0.333252 it returns 0.666504 for
the mantissa and 65535 for the exponent (-1 in decimal).
RADV/LLVM and AMDVLK do a v_bfe_i32 and AMDGPU-PRO uses SDWA with
the sign extension bit set. The latter is probably what we want to
do in long term but for now RA doesn't support changing non-SDWA
instructions to SDWA if useful/needed.
Fixes dEQP-VK.glsl.builtin.precision_fp16_storage16b.frexp.compute.*.
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/4546 >
2020-04-15 10:12:44 +02:00
Rhys Perry
fbd2be3f5d
aco: clear moved operands in get_reg_create_vector()
...
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4507 >
2020-04-14 10:49:12 +00:00
Rhys Perry
52cc1f8237
aco: improve p_create_vector RA for sub-dword operands
...
These's still improvements needed for sub-dword definitions, but that's
not as simple.
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4507 >
2020-04-14 10:49:12 +00:00
Rhys Perry
e18711cda3
aco: fix p_extract_vector validation
...
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4507 >
2020-04-14 10:49:12 +00:00
Rhys Perry
41ac44e1b3
aco: improve vector optimization with sub-dword vectors
...
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4507 >
2020-04-14 10:49:12 +00:00
Daniel Schürmann
28d36d26c2
aco: fix p_extract_vector optimization in presence of unequally sized vector operands
...
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4506 >
2020-04-13 16:35:40 +00:00
Samuel Pitoiset
fc1068de0d
aco: fix nir_op_pack_32_2x16_split if one operand is a constant
...
Because 16-bit constants are represented with the s1 RegClass, we
have to extract the low half.
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/4509 >
2020-04-13 11:51:17 +00:00
Samuel Pitoiset
4cfaef68d7
aco: implement 16-bit nir_op_f2i64/nir_op_f2u64
...
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/4509 >
2020-04-13 11:51:17 +00:00
Samuel Pitoiset
729bdc0d70
aco: fix f2i64/f2u64 with sgprs if the exponent computation overflow
...
This fixes f16->{i64,u64} conversions for +0/-0.
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/4509 >
2020-04-13 11:51:17 +00:00
Daniel Schürmann
38622de2ec
aco: make some reg_file helpers private and fix their uses
...
Fixes various subdword RA issues
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4492 >
2020-04-10 07:19:27 +00:00
Daniel Schürmann
331794495e
aco: rename aco_lower_bool_phis() -> aco_lower_phis()
...
We also lower subdword phis, now.
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4492 >
2020-04-10 07:19:27 +00:00
Daniel Schürmann
1d41521b16
aco: lower subdword phis with SGPR operands
...
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4492 >
2020-04-10 07:19:27 +00:00
Daniel Schürmann
a39df3bfce
aco: don't constant-propagate into subdword PSEUDO instructions
...
PSEUDO instructions are lowered using SDWA, and thus,
cannot take literals and before GFX9 cannot take constants
at all. As the in-register representation differs between
32bit and 16bit floats, we first need to ensure correct
behavior.
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4492 >
2020-04-10 07:19:27 +00:00
Daniel Schürmann
1de18708cb
aco: ensure correct bit representation of subdword constants
...
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4492 >
2020-04-10 07:19:27 +00:00
Daniel Schürmann
637f45f390
aco: setup subdword regclasses for ssa_undef & load_const
...
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4492 >
2020-04-10 07:19:27 +00:00
Samuel Pitoiset
67b567d0d0
aco: implement nir_op_b2f16/nir_op_i2f16/nir_op_u2f16
...
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/4452 >
2020-04-10 08:05:05 +02:00
Samuel Pitoiset
3119f978e5
aco: implement 16-bit comparisons
...
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/4452 >
2020-04-10 08:05:05 +02:00
Samuel Pitoiset
ccf8e23f59
aco: implement 16-bit nir_op_fmax3/nir_op_fmin3/nir_op_fmed3
...
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/4452 >
2020-04-10 08:05:05 +02:00
Samuel Pitoiset
981ced07a5
aco: implement 16-bit nir_op_ldexp
...
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/4452 >
2020-04-10 08:05:05 +02:00
Samuel Pitoiset
55537ed9d3
aco: implement 16-bit nir_op_f2i32/nir_op_f2u32
...
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/4452 >
2020-04-10 08:05:05 +02:00
Samuel Pitoiset
68339ff7a7
aco: implement 16-bit nir_op_bcsel
...
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/4452 >
2020-04-10 08:05:05 +02:00
Samuel Pitoiset
0646562a17
aco: implement 16-bit nir_op_fsign
...
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/4452 >
2020-04-10 08:05:05 +02:00
Samuel Pitoiset
6793ae1c5e
aco: implement 16-bit nir_op_fsat
...
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/4452 >
2020-04-10 08:05:05 +02:00
Samuel Pitoiset
0ecca65d11
aco: implement 16-bit nir_op_fmul
...
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/4452 >
2020-04-10 08:05:05 +02:00
Samuel Pitoiset
b0c60999bc
aco: implement 16-bit nir_op_fcos/nir_op_fsin
...
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/4452 >
2020-04-10 08:05:05 +02:00
Samuel Pitoiset
9be4be515f
aco: implement 16-bit nir_op_fsub/nir_op_fadd
...
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/4452 >
2020-04-10 08:05:05 +02:00
Samuel Pitoiset
b0b637ca17
aco: implement 16-bit nir_op_fabs/nir_op_fneg
...
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/4452 >
2020-04-10 08:05:05 +02:00
Samuel Pitoiset
acc5912786
aco: implement 16-bit nir_op_fmax/nir_op_fmin
...
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/4452 >
2020-04-10 08:05:05 +02:00
Samuel Pitoiset
66d5bfb09a
aco: implement 16-bit nir_op_ffloor/nir_op_fceil
...
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/4452 >
2020-04-10 08:05:05 +02:00
Samuel Pitoiset
c097c9f20c
aco: implement 16-bit nir_op_fsqrt/nir_op_frcp/nir_op_frsq
...
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/4452 >
2020-04-10 08:05:05 +02:00
Samuel Pitoiset
26ed9fb79e
aco: implement 16-bit nir_op_ftrunc/nir_op_fround_even
...
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/4452 >
2020-04-10 08:05:05 +02:00
Samuel Pitoiset
ee96181ad9
aco: implement 16-bit nir_op_fexp2/nir_op_flog2
...
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/4452 >
2020-04-10 08:05:05 +02:00
Samuel Pitoiset
b8486041df
aco: implement 16-bit nir_op_ffract
...
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/4452 >
2020-04-10 08:05:04 +02:00
Samuel Pitoiset
a8b45d7034
aco: implement 16-bit nir_op_frexp_sig/nir_op_frexp_exp
...
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/4452 >
2020-04-10 08:05:04 +02:00
Daniel Schürmann
d22e2b3bd0
aco: RA - move all std::function objects into proper functions
...
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4130 >
2020-04-09 15:08:57 +00:00
Daniel Schürmann
5351fee56a
aco: move all needed helper containers to ra_ctx
...
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4130 >
2020-04-09 15:08:57 +00:00
Daniel Schürmann
2ae27b96ef
aco: change live_out variables to std::unordered_set
...
Improves performance of live_var_analysis for larger shaders
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4130 >
2020-04-09 15:08:57 +00:00
Daniel Schürmann
acc10a7e51
aco: change some std::map to std::unordered_map in register_allocation
...
This improves compile times slightly for larger shaders
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4130 >
2020-04-09 15:08:57 +00:00
Daniel Schürmann
69b6069dd2
aco: refactor try_remove_trivial_phi() in RA
...
Minor refactoring to avoid some pointer chasing.
This patch also changes the live_out argument to be
passed by reference to avoid an unnecessary copy.
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4130 >
2020-04-09 15:08:57 +00:00
Daniel Schürmann
b66f474121
aco: improve speed of live_var_analysis
...
by merging live_sgprs and live_vgprs sets.
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4130 >
2020-04-09 15:08:57 +00:00