Branch/jump target prediction -8

By: Gabriele Svelto (gabriele.svelto.delete@this.gmail.com), August 17, 2016 3:52 am
Room: Moderated Discussions
Etienne (etienne_lorrain.delete@this.yahoo.fr) on August 17, 2016 1:27 am wrote:
> Still, if hardware can know branch taken/not taken a bit earlier
> it should improve code speed execution, isn't it?

Yes, but it already does thanks to OOOE execution. Branch conditions are evaluated early anyway because of it on nearly all architectures. Explicitly doing so in advance is useful only in in-order machines or on ones with such a small reorder buffer that it can't really look ahead more than a handful of instructions (e.g. early PowerPC processors, etc...).

> Having flags updated by nearly every assembly instruction like ia32/amd64 forces
> the compiler to do the test as late as possible, near the conditional jump.

Yes, but the execution flow is going to be different on an x86 OOOE core because the condition codes are also renamed; in practice evaluation can happen earlier anyway.

> I do not know very well POWER, but on PPC I did not see GCC using efficiently the multiple flag
> sets, maybe there are better compiler now - so the test can be moved as early as possible.

It never did IIRC and I don't think it does now. I remember that XLC did use multiple CRs when it was beneficial but I'm not sure they bother anymore; recent POWER processors have deep pipelines, huge reorder buffers and huge branch prediction tables so I doubt it would make a measurable difference.
< Previous Post in ThreadNext Post in Thread >
TopicPosted ByDate
Branch/jump target predictionTravis2016/08/09 10:44 AM
  Early decode of unconditional jumpsPeter Cordes2016/08/09 12:35 PM
    Early decode of unconditional jumpsExophase2016/08/09 01:29 PM
  pipelines are too long, noHeikki Kultala2016/08/09 12:37 PM
    pipelines are too long, nono name2016/08/09 07:17 PM
      pipelines are too long, noWilco2016/08/10 02:43 AM
        pipelines are too long, noPaul A. Clayton2016/08/10 08:44 PM
    Converged BTB/IcachePaul A. Clayton2016/08/10 08:44 PM
  Branch/jump target predictionsylt2016/08/10 03:27 AM
    Branch/jump target predictionPeter Cordes2016/08/12 04:23 PM
      Branch/jump target predictionsylt2016/08/12 11:35 PM
  Branch/jump target predictionMr. Camel2016/08/10 10:43 AM
    Branch/jump target predictionLinus Torvalds2016/08/10 12:46 PM
      Branch/jump target predictionMegol2016/08/10 03:25 PM
        Branch/jump target predictionLinus Torvalds2016/08/10 05:14 PM
          Branch/jump target predictionDavid Kanter2016/08/12 12:09 AM
            Branch/jump target predictionLinus Torvalds2016/08/12 12:25 PM
          Branch/jump target prediction2016/08/14 05:24 AM
            Branch/jump target predictionMaynard Handley2016/08/14 07:47 AM
              Branch/jump target predictionDavid Kanter2016/08/14 08:13 AM
              Branch/jump target prediction2016/08/16 06:19 AM
            Branch/jump target predictionTim McCaffrey2016/08/14 08:12 AM
              Branch/jump target predictionDavid Kanter2016/08/14 08:18 AM
                Branch/jump target predictionGabriele Svelto2016/08/14 02:09 PM
            Just a thoughtAnon2016/08/14 10:40 AM
              Just a thought2016/08/16 06:58 AM
                Just a thoughtAnon2016/08/16 08:45 AM
                  Just a thought2016/08/16 09:36 AM
            Branch/jump target predictionLinus Torvalds2016/08/14 10:40 AM
              Branch/jump target prediction2016/08/16 06:40 AM
                Branch/jump target predictionRicardo B2016/08/16 07:39 AM
                  Branch/jump target prediction -82016/08/16 09:23 AM
                    Branch/jump target prediction -8anon2016/08/16 10:09 AM
                    Branch/jump target prediction -8Ricardo B2016/08/16 10:33 AM
                      Branch/jump target prediction -8Exophase2016/08/16 11:02 AM
                        Branch/jump target prediction -8Ricardo B2016/08/16 11:31 AM
                        SPU hbr instruction (hint for branch)vvid2016/08/16 12:31 PM
                        Branch/jump target prediction -8no name2016/08/17 08:16 AM
                    Branch/jump target prediction -8Gabriele Svelto2016/08/16 11:46 AM
                      Branch/jump target prediction -8Etienne2016/08/17 01:27 AM
                        Branch/jump target prediction -8Gabriele Svelto2016/08/17 03:52 AM
                    Branch/jump target prediction -8Maynard Handley2016/08/18 10:02 AM
                      Branch/jump target prediction -82016/08/18 06:21 PM
                        Branch/jump target prediction -8Maynard Handley2016/08/18 07:27 PM
                          Branch/jump target prediction -8Megol2016/08/19 04:29 AM
                          Part 1/N - CPU-internal JIT2016/08/19 04:44 AM
                        Atom, you're such a comedian.Jim Trent2016/08/18 10:39 PM
                          Atom, you're such a comedian.2016/08/19 03:23 AM
                      Branch/jump target prediction -8Etienne2016/08/19 01:25 AM
                        Branch/jump target prediction -8Simon Farnsworth2016/08/19 04:17 AM
                          Branch/jump target prediction -8Michael S2016/08/19 06:39 AM
                          Branch/jump target prediction -8anon2016/08/19 07:29 AM
                            Branch/jump target prediction -8Simon Farnsworth2016/08/19 08:34 AM
                              Branch/jump target prediction -8anon2016/08/19 08:48 AM
                                Branch/jump target prediction -8Exophase2016/08/19 11:03 AM
                                Branch/jump target prediction -8Maynard Handley2016/08/19 11:34 AM
                            Branch/jump target prediction -8David Kanter2016/08/20 12:23 AM
                        Branch/jump target prediction -8Ricardo B2016/08/19 07:18 AM
                          Branch/jump target prediction -8Maynard Handley2016/08/19 08:41 AM
                            Branch/jump target prediction -8Michael S2016/08/19 09:26 AM
                              Branch/jump target prediction -8Maynard Handley2016/08/19 01:47 PM
                                Branch/jump target prediction -8Michael S2016/08/21 01:53 AM
                                  Branch/jump target prediction -8Ricardo B2016/08/22 05:17 AM
                                    Branch/jump target prediction -8Michael S2016/08/22 05:58 AM
                                      Branch/jump target prediction -8Ricardo B2016/08/22 07:50 AM
                            Branch/jump target prediction -8Simon Farnsworth2016/08/19 09:28 AM
                              Branch/jump target prediction -8Simon Farnsworth2016/08/19 09:40 AM
                            Branch/jump target prediction -8David Kanter2016/08/23 12:05 AM
                              Branch/jump target prediction -8Maynard Handley2016/08/23 07:49 AM
                      Branch/jump target prediction -8anon2016/08/26 08:00 AM
                        Branch/jump target prediction -8anon2016/08/26 08:14 AM
                Branch/jump target predictionMegol2016/08/19 04:23 AM
          Branch/jump target predictionMegol2016/08/19 07:42 AM
            Branch/jump target predictionMaynard Handley2016/08/19 11:46 AM
              Branch/jump target predictionDavid Kanter2016/08/20 12:34 AM
                Branch/jump target predictionMaynard Handley2016/08/20 07:07 AM
            Branch/jump target predictionsylt2016/08/19 11:48 AM
              Branch/jump target predictionsylt2016/08/19 12:00 PM
              Branch/jump target predictionMegol2016/08/21 10:27 AM
                The (apparent) state of trace caches on modern CPUsMaynard Handley2016/08/22 03:10 PM
                  The (apparent) state of trace caches on modern CPUsExophase2016/08/22 08:55 PM
                    The (apparent) state of trace caches on modern CPUsanon2016/08/23 12:36 AM
                      The (apparent) state of trace caches on modern CPUsExophase2016/08/23 05:08 AM
                        The (apparent) state of trace caches on modern CPUsanon2016/08/23 09:51 PM
                          The (apparent) state of trace caches on modern CPUsExophase2016/08/23 11:12 PM
                          The (apparent) state of trace caches on modern CPUsMaynard Handley2016/08/24 07:38 AM
                            The (apparent) state of trace caches on modern CPUsanon2016/08/24 08:26 PM
                    The (apparent) state of trace caches on modern CPUsMaynard Handley2016/08/23 07:48 AM
                      That's not trueDavid Kanter2016/08/23 09:39 AM
                        That's not trueMaynard Handley2016/08/23 09:56 AM
                      The (apparent) state of trace caches on modern CPUsanon2016/08/23 09:54 PM
                  The (wrong) state of trace caches on modern CPUsEric Bron2016/08/25 02:38 AM
                    The (wrong) state of trace caches on modern CPUsMichael S2016/08/25 03:28 AM
                      The (wrong) state of trace caches on modern CPUsEric Bron2016/08/25 07:12 AM
                      The (wrong) state of trace caches on modern CPUsMaynard Handley2016/08/25 09:50 AM
                        The (wrong) state of trace caches on modern CPUsMichael S2016/08/25 10:36 AM
                          The (wrong) state of trace caches on modern CPUsExophase2016/08/25 11:32 AM
                        The (wrong) state of trace caches on modern CPUsEric Bron2016/08/25 11:12 AM
                          The (wrong) state of trace caches on modern CPUsMaynard Handley2016/08/25 12:01 PM
                            The (wrong) state of trace caches on modern CPUsEric Bron2016/08/25 12:20 PM
                              The (wrong) state of trace caches on modern CPUsMaynard Handley2016/08/25 01:34 PM
        Branch/jump target predictionGabriele Svelto2016/08/11 01:15 PM
  Branch/jump target predictionGabriele Svelto2016/08/20 07:21 AM
Reply to this Topic
Name:
Email:
Topic:
Body: No Text
How do you spell tangerine? 🍊