mesa/src/panfrost/compiler
Olivia Lee 6f5f5ca4b2 pan/va: allow using both FAU and small constants in the same instruction
Normally we aren't able to mix FAU srcs from different pages. We
consider small constants (BIR_FAU_IMMEDIATE) to be page 0, and so were
previously always pulling small constants out with a MOV in instructions
that also use FAUs. This is not necessary. Message unit instructions
have no restrictions on small constant use and execution unit
instructions allow mixing small constants with FAU srcs as long as we
don't use more than 64 bits.

shader-db results on G610:

total instrs in shared programs: 673595 -> 672719 (-0.13%)
instrs in affected programs: 111294 -> 110418 (-0.79%)
helped: 293
HURT: 9
helped stats (abs) min: 1.0 max: 27.0 x̄: 3.12 x̃: 2
helped stats (rel) min: 0.08% max: 10.53% x̄: 1.71% x̃: 1.02%
HURT stats (abs)   min: 1.0 max: 15.0 x̄: 4.33 x̃: 3
HURT stats (rel)   min: 0.06% max: 12.20% x̄: 2.07% x̃: 0.49%
95% mean confidence interval for instrs value: -3.38 -2.42
95% mean confidence interval for instrs %-change: -1.80% -1.39%
Instrs are helped.

total cycles in shared programs: 34260.22 -> 34257.44 (<.01%)
cycles in affected programs: 143.53 -> 140.75 (-1.94%)
helped: 78
HURT: 1
helped stats (abs) min: 0.015625 max: 0.296875 x̄: 0.04 x̃: 0
helped stats (rel) min: 0.32% max: 5.71% x̄: 1.78% x̃: 1.32%
HURT stats (abs)   min: 0.046875 max: 0.046875 x̄: 0.05 x̃: 0
HURT stats (rel)   min: 1.90% max: 1.90% x̄: 1.90% x̃: 1.90%
95% mean confidence interval for cycles value: -0.05 -0.02
95% mean confidence interval for cycles %-change: -1.98% -1.49%
Cycles are helped.

total cvt in shared programs: 4097.12 -> 4083.44 (-0.33%)
cvt in affected programs: 706.75 -> 693.06 (-1.94%)
helped: 293
HURT: 9
helped stats (abs) min: 0.015625 max: 0.421875 x̄: 0.05 x̃: 0
helped stats (rel) min: 0.19% max: 45.45% x̄: 6.38% x̃: 2.53%
HURT stats (abs)   min: 0.015625 max: 0.234375 x̄: 0.07 x̃: 0
HURT stats (rel)   min: 0.15% max: 50.00% x̄: 7.85% x̃: 1.90%
95% mean confidence interval for cvt value: -0.05 -0.04
95% mean confidence interval for cvt %-change: -7.03% -4.89%
Cvt are helped.

total code size in shared programs: 6205824 -> 6198528 (-0.12%)
code size in affected programs: 395648 -> 388352 (-1.84%)
helped: 57
HURT: 2
helped stats (abs) min: 128.0 max: 256.0 x̄: 132.49 x̃: 128
helped stats (rel) min: 0.08% max: 25.00% x̄: 6.96% x̃: 5.26%
HURT stats (abs)   min: 128.0 max: 128.0 x̄: 128.00 x̃: 128
HURT stats (rel)   min: 1.12% max: 2.86% x̄: 1.99% x̃: 1.99%
95% mean confidence interval for code size value: -137.46 -109.86
95% mean confidence interval for code size %-change: -8.19% -5.12%
Code size are helped.

total threads in shared programs: 22203 -> 22204 (<.01%)
threads in affected programs: 1 -> 2 (100.00%)
helped: 1
HURT: 0

