- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
How can I get my unsigned bytes out of __m64 using the Intel compiler? Using visual studio I can use:
__m64 myvar;
myvar = someIntrinicFunction();
unsigned char mychar = myvar.m64_u8[0]; // broken for Intel compiler.
From vs, mmintrin.h:
typedef
union __declspec(intrin_type) _CRT_ALIGN(8) __m64{
unsigned __int64 m64_u64; float m64_f32[2]; __int8 m64_i8[8]; __int16 m64_i16[4]; __int32 m64_i32[2]; __int64 m64_i64; unsigned __int8 m64_u8[8]; unsigned __int16 m64_u16[4]; unsigned __int32 m64_u32[2];}
__m64;__64 is certainly defined for the intel compiler, why not the union? Does Intel use yet another notation (more #define hell), or do I need to waste more processor cycles doing the conversion by hand?
Thanks,
-Kevin
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
c = 0xff & m;
Or you can make a union (as above) or use a pointer into an array.
I don't think there's really any more processer cycles invoved in doing it by hand because when you do m64_u8[0], the compiler has to do issue similar code to extract the lowest byte and put it into a char.
Dale
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Dale,
Thanks for the note back. I wound up making my own union, and putting #ifdefs.
I eventually gave up and un-installed the compiler, VTune, thread profiler, the works. Life is much better now, although the uninstaller left a bunch of crap in my visual studio. I will just stick with the AMD performance analyzer. Simple, easy to use, 100 times more lightweight, and much, much more effective.
Thanks again,
-Kevin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
c = 0xff & m;
Or you can make a union (as above) or use a pointer into an array.
I don't think there's really any more processer cycles invoved in doing it by hand because when you do m64_u8[0], the compiler has to do issue similar code to extract the lowest byte and put it into a char.
Dale
Hi Dale,
I am facing the following error with __m64. Please help to provide some examples of resolution. Thanks.
__m64 var1;
var1.m64_u64 = 0x0101010101010101;
It is howing the following error: union "__m64" has no member "m64_u64".
Thanks,
Yau
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
For performance reasons, Intel compiler currently does not support this construct. The only work around at this time is to use Microsoft compiler for these instances, and use the Intel Compiler for code that does not use this construct.
The reason that it is defined in the Intel Compiler header is specifically for this purpose, allowing Microsoft built object that uses this construct, to link withIntel Compiler built object that does not use this code construct. Without the struct defined in the header, you will get a link error.
There is a pending feature request with the Intel Compiler team to support this code construct. Note that usage of this construct will result in lower runtime performance.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
__m64var1 = {0x0101010101010101};
Its able to compile and program works fine. I guess I am lucky. :)
Thanks,
Yau
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page