- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
My machine is Core2 microarchitecture and I try to compile some arithmetic codes by using the SSE instruction set. I search on the web and official manual, the answer is everything I need to do (in simplest way) to add the flag: march=native, because my chip support SSE. But when I use "gcc -march=native -Q --help=target -v" to check if the flag really works, the results display on the screen is a little bit beyond expectation, like:
-msse [disabled]
-msse2 [disabled]
-msse2avx [disabled]
-msse3 [disabled]
-msse4 [disabled]
-msse4.1 [disabled]
-msse4.2 [disabled]
-msse4a [disabled]
-msse5
-msseregparm [disabled]
-mssse3 [disabled]
I find all the SSE (even MMX) is disabled. Can any body tell me why and how to solve it? Many thanks!
PS: I know,an alternative way to active the option is to add the flags like -mmsse ...manually. But, I am just curiosity, why march=native doesn't works in my system:core2,Ubuntu 12.04(64bit system), gcc 4.6.3
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Could you find a more up to date build of gcc for your OS? The response posted looks like your CPU has been taken for an AMD.
core2, unfortunately, is ambiguous, as early core2 (including my last one) didn't support SSE4.1, while recent versions do, so it won't be surprising if gcc doesn't do a lot for you with that option.
On the old core2, with the gcc versions available back then, I used stuff like -march=pentium4 (if 32-bit). -mssse3 wasn't as important for gcc as for icc (of course you want that or -msse3 to support complex arithmetic). For the older gcc on the newer core2 with sse4.1, you may want
-mtune=barcelona to encourage the compiler to use some 128-bit moves. gcc was correct in preferring to split many 128-bit moves on the older core2.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I'm on Ubuntu 12.04, x86-64, gcc 4.6.3, Sandy Bridge CPU. Your command works as expected on my setup, all -msse* and -mavx are enabled. Could you also try the following command:
gcc -march=native -dM -E - <<<'' | grep SSE
This will display the predefined macros that indicate the support for various SSE versions. If that doesn't show anything, take a look at /proc/cpuinfo - are the extensions you're looking for there?
Also, are you by any chance running on a virtual machine? Hypervisors often disable CPU extensions for guest systems.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank you all above:
I think it's a “information prompting” bug of gcc on my environment, meaning the information retunred by the command "gcc -march=native -Q--help=target -v" is not correct with reality, because in fact I can use sse ISA without any flags with gcc.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Chenjie Y. wrote:
Thank you all above:
I think it's a “information prompting” bug of gcc on my environment, meaning the information retunred by the command "gcc -march=native -Q--help=target -v" is not correct with reality, because in fact I can use sse ISA without any flags with gcc.
All 64-bit versions of gcc for core2 will use sse and sse2 by default.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page