[libre-riscv-dev] register requirements of SimpleV

Jacob Lifshay programmerjake at gmail.com
Mon Oct 8 10:52:21 BST 2018


Before the implementation of SimpleV gets too far along, I think it would
be useful to increase the max number of registers from 64 to 128 or 256 as
fragment shaders require running at least 4 pixels simultaneously for
calculating screen-space derivatives (for mipmapping, among other things)
and it's very common to use 4-component vectors for things like colors
(rgba) and positions (using homogenous coordinates) so each 4-component
vector is replicated 4 times (for each pixel) meaning that each vector will
need 16 elements, and with vectors that big, we will quickly run out of
registers. I suggest increasing the register number fields to 8 bits in the
register redirection/parallelization CSRs as 8 is a nice round power of 2
and 256 registers should be enough. register renaming can take care of
needing more than that if it turns out to be necessary. At the very least
increasing the limit to 128 is almost necessary (giving you 8 16-element
vectors instead of 4) as just the required fragment shader variables
(screen-position/depth/perspective-correction and output color) for a basic
shader without even any textures require at least 2 16-element vectors,
using up half the available space.

Jacob Lifshay


More information about the libre-riscv-dev mailing list