diff test/test_shift.h @ 18:cf04071d2148

impl: initial NEON support; test: verify bit shifting functions
author Paper <paper@tflc.us>
date Wed, 20 Nov 2024 14:33:19 -0500
parents
children e26874655738
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/test_shift.h	Wed Nov 20 14:33:19 2024 -0500
@@ -0,0 +1,15 @@
+static int test_shift(void)
+{
+	int ret = 0;
+
+	ret |= (vec_ulrshift(0xFFFFFFFF, 16) != 0xFFFF);
+	ret |= (vec_ullshift(0xFFFF, 16) != 0xFFFF0000);
+	ret |= (vec_lrshift(0xFFFFFFFF, 16) != 0xFFFF);
+	ret |= (vec_llshift(0xFFFF, 16) != 0xFFFF0000);
+	ret |= (vec_urshift(0xFFFFFFFF, 16) != 0xFFFF);
+	ret |= (vec_ulshift(0xFFFF, 16) != 0xFFFF0000);
+	ret |= (vec_rshift(-0xFFFF, 8) != -0x100);
+	ret |= (vec_lshift(-0xFFFF, 8) != -0xFFFF00);
+
+	return ret;
+}