comparison ppc/dsputil_altivec.h @ 1033:b4172ff70d27 libavcodec

Altivec on non darwin systems patch by Romain Dolbeau
author bellard
date Sun, 26 Jan 2003 22:29:47 +0000
parents 9cc1031e1864
children b32afefe7d33
comparison
equal deleted inserted replaced
1032:8f440ca8e0b0 1033:b4172ff70d27
61 #define WORD_s0 0x10,0x11,0x12,0x13 61 #define WORD_s0 0x10,0x11,0x12,0x13
62 #define WORD_s1 0x14,0x15,0x16,0x17 62 #define WORD_s1 0x14,0x15,0x16,0x17
63 #define WORD_s2 0x18,0x19,0x1a,0x1b 63 #define WORD_s2 0x18,0x19,0x1a,0x1b
64 #define WORD_s3 0x1c,0x1d,0x1e,0x1f 64 #define WORD_s3 0x1c,0x1d,0x1e,0x1f
65 65
66 #ifdef CONFIG_DARWIN
66 #define vcprm(a,b,c,d) (const vector unsigned char)(WORD_ ## a, WORD_ ## b, WORD_ ## c, WORD_ ## d) 67 #define vcprm(a,b,c,d) (const vector unsigned char)(WORD_ ## a, WORD_ ## b, WORD_ ## c, WORD_ ## d)
68 #else
69 #define vcprm(a,b,c,d) (const vector unsigned char){WORD_ ## a, WORD_ ## b, WORD_ ## c, WORD_ ## d}
70 #endif
67 71
68 // vcprmle is used to keep the same index as in the SSE version. 72 // vcprmle is used to keep the same index as in the SSE version.
69 // it's the same as vcprm, with the index inversed 73 // it's the same as vcprm, with the index inversed
70 // ('le' is Little Endian) 74 // ('le' is Little Endian)
71 #define vcprmle(a,b,c,d) vcprm(d,c,b,a) 75 #define vcprmle(a,b,c,d) vcprm(d,c,b,a)
73 // used to build inverse/identity vectors (vcii) 77 // used to build inverse/identity vectors (vcii)
74 // n is _n_egative, p is _p_ositive 78 // n is _n_egative, p is _p_ositive
75 #define FLOAT_n -1. 79 #define FLOAT_n -1.
76 #define FLOAT_p 1. 80 #define FLOAT_p 1.
77 81
82
83 #ifdef CONFIG_DARWIN
78 #define vcii(a,b,c,d) (const vector float)(FLOAT_ ## a, FLOAT_ ## b, FLOAT_ ## c, FLOAT_ ## d) 84 #define vcii(a,b,c,d) (const vector float)(FLOAT_ ## a, FLOAT_ ## b, FLOAT_ ## c, FLOAT_ ## d)
85 #else
86 #define vcii(a,b,c,d) (const vector float){FLOAT_ ## a, FLOAT_ ## b, FLOAT_ ## c, FLOAT_ ## d}
87 #endif
79 88
80 #else /* HAVE_ALTIVEC */ 89 #else /* HAVE_ALTIVEC */
81 #ifdef ALTIVEC_USE_REFERENCE_C_CODE 90 #ifdef ALTIVEC_USE_REFERENCE_C_CODE
82 #error "I can't use ALTIVEC_USE_REFERENCE_C_CODE if I don't use HAVE_ALTIVEC" 91 #error "I can't use ALTIVEC_USE_REFERENCE_C_CODE if I don't use HAVE_ALTIVEC"
83 #endif /* ALTIVEC_USE_REFERENCE_C_CODE */ 92 #endif /* ALTIVEC_USE_REFERENCE_C_CODE */