Signed-off-by: Olivia Lee <olivia.lee@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Mary Guillemard <mary.guillemard@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35154>
2025-05-28 22:21:46 +00:00
..
bifrost panfrost: define bi_swizzle alias values 2025-04-10 10:15:46 -07:00
test bi: Rewrite dead code elimination 2024-08-20 10:03:30 +02:00
valhall pan/va: allow using both FAU and small constants in the same instruction 2025-05-28 22:21:46 +00:00
bi_builder.h.py panfrost: bi_builder.h.py: stop generating unneeded parentheses 2025-05-22 14:39:32 +00:00
bi_helper_invocations.c panfrost: Add BI_OPCODE_WMASK to bi_instr_uses_helpers 2025-02-28 08:55:32 +00:00
bi_layout.c
bi_liveness.c
bi_lower_divergent_indirects.c pan,nir: introduce load_attribute_pan 2024-12-18 08:33:16 +00:00
bi_lower_swizzle.c panfrost/va: valhall-specific swizzle lowering 2025-04-10 10:15:46 -07:00
bi_opcodes.c.py pan/bi: ignore ftz mode when scheduling int instructions 2025-04-10 16:21:09 +00:00
bi_opcodes.h.py pan/bi: ignore ftz mode when scheduling int instructions 2025-04-10 16:21:09 +00:00
bi_opt_constant_fold.c panfrost: fix shift overflow in bi_fold_constant 2024-01-26 09:40:48 +00:00
bi_opt_copy_prop.c panfrost: use an accessor function to read from bi_opcode_props 2025-02-20 23:33:00 +00:00
bi_opt_cse.c panfrost: use an accessor function to read from bi_opcode_props 2025-02-20 23:33:00 +00:00
bi_opt_dce.c panfrost: use an accessor function to read from bi_opcode_props 2025-02-20 23:33:00 +00:00
bi_opt_dual_tex.c
bi_opt_mod_props.c panfrost: use an accessor function to read from bi_opcode_props 2025-02-20 23:33:00 +00:00
bi_opt_push_ubo.c pan: Use a consistent pan_ prefix across src/panfrost/* 2025-05-21 14:58:20 +02:00
bi_packer.c.py panfrost: split pseudo instructions from Bifrost and Valhall 2024-08-20 12:18:19 +00:00
bi_pressure_schedule.c panfrost: use an accessor function to read from bi_opcode_props 2025-02-20 23:33:00 +00:00
bi_print.c
bi_print_common.c
bi_print_common.h
bi_printer.c.py panfrost: add bi_swizzle values for unused swizzles 2025-04-10 10:15:46 -07:00
bi_quirks.h
bi_ra.c pan/bi: bump iter_count to 2000 2025-01-22 23:19:18 +00:00
bi_swizzles.c.py panfrost: use bifrost instruction table for bi_lower_swizzle 2025-04-10 10:15:46 -07:00
bi_swizzles.h panfrost: use bifrost instruction table for bi_lower_swizzle 2025-04-10 10:15:46 -07:00
bi_test.h pan: Use a consistent pan_ prefix across src/panfrost/* 2025-05-21 14:58:20 +02:00
bi_validate.c
bifrost.h pan/bi: Expose the packed TextureOperationDescriptor in bifrost_texture_operation 2024-11-05 11:20:21 +00:00
bifrost_compile.c panvk: add support for {s,u}dot_4x8_{sat} 2025-05-22 14:39:32 +00:00
bifrost_compile.h panvk: add support for {s,u}dot_4x8_{sat} 2025-05-22 14:39:32 +00:00
bifrost_isa.py panfrost: Update bifrost_isa.py to support saturate for valhall 2025-05-22 14:39:32 +00:00
bifrost_nir.h pan/bi: Lower removed instructions in algebraic on v11+ 2025-02-19 20:13:19 +00:00
bifrost_nir_algebraic.py pan/bi: Lower ffract in bifrost_nir_algebraic on v11+ 2025-05-15 07:12:44 +00:00
bir.c panfrost: use an accessor function to read from bi_opcode_props 2025-02-20 23:33:00 +00:00
cmdline.c
compiler.h pan: Use a consistent pan_ prefix across src/panfrost/* 2025-05-21 14:58:20 +02:00
gen_disasm.py bi: Move bi_disasm definitions to their own header 2024-06-17 07:31:50 +00:00
IR_pseudo.xml pan/bi: add a MEMORY_BARRIER pseudo-instruction 2025-01-22 21:49:52 +00:00
meson.build panfrost: use cpp_args instead of c_args for C++ files 2025-05-19 16:34:26 +00:00
nodearray.h
Notes.txt
README.md

Bifrost compiler

Register file

Defined partially in software, partially in hardware.

Blend shaders

R0 - R3: input (color #0) R4 - R7: input (color #1) R8 - R15: general purpose R48: return address

Fragment

Anything live during BLEND must respect blend shader registers.

R0 - R3: preloaded (message #0) R4 - R7: preloaded (message #1) R57 - R63: preloaded (various)

R0 - R15: general purpose (full threads) R48 - R63: general purpose (full threads)

R32 - R47: general purpose (half threads, or v6)