- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi All,
The behaviour of _mm_move_ss() is unpredicted and its different from expected behaviour with Intel compiler in release mode.
I used the intrinnsic _mm_move_ss() for copying data from one xmm reg to another xmm reg.
Ex:
//vrz=vrx
vrz = _mm_move_ss(vrx, vrx) - does not work in release mode but works in debug mode.
If we pass two different arguments to _mm_move_ss() then the behaviour is ok in release mode.
vrz = _mm_move_ss(vrx, _mm_set1_ps(0.0)); - works in release mode
Is there any restriction on arguments?
What could be the reason for this behaviour?
Note: I used below options in release mode:
/Zi /nologo /W3 /O2 /D "_MBCS" /EHsc /MT /GS /QxCORE-AVX2 /Zc:wchar_t /Zc:forScope /Fp"Release\AlgoRomLib.pch" /Fa"Release\" /Fo"Release\" /Fd"Release\vc100.pdb" /Gd
Thanks,
Eswar Reddy K
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Here is test case:
class data32
{
public:
typedef union union32
{
int i;
float f;
} union32;
data32() {}
data32(int ii) { val.i = ii;};
data32(unsigned int ii) { val.i = (int)ii;};
data32(unsigned long ii) { val.i = (int)ii;};
data32(float ff) { val.f = ff;};
inline data32 & operator= (const int & i) { val.i = i; return *this; }
inline data32 & operator= (const float & f) { val.f = f; return *this; }
inline operator int() {return val.i;}
inline operator unsigned int() {return (unsigned int) val.i;}
inline operator unsigned long() {return (unsigned long) val.i;}
inline operator float() {return val.f;}
private:
union32 val;
};
void test_move_ss()
{
__m128 in, out;
in = _mm_set1_ps(1.0);
out = _mm_move_ss(in, in);
printf("%f\n",(float)((data32)_mm_extract_epi32(_mm_castps_si128(out),0)));
printf("%f\n",(float)((data32)_mm_extract_epi32(_mm_castps_si128(out),1)));
printf("%f\n",(float)((data32)_mm_extract_epi32(_mm_castps_si128(out),2)));
printf("%f\n",(float)((data32)_mm_extract_epi32(_mm_castps_si128(out),3)));
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Release mode:
0.000000
0.000000
0.000000
0.000000
Debug mode:
1.000000
1.000000
1.000000
1.000000
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Sergey,
Thanks for the detailed analysis.
out = _mm_move_ss( in, in );// => single var fails!
out = _mm_move_ss( inA, inB );//=> two different vars works in release mode.
When I use two different variables for _mm_move_ss() then it works in release mode. If we use single variable then it fails in release mode.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page