comparison ppc/util_altivec.h @ 6368:71d8c1fd3d88 libavcodec

Refactor vcprm and vcii macros by using the AVV macro.
author diego
date Mon, 18 Feb 2008 23:01:26 +0000
parents 3b73d2fbc9e4
children 266d4949aa15
comparison
equal deleted inserted replaced
6367:f02434b252ce 6368:71d8c1fd3d88
41 #define WORD_s0 0x10,0x11,0x12,0x13 41 #define WORD_s0 0x10,0x11,0x12,0x13
42 #define WORD_s1 0x14,0x15,0x16,0x17 42 #define WORD_s1 0x14,0x15,0x16,0x17
43 #define WORD_s2 0x18,0x19,0x1a,0x1b 43 #define WORD_s2 0x18,0x19,0x1a,0x1b
44 #define WORD_s3 0x1c,0x1d,0x1e,0x1f 44 #define WORD_s3 0x1c,0x1d,0x1e,0x1f
45 45
46 #ifdef __APPLE_CC__ 46 #define vcprm(a,b,c,d) (const vector unsigned char)AVV(WORD_ ## a, WORD_ ## b, WORD_ ## c, WORD_ ## d)
47 #define vcprm(a,b,c,d) (const vector unsigned char)(WORD_ ## a, WORD_ ## b, WORD_ ## c, WORD_ ## d) 47 #define vcii(a,b,c,d) (const vector float)AVV(FLOAT_ ## a, FLOAT_ ## b, FLOAT_ ## c, FLOAT_ ## d)
48 #else
49 #define vcprm(a,b,c,d) (const vector unsigned char){WORD_ ## a, WORD_ ## b, WORD_ ## c, WORD_ ## d}
50 #endif
51 48
52 // vcprmle is used to keep the same index as in the SSE version. 49 // vcprmle is used to keep the same index as in the SSE version.
53 // it's the same as vcprm, with the index inversed 50 // it's the same as vcprm, with the index inversed
54 // ('le' is Little Endian) 51 // ('le' is Little Endian)
55 #define vcprmle(a,b,c,d) vcprm(d,c,b,a) 52 #define vcprmle(a,b,c,d) vcprm(d,c,b,a)
57 // used to build inverse/identity vectors (vcii) 54 // used to build inverse/identity vectors (vcii)
58 // n is _n_egative, p is _p_ositive 55 // n is _n_egative, p is _p_ositive
59 #define FLOAT_n -1. 56 #define FLOAT_n -1.
60 #define FLOAT_p 1. 57 #define FLOAT_p 1.
61 58
62
63 #ifdef __APPLE_CC__
64 #define vcii(a,b,c,d) (const vector float)(FLOAT_ ## a, FLOAT_ ## b, FLOAT_ ## c, FLOAT_ ## d)
65 #else
66 #define vcii(a,b,c,d) (const vector float){FLOAT_ ## a, FLOAT_ ## b, FLOAT_ ## c, FLOAT_ ## d}
67 #endif
68 59
69 // Transpose 8x8 matrix of 16-bit elements (in-place) 60 // Transpose 8x8 matrix of 16-bit elements (in-place)
70 #define TRANSPOSE8(a,b,c,d,e,f,g,h) \ 61 #define TRANSPOSE8(a,b,c,d,e,f,g,h) \
71 do { \ 62 do { \
72 vector signed short A1, B1, C1, D1, E1, F1, G1, H1; \ 63 vector signed short A1, B1, C1, D1, E1, F1, G1, H1; \