This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

SSE scalar/float transition


Hello.

Didn't have much success last time i've asked but... 

As far as i know, right now,  the only way to "cast" an SSE scalar to
a float is to go thru a store/load; typical case:

void scalar_rsqrt_nr(float &arg) {
		const float val = arg;
		float approx;
		_mm_store_ss(&approx, _mm_rsqrt_ss(_mm_load_ss(&val)));

		arg = (3.f - ((approx*approx) * val)) * approx * 0.5f;
}

Hopefully recent gcc4 eliminate those useless store/load, but i wonder
if there's a way to write that in a cleaner way (while dodging the
"can't convert between vector values of different size" issue).


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]