mining
mining

Reputation: 3699

How to specify the CFLAGS to gcc-4.6 or gcc-4.7 to use the Intel-AVX

I have an Intel Core i7-3770, and I found that it contains the AVX, How do I specify the CFLAGS to gcc-4.6 or gcc-4.7 to use the Intel-AVX? Is there some example code or manual about this? Thanks.

Upvotes: 0

Views: 554

Answers (1)

Caladan
Caladan

Reputation: 1491

You should use -mavx switch or select proper CPU using -march=flag with flag equal corei7-avx, core-avx-i or core-avx2.

Still the compiler may not generate vectorized code unless you add some other switches.

Upvotes: 1

Related Questions