Announcement

Collapse
No announcement yet.

GCC 12 Enables Auto-Vectorization For -O2 Optimization Level

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • #11
    Originally posted by cl333r View Post

    I was wondering what applications would see a noticeable improvement?
    If I remember correctly arch uses -O2 by default on their packages. So I'm waiting at least some small (but overall) improvement on this distro.

    Comment


    • #12
      Originally posted by carewolf View Post
      but we could atleast have
      no, we can't compile some other nonstandard language by default

      Comment


      • #13
        Originally posted by birdie View Post
        This option makes the binary code significantly fatter while not always making it faster. I used it many years ago, then actually tested a number of applications, found no significant improvements in most of them and disabled it for good.
        i bet you didn't test it with gcc 12 many years ago

        Comment


        • #14
          Originally posted by pal666 View Post
          no, we can't compile some other nonstandard language by default
          Which language requires treating plus and minus 0 differently?

          As I said some of those options doesn't even affect C/C++.

          Comment


          • #15
            Originally posted by cl333r View Post

            I was wondering what applications would see a noticeable improvement?
            Almost no benchmarks because they are already hand optimized. But tight integer loops that haven't been optimized often vectorizes nicely.

            For instance autovectorization helps Qt a lot when working on non-standard formats, working on RGB32 or ARGB32PM is hand vectorized, but if you work on RGB555 or ARGB4444PM you benefit greatly from autovectorization. But even here, this won't make a difference, since for this exact reason the graphics module in Qt is already compiled with -O3 by default.

            Comment


            • #16
              Originally posted by jonix View Post
              If I remember correctly arch uses -O2 by default on their packages.
              yes:
              Code:
              CFLAGS="-march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions \
              -Wp,-D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security \
              -fstack-clash-protection -fcf-protection"
              CXXFLAGS="$CFLAGS -Wp,-D_GLIBCXX_ASSERTIONS"
              LDFLAGS="-Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now"

              Comment


              • #17
                Originally posted by carewolf View Post
                Which language requires treating plus and minus 0 differently?

                As I said some of those options doesn't even affect C/C++.
                no, you started with -fno-math-errno, which builds some other language than standard c or c++

                Comment


                • #18
                  Originally posted by pal666 View Post
                  no, you started with -fno-math-errno, which builds some other language than standard c or c++
                  Sure, but you dismissed the whole comment instead of just that part. Still I would rather nudge C++ to drop old C misfeatures like global errno and global rounding settings. The latter is often broken anyway, or breaks applications and libraries if you touch it.

                  And of course the features only accessible from other languages should probably be disabled with compiling c/c++, though it may require a new major version with a big changelog warning, as gcc is also used to compile libraries for other languages.

                  Comment


                  • #19
                    Originally posted by RealNC View Post
                    I've been using "-O2 -ftree-vectorize" for many years now.
                    I guess this now should be changed to "-O2 -fvect-cost-model=dynamic" instead. Otherwise you'll be using the very-cheap model.

                    Comment

                    Working...
                    X