SSE优化指令集编译错误: inlining failed in call to always_inline 'xxx': target specific option mismatch xxx
最近在使用sse指令集优化代码的时候,编译出错,报一堆类似如下的错误,
/usr/lib/gcc/x86_64-linux-gnu/7/include/fmaintrin.h:63:1: error: inlining failed in call to always_inline ‘__m256 _mm256_fmadd_ps(__m256, __m256, __m256)’: target specific option mismatch _mm256_fmadd_ps (__m256 __A, __m256 __B, __m256 __C)
这个问题 添加编译选项
-mfma
就解决了
类似其他 “__mm256_XXXXXX_XX ”函数,通过查找对应的SSE指令集即可,
网址为https://software.intel.com/sites/landingpage/IntrinsicsGuide/#expand=3828,301,2553
搜索框输入对应函数即可找到对应编译flag
参考:
https://blog.csdn.net/willib/article/details/52386087
https://software.intel.com/sites/landingpage/IntrinsicsGuide/#expand=3828,301,2553