comparison src/madplug/SFMT-alti.c @ 928:88bf800eba26 trunk

[svn] - use C-style vectors instead of apple's stuff
author nenolod
date Mon, 09 Apr 2007 08:50:46 -0700
parents fa7f7cd029af
children
comparison
equal deleted inserted replaced
927:b9cbd2e62186 928:88bf800eba26
9 inline static vector unsigned int vec_recursion(vector unsigned int a, 9 inline static vector unsigned int vec_recursion(vector unsigned int a,
10 vector unsigned int b, 10 vector unsigned int b,
11 vector unsigned int c, 11 vector unsigned int c,
12 vector unsigned int d) { 12 vector unsigned int d) {
13 13
14 const vector unsigned int sl1 = (vector unsigned int)(SL1, SL1, SL1, SL1); 14 const vector unsigned int sl1 = (vector unsigned int){SL1, SL1, SL1, SL1};
15 const vector unsigned int sr1 = (vector unsigned int)(SR1, SR1, SR1, SR1); 15 const vector unsigned int sr1 = (vector unsigned int){SR1, SR1, SR1, SR1};
16 #ifdef ONLY64 16 #ifdef ONLY64
17 const vector unsigned int mask = (vector unsigned int) 17 const vector unsigned int mask = (vector unsigned int)
18 (MSK2, MSK1, MSK4, MSK3); 18 {MSK2, MSK1, MSK4, MSK3};
19 const vector unsigned char perm_sl = ALTI_SL2_PERM64; 19 const vector unsigned char perm_sl = ALTI_SL2_PERM64;
20 const vector unsigned char perm_sr = ALTI_SR2_PERM64; 20 const vector unsigned char perm_sr = ALTI_SR2_PERM64;
21 #else 21 #else
22 const vector unsigned int mask = (vector unsigned int) 22 const vector unsigned int mask = (vector unsigned int)
23 (MSK1, MSK2, MSK3, MSK4); 23 {MSK1, MSK2, MSK3, MSK4};
24 const vector unsigned char perm_sl = ALTI_SL2_PERM; 24 const vector unsigned char perm_sl = ALTI_SL2_PERM;
25 const vector unsigned char perm_sr = ALTI_SR2_PERM; 25 const vector unsigned char perm_sr = ALTI_SR2_PERM;
26 #endif 26 #endif
27 vector unsigned int v, w, x, y, z; 27 vector unsigned int v, w, x, y, z;
28 x = vec_perm(a, (vector unsigned int)perm_sl, perm_sl); 28 x = vec_perm(a, (vector unsigned int)perm_sl, perm_sl);
115 * @param size size of 128-bit array. 115 * @param size size of 128-bit array.
116 */ 116 */
117 inline static void swap(w128_t array[], int size) { 117 inline static void swap(w128_t array[], int size) {
118 int i; 118 int i;
119 const vector unsigned char perm = (vector unsigned char) 119 const vector unsigned char perm = (vector unsigned char)
120 (4, 5, 6, 7, 0, 1, 2, 3, 12, 13, 14, 15, 8, 9, 10, 11); 120 {4, 5, 6, 7, 0, 1, 2, 3, 12, 13, 14, 15, 8, 9, 10, 11};
121 121
122 for (i = 0; i < size; i++) { 122 for (i = 0; i < size; i++) {
123 array[i].s = vec_perm(array[i].s, (vector unsigned int)perm, perm); 123 array[i].s = vec_perm(array[i].s, (vector unsigned int)perm, perm);
124 } 124 }
125 } 125 }