Bug 4706

Summary: Compile for SSE by default
Product: pixman Reporter: Steve Chaplin <d74n5pohf9>
Component: pixmanAssignee: Billy Biggs <billy.biggs>
Status: RESOLVED FIXED QA Contact: cairo-bugs mailing list <cairo-bugs>
Severity: critical    
Priority: high CC: cworth, otaylor
Version: 0.1.3   
Hardware: x86 (IA32)   
OS: All   
Whiteboard:
i915 platform: i915 features:
Attachments: patch to allow Athlon-XP use SSE

Description Steve Chaplin 2005-10-07 07:46:42 UTC
cairo/pixman/fbmmx.c has lines:
#if defined(__amd64__) || defined(__x86_64__)
#define USE_SSE
#endif

which excludes the Athlon-XP (which supports SSE) from running the SSE code.
(It looks like its excluding the Pentium 3 and Pentium 4 which also
support SSE)

Attached patch allows the Athlon-XP to run the SSE code.
Tested on my system with the imagepattern gtk snippet - the SSE version
of expand_alpha is called and works OK.

It seems odd having MMX selected at run-time and then selecting
SSE at compile-time. I think run-time detection for SSE may be a better
solution.
Comment 1 Steve Chaplin 2005-10-07 07:48:21 UTC
Created attachment 3508 [details] [review]
patch to allow Athlon-XP use SSE
Comment 2 Billy Biggs 2005-10-07 07:57:23 UTC
The patch isn't useful since we need to do runtime CPU detection for x86
systems. Fixing this is a little awkard since the code uses the gcc intrinsics,
so it must be compiled twice, once with -msse and -DUSE_SSE defined, and again
without, using some preprocessor macros to change the function names.
Comment 3 Billy Biggs 2005-10-10 11:19:35 UTC
Or, we can just only compile for SSE, which is also a reasonable suggestion.
Owen things we should first see how much faster the SSE code is from the
MMX code on certain processors.
Comment 4 Søren Sandmann Pedersen 2007-06-20 09:36:18 UTC
At this point it may be best to just compile for SSE exclusively. The set of MMX-but-not-SSE capable CPU's is fairly small.

They do exist though, and the OLPC laptop is an example, so we should provide a configure time option to compile for MMX.
Comment 5 Søren Sandmann Pedersen 2007-06-20 09:38:37 UTC
Closed by mistake
Comment 6 Eugene St Leger 2007-09-20 05:42:31 UTC
I appear to have run in to this bug (I have an old AMD Duron), as detailed in another bug report:
https://bugs.freedesktop.org/show_bug.cgi?id=12398#c6

The debian bug report mentions a fix:
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=442829#59

The fix seems to be a workaround.  They seem to have removed the -msse CFLAG, as can be seen here:
http://ftp.debian.org/debian/pool/main/p/pixman/pixman_0.9.5-2.diff.gz

My impression is that it is desired that MMX and SSE should be supported *separately*.  For Gentoo users, it is obviously desirable that libpixman (AKA x11-libs/pixman-0.9.5) should respect the -mmmx and -msse CFLAGS.  I hacked the build system so that I could build a working xserver.  Properly fixing the makefiles is beyond me though.  I have filed a Gentoo bug:
http://bugs.gentoo.org/show_bug.cgi?id=193138
Comment 7 Søren Sandmann Pedersen 2008-10-31 11:43:31 UTC
This bug is obsolete since we don't use the MMX extensions at all anymore.

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.