[gcc-help] force code generation for higher cpu using cflags
Toan Pham
tpham3783@gmail.com
Fri Jan 12 15:33:00 GMT 2018
Hi all, I have a gcc question and hopefully someone can help me out. Let's
say I have two compilers. Compiler GCC_A & GCC_B:
*GCC_A:* Host compiler - i686. This compiler was used to build compiler B
with optimization for pentium4 (--with-arch=pentium4). The configure
parameters to build compiler B is as follow:
Target: i686-t2-linux-gnu
Configured with: ../configure --prefix=/usr --bindir=/usr/bin
--sbindir=/usr/sbin --libdir=/usr/lib --datadir=/usr/share
--includedir=/usr/include --infodir=/usr/info --mandir=/usr/man
--sysconfdir=/etc --localstatedir=/var --disable-debug --with-libpam
--with-pam --enable-libpam --enable-pam --with-mysql-lib=/usr/lib/mysql
--with-mysql-include=/usr/include/mysql --with-mysql-lib=/usr/lib/mysql
--with-mysql-include=/usr/include/mysql --build=i686-t2-linux-gnu
--host=i686-t2-linux-gnu --target=i686-t2-linux-gnu
--enable-install-libiberty=no --disable-install-libiberty
--with-arch=pentium4 --with-arch=pentium4 --enable-__cxa_atexit
--disable-checking --disable-bootstrap --disable-libstdcxx-pch
--disable-multilib --disable-target-libiberty --with-gnu-as --with-gnu-ld
--enable-threads=posix --enable-languages=c,c++,objc,go --enable-shared
Thread model: posix
gcc version 4.8.5 (GCC)
*GCC_B:* Target/Build compiler for x86 pentium4. This compiler is used to
build root-filesystem for target board: x86 pentium4. In theory, this
compiler does not generate any code (ie avx1 avx2 sse3 sse3 sse4.1) not
supported by the intel pentium4 processor.
*My question is: * can I use compiler B with added compiler flags (-mavx
-mavx2 -march=corei7) to force compiler B to generate code for higher CPU
support? So far, I haven't been able to do so because compiler B wouldn't
be able to compile vectorized instruction sets (ie. avx+avx2+SSE)? I am
not sure if it is something I did wrong or that it is completely
impossible.
Thank you.
TP
More information about the Gcc-help
mailing list