[cairo] SSE support in pixman

Soeren Sandmann sandmann at daimi.au.dk
Fri Feb 22 10:08:56 PST 2008


Frederic Plourde <frederic.plourde at polymtl.ca> writes:

> "dnl GCC 4.2 when compiling with -msse will generate SSE instructions
> dnl on its own.  This means anything compiled with -mss can only be
> dnl run after a runtime check for SSE.  Unfortunately, since we still
> dnl need to support MMX-but-not-SSE (such as the OLPC), this means we
> dnl can only use SSE when compiling for x86-64 (where SSE is always
> dnl supported)."
> 
> ... and I'm wondering...my question is :
> 
> Isn't there anything we can do to support SSE...even on _x86_ ? How about
> enhancing "detectCPUFeatures(...) to detect specific non_SSE
> platforms such as the OLPC and then branch accordingly ? You are way
> more experienced than I am with pixman intrinsics... I was wondering
> if this sounds possible to you ;-)

Certainly.

The comment really refers to the parts of pixman-mmx.c that are
enclosed in #ifdef USE_SSE. Basically, these parts make use of the
pshufw instruction which was added along with SSE on Intel, and IIRC
as part of AMD's 'mmx extensions'.

But there is no problem adding a new pixman-sse.c file that would be
compiled with -msse containing code that would run if
detectCPUfeatures returned SSE/SSE2 etc.

Just pixman-mmx.c can't grow an SSE dependency outside x86-64.


Soren


More information about the cairo mailing list