POWER Vector Library Manual  1.0.4
vec_char_ppc.h
Go to the documentation of this file.
1 /*
2  Copyright (c) [2017, 2018] IBM Corporation.
3 
4  Licensed under the Apache License, Version 2.0 (the "License");
5  you may not use this file except in compliance with the License.
6  You may obtain a copy of the License at
7 
8  http://www.apache.org/licenses/LICENSE-2.0
9 
10  Unless required by applicable law or agreed to in writing, software
11  distributed under the License is distributed on an "AS IS" BASIS,
12  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  See the License for the specific language governing permissions and
14  limitations under the License.
15 
16  vec_char_ppc.h
17 
18  Contributors:
19  IBM Corporation, Steven Munroe
20  Created on: Jul 2, 2015
21  Steven Munroe, additional contributions for POWER9.
22  */
23 
24 #ifndef VEC_CHAR_PPC_H_
25 #define VEC_CHAR_PPC_H_
26 
27 #include <pveclib/vec_common_ppc.h>
28 
139 #ifndef vec_popcntb
141 static inline vui8_t vec_popcntb (vui8_t vra);
142 #else
143 /* Work around for GCC PR85830. */
144 #undef vec_popcntb
145 #define vec_popcntb __builtin_vec_vpopcntb
146 #endif
147 static inline vui8_t vec_vmrgeb (vui8_t vra, vui8_t vrb);
148 static inline vui8_t vec_vmrgob (vui8_t vra, vui8_t vrb);
150 
166 static inline vui8_t
168 {
169  vui8_t result;
170 #ifdef _ARCH_PWR9
171  __asm__(
172  "vabsdub %0,%1,%2;"
173  : "=v" (result)
174  : "v" (vra), "v" (vrb)
175  : );
176 #else
177  vui8_t a, b;
178  vui8_t vmin, vmax;
179 
180  a = (vui8_t) vra;
181  b = (vui8_t) vrb;
182  vmin = vec_min (a, b);
183  vmax = vec_max (a, b);
184  result = vec_sub (vmax, vmin);
185 #endif
186  return (result);
187 }
188 
213 static inline vui8_t
215 {
216  vui8_t r;
217 #ifdef _ARCH_PWR8
218 #if defined (vec_vclzb)
219  r = vec_vclzb (vra);
220 #elif defined (__clang__)
221  r = vec_cntlz (vra);
222 #else
223  __asm__(
224  "vclzb %0,%1;"
225  : "=v" (r)
226  : "v" (vra)
227  : );
228 #endif
229 #else
230 //#warning Implememention pre power8
231  __vector unsigned char n, nt, y, x, s, m;
232  __vector unsigned char z= { 0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0};
233  __vector unsigned char one = { 1,1,1,1, 1,1,1,1, 1,1,1,1, 1,1,1,1};
234 
235  /* n = 8 s = 4 */
236  s = vec_splat_u8(4);
237  n = vec_splat_u8(8);
238  x = vra;
239 
240  /* y=x>>4 if (y!=0) (n=n-4 x=y) */
241  y = vec_sr(x, s);
242  nt = vec_sub(n,s);
243  m = (__vector unsigned char)vec_cmpgt(y, z);
244  s = vec_sr(s,one);
245  x = vec_sel (x , y, m);
246  n = vec_sel (n , nt, m);
247 
248  /* y=x>>2 if (y!=0) (n=n-2 x=y) */
249  y = vec_sr(x, s);
250  nt = vec_sub(n,s);
251  m = (__vector unsigned char)vec_cmpgt(y, z);
252  s = vec_sr(s,one);
253  x = vec_sel (x , y, m);
254  n = vec_sel (n , nt, m);
255 
256  /* y=x>>1 if (y!=0) return (n=n-2) */
257  y = vec_sr(x, s);
258  nt = vec_sub(n,s);
259  nt = vec_sub(nt,s);
260  m = (__vector unsigned char)vec_cmpgt(y, z);
261  n = vec_sel (n , nt, m);
262 
263  /* else return (x-n) */
264  nt = vec_sub (n, x);
265  n = vec_sel (nt , n, m);
266  r = n;
267 #endif
268 
269  return (r);
270 }
271 
296 static inline vui8_t
298 {
299  vui8_t r;
300 #ifdef _ARCH_PWR9
301 #if defined (vec_cnttz) || defined (__clang__)
302  r = vec_cnttz (vra);
303 #else
304  __asm__(
305  "vctzb %0,%1;"
306  : "=v" (r)
307  : "v" (vra)
308  : );
309 #endif
310 #elif _ARCH_PWR8
311 // For _ARCH_PWR8. Generate 1's for the trailing zeros
312 // and 0's otherwise. Then count (popcnt) the 1's.
313 // _ARCH_PWR8 uses the hardware vpopcntb instruction.
314  const vui8_t ones = vec_splat_u8 (1);
315  vui8_t tzmask;
316  // tzmask = (!vra & (vra - 1))
317  tzmask = vec_andc (vec_sub (vra, ones), vra);
318  // return = vec_popcnt (!vra & (vra - 1))
319  r = vec_popcntb (tzmask);
320 #else
321  // For _ARCH_PWR7 and earlier (without hardware clz or popcnt).
322  // Generate 1's for the trailing zeros and 0's otherwise.
323  // Then count leading 0's using the PVECLIB vec_clzb implementation
324  // which minimizes the number of constant loads (vs popcntb).
325  // Finally subtract this count from 8.
326  const vui8_t ones = vec_splat_u8 (1);
327  const vui8_t c8s = vec_splat_u8 (8);
328  vui8_t term;
329  // term = (!vra & (vra - 1))
330  term = vec_andc (vec_sub (vra, ones), vra);
331  // return = 8 - vec_clz (!vra & (vra - 1))
332  return vec_sub (c8s, vec_clzb (term));
333 #endif
334  return ((vui8_t) r);
335 }
336 
353 static inline vui8_t
355 {
356  vui8_t result;
357  const vui8_t UC_FIRST =
358  { 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40,
359  0x40, 0x40, 0x40, 0x40 };
360  const vui8_t UC_LAST =
361  { 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a,
362  0x5a, 0x5a, 0x5a, 0x5a };
363  const vui8_t LC_FIRST =
364  { 0x60, 0x60, 0x60, 0x60, 0x60, 0x60, 0x60, 0x60, 0x60, 0x60, 0x60, 0x60,
365  0x60, 0x60, 0x60, 0x60 };
366  const vui8_t LC_LAST =
367  { 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a,
368  0x7a, 0x7a, 0x7a, 0x7a };
369  const vui8_t DG_FIRST =
370  { 0x2f, 0x2f, 0x2f, 0x2f, 0x2f, 0x2f, 0x2f, 0x2f, 0x2f, 0x2f, 0x2f, 0x2f,
371  0x2f, 0x2f, 0x2f, 0x2f };
372  const vui8_t DG_LAST =
373  { 0x39, 0x39, 0x39, 0x39, 0x39, 0x39, 0x39, 0x39, 0x39, 0x39, 0x39, 0x5a,
374  0x39, 0x39, 0x39, 0x39 };
375 
376  vui8_t cmp1, cmp2, cmp3, cmp4, cmp5, cmp6, cmask1, cmask2, cmask3;
377 
378  cmp1 = (vui8_t) vec_cmpgt (vec_str, LC_FIRST);
379  cmp2 = (vui8_t) vec_cmpgt (vec_str, LC_LAST);
380 
381  cmp3 = (vui8_t) vec_cmpgt (vec_str, UC_FIRST);
382  cmp4 = (vui8_t) vec_cmpgt (vec_str, UC_LAST);
383 
384  cmp5 = (vui8_t) vec_cmpgt (vec_str, DG_FIRST);
385  cmp6 = (vui8_t) vec_cmpgt (vec_str, DG_LAST);
386 
387  cmask1 = vec_andc (cmp1, cmp2);
388  cmask2 = vec_andc (cmp3, cmp4);
389  cmask3 = vec_andc (cmp5, cmp6);
390 
391  result = vec_or (vec_or (cmask1, cmask2), cmask3);
392 
393  return (result);
394 }
395 
412 static inline vui8_t
414 {
415  vui8_t result;
416  const vui8_t UC_FIRST =
417  { 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40,
418  0x40, 0x40, 0x40, 0x40 };
419  const vui8_t UC_LAST =
420  { 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a,
421  0x5a, 0x5a, 0x5a, 0x5a };
422  const vui8_t LC_FIRST =
423  { 0x60, 0x60, 0x60, 0x60, 0x60, 0x60, 0x60, 0x60, 0x60, 0x60, 0x60, 0x60,
424  0x60, 0x60, 0x60, 0x60 };
425  const vui8_t LC_LAST =
426  { 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a,
427  0x7a, 0x7a, 0x7a, 0x7a };
428 
429  vui8_t cmp1, cmp2, cmp3, cmp4, cmask1, cmask2;
430 
431  cmp1 = (vui8_t) vec_cmpgt (vec_str, LC_FIRST);
432  cmp2 = (vui8_t) vec_cmpgt (vec_str, LC_LAST);
433 
434  cmp3 = (vui8_t) vec_cmpgt (vec_str, UC_FIRST);
435  cmp4 = (vui8_t) vec_cmpgt (vec_str, UC_LAST);
436 
437  cmask1 = vec_andc (cmp1, cmp2);
438  cmask2 = vec_andc (cmp3, cmp4);
439 
440  result = vec_or (cmask1, cmask2);
441 
442  return (result);
443 }
444 
461 static inline vui8_t
463 {
464  vui8_t result;
465  const vui8_t DG_FIRST =
466  { 0x2f, 0x2f, 0x2f, 0x2f, 0x2f, 0x2f, 0x2f, 0x2f, 0x2f, 0x2f, 0x2f, 0x2f,
467  0x2f, 0x2f, 0x2f, 0x2f };
468  const vui8_t DG_LAST =
469  { 0x39, 0x39, 0x39, 0x39, 0x39, 0x39, 0x39, 0x39, 0x39, 0x39, 0x39, 0x5a,
470  0x39, 0x39, 0x39, 0x39 };
471 
472  vui8_t cmp1, cmp2;
473 
474  cmp1 = (vui8_t) vec_cmpgt (vec_str, DG_FIRST);
475  cmp2 = (vui8_t) vec_cmpgt (vec_str, DG_LAST);
476 
477  result = vec_andc (cmp1, cmp2);
478 
479  return (result);
480 }
481 
502 static inline vui8_t
504 {
505  return vec_vmrgeb ((vui8_t) vra, (vui8_t) vrb);
506 }
507 
528 static inline vui8_t
530 {
531  return vec_vmrgob ((vui8_t) vra, (vui8_t) vrb);
532 }
533 
552 static inline vui8_t
554 {
555 #if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
556  return vec_vmrgob ((vui8_t) vrb, (vui8_t) vra);
557 #else
558  return vec_vmrgeb ((vui8_t) vra, (vui8_t) vrb);
559 #endif
560 }
561 
580 static inline vui8_t
582 {
583 #if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
584  return vec_vmrgeb ((vui8_t) vrb, (vui8_t) vra);
585 #else
586  return vec_vmrgob ((vui8_t) vra, (vui8_t) vrb);
587 #endif
588 }
589 
606 static inline vi8_t
608 {
609 #if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
610  return (vi8_t) vec_mrgahb ((vui16_t)vec_mulo (vra, vrb),
611  (vui16_t)vec_mule (vra, vrb));
612 #else
613  return (vi8_t) vec_mrgahb ((vui16_t)vec_mule (vra, vrb),
614  (vui16_t)vec_mulo (vra, vrb));
615 #endif
616 }
617 
634 static inline vui8_t
636 {
637 #if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
638  return vec_mrgahb (vec_mulo (vra, vrb), vec_mule (vra, vrb));
639 #else
640  return vec_mrgahb (vec_mule (vra, vrb), vec_mulo (vra, vrb));
641 #endif
642 }
643 
663 static inline vui8_t
665 {
666 #if __GNUC__ >= 7
667 /* Generic vec_mul not supported for vector char until GCC 7. */
668  return vec_mul (vra, vrb);
669 #else
670 #if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
671  return vec_mrgalb (vec_mulo (vra, vrb), vec_mule (vra, vrb));
672 #else
673  return vec_mrgalb (vec_mule (vra, vrb), vec_mulo (vra, vrb));
674 #endif
675 #endif
676 }
677 
701 #ifndef vec_popcntb
702 static inline vui8_t
704 {
705  vui8_t r;
706 #ifdef _ARCH_PWR8
707 #if defined (vec_vpopcntb)
708  r = vec_vpopcntb (vra);
709 #elif defined (__clang__)
710  r = vec_popcnt (vra);
711 #else
712  __asm__(
713  "vpopcntb %0,%1;"
714  : "=v" (r)
715  : "v" (vra)
716  : );
717 #endif
718 #else
719 //#warning Implememention pre power8
720  vui8_t n, x1, x2, x, s;
721  vui8_t ones = { 1,1,1,1, 1,1,1,1, 1,1,1,1, 1,1,1,1};
722  vui8_t fives =
723  {0x55,0x55,0x55,0x55, 0x55,0x55,0x55,0x55,
724  0x55,0x55,0x55,0x55, 0x55,0x55,0x55,0x55};
725  vui8_t threes =
726  {0x33,0x33,0x33,0x33, 0x33,0x33,0x33,0x33,
727  0x33,0x33,0x33,0x33, 0x33,0x33,0x33,0x33};
728  vui8_t fs =
729  {0x0f,0x0f,0x0f,0x0f, 0x0f,0x0f,0x0f,0x0f,
730  0x0f,0x0f,0x0f,0x0f, 0x0f,0x0f,0x0f,0x0f};
731  /* n = 8 s = 4 */
732  s = ones;
733  x = vra;
734  /* x = x - ((x >> 1) & 0x55) */
735  x2 = vec_and (vec_sr (x, s), fives);
736  n = vec_sub (x, x2);
737  s = vec_add (s, s);
738  /* x = (x & 0x33) + ((x & 0xcc) >> 2) */
739  x1 = vec_and (n, threes);
740  x2 = vec_andc (n, threes);
741  n = vec_add (x1, vec_sr (x2, s));
742  s = vec_add (s, s);
743  /* x = (x + (x >> 4)) & 0x0f) */
744  x1 = vec_add (n, vec_sr (n, s));
745  n = vec_and (x1, fs);
746  r = n;
747 #endif
748  return (r);
749 }
750 #else
751 /* Work around for GCC PR85830. */
752 #undef vec_popcntb
753 #define vec_popcntb __builtin_vec_vpopcntb
754 #endif
755 
772 static inline vb8_t
774 {
775  vb8_t result;
776 
777 #if defined (_ARCH_PWR10) && (__GNUC__ >= 10)
778  __asm__(
779  "vexpandbm %0,%1"
780  : "=v" (result)
781  : "v" (vra)
782  : );
783 #else
784  const vui8_t rshift = vec_splat_u8( 7 );
785  // Vector Shift Right Algebraic Bytes 7-bits.
786  result = (vb8_t) vec_sra (vra, rshift);
787 #endif
788  return result;
789 }
790 
808 static inline vui8_t
809 vec_slbi (vui8_t vra, const unsigned int shb)
810 {
811  vui8_t lshift;
812  vui8_t result;
813 
814  if (shb < 8)
815  {
816  /* Load the shift const in a vector. The element shifts require
817  a shift amount for each element. For the immediate form the
818  shift constant is splatted to all elements of the
819  shift control. */
820  if (__builtin_constant_p(shb))
821  lshift = (vui8_t) vec_splat_s8(shb);
822  else
823  lshift = vec_splats ((unsigned char) shb);
824 
825  /* Vector Shift right bytes based on the lower 3-bits of
826  corresponding element of lshift. */
827  result = vec_vslb (vra, lshift);
828  }
829  else
830  { /* shifts greater then 7 bits return zeros. */
831  result = vec_xor ((vui8_t) vra, (vui8_t) vra);
832  }
833 
834  return (vui8_t) result;
835 }
836 
855 static inline vi8_t
856 vec_srabi (vi8_t vra, const unsigned int shb)
857 {
858  vui8_t lshift;
859  vi8_t result;
860 
861  if (shb < 8)
862  {
863  /* Load the shift const in a vector. The element shifts require
864  a shift amount for each element. For the immediate form the
865  shift constant is splatted to all elements of the
866  shift control. */
867  if (__builtin_constant_p(shb))
868  lshift = (vui8_t) vec_splat_s8(shb);
869  else
870  lshift = vec_splats ((unsigned char) shb);
871 
872  /* Vector Shift Right Algebraic Bytes based on the lower 3-bits
873  of corresponding element of lshift. */
874  result = vec_vsrab (vra, lshift);
875  }
876  else
877  { /* shifts greater then 7 bits returns the sign bit propagated to
878  all bits. This is equivalent to shift Right Algebraic of
879  7 bits. */
880  lshift = (vui8_t) vec_splat_s8(7);
881  result = vec_vsrab (vra, lshift);
882  }
883 
884  return (vi8_t) result;
885 }
886 
904 static inline vui8_t
905 vec_srbi (vui8_t vra, const unsigned int shb)
906 {
907  vui8_t lshift;
908  vui8_t result;
909 
910  if (shb < 8)
911  {
912  /* Load the shift const in a vector. The element shifts require
913  a shift amount for each element. For the immediate form the
914  shift constant is splatted to all elements of the
915  shift control. */
916  if (__builtin_constant_p(shb))
917  lshift = (vui8_t) vec_splat_s8(shb);
918  else
919  lshift = vec_splats ((unsigned char) shb);
920 
921  /* Vector Shift right bytes based on the lower 3-bits of
922  corresponding element of lshift. */
923  result = vec_vsrb (vra, lshift);
924  }
925  else
926  { /* shifts greater then 7 bits return zeros. */
927  result = vec_xor ((vui8_t) vra, (vui8_t) vra);
928  }
929 
930  return (vui8_t) result;
931 }
932 
952 static inline vui8_t
954 {
955  vui8_t result, vt1, vt2, vt3;
956  const vui8_t vzero = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
957 
958  vt1 = vec_slo (vrw, vrb);
959  vt3 = vec_sub (vzero, vrb);
960  vt2 = vec_sro (vrx, vt3);
961  result = vec_or (vt1, vt2);
962 
963  return (result);
964 }
965 
980 static inline vui8_t
982 {
983  vui8_t result;
984  const vui8_t UC_MASK =
985  { 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
986  0x20, 0x20, 0x20, 0x20 };
987  const vui8_t LC_FIRST =
988  { 0x60, 0x60, 0x60, 0x60, 0x60, 0x60, 0x60, 0x60, 0x60, 0x60, 0x60, 0x60,
989  0x60, 0x60, 0x60, 0x60 };
990  const vui8_t LC_LAST =
991  { 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a,
992  0x7a, 0x7a, 0x7a, 0x7a };
993 
994  vui8_t cmp1, cmp2, cmask;
995 
996  cmp1 = (vui8_t) vec_cmpgt (vec_str, LC_FIRST);
997  cmp2 = (vui8_t) vec_cmpgt (vec_str, LC_LAST);
998 
999  cmask = vec_andc (cmp1, cmp2);
1000  cmask = vec_and (cmask, UC_MASK);
1001 
1002  result = vec_andc (vec_str, cmask);
1003 
1004  return (result);
1005 }
1006 
1021 static inline vui8_t
1023 {
1024  vui8_t result;
1025  const vui8_t UC_MASK =
1026  { 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
1027  0x20, 0x20, 0x20, 0x20 };
1028  const vui8_t UC_FIRST =
1029  { 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40,
1030  0x40, 0x40, 0x40, 0x40 };
1031  const vui8_t UC_LAST =
1032  { 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a,
1033  0x5a, 0x5a, 0x5a, 0x5a };
1034 
1035  vui8_t cmp1, cmp2, cmask;
1036 
1037  cmp1 = (vui8_t) vec_cmpgt (vec_str, UC_FIRST);
1038  cmp2 = (vui8_t) vec_cmpgt (vec_str, UC_LAST);
1039 
1040  cmask = vec_andc (cmp1, cmp2);
1041  cmask = vec_and (cmask, UC_MASK);
1042 
1043  result = vec_or (vec_str, cmask);
1044 
1045  return (result);
1046 }
1047 
1084 static inline vui8_t
1086 {
1087 #if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
1088  const vui8_t permute =
1089  { 0x01, 0x11, 0x03, 0x13, 0x05, 0x15, 0x07, 0x17, 0x09, 0x19, 0x0B, 0x1B,
1090  0x0D, 0x1D, 0x0F, 0x1F };
1091 
1092  return vec_perm (vrb, vra, (vui8_t) permute);
1093 #else
1094  const vui8_t permute =
1095  { 0x00, 0x10, 0x02, 0x12, 0x04, 0x14, 0x06, 0x16, 0x08, 0x18, 0x0A, 0x1A,
1096  0x0C, 0x1C, 0x0E, 0x1E};
1097 
1098  return vec_perm (vra, vrb, (vui8_t)permute);
1099 #endif
1100 }
1101 
1138 static inline vui8_t
1140 {
1141 #if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
1142  const vui8_t permute =
1143  { 0x00, 0x10, 0x02, 0x12, 0x04, 0x14, 0x06, 0x16, 0x08, 0x18, 0x0A, 0x1A,
1144  0x0C, 0x1C, 0x0E, 0x1E};
1145  return vec_perm (vrb, vra, (vui8_t)permute);
1146 #else
1147  const vui8_t permute =
1148  { 0x01, 0x11, 0x03, 0x13, 0x05, 0x15, 0x07, 0x17, 0x09, 0x19, 0x0B, 0x1B,
1149  0x0D, 0x1D, 0x0F, 0x1F };
1150  return vec_perm (vra, vrb, (vui8_t)permute);
1151 #endif
1152 }
1153 
1154 #endif /* VEC_CHAR_PPC_H_ */
vec_mrgalb
static vui8_t vec_mrgalb(vui16_t vra, vui16_t vrb)
Vector Merge Algebraic Low Byte operation.
Definition: vec_char_ppc.h:529
vec_setb_sb
static vb8_t vec_setb_sb(vi8_t vra)
Vector Set Bool from Signed Byte.
Definition: vec_char_ppc.h:773
vec_mulhub
static vui8_t vec_mulhub(vui8_t vra, vui8_t vrb)
Vector Multiply High Unsigned Bytes.
Definition: vec_char_ppc.h:635
vec_vmrgob
static vui8_t vec_vmrgob(vui8_t vra, vui8_t vrb)
Vector Merge Odd Byte.
Definition: vec_char_ppc.h:1139
vec_shift_leftdo
static vui8_t vec_shift_leftdo(vui8_t vrw, vui8_t vrx, vui8_t vrb)
Shift left double quadword by octet. Return a vector unsigned char that is the left most 16 chars aft...
Definition: vec_char_ppc.h:953
vec_slbi
static vui8_t vec_slbi(vui8_t vra, const unsigned int shb)
Vector Shift left Byte Immediate.
Definition: vec_char_ppc.h:809
vec_srabi
static vi8_t vec_srabi(vi8_t vra, const unsigned int shb)
Vector Shift Right Algebraic Byte Immediate.
Definition: vec_char_ppc.h:856
vec_mrgeb
static vui8_t vec_mrgeb(vui8_t vra, vui8_t vrb)
Vector Merge Even Bytes operation.
Definition: vec_char_ppc.h:553
vui16_t
__vector unsigned short vui16_t
vector of 16-bit unsigned short elements.
Definition: vec_common_ppc.h:204
vec_toupper
static vui8_t vec_toupper(vui8_t vec_str)
Vector toupper.
Definition: vec_char_ppc.h:981
vec_ctzb
static vui8_t vec_ctzb(vui8_t vra)
Vector Count Trailing Zeros Byte for a unsigned char (byte) elements.
Definition: vec_char_ppc.h:297
vec_common_ppc.h
Common definitions and typedef used by the collection of Power Vector Library (pveclib) headers.
vui8_t
__vector unsigned char vui8_t
vector of 8-bit unsigned char elements.
Definition: vec_common_ppc.h:202
vec_srbi
static vui8_t vec_srbi(vui8_t vra, const unsigned int shb)
Vector Shift Right Byte Immediate.
Definition: vec_char_ppc.h:905
vec_tolower
static vui8_t vec_tolower(vui8_t vec_str)
Vector tolower.
Definition: vec_char_ppc.h:1022
vb8_t
__vector __bool char vb8_t
vector of 8-bit bool char elements.
Definition: vec_common_ppc.h:224
vec_isalnum
static vui8_t vec_isalnum(vui8_t vec_str)
Vector isalpha.
Definition: vec_char_ppc.h:354
vec_absdub
static vui8_t vec_absdub(vui8_t vra, vui8_t vrb)
Vector Absolute Difference Unsigned byte.
Definition: vec_char_ppc.h:167
vec_mrgob
static vui8_t vec_mrgob(vui8_t vra, vui8_t vrb)
Vector Merge Odd Halfwords operation.
Definition: vec_char_ppc.h:581
vec_mulhsb
static vi8_t vec_mulhsb(vi8_t vra, vi8_t vrb)
Vector Multiply High Signed Bytes.
Definition: vec_char_ppc.h:607
vec_popcntb
static vui8_t vec_popcntb(vui8_t vra)
Vector Population Count byte.
Definition: vec_char_ppc.h:703
vec_clzb
static vui8_t vec_clzb(vui8_t vra)
Vector Count Leading Zeros Byte for a unsigned char (byte) elements.
Definition: vec_char_ppc.h:214
vec_mulubm
static vui8_t vec_mulubm(vui8_t vra, vui8_t vrb)
Vector Multiply Unsigned Byte Modulo.
Definition: vec_char_ppc.h:664
vi8_t
__vector signed char vi8_t
vector of 8-bit signed char elements.
Definition: vec_common_ppc.h:211
vec_mrgahb
static vui8_t vec_mrgahb(vui16_t vra, vui16_t vrb)
Vector Merge Algebraic High Byte operation.
Definition: vec_char_ppc.h:503
vec_isalpha
static vui8_t vec_isalpha(vui8_t vec_str)
Vector isalnum.
Definition: vec_char_ppc.h:413
vec_vmrgeb
static vui8_t vec_vmrgeb(vui8_t vra, vui8_t vrb)
Vector Merge Even Bytes.
Definition: vec_char_ppc.h:1085
vec_isdigit
static vui8_t vec_isdigit(vui8_t vec_str)
Vector isdigit.
Definition: vec_char_ppc.h:462