SDL_HasMMX() on Windows CE

Compiling SDL 1.2.7 for Windows CE (ARM), there is a reference to
’SDL_HasMMX()’ in src/video/SDL_blit_N.c that gets on the way.

I would recommend doing SDL_cpuinfo.h such, that it takes care of this.
Or am I doing something wrong, perhaps?

My quick fix (in SDL_blit_N.c itself):

#ifdef _WIN32_WCE //AK(10-Aug-04)
#define SDL_HasMMX() SDL_FALSE
#endif

You can use UNDER_CE, or _WIN32_WCE (seems to be more recent). It is
possible to compile WinCE for x86 platform, in which case MMX could
be there. So one should check for i386, X86 or x86 first.

-ak

PocketPC using Intel PXA270 processors do have MMX support.
So, you should better leave the sensor code.

“Asko Kauppi” <asko.kauppi at sci.fi> ???:AEFD9DEE-EA55-11D8-9063-0003937E6E14 at sci.fi…> Compiling SDL 1.2.7 for Windows CE (ARM), there is a reference to

‘SDL_HasMMX()’ in src/video/SDL_blit_N.c that gets on the way.
I would recommend doing SDL_cpuinfo.h such, that it takes care of this. Or
am I doing something wrong, perhaps?

My quick fix (in SDL_blit_N.c itself):
#ifdef _WIN32_WCE //AK(10-Aug-04)
#define SDL_HasMMX() SDL_FALSE
#endif

RocWood wrote:

PocketPC using Intel PXA270 processors do have MMX support.
So, you should better leave the sensor code.

Well, these cpus have something called MMX but some of the MMX code in
SDL is really MMX/x86 code, so that it won’t work on xscale cpus.
(I’m not even sure whether the MMX instruction sets on xscale and on x86
are similar anyway, it looks more like a marketting trick to me, like
the strongarm->xscale name change. Anyone has info on this ?).

Stephane

The PXA270 and some other XScale CPUs have SIMD instructions as part
of an Intel coprocessor. The Intel SIMD co-processor has “MMX and SSE
integer instruction compatibility”, but I don’t think it has opcode
compatibility. If you write MMX in assembly, it probably won’t work.
If you write in compiler marcos, it might work if your compiler supports
it. “Wireless-MMX” also has about 40 extra instructions.

The ARM CPUs also have a SIMD instruction set called AME (ARM Media
Extensions), which work on 16-bit or 8-bit datum.

IMO, it would be better to have a call in SDL that differentiated
between x86/MMX and xScale Wireless-MMX.

-Pat

Stephane Marchesin wrote:> RocWood wrote:

PocketPC using Intel PXA270 processors do have MMX support.
So, you should better leave the sensor code.

Well, these cpus have something called MMX but some of the MMX code in
SDL is really MMX/x86 code, so that it won’t work on xscale cpus.
(I’m not even sure whether the MMX instruction sets on xscale and on x86
are similar anyway, it looks more like a marketting trick to me, like
the strongarm->xscale name change. Anyone has info on this ?).

Stephane


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl

src/cpuinfo/SDL_cpuinfo.c uses ‘_MSC_VER’ which (I think) is defined on
eVC++ automatically. Causes x86 assembler to be included in ARM - not
nice. :slight_smile:

Here’s a dump:

     clarm /nologo /W3 /GF /O2 /DARM /D_M_ARM /DNDEBUG 

/D_WIN32_WCE=400 /DUNDER_CE=400 /DUNICODE /D_UNICODE /DSDL_EXPORTS
/DWIN32 /DENABLE_WINDIB /DNO_SIGNAL_H […]
/Fo…/temp/wce400.armv4/sdl/SDL_cpuinfo.obj
sdl_cpuinfo.c(85) : error C4235: nonstandard extension used : '__asm’
keyword not supported in this product
sdl_cpuinfo.c(86) : error C2065: ‘pushfd’ : undeclared identifier
sdl_cpuinfo.c(86) : error C2065: ‘Get’ : undeclared identifier

So one solution would be to replace each “defined(_MSC_VER)” in that
file by (not sure if this is the best): “defined(_MSC_VER) &&
defined(X86)”

-ak

10.8.2004 kello 04:30, RocWood kirjoitti:

PocketPC using Intel PXA270 processors do have MMX support.> So, you should better leave the sensor code.

“Asko Kauppi” <asko.kauppi at sci.fi>
???:AEFD9DEE-EA55-11D8-9063-0003937E6E14 at sci.fi

Compiling SDL 1.2.7 for Windows CE (ARM), there is a reference to
’SDL_HasMMX()’ in src/video/SDL_blit_N.c that gets on the way.
I would recommend doing SDL_cpuinfo.h such, that it takes care of
this. Or
am I doing something wrong, perhaps?

My quick fix (in SDL_blit_N.c itself):
#ifdef _WIN32_WCE //AK(10-Aug-04)
#define SDL_HasMMX() SDL_FALSE
#endif


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl

Compiling SDL 1.2.7 for Windows CE (ARM), there is a reference to
’SDL_HasMMX()’ in src/video/SDL_blit_N.c that gets on the way.

The correct fix is to add SDL_cpuinfo.c to the SDL CE project and make sure
it’s doing the right thing.

Patches accepted! :slight_smile:

Thanks,
-Sam Lantinga, Software Engineer, Blizzard Entertainment