1 Fix compile on powerpc64/powerpc64le w/ altivec
3 Correct the type of some vectors passed to vec_slo() or vec_sro(), which only
6 Signed-off-by: Sam Bobroff <sam.bobroff@au1.ibm.com>
8 --- a/src/dvbcsa_bs_altivec.h 2016-11-28 14:33:34.410021500 +1100
9 +++ b/src/dvbcsa_bs_altivec.h 2016-11-28 14:34:25.442238715 +1100
13 dvbcsa_bs_word_t x = vec_splat_u8(10);
14 - return (dvbcsa_bs_word_t)vec_add(vec_splat_u8(0x1),vec_rl(x,x));
15 + return (dvbcsa_bs_word_t)vec_add((dvbcsa_bs_word_t)vec_splat_u8(0x1),vec_rl(x,x));
18 dvbcsa_bs_word_t x = vec_splat_u8(4);
20 #define SHVAL_14 BS_VAL8(0e)
21 #define SHVAL_7 BS_VAL8(07)
23 -#define BS_SHL(a, n) ({ dvbcsa_bs_word_t x = SHVAL_##n; vec_sll(vec_slo((a), x), x); })
24 -#define BS_SHR(a, n) ({ dvbcsa_bs_word_t x = SHVAL_##n; vec_srl(vec_sro((a), x), x); })
25 -#define BS_SHL8(a, n) ({ dvbcsa_bs_word_t x = vec_splat_u8(n*2); x = vec_add(x,x); x = vec_add(x,x); vec_slo((a), x); })
26 -#define BS_SHR8(a, n) ({ dvbcsa_bs_word_t x = vec_splat_u8(n*2); x = vec_add(x,x); x = vec_add(x,x); vec_sro((a), x); })
27 +#define BS_SHL(a, n) ({ vector unsigned char x = SHVAL_##n; vec_sll(vec_slo((a), x), x); })
28 +#define BS_SHR(a, n) ({ vector unsigned char x = SHVAL_##n; vec_srl(vec_sro((a), x), x); })
29 +#define BS_SHL8(a, n) ({ vector unsigned char x = vec_splat_u8(n*2); x = vec_add(x,x); x = vec_add(x,x); vec_slo((a), x); })
30 +#define BS_SHR8(a, n) ({ vector unsigned char x = vec_splat_u8(n*2); x = vec_add(x,x); x = vec_add(x,x); vec_sro((a), x); })
32 #define BS_EXTRACT8(a, n) ((uint8_t*)&(a))[15 - (n)]