Re: how to get -march=native's value?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 2021-09-17 12:53:25 -0500, Segher Boessenkool wrote:
> For x86 -march=something is the same as -march=native, _if_ the compiler
> knows about your CPU.

It isn't:

cventin:~> diff -u <(gcc -Q --help=target --help=params -march=haswell) \
                   <(gcc -Q --help=target --help=params -march=native)
--- /proc/self/fd/11    2021-09-27 14:53:27.003263155 +0200
+++ /proc/self/fd/14    2021-09-27 14:53:27.003263155 +0200
@@ -9,11 +9,11 @@
   -m8bit-idiv                          [disabled]
   -m96bit-long-double                  [disabled]
   -mabi=                               sysv
-  -mabm                                [disabled]
+  -mabm                                [enabled]
   -maccumulate-outgoing-args           [disabled]
   -maddress-mode=                      long
   -madx                                [disabled]
-  -maes                                [disabled]
+  -maes                                [enabled]
   -malign-data=                        compat
   -malign-double                       [disabled]
   -malign-functions=                   0
@@ -304,8 +304,8 @@
   --param=jump-table-max-growth-ratio-for-size=        300
   --param=jump-table-max-growth-ratio-for-speed=       800
   --param=l1-cache-line-size=          64
-  --param=l1-cache-size=               64
-  --param=l2-cache-size=               512
+  --param=l1-cache-size=               32
+  --param=l2-cache-size=               15360
   --param=large-function-growth=       100
   --param=large-function-insns=        2700
   --param=large-stack-frame-growth=    1000

I don't understand "_if_ the compiler knows about your CPU": if the
compiler knows about the CPU, it should select more accurate options
(as shown above, where abm and aes get enabled), shouldn't it?

-- 
Vincent Lefèvre <vincent@xxxxxxxxxx> - Web: <https://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <https://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)



[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux