Re: Tonights Tradeoff - Background Execution Buffers

Liste des GroupesRevenir à c arch 
Sujet : Re: Tonights Tradeoff - Background Execution Buffers
De : cr88192 (at) *nospam* gmail.com (BGB)
Groupes : comp.arch
Date : 12. Oct 2024, 20:10:01
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <veehid$9gnd$1@dont-email.me>
References : 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
User-Agent : Mozilla Thunderbird
On 10/9/2024 11:19 AM, MitchAlsup1 wrote:
On Wed, 9 Oct 2024 10:44:08 +0000, Robert Finch wrote:
 
>
Been thinking some about the carry and overflow and what to do about
register spills and reloads during expression processing. My thought was
that on the machine with 256 registers, simply allocate a ridiculous
number of registers for expression processing, for example 25 or even
50. Then if the expression is too complex, have the compiler spit out an
error message to the programmer to simplify the expression. Remnants of
the ‘expression too complex’ error in BASIC.
 Both completely unacceptable, and in your case completely unnecessary.
in 967 subroutines I read out of My 66000 LLVM compile, I only have
3 cases of spill-fill, and that is with only 32 registers with uni-
versal constants.
 
Tends to be a bit higher IME, but granted my compiler is a bit more naive:
   Either it can static-assign everything;
   Or, it needs to use spill-and-fill.
In RISC-V mode:
   Static-assign everything, Leaf: 13%
   Partial assign, Leaf: 7.1%
   Static-assign everything, Non-Leaf: 1.8%
   Partial assign, Non-Leaf: 85%
   Average, ~ 4.6 variables static-assigned
     Out of 16.6 variables in a function.
In XG2 mode:
   Static-assign everything, Leaf: 16%
   Partial assign, Leaf: 0.7%
   Static-assign everything, Non-Leaf: 1.9%
   Partial assign, Non-Leaf: 82%
   Average, ~ 4.8 variables static-assigned
     Out of 16.8 variables in a function.
Theoretically, the number of static-assigned variables and fully static-assigned functions could be higher, but it looks like the compiler is excluding a lot of them for some reason (may need to look into it).

Of the RISC-V code I read alongside with 32+32 registers, I counted 8.
 
With 64 GPRs, there can be less spill/fill, and without any increase in the number of hardware registers vs RV64G's 32+32 scheme.
Rarely is register pressure equally balanced in this way, and more often it is one of:
High integer register pressure, little or no FP pressure (most code);
Very high FP register pressure, low integer pressure (say, unrolled matrix multiply).
Where, an even-split X/F scheme serves neither, and a bigger unified register space serves both.
Though, I guess the usual argument for split GPR/FPR spaces is that with unified register spaces, both ALU and FPU need to use the same pipeline.
But, if it is a shared register pipeline, one can also leverage ALU for a lot of edge cases, like FPU compare.
If one uses a longer pipeline for FPU ops vs ALU, it seems like one will still need to pay the costs of the longer FPU pipeline regardless of whether they are a single or separate register file.
Apparently, similar reasoning for the V extension using separate vector registers (vs just aliasing with the F registers), but I don't really want to implement the V extension.
Almost more tempting to do a cut-down non-conforming "V in F" style implementation:
* Aliases V to F register pairs;
** TBD if better to use V0..V15 or even-only numbering.
** Or, V0..V31 exist (if aliased) for 64b vectors,
** but only even for 128b.
* Will drop mask bits and other more advanced features.
* Trying to set up V properly would result in the instructions faulting.
** Could allow the possibility of adding proper V later.

With those statistics and 256 registers, If you can't get to essentially
0 spill=fill the problem is not with your architecture but with your
compiler.
With 256 registers, probably 99% of functions could use a "statically assign every variable to a register" strategy (though, assuming a case where one can reuse registers for temporary values).
Where, most temporary values are created and used within a single basic block, and if no references to that specific temporary exist outside of the basic block (and if not marked with a phi operator), the value of the temporary can simply be assumed to disappear at the end of a basic block. This can also allow temporaries to be allocated into scratch registers.
My own thought though is that going much bigger in terms of the main register file likely isn't worth it.
Only real compelling use for a bigger register file (much over 64) at the moment would be more for optimizing interrupts and context switches.

