This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
SSE scalar/float transition
- From: tbp <tbptbp at gmail dot com>
- To: gcc at gcc dot gnu dot org
- Date: Mon, 24 Jan 2005 21:36:44 +0100
- Subject: SSE scalar/float transition
- Reply-to: tbp <tbptbp at gmail dot com>
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).