commit dacd06d46b1f09b1a8cfcf0c07802f8bd2708bf1
parent 7b0482c44275d0fff370f558131b590de3a19012
Author: vaplv <vaplv@free.fr>
Date: Fri, 24 Oct 2014 14:28:48 +0200
Remove the useless v4f_<x|y|z|w>mask functions
Change the implementation of the v4f_<mask|true|false> functions
Diffstat:
1 file changed, 2 insertions(+), 36 deletions(-)
diff --git a/src/sse/ssef.h b/src/sse/ssef.h
@@ -86,19 +86,13 @@ v4f_zero(void)
static FINLINE v4f_T
v4f_mask(const int32_t x, const int32_t y, const int32_t z, const int32_t w)
{
- union { int32_t i[4]; float f[4]; } mask;
- mask.i[0] = x;
- mask.i[1] = y;
- mask.i[2] = z;
- mask.i[3] = w;
- return v4f_set(mask.f[0], mask.f[1], mask.f[2], mask.f[3]);
+ return _mm_castsi128_ps(_mm_set_epi32(w, z, y, x));
}
static FINLINE v4f_T
v4f_true(void)
{
- const union { int32_t i; float f; } mask = { ~0 };
- return v4f_set1(mask.f);
+ return _mm_castsi128_ps(_mm_set1_epi32(~0));
}
static FINLINE v4f_T
@@ -107,34 +101,6 @@ v4f_false(void)
return v4f_zero();
}
-static FINLINE v4f_T
-v4f_xmask(void)
-{
- const union { int32_t i; float f; } mask = { ~0 };
- return v4f_set(mask.f, 0.f, 0.f, 0.f);
-}
-
-static FINLINE v4f_T
-v4f_ymask(void)
-{
- const union { int32_t i; float f; } mask = { ~0 };
- return v4f_set(0.f, mask.f, 0.f, 0.f);
-}
-
-static FINLINE v4f_T
-v4f_zmask(void)
-{
- const union { int32_t i; float f; } mask = { ~0 };
- return v4f_set(0.f, 0.f, mask.f, 0.f);
-}
-
-static FINLINE v4f_T
-v4f_wmask(void)
-{
- const union { int32_t i; float f; } mask = { ~0 };
- return v4f_set(0.f, 0.f, 0.f, mask.f);
-}
-
/*******************************************************************************
* Extract components
******************************************************************************/