From kde-kimageshop Mon Dec 11 21:18:11 2006 From: "Burdick, Thomas Edward" Date: Mon, 11 Dec 2006 21:18:11 +0000 To: kde-kimageshop Subject: Re: gcc autovectorize Message-Id: <3607.131.193.13.110.1165871891.squirrel () webmail ! uic ! edu> X-MARC-Message: https://marc.info/?l=kde-kimageshop&m=116591635104446 >From the website http://www.gnu.org/software/gcc/projects/tree-ssa/vectorization.html -ftree-vectorize then enable the simd extensions (maybe use cmake to check if these are available? or use a runtime check like they do in mplayer?) -msse or -msse2 or -msse3 or -maltivec Then if you want to see what loops are vectorized, and why if they are not -ftree-vectorizer-verbose=5 It works fairly well on simple loops like I mentioned before. The problem loops are ones that can escape before some known end, or if there's an unknown end. The website has some good examples of what works and what doesn't. Even for the things that don't work, this doesn't mean that you can't use the vector operations, it just means they won't be automatically done for you. GCC has some fairly generic functions that work with sse/altivec and possibly others. They are gcc specific though. I'm curious to know if gnome uses the simd instructions at all? -Tom On Mon, December 11, 2006 3:09 pm, Boudewijn Rempt wrote: > On Monday 11 December 2006 17:01, Tom Burdick wrote: >> I thought it worthy of mentioning, that in all of the newest GCC's (4.x >> and >> higher) there is an autovectorizing option. I've been using this in a >> project of my own and its made certain loops significantly faster. I'd >> suggest possibly trying krita with the flags this way to see what gcc >> vectorizes or not. Notably, it will automatically take a loop like >> >> for(int i = 0; i < 64; i++) { >> a[i] = b[i]*c[i]; >> } >> >> and instead use whatever simd instructions you have to eliminate a good >> number of iterations. >> >> If you've already tried this out, or are already using the simd >> instructions disregard! > > That's a good point, we don't do this. What do we need to do to enable it? > > -- > Boudewijn Rempt > http://www.valdyas.org/fading/index.cgi > _______________________________________________ > kimageshop mailing list > kimageshop@kde.org > https://mail.kde.org/mailman/listinfo/kimageshop > _______________________________________________ kimageshop mailing list kimageshop@kde.org https://mail.kde.org/mailman/listinfo/kimageshop