From kde-kimageshop Mon Dec 11 21:22:46 2006 From: Cyrille Berger Date: Mon, 11 Dec 2006 21:22:46 +0000 To: kde-kimageshop Subject: Re: gcc autovectorize Message-Id: <20061211212246.GB15992 () diwi ! org> X-MARC-Message: https://marc.info/?l=kde-kimageshop&m=116591635104447 > 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! well I have tried and never found the option to pass gcc to make it understand to use the simd instructions ;) The only problem is that it will only benefit our user that build krita themselves (mostly gentoo users), and those of them which use the relevant gcc option (only gentoo users). Two problems: 1) those options are dangerous, unfortunately very often they will make most C++ application even more buggy and crashy than they allready are (and as krita is far to have achieve a full level of stability, this is a bit annoying) 2) most of our user don't build krita themselves, and therefor use the distribution option for compilation, and most distribution doesn't build with those optimization (if they even build with mmx instructions enabled) So the plan is to make a direct usuage of simd instructions and to offer a run time check like, for instance, the gimp and mplayer do. But we have yet to decide the API to achieve that goal. There was a discution about this, but no decision was taken :'( That's said, nothing prevent us to write our loop in such a way that the autovector of gcc transform them to use simd. Except that I would like to have the possiblity to ask user which report crash to easily disable those optimizations. -- Cyrille Berger _______________________________________________ kimageshop mailing list kimageshop@kde.org https://mail.kde.org/mailman/listinfo/kimageshop