On Tue, May 10, 2005 at 04:53:55PM +0200, Nils Philippsen wrote:
> c) if you use -msse2 in CFLAGS for all files, you can't run
the latest
> GIMP on e.g. Pentium2, or pre-x86_64 AMD chips.
> -msse2 should be ONLY used on sources that have SSE/SSE2 stuff in it,
> and GIMP should make sure that no routine from those sources will be
> ever called on pre-SSE2 chips
According to the gcc man page, you need to use "-mfpmath=sse" if you
want to get SSE/SSE2 instructions generated from FP code. As I
No. -msse resp. -msse2 says that SSE resp. SSE2 instructions are available
and can be used. So, with -msse2 you can use SSE2 builtins, you can
use those regs in __asm statement clobbers/regs and GCC if it decides
it is worthwhile can use the SSE2 registers/instructions (say with
autovectorization, or with high register preasure to move data around,
etc.).
-mfpmath=sse uses the SSE2 unit for float/double arithmetics.
If the only place that you want to enable -msse2 for are the clobber
lists of __asm statements, then perhaps best would be to conditionalize
them:
__asm ("something" : ... : ... :
#ifdef __SSE2__
"xmm0", "xmm1"
#endif
);
etc., because without -msse2 (resp. -msse (__SSE__ macro)), the registers
are not known to the compiler, so there is no point to tell the compiler
about them.
Jakub