summaryrefslogtreecommitdiffstats
path: root/common.py
diff options
context:
space:
mode:
authorAlyssa Rosenzweig <[email protected]>2019-06-20 15:11:57 -0700
committerAlyssa Rosenzweig <[email protected]>2019-06-26 10:01:36 -0700
commit10688257bd7cc1b4241f7b069a4ee9bc3338be47 (patch)
tree581bf7eb651e607e38690c3c5532f15b7cb43d9a /common.py
parenta0a34946d8ef48223126e7ab89231f9b77e65f59 (diff)
panfrost/midgard: Merge embedded constants
In Midgard, a bundle consists of a few ALU instructions. Within the bundle, there is room for an optional 128-bit constant; this constant is shared across all instructions in the bundle. Unfortunately, many instructions want a 128-bit constant all to themselves (how selfish!). If we run out of space for constants in a bundle, the bundle has to be broken up, incurring a performance and space penalty. As an optimization, the scheduler now analyzes the constants coming in per-instruction and attempts to merge shared components, adjusting the swizzle accessing the bundle's constants appropriately. Concretely, given the GLSL: (a * vec4(1.5, 0.5, 0.5, 1.0)) + vec4(1.0, 2.3, 2.3, 0.5) instead of compiling to the naive two bundles: vmul.fmul [temp], [a], r26 fconstants 1.5, 0.5, 0.5, 1.0 vadd.fadd [out], [temp], r26 fconstants 1.0, 2.3, 2.3, 0.5 The scheduler can now fuse into a single (pipelined!) bundle: vmul.fmul [temp], [a], r26.xyyz vadd.fadd [out], [temp], r26.zwwy fconstants 1.5, 0.5, 1.0, 2.3 Signed-off-by: Alyssa Rosenzweig <[email protected]>
Diffstat (limited to 'common.py')
0 files changed, 0 insertions, 0 deletions