AMD Zen 5 Compiler Support Posted For GCC - Confirms New AVX Features & More

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • coder
    Senior Member
    • Nov 2014
    • 8836

    #21
    Originally posted by Sonadow View Post
    Processor-specific tunings are a pox and cancer and should never exist on anything except purpose-built appliances that exist to do only a very specific function.

    Everything else should be on -march=x86-64 -mtune=generic
    IMO, most of the benchmarks on sites like Phoronix should use generic targets, but if/when someone can safely use native tuning, it makes a lot of sense to do so.

    It's only through architecture-specific tuning that the compiler can know which instruction sequences or optimizations to prefer and which to avoid.

    Comment

    • Sonadow
      Senior Member
      • Jun 2009
      • 2261

      #22
      Originally posted by coder View Post
      IMO, most of the benchmarks on sites like Phoronix should use generic targets, but if/when someone can safely use native tuning, it makes a lot of sense to do so.

      It's only through architecture-specific tuning that the compiler can know which instruction sequences or optimizations to prefer and which to avoid.
      Have fun dealing with illegal instructions when copying a binary built on a one processor over to a computer running on another processor.
      Last edited by Sonadow; 13 February 2024, 03:14 AM.

      Comment

      • S.Pam
        Senior Member
        • Oct 2018
        • 676

        #23
        Originally posted by Sonadow View Post

        Processor-specific tunings are a pox and cancer and should never exist on anything except purpose-built appliances that exist to do only a very specific function.

        Everything else should be on -march=x86-64 -mtune=generic
        That's just weird. The context was a user who recompiles his own software to optimise for his platform. That's the definition of purpose built, isn't it?
        ​​​

        Comment

        • S.Pam
          Senior Member
          • Oct 2018
          • 676

          #24
          Originally posted by Sonadow View Post

          Have fun dealing with illegal instructions when copying a binary built on a one processor over to a computer running on another processor.
          This rarely works on Linux anyway unless you have either exactly the same version of libraries or a statically built binary.

          What's wrong with compiling for your hardware as long as you are aware that changing CPU to a lesser/older version might not work so good?

          Comment

          • coder
            Senior Member
            • Nov 2014
            • 8836

            #25
            Originally posted by Sonadow View Post
            Have fun dealing with illegal instructions when copying a binary built on a one processor over to a computer running on another processor.
            I know exactly what the downsides are, and I wouldn't do this in a context where I might ever want to run those binaries on a different machine, much less an older or otherwise inferior one.

            Furthermore, I've got some news that sounds like it just might blow your friggin' mind! I actually have machines of multiple ISAs on my network, and I compile code on each of them! Oh noessS!!! The horror! Whatever should I do if I somehow copy over a binary executable to a machine of a different ISA??? Oh, the humanity!
            🤯 😱
            Last edited by coder; 13 February 2024, 04:13 AM.

            Comment

            • coder
              Senior Member
              • Nov 2014
              • 8836

              #26
              Originally posted by S.Pam View Post
              This rarely works on Linux anyway unless you have either exactly the same version of libraries or a statically built binary.
              Depends. For C++ code, APIs tend not to be designed in a forward-compatible fashion. However, UNIX has a fairly rich tradition of semantic versioning and C libraries which properly implement it.

              If you bring your fragile libraries with the executable (or just statically link them, license-permitting), you can be quite successful in running old binaries on a newer kernel and libc.

              Comment

              • Sonadow
                Senior Member
                • Jun 2009
                • 2261

                #27
                Originally posted by S.Pam View Post

                This rarely works on Linux anyway unless you have either exactly the same version of libraries or a statically built binary.

                What's wrong with compiling for your hardware as long as you are aware that changing CPU to a lesser/older version might not work so good?
                Good. Please rebuild your current Linux distribution entirely from scratch to target your CPU with -march=native

                Comment

                • S.Pam
                  Senior Member
                  • Oct 2018
                  • 676

                  #28
                  Originally posted by Sonadow View Post

                  Good. Please rebuild your current Linux distribution entirely from scratch to target your CPU with -march=native
                  Of course. I'm using Gentoo, so that's a given.

                  Comment

                  • krishoza
                    Junior Member
                    • Nov 2024
                    • 3

                    #29
                    Originally posted by coder View Post
                    I think the only userspace instruction additions are AVX-512.


                    However, Zen 4 includes more than the Skylake-level AVX-512 functionality found in v4.


                    That said, I'm not sure how much benefit you'll get from those other extensions, aside from in software packages specifically optimized for them.

                    Also, using -mtune=znver4 could enable instruction cost tables specific to zen 4, depending on whether AMD ever got around to contributing them. Note that -mtune is implied by -march (for x86, at least; I think it's not true for ARM).
                    For this statement
                    Note that -mtune is implied by -march (for x86, at least; I think it's not true for ARM).
                    is there any compiler documentation which I can take a look at as to for what all compiler this statement is always True

                    Comment

                    Working...
                    X