annotate test/test_shift.h @ 25:92156fe32755

impl/ppc/altivec: update to new implementation the signed average function is wrong; it needs to round up the number when only one of them is odd, but that doesn't necessarily seem to be true because altivec is weird, and that's what we need to emulate the quirks for. ugh. also the altivec backend uses the generic functions instead of fallbacks because it does indeed use the exact same memory structure as the generic implementation...
author Paper <paper@tflc.us>
date Sun, 24 Nov 2024 11:15:59 +0000
parents e26874655738
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
18
cf04071d2148 impl: initial NEON support; test: verify bit shifting functions
Paper <paper@tflc.us>
parents:
diff changeset
1 static int test_shift(void)
cf04071d2148 impl: initial NEON support; test: verify bit shifting functions
Paper <paper@tflc.us>
parents:
diff changeset
2 {
cf04071d2148 impl: initial NEON support; test: verify bit shifting functions
Paper <paper@tflc.us>
parents:
diff changeset
3 int ret = 0;
cf04071d2148 impl: initial NEON support; test: verify bit shifting functions
Paper <paper@tflc.us>
parents:
diff changeset
4
cf04071d2148 impl: initial NEON support; test: verify bit shifting functions
Paper <paper@tflc.us>
parents:
diff changeset
5 ret |= (vec_lrshift(0xFFFFFFFF, 16) != 0xFFFF);
cf04071d2148 impl: initial NEON support; test: verify bit shifting functions
Paper <paper@tflc.us>
parents:
diff changeset
6 ret |= (vec_llshift(0xFFFF, 16) != 0xFFFF0000);
cf04071d2148 impl: initial NEON support; test: verify bit shifting functions
Paper <paper@tflc.us>
parents:
diff changeset
7 ret |= (vec_urshift(0xFFFFFFFF, 16) != 0xFFFF);
cf04071d2148 impl: initial NEON support; test: verify bit shifting functions
Paper <paper@tflc.us>
parents:
diff changeset
8 ret |= (vec_ulshift(0xFFFF, 16) != 0xFFFF0000);
cf04071d2148 impl: initial NEON support; test: verify bit shifting functions
Paper <paper@tflc.us>
parents:
diff changeset
9 ret |= (vec_rshift(-0xFFFF, 8) != -0x100);
cf04071d2148 impl: initial NEON support; test: verify bit shifting functions
Paper <paper@tflc.us>
parents:
diff changeset
10 ret |= (vec_lshift(-0xFFFF, 8) != -0xFFFF00);
cf04071d2148 impl: initial NEON support; test: verify bit shifting functions
Paper <paper@tflc.us>
parents:
diff changeset
11
cf04071d2148 impl: initial NEON support; test: verify bit shifting functions
Paper <paper@tflc.us>
parents:
diff changeset
12 return ret;
cf04071d2148 impl: initial NEON support; test: verify bit shifting functions
Paper <paper@tflc.us>
parents:
diff changeset
13 }