Click here to get back home

WMMX Intrinsic Functions

 HomeNewsGroups | Search | About
 microsoft.public.smartphone.developer    Post an article   get this group's latest topics as an RSS feed add this group's latest topics to your My MSN content add this group's latest topics to your My Yahoo content
Subject Author Date
WMMX Intrinsic Functions mike 05-31-2007
Get Chitika Premium
Posted by riki on June 6, 2007, 1:20 am
Please log in for more thread options
mike wrote:
> <http://msdn2.microsoft.com/en-us/library/ms254258(VS.80).aspx>
> I found this on msdn; does this not work with VS2005 today?
>
> Thanks,
hmm interesting, I don't have the contact details for anyone on the VSD
team. Nor do I have a WM5 xscale device handy - but I do know this fails
with an invalid instruction exception on the emulator:
#include <windows.h>
#include <mmintrin.h>
#include <cmnintrin.h>

int WINAPI WinMain(HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPTSTR lpCmdLine,
int nCmdShow)
{
        __m64 a = , b = ;
        a.m64_u32[1] = 1;
        b.m64_u32[1] = 2;

__m64 ret = _mm_adds_pi32(a, b);

return ret.m64_u32[0];
}


Riki

--
ThemeChanger and AbstractStart for Smartphone :
http://www.IfIHadADollarForEveryTimeSomeoneSaidThatIWouldHaveMyOwnWebiste.com/

Small minds discuss people,Average minds discuss events,Great minds
discuss ideas.

Posted by mike on June 6, 2007, 12:17 pm
Please log in for more thread options
> mike wrote:
> > <http://msdn2.microsoft.com/en-us/library/ms254258(VS.80).aspx>
> > I found this on msdn; does this not work with VS2005 today?
>
> > Thanks,
>
> hmm interesting, I don't have the contact details for anyone on the VSD
> team. Nor do I have a WM5 xscale device handy - but I do know this fails
> with an invalid instruction exception on the emulator:
> #include <windows.h>
> #include <mmintrin.h>
> #include <cmnintrin.h>
>
> int WINAPI WinMain(HINSTANCE hInstance,
> HINSTANCE hPrevInstance,
> LPTSTR lpCmdLine,
> int nCmdShow)
> {
> __m64 a = , b = ;
> a.m64_u32[1] = 1;
> b.m64_u32[1] = 2;
>
> __m64 ret = _mm_adds_pi32(a, b);
>
> return ret.m64_u32[0];
>
> }
>
> Riki
>
> --
> ThemeChanger and AbstractStart for Smartphone
:http://www.IfIHadADollarForEveryTimeSomeoneSaidThatIWouldHaveMyOwnWeb...
>
> Small minds discuss people,Average minds discuss events,Great minds
> discuss ideas.

Thanks for the help! You're much further than I am on this. I can't
even get the code you have here to compile. I copied it (except for
the return) into an existing project and receive the following...

Error        14        error C2275: '__m64' : illegal use of this type as an
expression
Error        15        error C2146: syntax error : missing ';' before identifier
'ret'
Error        16        error C2065: 'ret' : undeclared identifier
Error        17        error C2440: '=' : cannot convert from '__m64' to 'int'

I've included _CMMN_INTRIN_FUNC in the preprocessor entries but no
luck.

Mike


Posted by mike on June 6, 2007, 1:04 pm
Please log in for more thread options
>
>
>
>
>
> > mike wrote:
> > > <http://msdn2.microsoft.com/en-us/library/ms254258(VS.80).aspx>
> > > I found this on msdn; does this not work with VS2005 today?
>
> > > Thanks,
>
> > hmm interesting, I don't have the contact details for anyone on the VSD
> > team. Nor do I have a WM5 xscale device handy - but I do know this fails
> > with an invalid instruction exception on the emulator:
> > #include <windows.h>
> > #include <mmintrin.h>
> > #include <cmnintrin.h>
>
> > int WINAPI WinMain(HINSTANCE hInstance,
> > HINSTANCE hPrevInstance,
> > LPTSTR lpCmdLine,
> > int nCmdShow)
> > {
> > __m64 a = , b = ;
> > a.m64_u32[1] = 1;
> > b.m64_u32[1] = 2;
>
> > __m64 ret = _mm_adds_pi32(a, b);
>
> > return ret.m64_u32[0];
>
> > }
>
> > Riki
>
> > --
> > ThemeChanger and AbstractStart for Smartphone
:http://www.IfIHadADollarForEveryTimeSomeoneSaidThatIWouldHaveMyOwnWeb...
>
> > Small minds discuss people,Average minds discuss events,Great minds
> > discuss ideas.
>
> Thanks for the help! You're much further than I am on this. I can't
> even get the code you have here to compile. I copied it (except for
> the return) into an existing project and receive the following...
>
> Error 14 error C2275: '__m64' : illegal use of this type as an
> expression
> Error 15 error C2146: syntax error : missing ';' before identifier
> 'ret'
> Error 16 error C2065: 'ret' : undeclared identifier
> Error 17 error C2440: '=' : cannot convert from '__m64' to 'int'
>
> I've included _CMMN_INTRIN_FUNC in the preprocessor entries but no
> luck.
>
> Mike- Hide quoted text -
>
> - Show quoted text -

Some follow-up info...

I can get the below code to compile now and run on the mobile 6
emulator. However, if I uncomment the line __m64 ret =
_mm_adds_pi32( a, b ); below, I get the compile error that follows
it.

        void _m_empty(void);

        __m64 a = ;
        __m64 b = ;
        a.m64_u32[1] = 1;
        b.m64_u32[1] = 2;

        printf( "a.m64_u32: %d \n", a.m64_u32[ 1 ] );

//        __m64 ret = _mm_adds_pi32( a, b );

Error        14        error C2275: '__m64' : illegal use of this type as an
expression
Error        15        error C2146: syntax error : missing ';' before identifier
'ret'
Error        16        error C2065: 'ret' : undeclared identifier
Error        17        error C2440: '=' : cannot convert from '__m64' to 'int'

Thanks,

Mike


Posted by Riki on June 6, 2007, 1:35 pm
Please log in for more thread options
mike wrote:
> Thanks for the help! You're much further than I am on this. I can't
> even get the code you have here to compile. I copied it (except for
> the return) into an existing project and receive the following...
>
> Error        14        error C2275: '__m64' : illegal use of this type as an
> expression
> Error        15        error C2146: syntax error : missing ';' before identifier
> 'ret'
> Error        16        error C2065: 'ret' : undeclared identifier
> Error        17        error C2440: '=' : cannot convert from '__m64' to 'int'
>
> I've included _CMMN_INTRIN_FUNC in the preprocessor entries but no
> luck.

I compiled against WM5 SDK, with /Oi (enable intrinsics) and /QRxscale
(targeting xscale) - I just put those options into
Properties->Configuration Properties->c/c++->Command Line->Additional
Options, although you should be able to set c/c++->Optimization->Enable
Intrinsic Functions instead of /Oi.


Riki

--
ThemeChanger and AbstractStart for Smartphone :
http://www.IfIHadADollarForEveryTimeSomeoneSaidThatIWouldHaveMyOwnWebsite.com/

"Television is a medium because it is neither rare nor well done." --
Fred Friendly, former head of CBS News

Similar ThreadsPosted
wmmx WLDRW in intrinsics? July 20, 2007, 2:18 pm
Sms Functions API Failing April 2, 2007, 8:22 am
How to link the default functions or Folder by using code? October 27, 2005, 3:56 am
Can wininet functions trigger CM to auto-establish a GPRS connecti June 11, 2005, 10:03 pm

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap