Sujet : Re: Stealing a Great Idea from the 6600
De : cr88192 (at) *nospam* gmail.com (BGB)
Groupes : comp.archDate : 19. Jun 2024, 03:31:28
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <v4tfu3$1ostn$1@dont-email.me>
References : 1 2 3 4 5 6 7 8 9 10
User-Agent : Mozilla Thunderbird
On 6/18/2024 4:09 PM, MitchAlsup1 wrote:
BGB wrote:
On 6/13/2024 3:40 PM, MitchAlsup1 wrote:
BGB wrote:
>
On 6/13/2024 11:52 AM, Stefan Monnier wrote:
This is a late reply, but optimal static ordering for N-wide may be
very non-optimal for N-1 (or N-2, etc.). As an example, assume a
perfectly
>
AFAICT Terje was talking about scheduling for OoO CPUs, and wasn't
talking about the possible worst case situations, but about how things
usually turn out in practice.
>
For statically-scheduled or in-order CPUs, it can be indeed more
difficult to generate code that will run (almost) optimally on a
variety
of CPUs.
>
>
Yeah, you need to know the specifics of the pipeline for either optimal
>
machine code (in-order superscalar) or potentially to be able to run at
>
all (LIW / VLIW).
>
>
That said, on some OoO CPU's, such as when I was running a Piledriver based core, it did seem as if things were scheduled to assume an in-order CPU (such as putting other instructions between memory loads and the instructions using the results, etc), it did perform better (seemingly implying there are limits to the OoO magic).
>
When doing both Mc 88120 and K9 we found lots of sequences if code
where
the scheduling to more orderly or narrower implementations were
impeding
performance on the GBOoO core.
>
In this case, scheduling as-if it were an in-order core was leading to better performance than a more naive ordering (such as directly using the results of previous instructions or memory loads, vs shuffling
other
>
instructions in between them).
Either way, seemed to be different behavior than seen on either the Ryzen or on Intel Core based CPUs (where, seemingly, the CPU does not care about the relative order).
Because it had no requirement of code scheduling, unlike 1st generation
RISCs, so the cores were designed to put up good performance scores without any code scheduling.
Yeah, but why was Bulldozer/Piledriver seemingly much more sensitive to instruction scheduling issues than either its predecessors (such as the Phenom II) and successors (Ryzen)?...
Though, apparently "low IPC" was a noted issue with this processor family (apparently trying to gain higher clock-speeds at the expense of IPC; using a 20-stage pipeline, ...).
Though, less obvious how having a longer pipeline than either its predecessors or successors would effect instruction scheduling.
...
Though, OTOH, a lot of the sorts of optimization tricks I found for the
>
Piledriver were ineffective on the Ryzen, albeit mostly because the
more
generic stuff caught up.
>
For example, I had an LZ compressor that was faster than LZ4 on that
CPU
(it was based around doing everything in terms of aligned 32-bit
dwords,
gaining speed at the cost of worse compression), but then when going over to the Ryzen, LZ4 got faster...
>
It is the continuous nature of having to reschedule code every
generation
that lead to my wanting the compiler to just spit out correct code and
in the fewest number of instructions that lead to a lot of My 66000
architecture and microarchitectures.
>
Mostly works for x86-64 as well.
Though, I had noted that the optimization strategies that worked well
on
MSVC + Piledriver, continue to work effectively on my custom ISA /
core.
One of the things we found in Mc 88120 was that the compiler should
NEVER
be allowed to put unnecessary instructions in decode-execute slots that
were unused--and that almost invariable--the best code for the GBOoO machine was almost invariably the one with the fewest instructions, and
if several sequences had equally few instructions, it basically did not
matter.
For example::
for( i = 0; i < max, i++ )
a[i] = b[i];
was invariably faster than::
for( ap = &a[0], bp = & b[0];, i = 0; i < max; i++ )
*ap++ = *bp++;
because the later has 3 ADDs in the loop wile the former has but 1.
Because of this, I altered my programming style and almost never end up
using ++ or -- anymore.
In this case, it would often be something more like:
maxn4=max&(~3);
for(i=0; i<maxn4; i+=4)
{
ap=a+i; bp=b+i;
t0=ap[0]; t1=ap[1];
t2=ap[2]; t3=ap[3];
bp[0]=t0; bp[1]=t1;
bp[2]=t2; bp[3]=t3;
}
if(max!=maxn4)
{
for(; i < max; i++ )
a[i] = b[i];
}
If things are partially or fully unrolled, they often go faster. Using a large number of local variables seems to be effective (even in cases where the number of local variables exceeds the number of CPU registers).
Generally also using as few branches as possible.
Etc...
The seemingly significant change with the Ryzen was that branchy code got faster, as well as there seemingly being less of a penalty from using small and misaligned memory loads.
Say, it seemed like 8 and 16-bit loads were slower than 32 or 64 bit loads, as were DWORD/QWORD loads that were not aligned to a proper 32 or 64 bit boundary.
Granted, a special case like this does currently exist for the BJX2 core as well:
Aligned DWORD and QWORD may have latency reduced to 2 cycles, vs 3 cycles for normal memory access. So it doesn't seem entirely implausible that Piledriver might have been similar.
...
Date | Sujet | # | | Auteur |
17 Apr 24 | Stealing a Great Idea from the 6600 | 128 | | John Savard |
18 Apr 24 | Re: Stealing a Great Idea from the 6600 | 125 | | MitchAlsup1 |
18 Apr 24 | Re: Stealing a Great Idea from the 6600 | 124 | | John Savard |
18 Apr 24 | Re: Stealing a Great Idea from the 6600 | 123 | | MitchAlsup1 |
19 Apr 24 | Re: Stealing a Great Idea from the 6600 | 122 | | John Savard |
19 Apr 24 | Re: Stealing a Great Idea from the 6600 | 121 | | John Savard |
19 Apr 24 | Re: Stealing a Great Idea from the 6600 | 120 | | MitchAlsup1 |
20 Apr 24 | Re: Stealing a Great Idea from the 6600 | 2 | | John Savard |
21 Apr 24 | Re: Stealing a Great Idea from the 6600 | 1 | | John Savard |
20 Apr 24 | Re: Stealing a Great Idea from the 6600 | 117 | | John Savard |
20 Apr 24 | Re: Stealing a Great Idea from the 6600 | 116 | | John Savard |
20 Apr 24 | Re: Stealing a Great Idea from the 6600 | 115 | | MitchAlsup1 |
20 Apr 24 | Re: Stealing a Great Idea from the 6600 | 105 | | BGB |
21 Apr 24 | Re: Stealing a Great Idea from the 6600 | 104 | | MitchAlsup1 |
21 Apr 24 | Re: Stealing a Great Idea from the 6600 | 63 | | John Savard |
21 Apr 24 | Re: Stealing a Great Idea from the 6600 | 15 | | John Savard |
25 Apr 24 | Re: Stealing a Great Idea from the 6600 | 14 | | Lawrence D'Oliveiro |
25 Apr 24 | Re: Stealing a Great Idea from the 6600 | 12 | | MitchAlsup1 |
25 Apr 24 | Re: Stealing a Great Idea from the 6600 | 1 | | Lawrence D'Oliveiro |
30 Apr 24 | Re: a bit of history, Stealing a Great Idea from the 6600 | 10 | | John Levine |
3 May 24 | Re: a bit of history, Stealing a Great Idea from the 6600 | 9 | | Anton Ertl |
3 May 24 | Re: a bit of history, Stealing a Great Idea from the 6600 | 7 | | John Levine |
4 May 24 | Re: a bit of history, Stealing a Great Idea from the 6600 | 6 | | Thomas Koenig |
4 May 24 | Re: a bit of history, Stealing a Great Idea from the 6600 | 4 | | John Levine |
4 May 24 | Re: a bit of history, Stealing a Great Idea from the 6600 | 3 | | MitchAlsup1 |
5 May 24 | Re: a bit of history, Stealing a Great Idea from the 6600 | 2 | | Thomas Koenig |
5 May 24 | Re: a bit of history, Stealing a Great Idea from the 6600 | 1 | | MitchAlsup1 |
28 Jul 24 | Re: a bit of history, Stealing a Great Idea from the 6600 | 1 | | Lawrence D'Oliveiro |
3 May 24 | Re: a bit of history, Stealing a Great Idea from the 6600 | 1 | | MitchAlsup1 |
25 Apr 24 | Re: Stealing a Great Idea from the 6600 | 1 | | John Savard |
21 Apr 24 | Re: Stealing a Great Idea from the 6600 | 47 | | MitchAlsup1 |
23 Apr 24 | Re: Stealing a Great Idea from the 6600 | 45 | | George Neuner |
23 Apr 24 | Re: Stealing a Great Idea from the 6600 | 44 | | MitchAlsup1 |
25 Apr 24 | Re: Stealing a Great Idea from the 6600 | 43 | | George Neuner |
26 Apr 24 | Re: Stealing a Great Idea from the 6600 | 42 | | BGB |
26 Apr 24 | Re: Stealing a Great Idea from the 6600 | 41 | | MitchAlsup1 |
26 Apr 24 | Re: Stealing a Great Idea from the 6600 | 2 | | Anton Ertl |
26 Apr 24 | Re: Stealing a Great Idea from the 6600 | 1 | | MitchAlsup1 |
26 Apr 24 | Re: Stealing a Great Idea from the 6600 | 4 | | BGB |
26 Apr 24 | Re: Stealing a Great Idea from the 6600 | 2 | | MitchAlsup1 |
27 Apr 24 | Re: Stealing a Great Idea from the 6600 | 1 | | BGB |
26 Apr 24 | Re: Stealing a Great Idea from the 6600 | 1 | | MitchAlsup1 |
27 Apr 24 | Re: Stealing a Great Idea from the 6600 | 34 | | BGB |
27 Apr 24 | Re: Stealing a Great Idea from the 6600 | 33 | | MitchAlsup1 |
28 Apr 24 | Re: Stealing a Great Idea from the 6600 | 32 | | BGB |
28 Apr 24 | Re: Stealing a Great Idea from the 6600 | 31 | | MitchAlsup1 |
28 Apr 24 | Re: Stealing a Great Idea from the 6600 | 30 | | BGB |
28 Apr 24 | Re: Stealing a Great Idea from the 6600 | 24 | | BGB |
28 Apr 24 | Re: Stealing a Great Idea from the 6600 | 23 | | BGB |
28 Apr 24 | Re: Stealing a Great Idea from the 6600 | 22 | | Thomas Koenig |
28 Apr 24 | Re: Stealing a Great Idea from the 6600 | 21 | | BGB |
28 Apr 24 | Re: Stealing a Great Idea from the 6600 | 20 | | BGB |
28 Apr 24 | Re: Stealing a Great Idea from the 6600 | 2 | | Thomas Koenig |
28 Apr 24 | Re: Stealing a Great Idea from the 6600 | 1 | | BGB |
29 Jul 24 | Re: Stealing a Great Idea from the 6600 | 16 | | Lawrence D'Oliveiro |
29 Jul 24 | Re: Stealing a Great Idea from the 6600 | 6 | | BGB |
30 Jul 24 | Re: Stealing a Great Idea from the 6600 | 5 | | Lawrence D'Oliveiro |
30 Jul 24 | Re: Stealing a Great Idea from the 6600 | 4 | | BGB |
31 Jul 24 | Re: Stealing a Great Idea from the 6600 | 3 | | Lawrence D'Oliveiro |
31 Jul 24 | Re: Stealing a Great Idea from the 6600 | 2 | | BGB |
1 Aug 24 | Re: Stealing a Great Idea from the 6600 | 1 | | Lawrence D'Oliveiro |
29 Jul 24 | Re: Stealing a Great Idea from the 6600 | 9 | | Terje Mathisen |
29 Jul 24 | Re: Stealing a Great Idea from the 6600 | 8 | | MitchAlsup1 |
30 Jul 24 | Re: Stealing a Great Idea from the 6600 | 1 | | Lawrence D'Oliveiro |
30 Jul 24 | Re: Stealing a Great Idea from the 6600 | 4 | | Michael S |
30 Jul 24 | Re: Stealing a Great Idea from the 6600 | 3 | | MitchAlsup1 |
31 Jul 24 | Re: Stealing a Great Idea from the 6600 | 2 | | BGB |
1 Aug 24 | Re: Stealing a Great Idea from the 6600 | 1 | | Lawrence D'Oliveiro |
1 Aug 24 | Re: Stealing a Great Idea from the 6600 | 2 | | Thomas Koenig |
1 Aug 24 | Re: Stealing a Great Idea from the 6600 | 1 | | MitchAlsup1 |
29 Jul 24 | Re: Stealing a Great Idea from the 6600 | 1 | | George Neuner |
28 Apr 24 | Re: Stealing a Great Idea from the 6600 | 5 | | MitchAlsup1 |
28 Apr 24 | Re: Stealing a Great Idea from the 6600 | 4 | | BGB |
29 Apr 24 | Re: Stealing a Great Idea from the 6600 | 3 | | MitchAlsup1 |
29 Apr 24 | Re: Stealing a Great Idea from the 6600 | 2 | | BGB |
29 Apr 24 | Re: Stealing a Great Idea from the 6600 | 1 | | Thomas Koenig |
29 Apr 24 | Re: Stealing a Great Idea from the 6600 | 1 | | Tim Rentsch |
21 Apr 24 | Re: Stealing a Great Idea from the 6600 | 40 | | BGB |
21 Apr 24 | Re: Stealing a Great Idea from the 6600 | 39 | | MitchAlsup1 |
22 Apr 24 | Re: Stealing a Great Idea from the 6600 | 3 | | BGB |
22 Apr 24 | Re: Stealing a Great Idea from the 6600 | 2 | | MitchAlsup1 |
22 Apr 24 | Re: Stealing a Great Idea from the 6600 | 1 | | BGB |
22 Apr 24 | Re: Stealing a Great Idea from the 6600 | 2 | | John Savard |
22 Apr 24 | Re: Stealing a Great Idea from the 6600 | 1 | | BGB |
22 Apr 24 | Re: Stealing a Great Idea from the 6600 | 33 | | Terje Mathisen |
22 Apr 24 | Re: Stealing a Great Idea from the 6600 | 1 | | BGB |
13 Jun 24 | Re: Stealing a Great Idea from the 6600 | 31 | | Kent Dickey |
13 Jun 24 | Re: Stealing a Great Idea from the 6600 | 16 | | Stefan Monnier |
13 Jun 24 | Re: Stealing a Great Idea from the 6600 | 15 | | BGB |
13 Jun 24 | Re: Stealing a Great Idea from the 6600 | 14 | | MitchAlsup1 |
14 Jun 24 | Re: Stealing a Great Idea from the 6600 | 13 | | BGB |
18 Jun 24 | Re: Stealing a Great Idea from the 6600 | 12 | | MitchAlsup1 |
19 Jun 24 | Re: Stealing a Great Idea from the 6600 | 8 | | BGB |
19 Jun 24 | Re: Stealing a Great Idea from the 6600 | 7 | | MitchAlsup1 |
19 Jun 24 | Re: Stealing a Great Idea from the 6600 | 5 | | BGB |
19 Jun 24 | Re: Stealing a Great Idea from the 6600 | 4 | | MitchAlsup1 |
20 Jun 24 | Re: Stealing a Great Idea from the 6600 | 3 | | Thomas Koenig |
20 Jun 24 | Re: Stealing a Great Idea from the 6600 | 2 | | MitchAlsup1 |
21 Jun 24 | Re: Stealing a Great Idea from the 6600 | 1 | | Thomas Koenig |
20 Jun 24 | Re: Stealing a Great Idea from the 6600 | 1 | | John Savard |
19 Jun 24 | Re: Stealing a Great Idea from the 6600 | 1 | | Thomas Koenig |
20 Jun 24 | Re: Stealing a Great Idea from the 6600 | 1 | | MitchAlsup1 |
31 Jul 24 | Re: Stealing a Great Idea from the 6600 | 1 | | Lawrence D'Oliveiro |
13 Jun 24 | Re: Stealing a Great Idea from the 6600 | 13 | | MitchAlsup1 |
14 Jun 24 | Re: Stealing a Great Idea from the 6600 | 1 | | Terje Mathisen |
22 Apr 24 | Re: Stealing a Great Idea from the 6600 | 9 | | John Savard |
18 Apr 24 | Re: Stealing a Great Idea from the 6600 | 2 | | Lawrence D'Oliveiro |