Date Sujet#  Auteur
7 Sep 24 * Tonights Tradeoff52Robert Finch
7 Sep 24 `* Re: Tonights Tradeoff51MitchAlsup1
8 Sep 24  `* Re: Tonights Tradeoff50Robert Finch
8 Sep 24   `* Re: Tonights Tradeoff49MitchAlsup1
10 Sep 24    `* Re: Tonights Tradeoff48Robert Finch
10 Sep 24     +* Re: Tonights Tradeoff17BGB
10 Sep 24     i+* Re: Tonights Tradeoff12Robert Finch
10 Sep 24     ii+* Re: Tonights Tradeoff10BGB
11 Sep 24     iii`* Re: Tonights Tradeoff9Robert Finch
11 Sep 24     iii +* Re: Tonights Tradeoff7Stephen Fuld
11 Sep 24     iii i+- Re: Tonights Tradeoff1MitchAlsup1
12 Sep 24     iii i`* Re: Tonights Tradeoff5Robert Finch
12 Sep 24     iii i `* Re: Tonights Tradeoff4MitchAlsup1
12 Sep 24     iii i  `* Re: Tonights Tradeoff3Robert Finch
12 Sep 24     iii i   `* Re: Tonights Tradeoff2MitchAlsup1
13 Sep 24     iii i    `- Re: Tonights Tradeoff1MitchAlsup1
12 Sep 24     iii `- Re: Tonights Tradeoff1BGB
11 Sep 24     ii`- Re: Tonights Tradeoff1MitchAlsup1
11 Sep 24     i`* Re: Tonights Tradeoff4MitchAlsup1
12 Sep 24     i `* Re: Tonights Tradeoff3Thomas Koenig
12 Sep 24     i  `* Re: Tonights Tradeoff2BGB
12 Sep 24     i   `- Re: Tonights Tradeoff1Robert Finch
11 Sep 24     `* Re: Tonights Tradeoff30MitchAlsup1
15 Sep 24      `* Re: Tonights Tradeoff29Robert Finch
16 Sep 24       `* Re: Tonights Tradeoff28Robert Finch
24 Sep 24        `* Re: Tonights Tradeoff - Background Execution Buffers27Robert Finch
24 Sep 24         `* Re: Tonights Tradeoff - Background Execution Buffers26MitchAlsup1
26 Sep 24          `* Re: Tonights Tradeoff - Background Execution Buffers25Robert Finch
26 Sep 24           `* Re: Tonights Tradeoff - Background Execution Buffers24MitchAlsup1
27 Sep 24            `* Re: Tonights Tradeoff - Background Execution Buffers23Robert Finch
4 Oct 24             `* Re: Tonights Tradeoff - Background Execution Buffers22Robert Finch
4 Oct 24              +* Re: Tonights Tradeoff - Background Execution Buffers19Anton Ertl
4 Oct 24              i`* Re: Tonights Tradeoff - Background Execution Buffers18Robert Finch
5 Oct 24              i `* Re: Tonights Tradeoff - Background Execution Buffers17Anton Ertl
9 Oct 24              i  `* Re: Tonights Tradeoff - Background Execution Buffers16Robert Finch
9 Oct 24              i   +* Re: Tonights Tradeoff - Background Execution Buffers3MitchAlsup1
9 Oct 24              i   i+- Re: Tonights Tradeoff - Background Execution Buffers1Robert Finch
12 Oct 24              i   i`- Re: Tonights Tradeoff - Background Execution Buffers1BGB
12 Oct 24              i   +* Re: Tonights Tradeoff - Carry and Overflow11Robert Finch
12 Oct 24              i   i`* Re: Tonights Tradeoff - Carry and Overflow10MitchAlsup1
12 Oct 24              i   i `* Re: Tonights Tradeoff - Carry and Overflow9BGB
13 Oct 24              i   i  `* Re: Tonights Tradeoff - Carry and Overflow8Robert Finch
13 Oct 24              i   i   +* Re: Tonights Tradeoff - Carry and Overflow3MitchAlsup1
13 Oct 24              i   i   i`* Re: Tonights Tradeoff - ATOM2Robert Finch
13 Oct 24              i   i   i `- Re: Tonights Tradeoff - ATOM1MitchAlsup1
13 Oct 24              i   i   +- Re: Tonights Tradeoff - Carry and Overflow1BGB
31 Oct 24              i   i   `* Page fetching cache controller3Robert Finch
31 Oct 24              i   i    +- Re: Page fetching cache controller1MitchAlsup1
6 Nov 24              i   i    `- Re: Q+ Fibonacci1Robert Finch
13 Oct 24              i   `- Re: Tonights Tradeoff - Background Execution Buffers1Anton Ertl
4 Oct 24              +- Re: Tonights Tradeoff - Background Execution Buffers1BGB
6 Oct 24              `- Re: Tonights Tradeoff - Background Execution Buffers1MitchAlsup1

Haut de la page

Les messages affichés proviennent d'usenet.

NewsPortal