gcc autovectorize

Burdick, Thomas Edward tburdi1 at uic.edu
Thu Dec 14 01:09:48 CET 2006


Hmm.. well I suppose in complicated cases it may cause a problem. It'd be
interesting too know why exactly. Anyways, it was just a thought, I don't
use gentoo myself, I hate compiling my own software as it takes forever
(especially kde...) so I completely understand the mentality of runtime
checks.

Perhaps a way to deal with the runtime checks would be to load an
optimized shared library depending on what your machine is capable of. I
believe thats how the gimp does it for composition, which is the only
thing I saw using sse when I grepped their source. Maybe instead of
optimizing the loops, create generic vector operations optimized for each
possible configuration, this particular shared library would be pretty
small, could be heavily tested for bugs, and be very fast.

That really depends on how many operations of the sort of simple vector
operations happen in krita though whether it would be worth while
writting.

I believe Intel, AMD, and HP all have math libraries much like what I'm
talking about, however none of them are open source from what I saw. I
don't think they check at runtime either, more likely compile time.

So perhaps a vector library that allows all of the common operations to
happen on different primitive types using purely C like functions,
optimized for different types of hardware, would be of use?

It would surely make a difference for people editing large images, or
images using floating point numbers for pixel values.

-Tom

On Wed, December 13, 2006 1:29 pm, Cyrille Berger wrote:
>> It may also let you (the developer) know how it may effect
>> performance without dealing with hand coding it just yet.
>
>
>> In which cases
>> did you find it buggy? I would think it wouldn't create any more bugs
>> than
>> were already existant... but perhaps its doing something funny, and if
>> it
>> is, perhaps the people writting the vectorizer should be notified.
> just googling a bit
> http://www.google.com/search?q=ftree-vectorize&ie=UTF-8&oe=UTF-8
>
> even the man page of gcc for most of those option (not about
> -ftree-vectorize) gives a lot of warning on usuage of such functions.
> I haven't played much with -ftree-vectorize so I can't speak
> specifically about this option. But usually, when something isn't
> enabled by one of the -O option of gcc, it's because either the gcc
> folks consider it unstable, either it doesn't necesserellay give a
> performance boost. In this case, I consider the former. (and even if
> it's in -O3, it's risky, and yes I have experienced reproductible weird
> crash at -O3 not apparing at -O2).
>
> That's said, there are quiet a lot of crash in krita which are caused
> by the code and not gcc ;)
>
> --
> Cyrille Berger
>
> _______________________________________________
> kimageshop mailing list
> kimageshop at kde.org
> https://mail.kde.org/mailman/listinfo/kimageshop
>




More information about the kimageshop mailing list