On Sun, Nov 10, 2002 at 08:42:30PM +0100, Arpi wrote: > Hi, > > > > not too long ago I read on this list that you have to be extra careful > > > about using floating point in the kernel. Is the same true for MMX? If > > > so, would it be dangerous to compile a kernel module with -march=athlon? > > > AFAIK gcc-3.2 generates MMX instructions if the target CPU supports > > > them. > > > > If so, the kernel will crash, eventually. However, I thought that gcc > > wouldn't use MMX on its own (ie that you have to use the MMX data types to > > get MMX operations). Not true? > > Not. gcc (3.1+) will use MMX for integer, SSE for float code, even with > normal instructions, if both > - code optimization enabled (so it will recognize normal array operations > (example: for(i=0;i<15;i++) y[i]+=x[i];) and replace them with SIMD) > - SIMD usage enabled (-msse, -mmmx, -msse2, -m3dnow, > -mfpmath=sse (use SSE for float) / -mfpmath=sse,387 (use SSE and FPU in > parallel for float) > > so, by default it won't use SIMD.
In what did you based for the above statements? The gcc manual says that the -mmx and -msse only enable the built-in functions ( http://gcc.gnu.org/onlinedocs/gcc-3.2/gcc/i386-and-x86-64-Options.html ) > > Many other architectures use a compiler flag like "-msoft-float" or > > "-mno-fpu" to explicitly tell gcc that it cannot use the FP unit. If gcc > > starts using MMX on its own, we'll have to find the switch that tells it > > it has -mno-mmx, -mno-sse etc. > > > not to do that. You might want to ask some gcc people about it... On my kernel (2.4.20-pre10-mjc2) arch/i386/Makefile includes: ifdef CONFIG_MPENTIUMIII CFLAGS += -march=i686 endif ifdef CONFIG_MPENTIUMIII31 CFLAGS += -march=pentium3 -Os -mmmx -msse endif and of course that I've chosen the 2nd option (meant for >gcc-3.1) as I'm using gcc-3.2. But if what A'rpi says is true then this very wrong. José Fonseca __________________________________________________ Do You Yahoo!? Everything you'll ever need on one web page from News and Sport to Email and Music Charts http://uk.my.yahoo.com ------------------------------------------------------- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf _______________________________________________ Dri-devel mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/dri-devel