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?
Asked
Active
Viewed 305 times
0

yugr
- 19,769
- 3
- 51
- 96

Nguyễn Thanh Vũ
- 121
- 1
- 9
-
A relevant question: https://stackoverflow.com/questions/7269946/cortex-a9-neon-vs-vfp-usage-confusion – yugr Nov 14 '17 at 12:11
-
It will either complain or use the wrong instructions. – old_timer Nov 14 '17 at 13:58
2 Answers
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