内联调用always_inline'__m128i _mm_cvtepu8_epi32(__ m128i)'失败:目标特定选项不匹配_mm_cvtepu8_epi32(__m128i __X) [英] inlining failed in call to always_inline '__m128i _mm_cvtepu8_epi32(__m128i)': target specific option mismatch _mm_cvtepu8_epi32 (__m128i __X)

查看:654
本文介绍了内联调用always_inline'__m128i _mm_cvtepu8_epi32(__ m128i)'失败:目标特定选项不匹配_mm_cvtepu8_epi32(__m128i __X)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试从github编译此项目,该项目在C ++中使用SIMD内在功能(SSE4。 1)。 github中的项目是作为Visual Studio解决方案提供的,但是我正尝试使用cmake将其移植到Qtcreator中。在尝试编译时,出现以下错误:

I am trying to compile this project from github which is implemented in C++ with SIMD intrinsic (SSE4.1). The project in github is given as a Visual Studio solution, but I am trying to port it in Qtcreator with cmake. While I am trying to compile it I get the following error:

/usr/lib/gcc/x86_64-unknown-linux-gnu/5.3.0/include/smmintrin.h:520:1: error: inlining failed in call to always_inline '__m128i _mm_cvtepu8_epi32(__m128i)': target specific option mismatch
 _mm_cvtepu8_epi32 (__m128i __X)

我确定这与SSE优化部分有关,但是由于我对这个主题不太熟悉我不太清楚这是什么意思,以及如何解决这个问题,在我搜索的网络中,我并没有真正得到有用的东西。给出以下问题的代码如下:

which I am sure it has to do with the SSE optimization part, but since I am not that familiar with this subject I do not really know what it means and how I can solve it and in the net that I searched I couldn't really get something useful. The code that gives the following problem is the following:

static void cvt8u32f(const Mat& src, Mat& dest, const float amp)
{
    const int imsize = src.size().area()/8;
    const int nn = src.size().area()- imsize*8 ;
    uchar* s = (uchar*)src.ptr(0);
    float* d = dest.ptr<float>(0);
    const __m128 mamp = _mm_set_ps1(amp);
    const __m128i zero = _mm_setzero_si128();
    for(int i=imsize;i--;)
    {
        __m128i s1 = _mm_loadl_epi64((__m128i*)s);

        _mm_store_ps(d,_mm_mul_ps(mamp,_mm_cvtepi32_ps(_mm_cvtepu8_epi32(s1))));
        _mm_store_ps(d+4,_mm_mul_ps(mamp,_mm_cvtepi32_ps(_mm_cvtepu8_epi32(_mm_srli_si128(s1,4)))));
        s+=8;
        d+=8;
    }
    for(int i=0;i<nn;i++)
    {
        *d = (float)*s * amp;
        s++,d++;
    }

}

有人可以解释一下我是什么问题以及我所缺少的。

can someone explain me what is the issue and what I am missing. Thanks in advance.

推荐答案

在file.pro中添加:
QMAKE_CXXFLAGS + =-msse3

add in file.pro: QMAKE_CXXFLAGS +=-msse3

这篇关于内联调用always_inline'__m128i _mm_cvtepu8_epi32(__ m128i)'失败:目标特定选项不匹配_mm_cvtepu8_epi32(__m128i __X)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