I hope you find something, but there are challenges

By: NoSpammer (no.delete@this.spam.com), August 4, 2022 3:18 am
Room: Moderated Discussions
Anon (no.delete@this.spam.com) on August 3, 2022 9:25 am wrote:
> NoSpammer (no.delete@this.spam.com) on August 3, 2022 7:55 am wrote:
> > So mainstream architectures that used to use stack-like structures like intel x87
> > and archs using register windows being obsoleted are not a practical proof?
>
> But there is another way to explain that, stacks were very unfriendly to in order superscalar CPUs,
> then anyone caring about performance stoped using stacks and we continue not using by inercia.
>
> When CPUs implemented stack engines the difference reduced
> a lot, but nobody wanted to go back using stacks anymore.

I guess, apart from stack housekeeping, the primary reason is many instructions have high or variable latency, which means that you will not be able to reuse the top of stack immediately. So you either need to shuffle or you continue with dependent instruction anyways and let OOO handle that. But still, for optimal execution it's more optimal to put instructions closer to the order of execution, to release resources earlier. Even if you use stacks the optimal number of addressable sources will be close to what the register requirements studies have found, so you will have to address about 16-32 somehow, if not directly then you will be shuffling like x87. So I see no advantage for stacks.

> > I think it's quite clear that is not a compiler friendly target for current compiler tech.
>
> Wrong. Have you ever write a compiler? Targeting a stack is much easier than a register based
> architecture, Java and .Net intermediate languages are stack based exactly because of that.

Actually I have. Targeting a stack seems like a natural thing to do if your thinking is one equation at a time LR(1) one pass compilation, kinda like 80s style simplistic compilers. If you start thinking about optimizations, optimal temp var allocation, variable life-time, cross procedural optimization... then stack kinda gets in the way.

Intermediate languages are defined stack based because they don't want to impose register count, because that is relatively easy for interpreter and because eventually they can be further optimized and compiled to whatever anyways.

> > It's also quite clear that you will be burning power resolving a layer of indirection.
>
> And burning less power by loading less code, it is not clear to me which would be lower.

Compare that to stack housekeeping and needing to resolve some of the semantic of the instructions before you are even able to evaluate dependencies properly. My bet would be that you would already need to predecode to get even on par at renaming stage.

> > It's also quite clear that you will be wasting time shuffling stack order at many block edges.
>
> As this would be done in parallel to actual execution the is no wasted time.
>
> I don't know if it is possible to design a high performance stack based
> archtecture, I think it is, but I also know nobody have tried.

It might be possible but I certainly would not recommend it to someone designing a new general purpose architecture.
< Previous Post in ThreadNext Post in Thread >
TopicPosted ByDate
Empirical data on ISA design parametersNvaxPlus2022/08/02 08:45 AM
  Empirical data on ISA design parameters---2022/08/02 10:25 AM
    Empirical data on ISA design parametersRayla2022/08/02 10:29 AM
  Empirical data on ISA design parametersAnon2022/08/02 11:46 AM
    Empirical data on ISA design parametersAdrian2022/08/03 02:00 AM
      Immediate ranges (was: Empirical data on ISA...)Marcus2022/08/07 10:16 AM
        Immediate ranges (was: Empirical data on ISA...)Björn Ragnar Björnsson2022/08/07 05:14 PM
          Immediate ranges (was: Empirical data on ISA...)Marcus2022/08/07 09:50 PM
  I hope you find something, but there are challengesMark Roulo2022/08/02 06:48 PM
    I hope you find something, but there are challengesBrett2022/08/02 10:41 PM
      I hope you find something, but there are challengeshobold2022/08/03 03:17 AM
        I hope you find something, but there are challengesBrett2022/08/03 11:37 AM
    I hope you find something, but there are challengesvonk2022/08/03 12:22 AM
    I hope you find something, but there are challengesAdrian2022/08/03 02:19 AM
      I hope you find something, but there are challengesNoSpammer2022/08/03 07:55 AM
        I hope you find something, but there are challengesAnon2022/08/03 09:25 AM
          I hope you find something, but there are challengesLinus Torvalds2022/08/03 11:31 AM
          I hope you find something, but there are challengesNoSpammer2022/08/04 03:18 AM
            I hope you find something, but there are challengesAdrian2022/08/04 04:56 AM
              I hope you find something, but there are challengesLinus Torvalds2022/08/04 11:03 AM
                I hope you find something, but there are challengesMr. Camel2022/08/04 12:29 PM
              I hope you find something, but there are challengesNoSpammer2022/08/08 09:31 AM
            I hope you find something, but there are challengesAnon2022/08/04 02:54 PM
        I hope you find something, but there are challengesAdrian2022/08/03 11:33 AM
          I hope you find something, but there are challengesBrett2022/08/03 12:21 PM
          I hope you find something, but there are challenges---2022/08/03 02:55 PM
            I hope you find something, but there are challengesBrett2022/08/03 04:31 PM
              Rebirth of the 68k archBrett2022/08/05 01:17 PM
                Rebirth of the 68k archMarcus2022/08/06 04:36 AM
                  Rebirth of the 68k archMegol2022/08/07 02:01 PM
                    Rebirth of the 68k archMarcus2022/08/07 11:30 PM
                      Rebirth of the 68k archBrett2022/08/08 12:31 AM
                        Rebirth of the 68k archMarcus2022/08/08 01:46 AM
                  Rebirth of the 68k archAnon2022/08/07 02:57 PM
                    Rebirth of the 68k archBrett2022/08/07 05:37 PM
                      68K was not a kludgeMark Roulo2022/08/07 06:05 PM
                        68K was not a kludgeBrett2022/08/07 09:56 PM
                          68K was not a kludgenone2022/08/08 01:00 AM
                            rich man's VAX and more O.T.Michael S2022/08/08 02:44 AM
                              rich man's VAX and more O.T.none2022/08/08 02:51 AM
                Rebirth of the 68k archBrett2022/08/10 11:59 PM
                  Rebirth of the 68k archUngo2022/08/11 03:53 AM
                    Rebirth of the 68k archAnon42022/08/11 12:08 PM
                      Rebirth of the 68k archrwessel2022/08/11 01:02 PM
            I hope you find something, but there are challengesAdrian2022/08/04 12:07 AM
              I hope you find something, but there are challengesEtienne2022/08/04 05:15 AM
          I hope you find something, but there are challengesAnon2022/08/03 05:15 PM
        I hope you find something, but there are challengesblaine2022/08/03 12:03 PM
Reply to this Topic
Name:
Email:
Topic:
Body: No Text
How do you spell tangerine? 🍊