commit 030d7a7ca297002ee2f77091f3d90a2458a3c04b
parent 1b1ea7b04d5b5635c877b6e66ea21b168e0a9fc7
Author: vaplv <vaplv@free.fr>
Date: Fri, 24 Oct 2014 14:45:29 +0200
Add and test the v4f_andnot function
Diffstat:
2 files changed, 14 insertions(+), 0 deletions(-)
diff --git a/src/sse/ssef.h b/src/sse/ssef.h
@@ -231,6 +231,12 @@ v4f_and(const v4f_T v0, const v4f_T v1)
}
static FINLINE v4f_T
+v4f_andnot(const v4f_T v0, const v4f_T v1)
+{
+ return _mm_andnot_ps(v0, v1);
+}
+
+static FINLINE v4f_T
v4f_xor(const v4f_T v0, const v4f_T v1)
{
return _mm_xor_ps(v0, v1);
diff --git a/src/test_v4f.c b/src/test_v4f.c
@@ -110,6 +110,14 @@ main(int argc, char** argv)
cast.f[2] = v4f_z(k); CHECK(cast.i[2], (int32_t)0xFFFFFFFF);
cast.f[3] = v4f_w(k); CHECK(cast.i[3], (int32_t)0x00000000);
+ i = v4f_mask(0x00010203, 0x04050607, 0x08090A0B, 0x0C0D0E0F);
+ j = v4f_mask(0x01020401, 0x70605040, 0x0F1F2F3F, 0x00000000);
+ k = v4f_andnot(i, j);
+ cast.f[0] = v4f_x(k); CHECK(cast.i[0], 0x01020400);
+ cast.f[1] = v4f_y(k); CHECK(cast.i[1], 0x70605040);
+ cast.f[2] = v4f_z(k); CHECK(cast.i[2], 0x07162534);
+ cast.f[3] = v4f_w(k); CHECK(cast.i[3], 0x00000000);
+
i = v4f_set(1.f, 2.f, 3.f, 4.f);
j = v4f_set(5.f, 6.f, 7.f, 8.f);
k = v4f_sel(i, j, v4f_mask(~0, 0, 0, ~0));