comparison test/test_shift.h @ 37:4b5a557aa64f

*: turns out extern is a practical joke. rewrite to be always inline again the sample benchmark performs about 3x as well with optimizations disabled :)
author Paper <paper@tflc.us>
date Sat, 26 Apr 2025 01:04:35 -0400
parents 677c03c382b8
children
comparison
equal deleted inserted replaced
36:677c03c382b8 37:4b5a557aa64f
1 static int test_shift(void) 1 static int test_shift(void)
2 { 2 {
3 int ret = 0; 3 int ret = 0;
4 4
5 ret |= (vec_ulrshift(0xFFFFFFFF, 16) != 0xFFFF);
6 ret |= (vec_ullshift(0xFFFF, 16) != 0xFFFF0000);
7 ret |= (vec_lrshift(0xFFFFFFFF, 16) != 0xFFFF);
8 ret |= (vec_llshift(0xFFFF, 16) != 0xFFFF0000);
9 ret |= (vec_urshift(0xFFFFFFFF, 16) != 0xFFFF); 5 ret |= (vec_urshift(0xFFFFFFFF, 16) != 0xFFFF);
10 ret |= (vec_ulshift(0xFFFF, 16) != 0xFFFF0000); 6 ret |= (vec_ulshift(0xFFFF, 16) != 0xFFFF0000);
11 ret |= (vec_rshift(-0xFFFF, 8) != -0x100); 7 ret |= (vec_rshift(-0xFFFF, 8) != -0x100);
12 ret |= (vec_lshift(-0xFFFF, 8) != -0xFFFF00); 8 ret |= (vec_lshift(-0xFFFF, 8) != -0xFFFF00);
13 9