0

For example, if I have a chip -mcpu=cortex-a7 , I should define -mfpu=neon-vfpv4 , not -mfpu=neon . However, I'm wondering what will happen if I define -mfpu=neon on Cortex-A7? Will it just ignore the flag and don't do the SIMD, or what will it do with the wrong flag like that?

yugr
  • 19,769
  • 3
  • 51
  • 96

2 Answers2

2

It will use an older set of NEON instructions (-mfpu=neon is for selecting the NEON instructions that are available on the Cortex-A8 core). For example, it will not include the VFMA instructions.

Note that from GCC 8 (still in development) you will be able to just use -mfpu=auto or leave out the -mfpu entirely and have the compiler pick the optimal FPU setting for the -mcpu option you selected

Kyrill
  • 2,963
  • 1
  • 8
  • 12
0

If you do this compiler won't use VFPv4 instructions and potentially generate suboptimal code.

yugr
  • 19,769
  • 3
  • 51
  • 96