I am trying to compile a program that uses AVX2 instructions from the rather new Intel Haswell processors.
I have checked that the Macbook Pro I am using has a Crystalwell processor, which should have such AVX2 extensions:
sysctl -n machdep.cpu.brand_string
Intel(R) Core(TM) i7-4870HQ CPU @ 2.50GHz
My intention is to compile such program using an Ubuntu 15.10 64-Bit version VirtualBox image, which has got a recent version of gcc:
gcc (Ubuntu 5.2.1-22ubuntu2) 5.2.1 20151010
When I check the extensions in the VirtualBox machine, I do not see avx2 listed:
processor : 3
vendor_id : GenuineIntel
cpu family : 6
model : 70
model name : Intel(R) Core(TM) i7-4870HQ CPU @ 2.50GHz
stepping : 1
cpu MHz : 2494.226
cache size : 6144 KB
physical id : 0
siblings : 4
core id : 3
cpu cores : 4
apicid : 3
initial apicid : 3
fpu : yes
fpu_exception : yes
cpuid level : 13
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx rdtscp lm constant_tsc rep_good nopl xtopology nonstop_tsc pni pclmulqdq ssse3 cx16 sse4_1 sse4_2 movbe popcnt aes xsave avx rdrand hypervisor lahf_lm abm
bugs :
bogomips : 4988.45
clflush size : 64
cache_alignment : 64
address sizes : 39 bits physical, 48 bits virtual
power management:
Any ideas?