On Sat, 28 Sep 2002, Alex Beregszaszi wrote:

> Hi,
>
> > > > Does anyone know, if gcc 3.x already supports MMX, MMX2, SSE and/or SSE2 ?
> > > >
> > > > If yes, then there's absolutely no need to fiddle with asm code around.
> > > >
> > > > One way is simply to use Intels C/C++ compiler to make use of these x86
> > > > extensions, but it is not as widely used and available as gcc.
> >
> > > icc isn't that cool one, hand optimized code is much better
> >
> > Nowadays, c compiler optimizes the code that good, that you can't gain
> > much with handoptimized asm code, except your code uses asm commands, the
> > c compiler is not aware of.
>
> In the most applications that's true, but for multimedia applications not.

> > I'd prefer to let do this job do the c compiler, whereever possible.

> but you couldn't force the users to use icc (i've never used that and
> i'm not wanting too)

That's true. That's why I asked, whether gcc supports it or not.

> > > > Thus, if gcc 3.x supports them, then people just need to upgrade...
> >
> > > do not prefer gcc3.x over gcc2.95.4 especially by graphical libs/apps
> > > gcc3 (and gcc 2.96.x) is a bit buggy yet with graphical codes.
> >
> > In other words: gcc 3.x supports MMX, MMX2, SSE, etc. but this code is
> > buggy. Is that right?
> dunno
>
> gcc 2.95.4 supports MMX/SSE too.. else you wouldn't able to compile
> the sources. (here gcc means gnu compiler collection, so GAS supports
> the MMX/SSE opcodes)

Yes, I am aware of that. See below.

> The newer gcc versions (such as 3.x series) do support for example
> Altivec and MVI instructions but older ones not.

Hey cool! Darwin 6.x (the BSD-subsystem of Mac OS X 10.2) comes with gcc
3.1, which I have on my PowerBook G4. But I fear, you mean the GAS, not
the c compiler itself, right?

That's the point what I wanna know: If the GNU C compiler itself supports
MMX/SSE/Altivec/etc. or not.

> > > It makes more sense to include support for MMX/SSE optimized codes.
> >
> > Yes, unless the c compiler generates code, that is as good as the hand
> > optimized one. See above.
>
> I don't believe that c compilers can do everything.

Right. And (multimedia) apps can't do either...

> After our independent home measurances with gcc 2.95.x and 3.0.x/3.1.x
> it was clear: gcc series-3 needs more time to compile the source
> (becouse of the optimization routines) and makes a speedup about -4 to
> +4 % ;) Not that much i think.

hmm... strange.

> Hmm, have a look at libmpeg2,liba52,ffmpeg/libavcodec or
> mplayer/postproc sources, they're heavily optimized with runtime cpu
> detection. They've got the original C code in one file, and the
> optimized ones in others.

Ok, that's better than the #ifdef...#endif blocks. But you can't get rid
of maintaining the same algorithm multiple times in multiple
implementations.


CU,

Christoph Egger
E-Mail: [EMAIL PROTECTED]

Reply via email to