[Bug plugins/57355] New: -march=native ivy bridge i5 shows tuning for sandy bridge

2013-05-21 Thread croutch at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57355

Bug ID: 57355
   Summary: -march=native ivy bridge i5 shows tuning for sandy
bridge
   Product: gcc
   Version: 4.7.2
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: plugins
  Assignee: unassigned at gcc dot gnu.org
  Reporter: croutch at gmail dot com


[Bug target/57355] -march=native ivy bridge i5 shows tuning for sandy bridge

2013-05-21 Thread croutch at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57355

--- Comment #2 from croutch  ---
I have a. 
Intel Core i5 3570K 3,4Ghz (Ivy Bridge)

I use gentoo linux with gcc 4.7.3 and those settings.

CFLAGS="-march=native -O2 -pipe" 
CXXFLAGS="${CFLAGS}" 
MAKEOPTS="-j4" 

>From manual.
core-avx-i = for ivy bridge 
Intel Core CPU with 64-bit extensions, MMX, SSE, SSE2, SSE3, SSSE3, SSE4.1,
SSE4.2, AVX, AES, PCLMUL, FSGSBASE, RDRND and F16C instruction set support.

When i use this command i get this output.

$ gcc -c -Q -march=native --help=target | grep march 
-march=corei7-avx 

for sandy bridge?

And this command shows . 
echo "" | gcc -march=native -v -E - 2>&1 | grep cc1 
/usr/libexec/gcc/x86_64-pc-linux-gnu/4.7.1/cc1 -E -quiet -v - -march=corei7-avx
-mcx16 -msahf -mno-movbe -maes -mpclmul -mpopcnt -mno-abm -mno-lwp -mno-fma
-mno-fma4 -mno-xop 
-mno-bmi -mno-bmi2 -mno-tbm -mavx -mno-avx2 -msse4.2 -msse4.1 -mno-lzcnt
-mrdrnd -mf16c -mfsgsbase --param l1-cache-size=32 --param
l1-cache-line-size=64 --param l2-cache-size=6144 -mtune=generic 

I thougth CFLAGS="-march=native -O2 -pipe" should enable most of this ->
core-avx-i in gcc 4.7 with ivy bridge?? not for sandy bridge??

I found same problems in many linux forums.
Here are one  with a included patch -
https://bbs.archlinux.org/viewtopic.php?id=156282

Link to patch  https://github.com/crondog/misc-patches


[Bug target/57355] -march=native ivy bridge i5 shows tuning for sandy bridge

2013-05-21 Thread croutch at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57355

--- Comment #3 from croutch  ---
Created attachment 30155
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=30155&action=edit
gcc-native-ivy-detect

This patch is not from me and not tested by me.