On Tue, 2005-05-10 at 08:26 -0400, Jakub Jelinek wrote:
On Tue, May 10, 2005 at 02:19:32PM +0200, Ralf Ertzinger wrote:
> On Tue, May 10, 2005 at 08:12:35AM -0400, Build System wrote:
>
> > - on x86 and x86_64, use -msse and -msse2 to accomodate newer compilers
>
> Not that I want to revive the whole .i386.rpm vs. i686.rpm discussion,
> but... how does gcc handle these flags? Does it build alternative
> code for processors that do not have these features? Or does the binary
> not run on anything below PII or compatible?
The way it is done in current rawhide's GIMP is definitely wrong.
%ifarch %ix86 x86_64
CFLAGS="%optflags -msse -msse2" CXXFLAGS="%optflags -msse -msse2" \
%endif
%configure \
a) on x86-64 this is unnecessary, all x86-64's have -msse2 by default
b) -msse2 implies -msse
ACK
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
understand the manpage, "-msse" and the like only _enable_ its use in
inline assembler code. GIMP does check whether MMX/SSE etc. are
available when starting and only uses the optimized code paths if
possible.
Nils
--
Nils Philippsen / Red Hat / nphilipp(a)redhat.com
"They that can give up essential liberty to obtain a little temporary
safety deserve neither liberty nor safety." -- B. Franklin, 1759
PGP fingerprint: C4A8 9474 5C4C ADE3 2B8F 656D 47D8 9B65 6951 3011