[cairo] MMX Makefile for PIXMAN

Soeren Sandmann sandmann at daimi.au.dk
Tue Feb 26 19:05:51 PST 2008

Frédéric Plourde <frederic.plourde at polymtl.ca> writes:

> Here are 2 patches that enable MMX compilation under win32 platforms
> for PIXMAN.

I can't get the patch to apply - could you upload it somewhere, or
send it as an attachment instead?

> Notice the addition of the MMX option at command line for the
> Makefile.win32 files.
> Care though is to be taken : There are still many issues to be
> resolved inside pixman-mmx.c fast paths as I noticed significant perf
> drops using MMX (with alpha_ perf cases) !!
> ** also, many similar changes have been made in pixman-mmx.c  to allow
> Visual Studio to compile correctly. These changes concern all the
> "cast to union type" made from subtypes to __m64 union type, which is
> a valid casting operation under GCC, but NOT using cl with Visual
> Studio (arrghh!) ;-)    

I found this old message:


where Bill Baxter says:

    But actually now that I think of it maybe casting via one of the
    __m64 union members would have been more straightforward.

Is this useful?

> I had to cast the pointers to those variables instead of using the
> objet refs. ** I'd like the input of the reviewers on that
> point... Is that in line with the Cairo/Pixman philosophy ? **

Pixman does not have strict philosophical guidelines on such issues. 

However, I suspect that taking the address of variables may cause GCC
to not register allocate them, which would be very bad. If MSVC has
the same issue, that could explain the performance hit you are seeing.

If we end up having to do two different things for GCC and MSVC, then
a macro, M64, should be defined that will do that cast. In fact, this
may be a good idea in any case.


More information about the cairo mailing list