AltiVec/PacketMath.h
Go to the documentation of this file.
1 // This file is part of Eigen, a lightweight C++ template library
2 // for linear algebra.
3 //
4 // Copyright (C) 2008 Konstantinos Margaritis <markos@codex.gr>
5 //
6 // Eigen is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU Lesser General Public
8 // License as published by the Free Software Foundation; either
9 // version 3 of the License, or (at your option) any later version.
10 //
11 // Alternatively, you can redistribute it and/or
12 // modify it under the terms of the GNU General Public License as
13 // published by the Free Software Foundation; either version 2 of
14 // the License, or (at your option) any later version.
15 //
16 // Eigen is distributed in the hope that it will be useful, but WITHOUT ANY
17 // WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
18 // FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License or the
19 // GNU General Public License for more details.
20 //
21 // You should have received a copy of the GNU Lesser General Public
22 // License and a copy of the GNU General Public License along with
23 // Eigen. If not, see <http://www.gnu.org/licenses/>.
24 
25 #ifndef EIGEN_PACKET_MATH_ALTIVEC_H
26 #define EIGEN_PACKET_MATH_ALTIVEC_H
27 
28 namespace Eigen {
29 
30 namespace internal {
31 
32 #ifndef EIGEN_CACHEFRIENDLY_PRODUCT_THRESHOLD
33 #define EIGEN_CACHEFRIENDLY_PRODUCT_THRESHOLD 4
34 #endif
35 
36 #ifndef EIGEN_HAS_FUSE_CJMADD
37 #define EIGEN_HAS_FUSE_CJMADD 1
38 #endif
39 
40 // NOTE Altivec has 32 registers, but Eigen only accepts a value of 8 or 16
41 #ifndef EIGEN_ARCH_DEFAULT_NUMBER_OF_REGISTERS
42 #define EIGEN_ARCH_DEFAULT_NUMBER_OF_REGISTERS 16
43 #endif
44 
45 typedef __vector float Packet4f;
46 typedef __vector int Packet4i;
47 typedef __vector unsigned int Packet4ui;
48 typedef __vector __bool int Packet4bi;
49 typedef __vector short int Packet8i;
50 typedef __vector unsigned char Packet16uc;
51 
52 // We don't want to write the same code all the time, but we need to reuse the constants
53 // and it doesn't really work to declare them global, so we define macros instead
54 
55 #define _EIGEN_DECLARE_CONST_FAST_Packet4f(NAME,X) \
56  Packet4f p4f_##NAME = (Packet4f) vec_splat_s32(X)
57 
58 #define _EIGEN_DECLARE_CONST_FAST_Packet4i(NAME,X) \
59  Packet4i p4i_##NAME = vec_splat_s32(X)
60 
61 #define _EIGEN_DECLARE_CONST_Packet4f(NAME,X) \
62  Packet4f p4f_##NAME = pset1<Packet4f>(X)
63 
64 #define _EIGEN_DECLARE_CONST_Packet4f_FROM_INT(NAME,X) \
65  Packet4f p4f_##NAME = vreinterpretq_f32_u32(pset1<int>(X))
66 
67 #define _EIGEN_DECLARE_CONST_Packet4i(NAME,X) \
68  Packet4i p4i_##NAME = pset1<Packet4i>(X)
69 
70 #define DST_CHAN 1
71 #define DST_CTRL(size, count, stride) (((size) << 24) | ((count) << 16) | (stride))
72 
73 // Define global static constants:
74 static Packet4f p4f_COUNTDOWN = { 3.0, 2.0, 1.0, 0.0 };
75 static Packet4i p4i_COUNTDOWN = { 3, 2, 1, 0 };
76 static Packet16uc p16uc_REVERSE = {12,13,14,15, 8,9,10,11, 4,5,6,7, 0,1,2,3};
77 static Packet16uc p16uc_FORWARD = vec_lvsl(0, (float*)0);
78 static Packet16uc p16uc_DUPLICATE = {0,1,2,3, 0,1,2,3, 4,5,6,7, 4,5,6,7};
79 
83 static _EIGEN_DECLARE_CONST_FAST_Packet4i(MINUS16,-16);
84 static _EIGEN_DECLARE_CONST_FAST_Packet4i(MINUS1,-1);
85 static Packet4f p4f_ONE = vec_ctf(p4i_ONE, 0);
86 static Packet4f p4f_ZERO_ = (Packet4f) vec_sl((Packet4ui)p4i_MINUS1, (Packet4ui)p4i_MINUS1);
87 
88 template<> struct packet_traits<float> : default_packet_traits
89 {
90  typedef Packet4f type;
91  enum {
92  Vectorizable = 1,
93  AlignedOnScalar = 1,
94  size=4,
95 
96  // FIXME check the Has*
97  HasSin = 0,
98  HasCos = 0,
99  HasLog = 0,
100  HasExp = 0,
101  HasSqrt = 0
102  };
103 };
104 template<> struct packet_traits<int> : default_packet_traits
105 {
106  typedef Packet4i type;
107  enum {
108  // FIXME check the Has*
109  Vectorizable = 1,
110  AlignedOnScalar = 1,
111  size=4
112  };
113 };
114 
115 template<> struct unpacket_traits<Packet4f> { typedef float type; enum {size=4}; };
116 template<> struct unpacket_traits<Packet4i> { typedef int type; enum {size=4}; };
117 /*
118 inline std::ostream & operator <<(std::ostream & s, const Packet4f & v)
119 {
120  union {
121  Packet4f v;
122  float n[4];
123  } vt;
124  vt.v = v;
125  s << vt.n[0] << ", " << vt.n[1] << ", " << vt.n[2] << ", " << vt.n[3];
126  return s;
127 }
128 
129 inline std::ostream & operator <<(std::ostream & s, const Packet4i & v)
130 {
131  union {
132  Packet4i v;
133  int n[4];
134  } vt;
135  vt.v = v;
136  s << vt.n[0] << ", " << vt.n[1] << ", " << vt.n[2] << ", " << vt.n[3];
137  return s;
138 }
139 
140 inline std::ostream & operator <<(std::ostream & s, const Packet4ui & v)
141 {
142  union {
143  Packet4ui v;
144  unsigned int n[4];
145  } vt;
146  vt.v = v;
147  s << vt.n[0] << ", " << vt.n[1] << ", " << vt.n[2] << ", " << vt.n[3];
148  return s;
149 }
150 
151 inline std::ostream & operator <<(std::ostream & s, const Packetbi & v)
152 {
153  union {
154  Packet4bi v;
155  unsigned int n[4];
156  } vt;
157  vt.v = v;
158  s << vt.n[0] << ", " << vt.n[1] << ", " << vt.n[2] << ", " << vt.n[3];
159  return s;
160 }
161 */
162 template<> EIGEN_STRONG_INLINE Packet4f pset1<Packet4f>(const float& from) {
163  // Taken from http://developer.apple.com/hardwaredrivers/ve/alignment.html
164  float EIGEN_ALIGN16 af[4];
165  af[0] = from;
166  Packet4f vc = vec_ld(0, af);
167  vc = vec_splat(vc, 0);
168  return vc;
169 }
170 
171 template<> EIGEN_STRONG_INLINE Packet4i pset1<Packet4i>(const int& from) {
172  int EIGEN_ALIGN16 ai[4];
173  ai[0] = from;
174  Packet4i vc = vec_ld(0, ai);
175  vc = vec_splat(vc, 0);
176  return vc;
177 }
178 
179 template<> EIGEN_STRONG_INLINE Packet4f plset<float>(const float& a) { return vec_add(pset1<Packet4f>(a), p4f_COUNTDOWN); }
180 template<> EIGEN_STRONG_INLINE Packet4i plset<int>(const int& a) { return vec_add(pset1<Packet4i>(a), p4i_COUNTDOWN); }
181 
182 template<> EIGEN_STRONG_INLINE Packet4f padd<Packet4f>(const Packet4f& a, const Packet4f& b) { return vec_add(a,b); }
183 template<> EIGEN_STRONG_INLINE Packet4i padd<Packet4i>(const Packet4i& a, const Packet4i& b) { return vec_add(a,b); }
184 
185 template<> EIGEN_STRONG_INLINE Packet4f psub<Packet4f>(const Packet4f& a, const Packet4f& b) { return vec_sub(a,b); }
186 template<> EIGEN_STRONG_INLINE Packet4i psub<Packet4i>(const Packet4i& a, const Packet4i& b) { return vec_sub(a,b); }
187 
188 template<> EIGEN_STRONG_INLINE Packet4f pnegate(const Packet4f& a) { return psub<Packet4f>(p4f_ZERO, a); }
189 template<> EIGEN_STRONG_INLINE Packet4i pnegate(const Packet4i& a) { return psub<Packet4i>(p4i_ZERO, a); }
190 
191 template<> EIGEN_STRONG_INLINE Packet4f pmul<Packet4f>(const Packet4f& a, const Packet4f& b) { return vec_madd(a,b,p4f_ZERO); }
192 /* Commented out: it's actually slower than processing it scalar
193  *
194 template<> EIGEN_STRONG_INLINE Packet4i pmul<Packet4i>(const Packet4i& a, const Packet4i& b)
195 {
196  // Detailed in: http://freevec.org/content/32bit_signed_integer_multiplication_altivec
197  //Set up constants, variables
198  Packet4i a1, b1, bswap, low_prod, high_prod, prod, prod_, v1sel;
199 
200  // Get the absolute values
201  a1 = vec_abs(a);
202  b1 = vec_abs(b);
203 
204  // Get the signs using xor
205  Packet4bi sgn = (Packet4bi) vec_cmplt(vec_xor(a, b), p4i_ZERO);
206 
207  // Do the multiplication for the asbolute values.
208  bswap = (Packet4i) vec_rl((Packet4ui) b1, (Packet4ui) p4i_MINUS16 );
209  low_prod = vec_mulo((Packet8i) a1, (Packet8i)b1);
210  high_prod = vec_msum((Packet8i) a1, (Packet8i) bswap, p4i_ZERO);
211  high_prod = (Packet4i) vec_sl((Packet4ui) high_prod, (Packet4ui) p4i_MINUS16);
212  prod = vec_add( low_prod, high_prod );
213 
214  // NOR the product and select only the negative elements according to the sign mask
215  prod_ = vec_nor(prod, prod);
216  prod_ = vec_sel(p4i_ZERO, prod_, sgn);
217 
218  // Add 1 to the result to get the negative numbers
219  v1sel = vec_sel(p4i_ZERO, p4i_ONE, sgn);
220  prod_ = vec_add(prod_, v1sel);
221 
222  // Merge the results back to the final vector.
223  prod = vec_sel(prod, prod_, sgn);
224 
225  return prod;
226 }
227 */
229 {
230  Packet4f t, y_0, y_1, res;
231 
232  // Altivec does not offer a divide instruction, we have to do a reciprocal approximation
233  y_0 = vec_re(b);
234 
235  // Do one Newton-Raphson iteration to get the needed accuracy
236  t = vec_nmsub(y_0, b, p4f_ONE);
237  y_1 = vec_madd(y_0, t, y_0);
238 
239  res = vec_madd(a, y_1, p4f_ZERO);
240  return res;
241 }
242 
243 template<> EIGEN_STRONG_INLINE Packet4i pdiv<Packet4i>(const Packet4i& /*a*/, const Packet4i& /*b*/)
244 { eigen_assert(false && "packet integer division are not supported by AltiVec");
245  return pset1<Packet4i>(0);
246 }
247 
248 // for some weird raisons, it has to be overloaded for packet of integers
249 template<> EIGEN_STRONG_INLINE Packet4f pmadd(const Packet4f& a, const Packet4f& b, const Packet4f& c) { return vec_madd(a, b, c); }
250 template<> EIGEN_STRONG_INLINE Packet4i pmadd(const Packet4i& a, const Packet4i& b, const Packet4i& c) { return padd(pmul(a,b), c); }
251 
252 template<> EIGEN_STRONG_INLINE Packet4f pmin<Packet4f>(const Packet4f& a, const Packet4f& b) { return vec_min(a, b); }
253 template<> EIGEN_STRONG_INLINE Packet4i pmin<Packet4i>(const Packet4i& a, const Packet4i& b) { return vec_min(a, b); }
254 
255 template<> EIGEN_STRONG_INLINE Packet4f pmax<Packet4f>(const Packet4f& a, const Packet4f& b) { return vec_max(a, b); }
256 template<> EIGEN_STRONG_INLINE Packet4i pmax<Packet4i>(const Packet4i& a, const Packet4i& b) { return vec_max(a, b); }
257 
258 // Logical Operations are not supported for float, so we have to reinterpret casts using NEON intrinsics
259 template<> EIGEN_STRONG_INLINE Packet4f pand<Packet4f>(const Packet4f& a, const Packet4f& b) { return vec_and(a, b); }
260 template<> EIGEN_STRONG_INLINE Packet4i pand<Packet4i>(const Packet4i& a, const Packet4i& b) { return vec_and(a, b); }
261 
262 template<> EIGEN_STRONG_INLINE Packet4f por<Packet4f>(const Packet4f& a, const Packet4f& b) { return vec_or(a, b); }
263 template<> EIGEN_STRONG_INLINE Packet4i por<Packet4i>(const Packet4i& a, const Packet4i& b) { return vec_or(a, b); }
264 
265 template<> EIGEN_STRONG_INLINE Packet4f pxor<Packet4f>(const Packet4f& a, const Packet4f& b) { return vec_xor(a, b); }
266 template<> EIGEN_STRONG_INLINE Packet4i pxor<Packet4i>(const Packet4i& a, const Packet4i& b) { return vec_xor(a, b); }
267 
268 template<> EIGEN_STRONG_INLINE Packet4f pandnot<Packet4f>(const Packet4f& a, const Packet4f& b) { return vec_and(a, vec_nor(b, b)); }
269 template<> EIGEN_STRONG_INLINE Packet4i pandnot<Packet4i>(const Packet4i& a, const Packet4i& b) { return vec_and(a, vec_nor(b, b)); }
270 
271 template<> EIGEN_STRONG_INLINE Packet4f pload<Packet4f>(const float* from) { EIGEN_DEBUG_ALIGNED_LOAD return vec_ld(0, from); }
272 template<> EIGEN_STRONG_INLINE Packet4i pload<Packet4i>(const int* from) { EIGEN_DEBUG_ALIGNED_LOAD return vec_ld(0, from); }
273 
274 template<> EIGEN_STRONG_INLINE Packet4f ploadu<Packet4f>(const float* from)
275 {
277  // Taken from http://developer.apple.com/hardwaredrivers/ve/alignment.html
278  Packet16uc MSQ, LSQ;
279  Packet16uc mask;
280  MSQ = vec_ld(0, (unsigned char *)from); // most significant quadword
281  LSQ = vec_ld(15, (unsigned char *)from); // least significant quadword
282  mask = vec_lvsl(0, from); // create the permute mask
283  return (Packet4f) vec_perm(MSQ, LSQ, mask); // align the data
284 
285 }
286 template<> EIGEN_STRONG_INLINE Packet4i ploadu<Packet4i>(const int* from)
287 {
289  // Taken from http://developer.apple.com/hardwaredrivers/ve/alignment.html
290  Packet16uc MSQ, LSQ;
291  Packet16uc mask;
292  MSQ = vec_ld(0, (unsigned char *)from); // most significant quadword
293  LSQ = vec_ld(15, (unsigned char *)from); // least significant quadword
294  mask = vec_lvsl(0, from); // create the permute mask
295  return (Packet4i) vec_perm(MSQ, LSQ, mask); // align the data
296 }
297 
298 template<> EIGEN_STRONG_INLINE Packet4f ploaddup<Packet4f>(const float* from)
299 {
300  Packet4f p;
301  if((ptrdiff_t(&from) % 16) == 0) p = pload<Packet4f>(from);
302  else p = ploadu<Packet4f>(from);
303  return vec_perm(p, p, p16uc_DUPLICATE);
304 }
306 {
307  Packet4i p;
308  if((ptrdiff_t(&from) % 16) == 0) p = pload<Packet4i>(from);
309  else p = ploadu<Packet4i>(from);
310  return vec_perm(p, p, p16uc_DUPLICATE);
311 }
312 
313 template<> EIGEN_STRONG_INLINE void pstore<float>(float* to, const Packet4f& from) { EIGEN_DEBUG_ALIGNED_STORE vec_st(from, 0, to); }
314 template<> EIGEN_STRONG_INLINE void pstore<int>(int* to, const Packet4i& from) { EIGEN_DEBUG_ALIGNED_STORE vec_st(from, 0, to); }
315 
316 template<> EIGEN_STRONG_INLINE void pstoreu<float>(float* to, const Packet4f& from)
317 {
319  // Taken from http://developer.apple.com/hardwaredrivers/ve/alignment.html
320  // Warning: not thread safe!
321  Packet16uc MSQ, LSQ, edges;
322  Packet16uc edgeAlign, align;
323 
324  MSQ = vec_ld(0, (unsigned char *)to); // most significant quadword
325  LSQ = vec_ld(15, (unsigned char *)to); // least significant quadword
326  edgeAlign = vec_lvsl(0, to); // permute map to extract edges
327  edges=vec_perm(LSQ,MSQ,edgeAlign); // extract the edges
328  align = vec_lvsr( 0, to ); // permute map to misalign data
329  MSQ = vec_perm(edges,(Packet16uc)from,align); // misalign the data (MSQ)
330  LSQ = vec_perm((Packet16uc)from,edges,align); // misalign the data (LSQ)
331  vec_st( LSQ, 15, (unsigned char *)to ); // Store the LSQ part first
332  vec_st( MSQ, 0, (unsigned char *)to ); // Store the MSQ part
333 }
334 template<> EIGEN_STRONG_INLINE void pstoreu<int>(int* to, const Packet4i& from)
335 {
337  // Taken from http://developer.apple.com/hardwaredrivers/ve/alignment.html
338  // Warning: not thread safe!
339  Packet16uc MSQ, LSQ, edges;
340  Packet16uc edgeAlign, align;
341 
342  MSQ = vec_ld(0, (unsigned char *)to); // most significant quadword
343  LSQ = vec_ld(15, (unsigned char *)to); // least significant quadword
344  edgeAlign = vec_lvsl(0, to); // permute map to extract edges
345  edges=vec_perm(LSQ, MSQ, edgeAlign); // extract the edges
346  align = vec_lvsr( 0, to ); // permute map to misalign data
347  MSQ = vec_perm(edges, (Packet16uc) from, align); // misalign the data (MSQ)
348  LSQ = vec_perm((Packet16uc) from, edges, align); // misalign the data (LSQ)
349  vec_st( LSQ, 15, (unsigned char *)to ); // Store the LSQ part first
350  vec_st( MSQ, 0, (unsigned char *)to ); // Store the MSQ part
351 }
352 
353 template<> EIGEN_STRONG_INLINE void prefetch<float>(const float* addr) { vec_dstt(addr, DST_CTRL(2,2,32), DST_CHAN); }
354 template<> EIGEN_STRONG_INLINE void prefetch<int>(const int* addr) { vec_dstt(addr, DST_CTRL(2,2,32), DST_CHAN); }
355 
356 template<> EIGEN_STRONG_INLINE float pfirst<Packet4f>(const Packet4f& a) { float EIGEN_ALIGN16 x[4]; vec_st(a, 0, x); return x[0]; }
357 template<> EIGEN_STRONG_INLINE int pfirst<Packet4i>(const Packet4i& a) { int EIGEN_ALIGN16 x[4]; vec_st(a, 0, x); return x[0]; }
358 
359 template<> EIGEN_STRONG_INLINE Packet4f preverse(const Packet4f& a) { return (Packet4f)vec_perm((Packet16uc)a,(Packet16uc)a, p16uc_REVERSE); }
360 template<> EIGEN_STRONG_INLINE Packet4i preverse(const Packet4i& a) { return (Packet4i)vec_perm((Packet16uc)a,(Packet16uc)a, p16uc_REVERSE); }
361 
362 template<> EIGEN_STRONG_INLINE Packet4f pabs(const Packet4f& a) { return vec_abs(a); }
363 template<> EIGEN_STRONG_INLINE Packet4i pabs(const Packet4i& a) { return vec_abs(a); }
364 
366 {
367  Packet4f b, sum;
368  b = (Packet4f) vec_sld(a, a, 8);
369  sum = vec_add(a, b);
370  b = (Packet4f) vec_sld(sum, sum, 4);
371  sum = vec_add(sum, b);
372  return pfirst(sum);
373 }
374 
376 {
377  Packet4f v[4], sum[4];
378 
379  // It's easier and faster to transpose then add as columns
380  // Check: http://www.freevec.org/function/matrix_4x4_transpose_floats for explanation
381  // Do the transpose, first set of moves
382  v[0] = vec_mergeh(vecs[0], vecs[2]);
383  v[1] = vec_mergel(vecs[0], vecs[2]);
384  v[2] = vec_mergeh(vecs[1], vecs[3]);
385  v[3] = vec_mergel(vecs[1], vecs[3]);
386  // Get the resulting vectors
387  sum[0] = vec_mergeh(v[0], v[2]);
388  sum[1] = vec_mergel(v[0], v[2]);
389  sum[2] = vec_mergeh(v[1], v[3]);
390  sum[3] = vec_mergel(v[1], v[3]);
391 
392  // Now do the summation:
393  // Lines 0+1
394  sum[0] = vec_add(sum[0], sum[1]);
395  // Lines 2+3
396  sum[1] = vec_add(sum[2], sum[3]);
397  // Add the results
398  sum[0] = vec_add(sum[0], sum[1]);
399 
400  return sum[0];
401 }
402 
404 {
405  Packet4i sum;
406  sum = vec_sums(a, p4i_ZERO);
407  sum = vec_sld(sum, p4i_ZERO, 12);
408  return pfirst(sum);
409 }
410 
412 {
413  Packet4i v[4], sum[4];
414 
415  // It's easier and faster to transpose then add as columns
416  // Check: http://www.freevec.org/function/matrix_4x4_transpose_floats for explanation
417  // Do the transpose, first set of moves
418  v[0] = vec_mergeh(vecs[0], vecs[2]);
419  v[1] = vec_mergel(vecs[0], vecs[2]);
420  v[2] = vec_mergeh(vecs[1], vecs[3]);
421  v[3] = vec_mergel(vecs[1], vecs[3]);
422  // Get the resulting vectors
423  sum[0] = vec_mergeh(v[0], v[2]);
424  sum[1] = vec_mergel(v[0], v[2]);
425  sum[2] = vec_mergeh(v[1], v[3]);
426  sum[3] = vec_mergel(v[1], v[3]);
427 
428  // Now do the summation:
429  // Lines 0+1
430  sum[0] = vec_add(sum[0], sum[1]);
431  // Lines 2+3
432  sum[1] = vec_add(sum[2], sum[3]);
433  // Add the results
434  sum[0] = vec_add(sum[0], sum[1]);
435 
436  return sum[0];
437 }
438 
439 // Other reduction functions:
440 // mul
442 {
443  Packet4f prod;
444  prod = pmul(a, (Packet4f)vec_sld(a, a, 8));
445  return pfirst(pmul(prod, (Packet4f)vec_sld(prod, prod, 4)));
446 }
447 
449 {
450  EIGEN_ALIGN16 int aux[4];
451  pstore(aux, a);
452  return aux[0] * aux[1] * aux[2] * aux[3];
453 }
454 
455 // min
457 {
458  Packet4f b, res;
459  b = vec_min(a, vec_sld(a, a, 8));
460  res = vec_min(b, vec_sld(b, b, 4));
461  return pfirst(res);
462 }
463 
465 {
466  Packet4i b, res;
467  b = vec_min(a, vec_sld(a, a, 8));
468  res = vec_min(b, vec_sld(b, b, 4));
469  return pfirst(res);
470 }
471 
472 // max
474 {
475  Packet4f b, res;
476  b = vec_max(a, vec_sld(a, a, 8));
477  res = vec_max(b, vec_sld(b, b, 4));
478  return pfirst(res);
479 }
480 
482 {
483  Packet4i b, res;
484  b = vec_max(a, vec_sld(a, a, 8));
485  res = vec_max(b, vec_sld(b, b, 4));
486  return pfirst(res);
487 }
488 
489 template<int Offset>
490 struct palign_impl<Offset,Packet4f>
491 {
492  static EIGEN_STRONG_INLINE void run(Packet4f& first, const Packet4f& second)
493  {
494  if (Offset!=0)
495  first = vec_sld(first, second, Offset*4);
496  }
497 };
498 
499 template<int Offset>
500 struct palign_impl<Offset,Packet4i>
501 {
502  static EIGEN_STRONG_INLINE void run(Packet4i& first, const Packet4i& second)
503  {
504  if (Offset!=0)
505  first = vec_sld(first, second, Offset*4);
506  }
507 };
508 
509 } // end namespace internal
510 
511 } // end namespace Eigen
512 
513 #endif // EIGEN_PACKET_MATH_ALTIVEC_H