[Xorg] Re: Faster render with gcc 3.4 mmx intrinsics
Soeren Sandmann
sandmann at daimi.au.dk
Thu Jul 22 12:33:48 PDT 2004
Ian Romanick <idr at us.ibm.com> writes:
> Soeren Sandmann wrote:
>
> > This essentially *changes* DefaultCCOptions for all of the framebuffer
> > code, which is not very nice. The problem is
> > (a) MMX intrinsics don't work with -pedantic
> > (b) DefaultCCOptions includes -pedantic
> > (c) There is no way to _remove_ options from DefaultCCOptions
> > Also, the code is written in a way that needs gcc's default inline
> > heuristics to be turned off, but that's not a problem because you can
> > easily *add* options to DefaultCCOptions.
> > If someone has a clean solution, please let me know. Personally I am
> > inclined to just remove -pedantic from
> > DefaultCCOptions, because the option it isn't really that useful.
>
> Would it maybe be better to add something like StrictCCWarningOptions
> that include -pedantic and is used only where it will work (i.e.,
> every place that doesn't use MMX intrinsics)? I've run into similar
> irritations before.
The problem is it will work a lot of places, so as far as I can see
you have to modify a lot of Imakefiles to do that.
But anyway I managed to get it compiling with -pedantic (with a ton of
warnings, though), so I have committed it. The build system related
changes are straight forward now (see below).
Søren
Index: config/cf/xorg.cf
===================================================================
RCS file: /cvs/xorg/xc/config/cf/xorg.cf,v
retrieving revision 1.11
diff -u -r1.11 xorg.cf
--- config/cf/xorg.cf 6 Jul 2004 23:50:59 -0000 1.11
+++ config/cf/xorg.cf 22 Jul 2004 18:03:42 -0000
@@ -1403,6 +1403,14 @@
# else
# define Gcc28Warnings /* */
# endif
+# ifndef HasGcc34
+# if (((GccMajorVersion == 3) && (GccMinorVersion >= 4)) || \
+ (GccMajorVersion > 3))
+# define HasGcc34 YES
+# else
+# define HasGcc34 NO
+# endif
+# endif
# endif
# ifndef GccWarningOptions
# if XFree86Devel
Index: programs/Xserver/fb/Imakefile
===================================================================
RCS file: /cvs/xorg/xc/programs/Xserver/fb/Imakefile,v
retrieving revision 1.3
diff -u -r1.3 Imakefile
--- programs/Xserver/fb/Imakefile 30 Jun 2004 20:06:53 -0000 1.3
+++ programs/Xserver/fb/Imakefile 22 Jul 2004 18:04:01 -0000
@@ -3,6 +3,11 @@
XCOMM
XCOMM Id: Imakefile,v 1.1 1999/11/02 03:54:44 keithp Exp $
+#if defined(i386Architecture) && defined(HasGcc34) && HasGcc34
+SpecialCObjectRule(fbmmx,fbmmx.c,-mmmx -Winline --param inline-unit-growth=10000 \
+ --param large-function-growth=10000 -DUSE_GCC34_MMX)
+#endif
+
#if DoLoadableServer
#if !BuildModuleInSubdir
#define IHaveModules
@@ -59,7 +64,8 @@
fbutil.c \
fbwindow.c \
fb24_32.c \
- fbpict.c
+ fbpict.c \
+ fbmmx.c
OBJS = $(XFMODOBJ) \
fbarc.o \
@@ -93,7 +99,8 @@
fbutil.o \
fbwindow.o \
fb24_32.o \
- fbpict.o
+ fbpict.o \
+ fbmmx.o
INCLUDES = -I$(SERVERSRC)/fb -I$(SERVERSRC)/mi -I$(SERVERSRC)/include \
-I$(XINCLUDESRC) \
@@ -161,6 +168,7 @@
LinkSourceFile(fbtrap.c,LinkDirectory)
LinkSourceFile(fbutil.c,LinkDirectory)
LinkSourceFile(fbwindow.c,LinkDirectory)
+LinkSourceFile(fbmmx.c,LinkDirectory)
#endif
InstallDriverSDKLibraryModule(fb,$(DRIVERSDKMODULEDIR),.)
More information about the xorg
mailing list