@cpp-linter/clang-tidy-win32-x64 12.0.1 → 13.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (171) hide show
  1. package/README.md +2 -2
  2. package/bin/clang-tidy.exe +2 -2
  3. package/lib/clang/{12.0.1 → 13.0.0}/include/__clang_cuda_device_functions.h +174 -102
  4. package/lib/clang/{12.0.1 → 13.0.0}/include/__clang_cuda_runtime_wrapper.h +6 -1
  5. package/lib/clang/{12.0.1 → 13.0.0}/include/__clang_hip_cmath.h +272 -94
  6. package/lib/clang/{12.0.1 → 13.0.0}/include/__clang_hip_libdevice_declares.h +24 -12
  7. package/lib/clang/{12.0.1 → 13.0.0}/include/__clang_hip_math.h +48 -2
  8. package/lib/clang/13.0.0/include/__clang_hip_runtime_wrapper.h +124 -0
  9. package/lib/clang/{12.0.1 → 13.0.0}/include/altivec.h +1165 -423
  10. package/lib/clang/{12.0.1 → 13.0.0}/include/amxintrin.h +234 -19
  11. package/lib/clang/{12.0.1 → 13.0.0}/include/arm_acle.h +55 -0
  12. package/lib/clang/{12.0.1 → 13.0.0}/include/arm_neon.h +1077 -165
  13. package/lib/clang/{12.0.1 → 13.0.0}/include/arm_sve.h +11791 -5896
  14. package/lib/clang/{12.0.1 → 13.0.0}/include/avx512fintrin.h +177 -37
  15. package/lib/clang/13.0.0/include/builtins.h +16 -0
  16. package/lib/clang/{12.0.1 → 13.0.0}/include/cuda_wrappers/complex +8 -0
  17. package/lib/clang/13.0.0/include/hexagon_circ_brev_intrinsics.h +298 -0
  18. package/lib/clang/13.0.0/include/hexagon_protos.h +8450 -0
  19. package/lib/clang/13.0.0/include/hexagon_types.h +2653 -0
  20. package/lib/clang/13.0.0/include/hvx_hexagon_protos.h +4392 -0
  21. package/lib/clang/{12.0.1 → 13.0.0}/include/intrin.h +44 -8
  22. package/lib/clang/{12.0.1 → 13.0.0}/include/keylockerintrin.h +30 -0
  23. package/lib/clang/{12.0.1 → 13.0.0}/include/opencl-c-base.h +144 -3
  24. package/lib/clang/{12.0.1 → 13.0.0}/include/opencl-c.h +505 -355
  25. package/lib/clang/13.0.0/include/openmp_wrappers/__clang_openmp_device_functions.h +106 -0
  26. package/lib/clang/{12.0.1 → 13.0.0}/include/openmp_wrappers/cmath +54 -0
  27. package/lib/clang/{12.0.1 → 13.0.0}/include/openmp_wrappers/complex +1 -7
  28. package/lib/clang/{12.0.1 → 13.0.0}/include/openmp_wrappers/complex.h +0 -1
  29. package/lib/clang/{12.0.1 → 13.0.0}/include/openmp_wrappers/math.h +10 -0
  30. package/lib/clang/{12.0.1 → 13.0.0}/include/openmp_wrappers/new +2 -24
  31. package/lib/clang/13.0.0/include/riscv_vector.h +123865 -0
  32. package/lib/clang/{12.0.1 → 13.0.0}/include/uintrintrin.h +7 -0
  33. package/lib/clang/{12.0.1 → 13.0.0}/include/vaesintrin.h +21 -20
  34. package/lib/clang/{12.0.1 → 13.0.0}/include/vecintrin.h +206 -77
  35. package/lib/clang/{12.0.1 → 13.0.0}/include/vpclmulqdqintrin.h +2 -0
  36. package/lib/clang/{12.0.1 → 13.0.0}/include/wasm_simd128.h +806 -239
  37. package/package.json +6 -6
  38. package/lib/clang/12.0.1/include/__clang_hip_runtime_wrapper.h +0 -69
  39. package/lib/clang/12.0.1/include/openmp_wrappers/__clang_openmp_device_functions.h +0 -42
  40. package/lib/clang/{12.0.1 → 13.0.0}/include/__clang_cuda_builtin_vars.h +0 -0
  41. package/lib/clang/{12.0.1 → 13.0.0}/include/__clang_cuda_cmath.h +0 -0
  42. package/lib/clang/{12.0.1 → 13.0.0}/include/__clang_cuda_complex_builtins.h +0 -0
  43. package/lib/clang/{12.0.1 → 13.0.0}/include/__clang_cuda_intrinsics.h +0 -0
  44. package/lib/clang/{12.0.1 → 13.0.0}/include/__clang_cuda_libdevice_declares.h +0 -0
  45. package/lib/clang/{12.0.1 → 13.0.0}/include/__clang_cuda_math.h +2 -2
  46. package/lib/clang/{12.0.1 → 13.0.0}/include/__clang_cuda_math_forward_declares.h +0 -0
  47. package/lib/clang/{12.0.1 → 13.0.0}/include/__stddef_max_align_t.h +0 -0
  48. package/lib/clang/{12.0.1 → 13.0.0}/include/__wmmintrin_aes.h +0 -0
  49. package/lib/clang/{12.0.1 → 13.0.0}/include/__wmmintrin_pclmul.h +0 -0
  50. package/lib/clang/{12.0.1 → 13.0.0}/include/adxintrin.h +0 -0
  51. package/lib/clang/{12.0.1 → 13.0.0}/include/ammintrin.h +0 -0
  52. package/lib/clang/{12.0.1 → 13.0.0}/include/arm64intr.h +0 -0
  53. package/lib/clang/{12.0.1 → 13.0.0}/include/arm_bf16.h +0 -0
  54. package/lib/clang/{12.0.1 → 13.0.0}/include/arm_cde.h +0 -0
  55. package/lib/clang/{12.0.1 → 13.0.0}/include/arm_cmse.h +0 -0
  56. package/lib/clang/{12.0.1 → 13.0.0}/include/arm_fp16.h +0 -0
  57. package/lib/clang/{12.0.1 → 13.0.0}/include/arm_mve.h +0 -0
  58. package/lib/clang/{12.0.1 → 13.0.0}/include/armintr.h +0 -0
  59. package/lib/clang/{12.0.1 → 13.0.0}/include/avx2intrin.h +0 -0
  60. package/lib/clang/{12.0.1 → 13.0.0}/include/avx512bf16intrin.h +0 -0
  61. package/lib/clang/{12.0.1 → 13.0.0}/include/avx512bitalgintrin.h +0 -0
  62. package/lib/clang/{12.0.1 → 13.0.0}/include/avx512bwintrin.h +0 -0
  63. package/lib/clang/{12.0.1 → 13.0.0}/include/avx512cdintrin.h +0 -0
  64. package/lib/clang/{12.0.1 → 13.0.0}/include/avx512dqintrin.h +0 -0
  65. package/lib/clang/{12.0.1 → 13.0.0}/include/avx512erintrin.h +0 -0
  66. package/lib/clang/{12.0.1 → 13.0.0}/include/avx512ifmaintrin.h +0 -0
  67. package/lib/clang/{12.0.1 → 13.0.0}/include/avx512ifmavlintrin.h +0 -0
  68. package/lib/clang/{12.0.1 → 13.0.0}/include/avx512pfintrin.h +0 -0
  69. package/lib/clang/{12.0.1 → 13.0.0}/include/avx512vbmi2intrin.h +0 -0
  70. package/lib/clang/{12.0.1 → 13.0.0}/include/avx512vbmiintrin.h +0 -0
  71. package/lib/clang/{12.0.1 → 13.0.0}/include/avx512vbmivlintrin.h +0 -0
  72. package/lib/clang/{12.0.1 → 13.0.0}/include/avx512vlbf16intrin.h +0 -0
  73. package/lib/clang/{12.0.1 → 13.0.0}/include/avx512vlbitalgintrin.h +0 -0
  74. package/lib/clang/{12.0.1 → 13.0.0}/include/avx512vlbwintrin.h +0 -0
  75. package/lib/clang/{12.0.1 → 13.0.0}/include/avx512vlcdintrin.h +0 -0
  76. package/lib/clang/{12.0.1 → 13.0.0}/include/avx512vldqintrin.h +0 -0
  77. package/lib/clang/{12.0.1 → 13.0.0}/include/avx512vlintrin.h +0 -0
  78. package/lib/clang/{12.0.1 → 13.0.0}/include/avx512vlvbmi2intrin.h +0 -0
  79. package/lib/clang/{12.0.1 → 13.0.0}/include/avx512vlvnniintrin.h +0 -0
  80. package/lib/clang/{12.0.1 → 13.0.0}/include/avx512vlvp2intersectintrin.h +0 -0
  81. package/lib/clang/{12.0.1 → 13.0.0}/include/avx512vnniintrin.h +0 -0
  82. package/lib/clang/{12.0.1 → 13.0.0}/include/avx512vp2intersectintrin.h +0 -0
  83. package/lib/clang/{12.0.1 → 13.0.0}/include/avx512vpopcntdqintrin.h +0 -0
  84. package/lib/clang/{12.0.1 → 13.0.0}/include/avx512vpopcntdqvlintrin.h +0 -0
  85. package/lib/clang/{12.0.1 → 13.0.0}/include/avxintrin.h +0 -0
  86. package/lib/clang/{12.0.1 → 13.0.0}/include/avxvnniintrin.h +0 -0
  87. package/lib/clang/{12.0.1 → 13.0.0}/include/bmi2intrin.h +0 -0
  88. package/lib/clang/{12.0.1 → 13.0.0}/include/bmiintrin.h +0 -0
  89. package/lib/clang/{12.0.1 → 13.0.0}/include/cet.h +0 -0
  90. package/lib/clang/{12.0.1 → 13.0.0}/include/cetintrin.h +0 -0
  91. package/lib/clang/{12.0.1 → 13.0.0}/include/cldemoteintrin.h +0 -0
  92. package/lib/clang/{12.0.1 → 13.0.0}/include/clflushoptintrin.h +0 -0
  93. package/lib/clang/{12.0.1 → 13.0.0}/include/clwbintrin.h +0 -0
  94. package/lib/clang/{12.0.1 → 13.0.0}/include/clzerointrin.h +0 -0
  95. package/lib/clang/{12.0.1 → 13.0.0}/include/cpuid.h +0 -0
  96. package/lib/clang/{12.0.1 → 13.0.0}/include/cuda_wrappers/algorithm +0 -0
  97. package/lib/clang/{12.0.1 → 13.0.0}/include/cuda_wrappers/new +0 -0
  98. package/lib/clang/{12.0.1 → 13.0.0}/include/emmintrin.h +0 -0
  99. package/lib/clang/{12.0.1 → 13.0.0}/include/enqcmdintrin.h +0 -0
  100. package/lib/clang/{12.0.1 → 13.0.0}/include/f16cintrin.h +0 -0
  101. package/lib/clang/{12.0.1 → 13.0.0}/include/float.h +0 -0
  102. package/lib/clang/{12.0.1 → 13.0.0}/include/fma4intrin.h +0 -0
  103. package/lib/clang/{12.0.1 → 13.0.0}/include/fmaintrin.h +0 -0
  104. package/lib/clang/{12.0.1 → 13.0.0}/include/fxsrintrin.h +0 -0
  105. package/lib/clang/{12.0.1 → 13.0.0}/include/gfniintrin.h +0 -0
  106. package/lib/clang/{12.0.1 → 13.0.0}/include/hresetintrin.h +0 -0
  107. package/lib/clang/{12.0.1 → 13.0.0}/include/htmintrin.h +0 -0
  108. package/lib/clang/{12.0.1 → 13.0.0}/include/htmxlintrin.h +0 -0
  109. package/lib/clang/{12.0.1 → 13.0.0}/include/ia32intrin.h +0 -0
  110. package/lib/clang/{12.0.1 → 13.0.0}/include/immintrin.h +5 -5
  111. /package/lib/clang/{12.0.1 → 13.0.0}/include/inttypes.h +0 -0
  112. /package/lib/clang/{12.0.1 → 13.0.0}/include/invpcidintrin.h +0 -0
  113. /package/lib/clang/{12.0.1 → 13.0.0}/include/iso646.h +0 -0
  114. /package/lib/clang/{12.0.1 → 13.0.0}/include/limits.h +0 -0
  115. /package/lib/clang/{12.0.1 → 13.0.0}/include/lwpintrin.h +0 -0
  116. /package/lib/clang/{12.0.1 → 13.0.0}/include/lzcntintrin.h +0 -0
  117. /package/lib/clang/{12.0.1 → 13.0.0}/include/mm3dnow.h +0 -0
  118. /package/lib/clang/{12.0.1 → 13.0.0}/include/mm_malloc.h +0 -0
  119. /package/lib/clang/{12.0.1 → 13.0.0}/include/mmintrin.h +0 -0
  120. /package/lib/clang/{12.0.1 → 13.0.0}/include/module.modulemap +0 -0
  121. /package/lib/clang/{12.0.1 → 13.0.0}/include/movdirintrin.h +0 -0
  122. /package/lib/clang/{12.0.1 → 13.0.0}/include/msa.h +0 -0
  123. /package/lib/clang/{12.0.1 → 13.0.0}/include/mwaitxintrin.h +0 -0
  124. /package/lib/clang/{12.0.1 → 13.0.0}/include/nmmintrin.h +0 -0
  125. /package/lib/clang/{12.0.1 → 13.0.0}/include/openmp_wrappers/complex_cmath.h +0 -0
  126. /package/lib/clang/{12.0.1 → 13.0.0}/include/pconfigintrin.h +0 -0
  127. /package/lib/clang/{12.0.1 → 13.0.0}/include/pkuintrin.h +0 -0
  128. /package/lib/clang/{12.0.1 → 13.0.0}/include/pmmintrin.h +0 -0
  129. /package/lib/clang/{12.0.1 → 13.0.0}/include/popcntintrin.h +0 -0
  130. /package/lib/clang/{12.0.1 → 13.0.0}/include/ppc_wrappers/emmintrin.h +0 -0
  131. /package/lib/clang/{12.0.1 → 13.0.0}/include/ppc_wrappers/mm_malloc.h +0 -0
  132. /package/lib/clang/{12.0.1 → 13.0.0}/include/ppc_wrappers/mmintrin.h +0 -0
  133. /package/lib/clang/{12.0.1 → 13.0.0}/include/ppc_wrappers/pmmintrin.h +0 -0
  134. /package/lib/clang/{12.0.1 → 13.0.0}/include/ppc_wrappers/smmintrin.h +0 -0
  135. /package/lib/clang/{12.0.1 → 13.0.0}/include/ppc_wrappers/tmmintrin.h +0 -0
  136. /package/lib/clang/{12.0.1 → 13.0.0}/include/ppc_wrappers/xmmintrin.h +0 -0
  137. /package/lib/clang/{12.0.1 → 13.0.0}/include/prfchwintrin.h +0 -0
  138. /package/lib/clang/{12.0.1 → 13.0.0}/include/ptwriteintrin.h +0 -0
  139. /package/lib/clang/{12.0.1 → 13.0.0}/include/rdseedintrin.h +0 -0
  140. /package/lib/clang/{12.0.1 → 13.0.0}/include/rtmintrin.h +0 -0
  141. /package/lib/clang/{12.0.1 → 13.0.0}/include/s390intrin.h +0 -0
  142. /package/lib/clang/{12.0.1 → 13.0.0}/include/serializeintrin.h +0 -0
  143. /package/lib/clang/{12.0.1 → 13.0.0}/include/sgxintrin.h +0 -0
  144. /package/lib/clang/{12.0.1 → 13.0.0}/include/shaintrin.h +0 -0
  145. /package/lib/clang/{12.0.1 → 13.0.0}/include/smmintrin.h +0 -0
  146. /package/lib/clang/{12.0.1 → 13.0.0}/include/stdalign.h +0 -0
  147. /package/lib/clang/{12.0.1 → 13.0.0}/include/stdarg.h +0 -0
  148. /package/lib/clang/{12.0.1 → 13.0.0}/include/stdatomic.h +0 -0
  149. /package/lib/clang/{12.0.1 → 13.0.0}/include/stdbool.h +0 -0
  150. /package/lib/clang/{12.0.1 → 13.0.0}/include/stddef.h +0 -0
  151. /package/lib/clang/{12.0.1 → 13.0.0}/include/stdint.h +0 -0
  152. /package/lib/clang/{12.0.1 → 13.0.0}/include/stdnoreturn.h +0 -0
  153. /package/lib/clang/{12.0.1 → 13.0.0}/include/tbmintrin.h +0 -0
  154. /package/lib/clang/{12.0.1 → 13.0.0}/include/tgmath.h +0 -0
  155. /package/lib/clang/{12.0.1 → 13.0.0}/include/tmmintrin.h +0 -0
  156. /package/lib/clang/{12.0.1 → 13.0.0}/include/tsxldtrkintrin.h +0 -0
  157. /package/lib/clang/{12.0.1 → 13.0.0}/include/unwind.h +0 -0
  158. /package/lib/clang/{12.0.1 → 13.0.0}/include/vadefs.h +0 -0
  159. /package/lib/clang/{12.0.1 → 13.0.0}/include/varargs.h +0 -0
  160. /package/lib/clang/{12.0.1 → 13.0.0}/include/waitpkgintrin.h +0 -0
  161. /package/lib/clang/{12.0.1 → 13.0.0}/include/wbnoinvdintrin.h +0 -0
  162. /package/lib/clang/{12.0.1 → 13.0.0}/include/wmmintrin.h +0 -0
  163. /package/lib/clang/{12.0.1 → 13.0.0}/include/x86gprintrin.h +0 -0
  164. /package/lib/clang/{12.0.1 → 13.0.0}/include/x86intrin.h +0 -0
  165. /package/lib/clang/{12.0.1 → 13.0.0}/include/xmmintrin.h +0 -0
  166. /package/lib/clang/{12.0.1 → 13.0.0}/include/xopintrin.h +0 -0
  167. /package/lib/clang/{12.0.1 → 13.0.0}/include/xsavecintrin.h +0 -0
  168. /package/lib/clang/{12.0.1 → 13.0.0}/include/xsaveintrin.h +0 -0
  169. /package/lib/clang/{12.0.1 → 13.0.0}/include/xsaveoptintrin.h +0 -0
  170. /package/lib/clang/{12.0.1 → 13.0.0}/include/xsavesintrin.h +0 -0
  171. /package/lib/clang/{12.0.1 → 13.0.0}/include/xtestintrin.h +0 -0
@@ -41,9 +41,7 @@
41
41
 
42
42
  #define __ATTRS_o_ai __attribute__((__overloadable__, __always_inline__))
43
43
 
44
- #ifdef __POWER9_VECTOR__
45
44
  #include <stddef.h>
46
- #endif
47
45
 
48
46
  static __inline__ vector signed char __ATTRS_o_ai vec_perm(
49
47
  vector signed char __a, vector signed char __b, vector unsigned char __c);
@@ -126,7 +124,7 @@ vec_abs(vector signed int __a) {
126
124
  return __builtin_altivec_vmaxsw(__a, -__a);
127
125
  }
128
126
 
129
- #if defined(__POWER8_VECTOR__) && defined(__powerpc64__)
127
+ #ifdef __POWER8_VECTOR__
130
128
  static __inline__ vector signed long long __ATTRS_o_ai
131
129
  vec_abs(vector signed long long __a) {
132
130
  return __builtin_altivec_vmaxsd(__a, -__a);
@@ -284,7 +282,7 @@ vec_add(vector unsigned int __a, vector bool int __b) {
284
282
  return __a + (vector unsigned int)__b;
285
283
  }
286
284
 
287
- #if defined(__POWER8_VECTOR__) && defined(__powerpc64__)
285
+ #ifdef __POWER8_VECTOR__
288
286
  static __inline__ vector signed long long __ATTRS_o_ai
289
287
  vec_add(vector signed long long __a, vector signed long long __b) {
290
288
  return __a + __b;
@@ -295,6 +293,7 @@ vec_add(vector unsigned long long __a, vector unsigned long long __b) {
295
293
  return __a + __b;
296
294
  }
297
295
 
296
+ #ifdef __SIZEOF_INT128__
298
297
  static __inline__ vector signed __int128 __ATTRS_o_ai
299
298
  vec_add(vector signed __int128 __a, vector signed __int128 __b) {
300
299
  return __a + __b;
@@ -304,7 +303,37 @@ static __inline__ vector unsigned __int128 __ATTRS_o_ai
304
303
  vec_add(vector unsigned __int128 __a, vector unsigned __int128 __b) {
305
304
  return __a + __b;
306
305
  }
307
- #endif // defined(__POWER8_VECTOR__) && defined(__powerpc64__)
306
+ #endif
307
+
308
+ static __inline__ vector unsigned char __attribute__((__always_inline__))
309
+ vec_add_u128(vector unsigned char __a, vector unsigned char __b) {
310
+ return __builtin_altivec_vadduqm(__a, __b);
311
+ }
312
+ #elif defined(__VSX__)
313
+ static __inline__ vector signed long long __ATTRS_o_ai
314
+ vec_add(vector signed long long __a, vector signed long long __b) {
315
+ #ifdef __LITTLE_ENDIAN__
316
+ // Little endian systems on CPU's prior to Power8 don't really exist
317
+ // so scalarizing is fine.
318
+ return __a + __b;
319
+ #else
320
+ vector unsigned int __res =
321
+ (vector unsigned int)__a + (vector unsigned int)__b;
322
+ vector unsigned int __carry = __builtin_altivec_vaddcuw(
323
+ (vector unsigned int)__a, (vector unsigned int)__b);
324
+ __carry = __builtin_shufflevector((vector unsigned char)__carry,
325
+ (vector unsigned char)__carry, 0, 0, 0, 7,
326
+ 0, 0, 0, 0, 0, 0, 0, 15, 0, 0, 0, 0);
327
+ return (vector signed long long)(__res + __carry);
328
+ #endif
329
+ }
330
+
331
+ static __inline__ vector unsigned long long __ATTRS_o_ai
332
+ vec_add(vector unsigned long long __a, vector unsigned long long __b) {
333
+ return (vector unsigned long long)vec_add((vector signed long long)__a,
334
+ (vector signed long long)__b);
335
+ }
336
+ #endif // __POWER8_VECTOR__
308
337
 
309
338
  static __inline__ vector float __ATTRS_o_ai vec_add(vector float __a,
310
339
  vector float __b) {
@@ -320,7 +349,8 @@ static __inline__ vector double __ATTRS_o_ai vec_add(vector double __a,
320
349
 
321
350
  /* vec_adde */
322
351
 
323
- #if defined(__POWER8_VECTOR__) && defined(__powerpc64__)
352
+ #ifdef __POWER8_VECTOR__
353
+ #ifdef __SIZEOF_INT128__
324
354
  static __inline__ vector signed __int128 __ATTRS_o_ai
325
355
  vec_adde(vector signed __int128 __a, vector signed __int128 __b,
326
356
  vector signed __int128 __c) {
@@ -334,6 +364,13 @@ vec_adde(vector unsigned __int128 __a, vector unsigned __int128 __b,
334
364
  }
335
365
  #endif
336
366
 
367
+ static __inline__ vector unsigned char __attribute__((__always_inline__))
368
+ vec_adde_u128(vector unsigned char __a, vector unsigned char __b,
369
+ vector unsigned char __c) {
370
+ return (vector unsigned char)__builtin_altivec_vaddeuqm(__a, __b, __c);
371
+ }
372
+ #endif
373
+
337
374
  static __inline__ vector signed int __ATTRS_o_ai
338
375
  vec_adde(vector signed int __a, vector signed int __b,
339
376
  vector signed int __c) {
@@ -352,7 +389,8 @@ vec_adde(vector unsigned int __a, vector unsigned int __b,
352
389
 
353
390
  /* vec_addec */
354
391
 
355
- #if defined(__POWER8_VECTOR__) && defined(__powerpc64__)
392
+ #ifdef __POWER8_VECTOR__
393
+ #ifdef __SIZEOF_INT128__
356
394
  static __inline__ vector signed __int128 __ATTRS_o_ai
357
395
  vec_addec(vector signed __int128 __a, vector signed __int128 __b,
358
396
  vector signed __int128 __c) {
@@ -364,7 +402,15 @@ vec_addec(vector unsigned __int128 __a, vector unsigned __int128 __b,
364
402
  vector unsigned __int128 __c) {
365
403
  return __builtin_altivec_vaddecuq(__a, __b, __c);
366
404
  }
405
+ #endif
406
+
407
+ static __inline__ vector unsigned char __attribute__((__always_inline__))
408
+ vec_addec_u128(vector unsigned char __a, vector unsigned char __b,
409
+ vector unsigned char __c) {
410
+ return (vector unsigned char)__builtin_altivec_vaddecuq(__a, __b, __c);
411
+ }
367
412
 
413
+ #ifdef __powerpc64__
368
414
  static __inline__ vector signed int __ATTRS_o_ai
369
415
  vec_addec(vector signed int __a, vector signed int __b,
370
416
  vector signed int __c) {
@@ -407,8 +453,8 @@ vec_addec(vector unsigned int __a, vector unsigned int __b,
407
453
  vector unsigned int ret = { __result[0], __result[1], __result[2], __result[3] };
408
454
  return ret;
409
455
  }
410
-
411
- #endif
456
+ #endif // __powerpc64__
457
+ #endif // __POWER8_VECTOR__
412
458
 
413
459
  /* vec_vaddubm */
414
460
 
@@ -534,7 +580,8 @@ vec_addc(vector unsigned int __a, vector unsigned int __b) {
534
580
  return __builtin_altivec_vaddcuw(__a, __b);
535
581
  }
536
582
 
537
- #if defined(__POWER8_VECTOR__) && defined(__powerpc64__)
583
+ #ifdef __POWER8_VECTOR__
584
+ #ifdef __SIZEOF_INT128__
538
585
  static __inline__ vector signed __int128 __ATTRS_o_ai
539
586
  vec_addc(vector signed __int128 __a, vector signed __int128 __b) {
540
587
  return (vector signed __int128)__builtin_altivec_vaddcuq(
@@ -545,6 +592,12 @@ static __inline__ vector unsigned __int128 __ATTRS_o_ai
545
592
  vec_addc(vector unsigned __int128 __a, vector unsigned __int128 __b) {
546
593
  return __builtin_altivec_vaddcuq(__a, __b);
547
594
  }
595
+ #endif
596
+
597
+ static __inline__ vector unsigned char __attribute__((__always_inline__))
598
+ vec_addc_u128(vector unsigned char __a, vector unsigned char __b) {
599
+ return (vector unsigned char)__builtin_altivec_vaddcuq(__a, __b);
600
+ }
548
601
  #endif // defined(__POWER8_VECTOR__) && defined(__powerpc64__)
549
602
 
550
603
  /* vec_vaddcuw */
@@ -748,7 +801,8 @@ vec_vadduws(vector unsigned int __a, vector bool int __b) {
748
801
  return __builtin_altivec_vadduws(__a, (vector unsigned int)__b);
749
802
  }
750
803
 
751
- #if defined(__POWER8_VECTOR__) && defined(__powerpc64__)
804
+ #if defined(__POWER8_VECTOR__) && defined(__powerpc64__) && \
805
+ defined(__SIZEOF_INT128__)
752
806
  /* vec_vadduqm */
753
807
 
754
808
  static __inline__ vector signed __int128 __ATTRS_o_ai
@@ -1598,6 +1652,17 @@ static __inline__ vector double __ATTRS_o_ai vec_ceil(vector double __a) {
1598
1652
  }
1599
1653
  #endif
1600
1654
 
1655
+ /* vec_roundp */
1656
+ static __inline__ vector float __ATTRS_o_ai vec_roundp(vector float __a) {
1657
+ return vec_ceil(__a);
1658
+ }
1659
+
1660
+ #ifdef __VSX__
1661
+ static __inline__ vector double __ATTRS_o_ai vec_roundp(vector double __a) {
1662
+ return vec_ceil(__a);
1663
+ }
1664
+ #endif
1665
+
1601
1666
  /* vec_vrfip */
1602
1667
 
1603
1668
  static __inline__ vector float __attribute__((__always_inline__))
@@ -1690,7 +1755,31 @@ vec_cmpeq(vector bool long long __a, vector bool long long __b) {
1690
1755
  return (vector bool long long)__builtin_altivec_vcmpequd(
1691
1756
  (vector long long)__a, (vector long long)__b);
1692
1757
  }
1758
+ #elif defined(__VSX__)
1759
+ static __inline__ vector bool long long __ATTRS_o_ai
1760
+ vec_cmpeq(vector signed long long __a, vector signed long long __b) {
1761
+ vector bool int __wordcmp =
1762
+ vec_cmpeq((vector signed int)__a, (vector signed int)__b);
1763
+ #ifdef __LITTLE_ENDIAN__
1764
+ __wordcmp &= __builtin_shufflevector(__wordcmp, __wordcmp, 3, 0, 1, 2);
1765
+ return (vector bool long long)__builtin_shufflevector(__wordcmp, __wordcmp, 1,
1766
+ 1, 3, 3);
1767
+ #else
1768
+ __wordcmp &= __builtin_shufflevector(__wordcmp, __wordcmp, 1, 2, 3, 0);
1769
+ return (vector bool long long)__builtin_shufflevector(__wordcmp, __wordcmp, 0,
1770
+ 0, 2, 2);
1771
+ #endif
1772
+ }
1773
+
1774
+ static __inline__ vector bool long long __ATTRS_o_ai
1775
+ vec_cmpeq(vector unsigned long long __a, vector unsigned long long __b) {
1776
+ return vec_cmpeq((vector signed long long)__a, (vector signed long long)__b);
1777
+ }
1693
1778
 
1779
+ static __inline__ vector bool long long __ATTRS_o_ai
1780
+ vec_cmpeq(vector bool long long __a, vector bool long long __b) {
1781
+ return vec_cmpeq((vector signed long long)__a, (vector signed long long)__b);
1782
+ }
1694
1783
  #endif
1695
1784
 
1696
1785
  static __inline__ vector bool int __ATTRS_o_ai vec_cmpeq(vector float __a,
@@ -1709,7 +1798,7 @@ vec_cmpeq(vector double __a, vector double __b) {
1709
1798
  }
1710
1799
  #endif
1711
1800
 
1712
- #ifdef __POWER10_VECTOR__
1801
+ #if defined(__POWER10_VECTOR__) && defined(__SIZEOF_INT128__)
1713
1802
  static __inline__ vector bool __int128 __ATTRS_o_ai
1714
1803
  vec_cmpeq(vector signed __int128 __a, vector signed __int128 __b) {
1715
1804
  return (vector bool __int128)__builtin_altivec_vcmpequq(
@@ -1786,7 +1875,7 @@ vec_cmpne(vector float __a, vector float __b) {
1786
1875
  (vector int)__b);
1787
1876
  }
1788
1877
 
1789
- #ifdef __POWER10_VECTOR__
1878
+ #if defined(__POWER10_VECTOR__) && defined(__SIZEOF_INT128__)
1790
1879
  static __inline__ vector bool __int128 __ATTRS_o_ai
1791
1880
  vec_cmpne(vector unsigned __int128 __a, vector unsigned __int128 __b) {
1792
1881
  return (vector bool __int128) ~(__builtin_altivec_vcmpequq(
@@ -1884,6 +1973,7 @@ vec_parity_lsbb(vector signed int __a) {
1884
1973
  return __builtin_altivec_vprtybw(__a);
1885
1974
  }
1886
1975
 
1976
+ #ifdef __SIZEOF_INT128__
1887
1977
  static __inline__ vector unsigned __int128 __ATTRS_o_ai
1888
1978
  vec_parity_lsbb(vector unsigned __int128 __a) {
1889
1979
  return __builtin_altivec_vprtybq(__a);
@@ -1893,6 +1983,7 @@ static __inline__ vector unsigned __int128 __ATTRS_o_ai
1893
1983
  vec_parity_lsbb(vector signed __int128 __a) {
1894
1984
  return __builtin_altivec_vprtybq(__a);
1895
1985
  }
1986
+ #endif
1896
1987
 
1897
1988
  static __inline__ vector unsigned long long __ATTRS_o_ai
1898
1989
  vec_parity_lsbb(vector unsigned long long __a) {
@@ -1976,6 +2067,24 @@ vec_cmpne(vector unsigned long long __a, vector unsigned long long __b) {
1976
2067
  return (vector bool long long)
1977
2068
  ~(__builtin_altivec_vcmpequd((vector long long)__a, (vector long long)__b));
1978
2069
  }
2070
+ #elif defined(__VSX__)
2071
+ static __inline__ vector bool long long __ATTRS_o_ai
2072
+ vec_cmpne(vector bool long long __a, vector bool long long __b) {
2073
+ return (vector bool long long)~(
2074
+ vec_cmpeq((vector signed long long)__a, (vector signed long long)__b));
2075
+ }
2076
+
2077
+ static __inline__ vector bool long long __ATTRS_o_ai
2078
+ vec_cmpne(vector signed long long __a, vector signed long long __b) {
2079
+ return (vector bool long long)~(
2080
+ vec_cmpeq((vector signed long long)__a, (vector signed long long)__b));
2081
+ }
2082
+
2083
+ static __inline__ vector bool long long __ATTRS_o_ai
2084
+ vec_cmpne(vector unsigned long long __a, vector unsigned long long __b) {
2085
+ return (vector bool long long)~(
2086
+ vec_cmpeq((vector signed long long)__a, (vector signed long long)__b));
2087
+ }
1979
2088
  #endif
1980
2089
 
1981
2090
  #ifdef __VSX__
@@ -2028,6 +2137,46 @@ static __inline__ vector bool long long __ATTRS_o_ai
2028
2137
  vec_cmpgt(vector unsigned long long __a, vector unsigned long long __b) {
2029
2138
  return (vector bool long long)__builtin_altivec_vcmpgtud(__a, __b);
2030
2139
  }
2140
+ #elif defined(__VSX__)
2141
+ static __inline__ vector bool long long __ATTRS_o_ai
2142
+ vec_cmpgt(vector signed long long __a, vector signed long long __b) {
2143
+ vector signed int __sgtw = (vector signed int)vec_cmpgt(
2144
+ (vector signed int)__a, (vector signed int)__b);
2145
+ vector unsigned int __ugtw = (vector unsigned int)vec_cmpgt(
2146
+ (vector unsigned int)__a, (vector unsigned int)__b);
2147
+ vector unsigned int __eqw = (vector unsigned int)vec_cmpeq(
2148
+ (vector signed int)__a, (vector signed int)__b);
2149
+ #ifdef __LITTLE_ENDIAN__
2150
+ __ugtw = __builtin_shufflevector(__ugtw, __ugtw, 3, 0, 1, 2) & __eqw;
2151
+ __sgtw |= (vector signed int)__ugtw;
2152
+ return (vector bool long long)__builtin_shufflevector(__sgtw, __sgtw, 1, 1, 3,
2153
+ 3);
2154
+ #else
2155
+ __ugtw = __builtin_shufflevector(__ugtw, __ugtw, 1, 2, 3, 0) & __eqw;
2156
+ __sgtw |= (vector signed int)__ugtw;
2157
+ return (vector bool long long)__builtin_shufflevector(__sgtw, __sgtw, 0, 0, 2,
2158
+ 2);
2159
+ #endif
2160
+ }
2161
+
2162
+ static __inline__ vector bool long long __ATTRS_o_ai
2163
+ vec_cmpgt(vector unsigned long long __a, vector unsigned long long __b) {
2164
+ vector unsigned int __ugtw = (vector unsigned int)vec_cmpgt(
2165
+ (vector unsigned int)__a, (vector unsigned int)__b);
2166
+ vector unsigned int __eqw = (vector unsigned int)vec_cmpeq(
2167
+ (vector signed int)__a, (vector signed int)__b);
2168
+ #ifdef __LITTLE_ENDIAN__
2169
+ __eqw = __builtin_shufflevector(__ugtw, __ugtw, 3, 0, 1, 2) & __eqw;
2170
+ __ugtw |= __eqw;
2171
+ return (vector bool long long)__builtin_shufflevector(__ugtw, __ugtw, 1, 1, 3,
2172
+ 3);
2173
+ #else
2174
+ __eqw = __builtin_shufflevector(__ugtw, __ugtw, 1, 2, 3, 0) & __eqw;
2175
+ __ugtw |= __eqw;
2176
+ return (vector bool long long)__builtin_shufflevector(__ugtw, __ugtw, 0, 0, 2,
2177
+ 2);
2178
+ #endif
2179
+ }
2031
2180
  #endif
2032
2181
 
2033
2182
  static __inline__ vector bool int __ATTRS_o_ai vec_cmpgt(vector float __a,
@@ -2046,7 +2195,7 @@ vec_cmpgt(vector double __a, vector double __b) {
2046
2195
  }
2047
2196
  #endif
2048
2197
 
2049
- #ifdef __POWER10_VECTOR__
2198
+ #if defined(__POWER10_VECTOR__) && defined(__SIZEOF_INT128__)
2050
2199
  static __inline__ vector bool __int128 __ATTRS_o_ai
2051
2200
  vec_cmpgt(vector signed __int128 __a, vector signed __int128 __b) {
2052
2201
  return (vector bool __int128)__builtin_altivec_vcmpgtsq(
@@ -2106,9 +2255,7 @@ static __inline__ vector bool long long __ATTRS_o_ai
2106
2255
  vec_cmpge(vector double __a, vector double __b) {
2107
2256
  return (vector bool long long)__builtin_vsx_xvcmpgedp(__a, __b);
2108
2257
  }
2109
- #endif
2110
2258
 
2111
- #ifdef __POWER8_VECTOR__
2112
2259
  static __inline__ vector bool long long __ATTRS_o_ai
2113
2260
  vec_cmpge(vector signed long long __a, vector signed long long __b) {
2114
2261
  return ~(vec_cmpgt(__b, __a));
@@ -2120,7 +2267,7 @@ vec_cmpge(vector unsigned long long __a, vector unsigned long long __b) {
2120
2267
  }
2121
2268
  #endif
2122
2269
 
2123
- #ifdef __POWER10_VECTOR__
2270
+ #if defined(__POWER10_VECTOR__) && defined(__SIZEOF_INT128__)
2124
2271
  static __inline__ vector bool __int128 __ATTRS_o_ai
2125
2272
  vec_cmpge(vector signed __int128 __a, vector signed __int128 __b) {
2126
2273
  return ~(vec_cmpgt(__b, __a));
@@ -2230,9 +2377,7 @@ static __inline__ vector bool long long __ATTRS_o_ai
2230
2377
  vec_cmple(vector double __a, vector double __b) {
2231
2378
  return vec_cmpge(__b, __a);
2232
2379
  }
2233
- #endif
2234
2380
 
2235
- #ifdef __POWER8_VECTOR__
2236
2381
  static __inline__ vector bool long long __ATTRS_o_ai
2237
2382
  vec_cmple(vector signed long long __a, vector signed long long __b) {
2238
2383
  return vec_cmpge(__b, __a);
@@ -2244,7 +2389,7 @@ vec_cmple(vector unsigned long long __a, vector unsigned long long __b) {
2244
2389
  }
2245
2390
  #endif
2246
2391
 
2247
- #ifdef __POWER10_VECTOR__
2392
+ #if defined(__POWER10_VECTOR__) && defined(__SIZEOF_INT128__)
2248
2393
  static __inline__ vector bool __int128 __ATTRS_o_ai
2249
2394
  vec_cmple(vector signed __int128 __a, vector signed __int128 __b) {
2250
2395
  return vec_cmpge(__b, __a);
@@ -2300,7 +2445,7 @@ vec_cmplt(vector double __a, vector double __b) {
2300
2445
  }
2301
2446
  #endif
2302
2447
 
2303
- #ifdef __POWER10_VECTOR__
2448
+ #if defined(__POWER10_VECTOR__) && defined(__SIZEOF_INT128__)
2304
2449
  static __inline__ vector bool __int128 __ATTRS_o_ai
2305
2450
  vec_cmplt(vector signed __int128 __a, vector signed __int128 __b) {
2306
2451
  return vec_cmpgt(__b, __a);
@@ -2312,7 +2457,7 @@ vec_cmplt(vector unsigned __int128 __a, vector unsigned __int128 __b) {
2312
2457
  }
2313
2458
  #endif
2314
2459
 
2315
- #ifdef __POWER8_VECTOR__
2460
+ #ifdef __VSX__
2316
2461
  static __inline__ vector bool long long __ATTRS_o_ai
2317
2462
  vec_cmplt(vector signed long long __a, vector signed long long __b) {
2318
2463
  return vec_cmpgt(__b, __a);
@@ -2322,7 +2467,9 @@ static __inline__ vector bool long long __ATTRS_o_ai
2322
2467
  vec_cmplt(vector unsigned long long __a, vector unsigned long long __b) {
2323
2468
  return vec_cmpgt(__b, __a);
2324
2469
  }
2470
+ #endif
2325
2471
 
2472
+ #ifdef __POWER8_VECTOR__
2326
2473
  /* vec_popcnt */
2327
2474
 
2328
2475
  static __inline__ vector signed char __ATTRS_o_ai
@@ -2358,6 +2505,7 @@ vec_popcnt(vector unsigned long long __a) {
2358
2505
  return __builtin_altivec_vpopcntd(__a);
2359
2506
  }
2360
2507
 
2508
+ #define vec_vclz vec_cntlz
2361
2509
  /* vec_cntlz */
2362
2510
 
2363
2511
  static __inline__ vector signed char __ATTRS_o_ai
@@ -2870,6 +3018,7 @@ static __inline__ vector float __ATTRS_o_ai vec_xl_len(const float *__a, size_t
2870
3018
  return (vector float)__builtin_vsx_lxvl(__a, (__b << 56));
2871
3019
  }
2872
3020
 
3021
+ #ifdef __SIZEOF_INT128__
2873
3022
  static __inline__ vector signed __int128 __ATTRS_o_ai
2874
3023
  vec_xl_len(const signed __int128 *__a, size_t __b) {
2875
3024
  return (vector signed __int128)__builtin_vsx_lxvl(__a, (__b << 56));
@@ -2879,6 +3028,7 @@ static __inline__ vector unsigned __int128 __ATTRS_o_ai
2879
3028
  vec_xl_len(const unsigned __int128 *__a, size_t __b) {
2880
3029
  return (vector unsigned __int128)__builtin_vsx_lxvl(__a, (__b << 56));
2881
3030
  }
3031
+ #endif
2882
3032
 
2883
3033
  static __inline__ vector signed long long __ATTRS_o_ai
2884
3034
  vec_xl_len(const signed long long *__a, size_t __b) {
@@ -2946,6 +3096,7 @@ static __inline__ void __ATTRS_o_ai vec_xst_len(vector float __a, float *__b,
2946
3096
  return __builtin_vsx_stxvl((vector int)__a, __b, (__c << 56));
2947
3097
  }
2948
3098
 
3099
+ #ifdef __SIZEOF_INT128__
2949
3100
  static __inline__ void __ATTRS_o_ai vec_xst_len(vector signed __int128 __a,
2950
3101
  signed __int128 *__b,
2951
3102
  size_t __c) {
@@ -2957,6 +3108,7 @@ static __inline__ void __ATTRS_o_ai vec_xst_len(vector unsigned __int128 __a,
2957
3108
  size_t __c) {
2958
3109
  return __builtin_vsx_stxvl((vector int)__a, __b, (__c << 56));
2959
3110
  }
3111
+ #endif
2960
3112
 
2961
3113
  static __inline__ void __ATTRS_o_ai vec_xst_len(vector signed long long __a,
2962
3114
  signed long long *__b,
@@ -2991,6 +3143,15 @@ static __inline__ void __ATTRS_o_ai vec_xst_len_r(vector unsigned char __a,
2991
3143
  #endif
2992
3144
  #endif
2993
3145
 
3146
+ #if defined(__POWER9_VECTOR__) && defined(__powerpc64__)
3147
+ #define __vec_ldrmb(PTR, CNT) vec_xl_len_r((const unsigned char *)(PTR), (CNT))
3148
+ #define __vec_strmb(PTR, CNT, VAL) \
3149
+ vec_xst_len_r((VAL), (unsigned char *)(PTR), (CNT))
3150
+ #else
3151
+ #define __vec_ldrmb __builtin_vsx_ldrmb
3152
+ #define __vec_strmb __builtin_vsx_strmb
3153
+ #endif
3154
+
2994
3155
  /* vec_cpsgn */
2995
3156
 
2996
3157
  #ifdef __VSX__
@@ -3008,6 +3169,23 @@ static __inline__ vector double __ATTRS_o_ai vec_cpsgn(vector double __a,
3008
3169
  /* vec_ctf */
3009
3170
 
3010
3171
  #ifdef __VSX__
3172
+ // There are some functions that have different signatures with the XL compiler
3173
+ // from those in Clang/GCC and documented in the PVIPR. This macro ensures that
3174
+ // the XL-compatible signatures are used for those functions.
3175
+ #ifdef __XL_COMPAT_ALTIVEC__
3176
+ #define vec_ctf(__a, __b) \
3177
+ _Generic((__a), vector int \
3178
+ : (vector float)__builtin_altivec_vcfsx((vector int)(__a), (__b)), \
3179
+ vector unsigned int \
3180
+ : (vector float)__builtin_altivec_vcfux((vector unsigned int)(__a), \
3181
+ (__b)), \
3182
+ vector unsigned long long \
3183
+ : (__builtin_vsx_xvcvuxdsp((vector unsigned long long)(__a)) * \
3184
+ (vector float)(vector unsigned)((0x7f - (__b)) << 23)), \
3185
+ vector signed long long \
3186
+ : (__builtin_vsx_xvcvsxdsp((vector signed long long)(__a)) * \
3187
+ (vector float)(vector unsigned)((0x7f - (__b)) << 23)))
3188
+ #else // __XL_COMPAT_ALTIVEC__
3011
3189
  #define vec_ctf(__a, __b) \
3012
3190
  _Generic((__a), vector int \
3013
3191
  : (vector float)__builtin_altivec_vcfsx((vector int)(__a), (__b)), \
@@ -3024,6 +3202,7 @@ static __inline__ vector double __ATTRS_o_ai vec_cpsgn(vector double __a,
3024
3202
  vector double) * \
3025
3203
  (vector double)(vector unsigned long long)((0x3ffULL - (__b)) \
3026
3204
  << 52)))
3205
+ #endif // __XL_COMPAT_ALTIVEC__
3027
3206
  #else
3028
3207
  #define vec_ctf(__a, __b) \
3029
3208
  _Generic((__a), vector int \
@@ -3033,10 +3212,32 @@ static __inline__ vector double __ATTRS_o_ai vec_cpsgn(vector double __a,
3033
3212
  (__b)))
3034
3213
  #endif
3035
3214
 
3215
+ /* vec_ctd */
3216
+ #ifdef __VSX__
3217
+ #define vec_ctd(__a, __b) \
3218
+ _Generic((__a), vector signed int \
3219
+ : (vec_doublee((vector signed int)(__a)) * \
3220
+ (vector double)(vector unsigned long long)((0x3ffULL - (__b)) \
3221
+ << 52)), \
3222
+ vector unsigned int \
3223
+ : (vec_doublee((vector unsigned int)(__a)) * \
3224
+ (vector double)(vector unsigned long long)((0x3ffULL - (__b)) \
3225
+ << 52)), \
3226
+ vector unsigned long long \
3227
+ : (__builtin_convertvector((vector unsigned long long)(__a), \
3228
+ vector double) * \
3229
+ (vector double)(vector unsigned long long)((0x3ffULL - (__b)) \
3230
+ << 52)), \
3231
+ vector signed long long \
3232
+ : (__builtin_convertvector((vector signed long long)(__a), \
3233
+ vector double) * \
3234
+ (vector double)(vector unsigned long long)((0x3ffULL - (__b)) \
3235
+ << 52)))
3236
+ #endif // __VSX__
3237
+
3036
3238
  /* vec_vcfsx */
3037
3239
 
3038
3240
  #define vec_vcfux __builtin_altivec_vcfux
3039
-
3040
3241
  /* vec_vcfux */
3041
3242
 
3042
3243
  #define vec_vcfsx(__a, __b) __builtin_altivec_vcfsx((vector int)(__a), (__b))
@@ -3044,6 +3245,19 @@ static __inline__ vector double __ATTRS_o_ai vec_cpsgn(vector double __a,
3044
3245
  /* vec_cts */
3045
3246
 
3046
3247
  #ifdef __VSX__
3248
+ #ifdef __XL_COMPAT_ALTIVEC__
3249
+ #define vec_cts(__a, __b) \
3250
+ _Generic((__a), vector float \
3251
+ : __builtin_altivec_vctsxs((vector float)(__a), (__b)), \
3252
+ vector double \
3253
+ : __extension__({ \
3254
+ vector double __ret = \
3255
+ (vector double)(__a) * \
3256
+ (vector double)(vector unsigned long long)((0x3ffULL + (__b)) \
3257
+ << 52); \
3258
+ __builtin_vsx_xvcvdpsxws(__ret); \
3259
+ }))
3260
+ #else // __XL_COMPAT_ALTIVEC__
3047
3261
  #define vec_cts(__a, __b) \
3048
3262
  _Generic((__a), vector float \
3049
3263
  : __builtin_altivec_vctsxs((vector float)(__a), (__b)), \
@@ -3055,6 +3269,7 @@ static __inline__ vector double __ATTRS_o_ai vec_cpsgn(vector double __a,
3055
3269
  << 52); \
3056
3270
  __builtin_convertvector(__ret, vector signed long long); \
3057
3271
  }))
3272
+ #endif // __XL_COMPAT_ALTIVEC__
3058
3273
  #else
3059
3274
  #define vec_cts __builtin_altivec_vctsxs
3060
3275
  #endif
@@ -3066,6 +3281,19 @@ static __inline__ vector double __ATTRS_o_ai vec_cpsgn(vector double __a,
3066
3281
  /* vec_ctu */
3067
3282
 
3068
3283
  #ifdef __VSX__
3284
+ #ifdef __XL_COMPAT_ALTIVEC__
3285
+ #define vec_ctu(__a, __b) \
3286
+ _Generic((__a), vector float \
3287
+ : __builtin_altivec_vctuxs((vector float)(__a), (__b)), \
3288
+ vector double \
3289
+ : __extension__({ \
3290
+ vector double __ret = \
3291
+ (vector double)(__a) * \
3292
+ (vector double)(vector unsigned long long)((0x3ffULL + __b) \
3293
+ << 52); \
3294
+ __builtin_vsx_xvcvdpuxws(__ret); \
3295
+ }))
3296
+ #else // __XL_COMPAT_ALTIVEC__
3069
3297
  #define vec_ctu(__a, __b) \
3070
3298
  _Generic((__a), vector float \
3071
3299
  : __builtin_altivec_vctuxs((vector float)(__a), (__b)), \
@@ -3077,10 +3305,95 @@ static __inline__ vector double __ATTRS_o_ai vec_cpsgn(vector double __a,
3077
3305
  << 52); \
3078
3306
  __builtin_convertvector(__ret, vector unsigned long long); \
3079
3307
  }))
3308
+ #endif // __XL_COMPAT_ALTIVEC__
3080
3309
  #else
3081
3310
  #define vec_ctu __builtin_altivec_vctuxs
3082
3311
  #endif
3083
3312
 
3313
+ #ifdef __LITTLE_ENDIAN__
3314
+ /* vec_ctsl */
3315
+
3316
+ #ifdef __VSX__
3317
+ #define vec_ctsl(__a, __b) \
3318
+ _Generic((__a), vector float \
3319
+ : __extension__({ \
3320
+ vector float __ret = \
3321
+ (vector float)(__a) * \
3322
+ (vector float)(vector unsigned)((0x7f + (__b)) << 23); \
3323
+ __builtin_vsx_xvcvspsxds( \
3324
+ __builtin_vsx_xxsldwi(__ret, __ret, 1)); \
3325
+ }), \
3326
+ vector double \
3327
+ : __extension__({ \
3328
+ vector double __ret = \
3329
+ (vector double)(__a) * \
3330
+ (vector double)(vector unsigned long long)((0x3ffULL + __b) \
3331
+ << 52); \
3332
+ __builtin_convertvector(__ret, vector signed long long); \
3333
+ }))
3334
+
3335
+ /* vec_ctul */
3336
+
3337
+ #define vec_ctul(__a, __b) \
3338
+ _Generic((__a), vector float \
3339
+ : __extension__({ \
3340
+ vector float __ret = \
3341
+ (vector float)(__a) * \
3342
+ (vector float)(vector unsigned)((0x7f + (__b)) << 23); \
3343
+ __builtin_vsx_xvcvspuxds( \
3344
+ __builtin_vsx_xxsldwi(__ret, __ret, 1)); \
3345
+ }), \
3346
+ vector double \
3347
+ : __extension__({ \
3348
+ vector double __ret = \
3349
+ (vector double)(__a) * \
3350
+ (vector double)(vector unsigned long long)((0x3ffULL + __b) \
3351
+ << 52); \
3352
+ __builtin_convertvector(__ret, vector unsigned long long); \
3353
+ }))
3354
+ #endif
3355
+ #else // __LITTLE_ENDIAN__
3356
+ /* vec_ctsl */
3357
+
3358
+ #ifdef __VSX__
3359
+ #define vec_ctsl(__a, __b) \
3360
+ _Generic((__a), vector float \
3361
+ : __extension__({ \
3362
+ vector float __ret = \
3363
+ (vector float)(__a) * \
3364
+ (vector float)(vector unsigned)((0x7f + (__b)) << 23); \
3365
+ __builtin_vsx_xvcvspsxds(__ret); \
3366
+ }), \
3367
+ vector double \
3368
+ : __extension__({ \
3369
+ vector double __ret = \
3370
+ (vector double)(__a) * \
3371
+ (vector double)(vector unsigned long long)((0x3ffULL + __b) \
3372
+ << 52); \
3373
+ __builtin_convertvector(__ret, vector signed long long); \
3374
+ }))
3375
+
3376
+ /* vec_ctul */
3377
+
3378
+ #define vec_ctul(__a, __b) \
3379
+ _Generic((__a), vector float \
3380
+ : __extension__({ \
3381
+ vector float __ret = \
3382
+ (vector float)(__a) * \
3383
+ (vector float)(vector unsigned)((0x7f + (__b)) << 23); \
3384
+ __builtin_vsx_xvcvspuxds(__ret); \
3385
+ }), \
3386
+ vector double \
3387
+ : __extension__({ \
3388
+ vector double __ret = \
3389
+ (vector double)(__a) * \
3390
+ (vector double)(vector unsigned long long)((0x3ffULL + __b) \
3391
+ << 52); \
3392
+ __builtin_convertvector(__ret, vector unsigned long long); \
3393
+ }))
3394
+ #endif
3395
+ #endif // __LITTLE_ENDIAN__
3396
+
3084
3397
  /* vec_vctuxs */
3085
3398
 
3086
3399
  #define vec_vctuxs __builtin_altivec_vctuxs
@@ -3114,7 +3427,7 @@ vec_signextll(vector signed int __a) {
3114
3427
  }
3115
3428
  #endif
3116
3429
 
3117
- #ifdef __POWER10_VECTOR__
3430
+ #if defined(__POWER10_VECTOR__) && defined(__SIZEOF_INT128__)
3118
3431
  static __inline__ vector signed __int128 __ATTRS_o_ai
3119
3432
  vec_signextq(vector signed long long __a) {
3120
3433
  return __builtin_altivec_vextsd2q(__a);
@@ -3399,6 +3712,15 @@ vec_doubleo(vector float __a) {
3399
3712
  return __builtin_vsx_xvcvspdp(vec_sld(__a, __a, 4));
3400
3713
  #endif
3401
3714
  }
3715
+
3716
+ /* vec_cvf */
3717
+ static __inline__ vector double __ATTRS_o_ai vec_cvf(vector float __a) {
3718
+ return vec_doublee(__a);
3719
+ }
3720
+
3721
+ static __inline__ vector float __ATTRS_o_ai vec_cvf(vector double __a) {
3722
+ return vec_floate(__a);
3723
+ }
3402
3724
  #endif
3403
3725
 
3404
3726
  /* vec_div */
@@ -3481,6 +3803,7 @@ vec_dive(vector unsigned long long __a, vector unsigned long long __b) {
3481
3803
  return __builtin_altivec_vdiveud(__a, __b);
3482
3804
  }
3483
3805
 
3806
+ #ifdef __SIZEOF_INT128__
3484
3807
  static __inline__ vector unsigned __int128 __ATTRS_o_ai
3485
3808
  vec_dive(vector unsigned __int128 __a, vector unsigned __int128 __b) {
3486
3809
  return __builtin_altivec_vdiveuq(__a, __b);
@@ -3491,8 +3814,9 @@ vec_dive(vector signed __int128 __a, vector signed __int128 __b) {
3491
3814
  return __builtin_altivec_vdivesq(__a, __b);
3492
3815
  }
3493
3816
  #endif
3817
+ #endif
3494
3818
 
3495
- #ifdef __POWER10_VECTOR__
3819
+ #if defined(__POWER10_VECTOR__) && defined(__SIZEOF_INT128__)
3496
3820
  static __inline__ vector unsigned __int128 __ATTRS_o_ai
3497
3821
  vec_div(vector unsigned __int128 __a, vector unsigned __int128 __b) {
3498
3822
  return __a / __b;
@@ -3661,6 +3985,17 @@ static __inline__ vector double __ATTRS_o_ai vec_floor(vector double __a) {
3661
3985
  }
3662
3986
  #endif
3663
3987
 
3988
+ /* vec_roundm */
3989
+ static __inline__ vector float __ATTRS_o_ai vec_roundm(vector float __a) {
3990
+ return vec_floor(__a);
3991
+ }
3992
+
3993
+ #ifdef __VSX__
3994
+ static __inline__ vector double __ATTRS_o_ai vec_roundm(vector double __a) {
3995
+ return vec_floor(__a);
3996
+ }
3997
+ #endif
3998
+
3664
3999
  /* vec_vrfim */
3665
4000
 
3666
4001
  static __inline__ vector float __attribute__((__always_inline__))
@@ -3671,251 +4006,251 @@ vec_vrfim(vector float __a) {
3671
4006
  /* vec_ld */
3672
4007
 
3673
4008
  static __inline__ vector signed char __ATTRS_o_ai
3674
- vec_ld(int __a, const vector signed char *__b) {
4009
+ vec_ld(long __a, const vector signed char *__b) {
3675
4010
  return (vector signed char)__builtin_altivec_lvx(__a, __b);
3676
4011
  }
3677
4012
 
3678
4013
  static __inline__ vector signed char __ATTRS_o_ai
3679
- vec_ld(int __a, const signed char *__b) {
4014
+ vec_ld(long __a, const signed char *__b) {
3680
4015
  return (vector signed char)__builtin_altivec_lvx(__a, __b);
3681
4016
  }
3682
4017
 
3683
4018
  static __inline__ vector unsigned char __ATTRS_o_ai
3684
- vec_ld(int __a, const vector unsigned char *__b) {
4019
+ vec_ld(long __a, const vector unsigned char *__b) {
3685
4020
  return (vector unsigned char)__builtin_altivec_lvx(__a, __b);
3686
4021
  }
3687
4022
 
3688
4023
  static __inline__ vector unsigned char __ATTRS_o_ai
3689
- vec_ld(int __a, const unsigned char *__b) {
4024
+ vec_ld(long __a, const unsigned char *__b) {
3690
4025
  return (vector unsigned char)__builtin_altivec_lvx(__a, __b);
3691
4026
  }
3692
4027
 
3693
4028
  static __inline__ vector bool char __ATTRS_o_ai
3694
- vec_ld(int __a, const vector bool char *__b) {
4029
+ vec_ld(long __a, const vector bool char *__b) {
3695
4030
  return (vector bool char)__builtin_altivec_lvx(__a, __b);
3696
4031
  }
3697
4032
 
3698
- static __inline__ vector short __ATTRS_o_ai vec_ld(int __a,
4033
+ static __inline__ vector short __ATTRS_o_ai vec_ld(long __a,
3699
4034
  const vector short *__b) {
3700
4035
  return (vector short)__builtin_altivec_lvx(__a, __b);
3701
4036
  }
3702
4037
 
3703
- static __inline__ vector short __ATTRS_o_ai vec_ld(int __a, const short *__b) {
4038
+ static __inline__ vector short __ATTRS_o_ai vec_ld(long __a, const short *__b) {
3704
4039
  return (vector short)__builtin_altivec_lvx(__a, __b);
3705
4040
  }
3706
4041
 
3707
4042
  static __inline__ vector unsigned short __ATTRS_o_ai
3708
- vec_ld(int __a, const vector unsigned short *__b) {
4043
+ vec_ld(long __a, const vector unsigned short *__b) {
3709
4044
  return (vector unsigned short)__builtin_altivec_lvx(__a, __b);
3710
4045
  }
3711
4046
 
3712
4047
  static __inline__ vector unsigned short __ATTRS_o_ai
3713
- vec_ld(int __a, const unsigned short *__b) {
4048
+ vec_ld(long __a, const unsigned short *__b) {
3714
4049
  return (vector unsigned short)__builtin_altivec_lvx(__a, __b);
3715
4050
  }
3716
4051
 
3717
4052
  static __inline__ vector bool short __ATTRS_o_ai
3718
- vec_ld(int __a, const vector bool short *__b) {
4053
+ vec_ld(long __a, const vector bool short *__b) {
3719
4054
  return (vector bool short)__builtin_altivec_lvx(__a, __b);
3720
4055
  }
3721
4056
 
3722
- static __inline__ vector pixel __ATTRS_o_ai vec_ld(int __a,
4057
+ static __inline__ vector pixel __ATTRS_o_ai vec_ld(long __a,
3723
4058
  const vector pixel *__b) {
3724
4059
  return (vector pixel)__builtin_altivec_lvx(__a, __b);
3725
4060
  }
3726
4061
 
3727
- static __inline__ vector int __ATTRS_o_ai vec_ld(int __a,
4062
+ static __inline__ vector int __ATTRS_o_ai vec_ld(long __a,
3728
4063
  const vector int *__b) {
3729
4064
  return (vector int)__builtin_altivec_lvx(__a, __b);
3730
4065
  }
3731
4066
 
3732
- static __inline__ vector int __ATTRS_o_ai vec_ld(int __a, const int *__b) {
4067
+ static __inline__ vector int __ATTRS_o_ai vec_ld(long __a, const int *__b) {
3733
4068
  return (vector int)__builtin_altivec_lvx(__a, __b);
3734
4069
  }
3735
4070
 
3736
4071
  static __inline__ vector unsigned int __ATTRS_o_ai
3737
- vec_ld(int __a, const vector unsigned int *__b) {
4072
+ vec_ld(long __a, const vector unsigned int *__b) {
3738
4073
  return (vector unsigned int)__builtin_altivec_lvx(__a, __b);
3739
4074
  }
3740
4075
 
3741
4076
  static __inline__ vector unsigned int __ATTRS_o_ai
3742
- vec_ld(int __a, const unsigned int *__b) {
4077
+ vec_ld(long __a, const unsigned int *__b) {
3743
4078
  return (vector unsigned int)__builtin_altivec_lvx(__a, __b);
3744
4079
  }
3745
4080
 
3746
4081
  static __inline__ vector bool int __ATTRS_o_ai
3747
- vec_ld(int __a, const vector bool int *__b) {
4082
+ vec_ld(long __a, const vector bool int *__b) {
3748
4083
  return (vector bool int)__builtin_altivec_lvx(__a, __b);
3749
4084
  }
3750
4085
 
3751
- static __inline__ vector float __ATTRS_o_ai vec_ld(int __a,
4086
+ static __inline__ vector float __ATTRS_o_ai vec_ld(long __a,
3752
4087
  const vector float *__b) {
3753
4088
  return (vector float)__builtin_altivec_lvx(__a, __b);
3754
4089
  }
3755
4090
 
3756
- static __inline__ vector float __ATTRS_o_ai vec_ld(int __a, const float *__b) {
4091
+ static __inline__ vector float __ATTRS_o_ai vec_ld(long __a, const float *__b) {
3757
4092
  return (vector float)__builtin_altivec_lvx(__a, __b);
3758
4093
  }
3759
4094
 
3760
4095
  /* vec_lvx */
3761
4096
 
3762
4097
  static __inline__ vector signed char __ATTRS_o_ai
3763
- vec_lvx(int __a, const vector signed char *__b) {
4098
+ vec_lvx(long __a, const vector signed char *__b) {
3764
4099
  return (vector signed char)__builtin_altivec_lvx(__a, __b);
3765
4100
  }
3766
4101
 
3767
4102
  static __inline__ vector signed char __ATTRS_o_ai
3768
- vec_lvx(int __a, const signed char *__b) {
4103
+ vec_lvx(long __a, const signed char *__b) {
3769
4104
  return (vector signed char)__builtin_altivec_lvx(__a, __b);
3770
4105
  }
3771
4106
 
3772
4107
  static __inline__ vector unsigned char __ATTRS_o_ai
3773
- vec_lvx(int __a, const vector unsigned char *__b) {
4108
+ vec_lvx(long __a, const vector unsigned char *__b) {
3774
4109
  return (vector unsigned char)__builtin_altivec_lvx(__a, __b);
3775
4110
  }
3776
4111
 
3777
4112
  static __inline__ vector unsigned char __ATTRS_o_ai
3778
- vec_lvx(int __a, const unsigned char *__b) {
4113
+ vec_lvx(long __a, const unsigned char *__b) {
3779
4114
  return (vector unsigned char)__builtin_altivec_lvx(__a, __b);
3780
4115
  }
3781
4116
 
3782
4117
  static __inline__ vector bool char __ATTRS_o_ai
3783
- vec_lvx(int __a, const vector bool char *__b) {
4118
+ vec_lvx(long __a, const vector bool char *__b) {
3784
4119
  return (vector bool char)__builtin_altivec_lvx(__a, __b);
3785
4120
  }
3786
4121
 
3787
- static __inline__ vector short __ATTRS_o_ai vec_lvx(int __a,
4122
+ static __inline__ vector short __ATTRS_o_ai vec_lvx(long __a,
3788
4123
  const vector short *__b) {
3789
4124
  return (vector short)__builtin_altivec_lvx(__a, __b);
3790
4125
  }
3791
4126
 
3792
- static __inline__ vector short __ATTRS_o_ai vec_lvx(int __a, const short *__b) {
4127
+ static __inline__ vector short __ATTRS_o_ai vec_lvx(long __a, const short *__b) {
3793
4128
  return (vector short)__builtin_altivec_lvx(__a, __b);
3794
4129
  }
3795
4130
 
3796
4131
  static __inline__ vector unsigned short __ATTRS_o_ai
3797
- vec_lvx(int __a, const vector unsigned short *__b) {
4132
+ vec_lvx(long __a, const vector unsigned short *__b) {
3798
4133
  return (vector unsigned short)__builtin_altivec_lvx(__a, __b);
3799
4134
  }
3800
4135
 
3801
4136
  static __inline__ vector unsigned short __ATTRS_o_ai
3802
- vec_lvx(int __a, const unsigned short *__b) {
4137
+ vec_lvx(long __a, const unsigned short *__b) {
3803
4138
  return (vector unsigned short)__builtin_altivec_lvx(__a, __b);
3804
4139
  }
3805
4140
 
3806
4141
  static __inline__ vector bool short __ATTRS_o_ai
3807
- vec_lvx(int __a, const vector bool short *__b) {
4142
+ vec_lvx(long __a, const vector bool short *__b) {
3808
4143
  return (vector bool short)__builtin_altivec_lvx(__a, __b);
3809
4144
  }
3810
4145
 
3811
- static __inline__ vector pixel __ATTRS_o_ai vec_lvx(int __a,
4146
+ static __inline__ vector pixel __ATTRS_o_ai vec_lvx(long __a,
3812
4147
  const vector pixel *__b) {
3813
4148
  return (vector pixel)__builtin_altivec_lvx(__a, __b);
3814
4149
  }
3815
4150
 
3816
- static __inline__ vector int __ATTRS_o_ai vec_lvx(int __a,
4151
+ static __inline__ vector int __ATTRS_o_ai vec_lvx(long __a,
3817
4152
  const vector int *__b) {
3818
4153
  return (vector int)__builtin_altivec_lvx(__a, __b);
3819
4154
  }
3820
4155
 
3821
- static __inline__ vector int __ATTRS_o_ai vec_lvx(int __a, const int *__b) {
4156
+ static __inline__ vector int __ATTRS_o_ai vec_lvx(long __a, const int *__b) {
3822
4157
  return (vector int)__builtin_altivec_lvx(__a, __b);
3823
4158
  }
3824
4159
 
3825
4160
  static __inline__ vector unsigned int __ATTRS_o_ai
3826
- vec_lvx(int __a, const vector unsigned int *__b) {
4161
+ vec_lvx(long __a, const vector unsigned int *__b) {
3827
4162
  return (vector unsigned int)__builtin_altivec_lvx(__a, __b);
3828
4163
  }
3829
4164
 
3830
4165
  static __inline__ vector unsigned int __ATTRS_o_ai
3831
- vec_lvx(int __a, const unsigned int *__b) {
4166
+ vec_lvx(long __a, const unsigned int *__b) {
3832
4167
  return (vector unsigned int)__builtin_altivec_lvx(__a, __b);
3833
4168
  }
3834
4169
 
3835
4170
  static __inline__ vector bool int __ATTRS_o_ai
3836
- vec_lvx(int __a, const vector bool int *__b) {
4171
+ vec_lvx(long __a, const vector bool int *__b) {
3837
4172
  return (vector bool int)__builtin_altivec_lvx(__a, __b);
3838
4173
  }
3839
4174
 
3840
- static __inline__ vector float __ATTRS_o_ai vec_lvx(int __a,
4175
+ static __inline__ vector float __ATTRS_o_ai vec_lvx(long __a,
3841
4176
  const vector float *__b) {
3842
4177
  return (vector float)__builtin_altivec_lvx(__a, __b);
3843
4178
  }
3844
4179
 
3845
- static __inline__ vector float __ATTRS_o_ai vec_lvx(int __a, const float *__b) {
4180
+ static __inline__ vector float __ATTRS_o_ai vec_lvx(long __a, const float *__b) {
3846
4181
  return (vector float)__builtin_altivec_lvx(__a, __b);
3847
4182
  }
3848
4183
 
3849
4184
  /* vec_lde */
3850
4185
 
3851
4186
  static __inline__ vector signed char __ATTRS_o_ai
3852
- vec_lde(int __a, const signed char *__b) {
4187
+ vec_lde(long __a, const signed char *__b) {
3853
4188
  return (vector signed char)__builtin_altivec_lvebx(__a, __b);
3854
4189
  }
3855
4190
 
3856
4191
  static __inline__ vector unsigned char __ATTRS_o_ai
3857
- vec_lde(int __a, const unsigned char *__b) {
4192
+ vec_lde(long __a, const unsigned char *__b) {
3858
4193
  return (vector unsigned char)__builtin_altivec_lvebx(__a, __b);
3859
4194
  }
3860
4195
 
3861
- static __inline__ vector short __ATTRS_o_ai vec_lde(int __a, const short *__b) {
4196
+ static __inline__ vector short __ATTRS_o_ai vec_lde(long __a, const short *__b) {
3862
4197
  return (vector short)__builtin_altivec_lvehx(__a, __b);
3863
4198
  }
3864
4199
 
3865
4200
  static __inline__ vector unsigned short __ATTRS_o_ai
3866
- vec_lde(int __a, const unsigned short *__b) {
4201
+ vec_lde(long __a, const unsigned short *__b) {
3867
4202
  return (vector unsigned short)__builtin_altivec_lvehx(__a, __b);
3868
4203
  }
3869
4204
 
3870
- static __inline__ vector int __ATTRS_o_ai vec_lde(int __a, const int *__b) {
4205
+ static __inline__ vector int __ATTRS_o_ai vec_lde(long __a, const int *__b) {
3871
4206
  return (vector int)__builtin_altivec_lvewx(__a, __b);
3872
4207
  }
3873
4208
 
3874
4209
  static __inline__ vector unsigned int __ATTRS_o_ai
3875
- vec_lde(int __a, const unsigned int *__b) {
4210
+ vec_lde(long __a, const unsigned int *__b) {
3876
4211
  return (vector unsigned int)__builtin_altivec_lvewx(__a, __b);
3877
4212
  }
3878
4213
 
3879
- static __inline__ vector float __ATTRS_o_ai vec_lde(int __a, const float *__b) {
4214
+ static __inline__ vector float __ATTRS_o_ai vec_lde(long __a, const float *__b) {
3880
4215
  return (vector float)__builtin_altivec_lvewx(__a, __b);
3881
4216
  }
3882
4217
 
3883
4218
  /* vec_lvebx */
3884
4219
 
3885
4220
  static __inline__ vector signed char __ATTRS_o_ai
3886
- vec_lvebx(int __a, const signed char *__b) {
4221
+ vec_lvebx(long __a, const signed char *__b) {
3887
4222
  return (vector signed char)__builtin_altivec_lvebx(__a, __b);
3888
4223
  }
3889
4224
 
3890
4225
  static __inline__ vector unsigned char __ATTRS_o_ai
3891
- vec_lvebx(int __a, const unsigned char *__b) {
4226
+ vec_lvebx(long __a, const unsigned char *__b) {
3892
4227
  return (vector unsigned char)__builtin_altivec_lvebx(__a, __b);
3893
4228
  }
3894
4229
 
3895
4230
  /* vec_lvehx */
3896
4231
 
3897
- static __inline__ vector short __ATTRS_o_ai vec_lvehx(int __a,
4232
+ static __inline__ vector short __ATTRS_o_ai vec_lvehx(long __a,
3898
4233
  const short *__b) {
3899
4234
  return (vector short)__builtin_altivec_lvehx(__a, __b);
3900
4235
  }
3901
4236
 
3902
4237
  static __inline__ vector unsigned short __ATTRS_o_ai
3903
- vec_lvehx(int __a, const unsigned short *__b) {
4238
+ vec_lvehx(long __a, const unsigned short *__b) {
3904
4239
  return (vector unsigned short)__builtin_altivec_lvehx(__a, __b);
3905
4240
  }
3906
4241
 
3907
4242
  /* vec_lvewx */
3908
4243
 
3909
- static __inline__ vector int __ATTRS_o_ai vec_lvewx(int __a, const int *__b) {
4244
+ static __inline__ vector int __ATTRS_o_ai vec_lvewx(long __a, const int *__b) {
3910
4245
  return (vector int)__builtin_altivec_lvewx(__a, __b);
3911
4246
  }
3912
4247
 
3913
4248
  static __inline__ vector unsigned int __ATTRS_o_ai
3914
- vec_lvewx(int __a, const unsigned int *__b) {
4249
+ vec_lvewx(long __a, const unsigned int *__b) {
3915
4250
  return (vector unsigned int)__builtin_altivec_lvewx(__a, __b);
3916
4251
  }
3917
4252
 
3918
- static __inline__ vector float __ATTRS_o_ai vec_lvewx(int __a,
4253
+ static __inline__ vector float __ATTRS_o_ai vec_lvewx(long __a,
3919
4254
  const float *__b) {
3920
4255
  return (vector float)__builtin_altivec_lvewx(__a, __b);
3921
4256
  }
@@ -3923,179 +4258,179 @@ static __inline__ vector float __ATTRS_o_ai vec_lvewx(int __a,
3923
4258
  /* vec_ldl */
3924
4259
 
3925
4260
  static __inline__ vector signed char __ATTRS_o_ai
3926
- vec_ldl(int __a, const vector signed char *__b) {
4261
+ vec_ldl(long __a, const vector signed char *__b) {
3927
4262
  return (vector signed char)__builtin_altivec_lvxl(__a, __b);
3928
4263
  }
3929
4264
 
3930
4265
  static __inline__ vector signed char __ATTRS_o_ai
3931
- vec_ldl(int __a, const signed char *__b) {
4266
+ vec_ldl(long __a, const signed char *__b) {
3932
4267
  return (vector signed char)__builtin_altivec_lvxl(__a, __b);
3933
4268
  }
3934
4269
 
3935
4270
  static __inline__ vector unsigned char __ATTRS_o_ai
3936
- vec_ldl(int __a, const vector unsigned char *__b) {
4271
+ vec_ldl(long __a, const vector unsigned char *__b) {
3937
4272
  return (vector unsigned char)__builtin_altivec_lvxl(__a, __b);
3938
4273
  }
3939
4274
 
3940
4275
  static __inline__ vector unsigned char __ATTRS_o_ai
3941
- vec_ldl(int __a, const unsigned char *__b) {
4276
+ vec_ldl(long __a, const unsigned char *__b) {
3942
4277
  return (vector unsigned char)__builtin_altivec_lvxl(__a, __b);
3943
4278
  }
3944
4279
 
3945
4280
  static __inline__ vector bool char __ATTRS_o_ai
3946
- vec_ldl(int __a, const vector bool char *__b) {
4281
+ vec_ldl(long __a, const vector bool char *__b) {
3947
4282
  return (vector bool char)__builtin_altivec_lvxl(__a, __b);
3948
4283
  }
3949
4284
 
3950
- static __inline__ vector short __ATTRS_o_ai vec_ldl(int __a,
4285
+ static __inline__ vector short __ATTRS_o_ai vec_ldl(long __a,
3951
4286
  const vector short *__b) {
3952
4287
  return (vector short)__builtin_altivec_lvxl(__a, __b);
3953
4288
  }
3954
4289
 
3955
- static __inline__ vector short __ATTRS_o_ai vec_ldl(int __a, const short *__b) {
4290
+ static __inline__ vector short __ATTRS_o_ai vec_ldl(long __a, const short *__b) {
3956
4291
  return (vector short)__builtin_altivec_lvxl(__a, __b);
3957
4292
  }
3958
4293
 
3959
4294
  static __inline__ vector unsigned short __ATTRS_o_ai
3960
- vec_ldl(int __a, const vector unsigned short *__b) {
4295
+ vec_ldl(long __a, const vector unsigned short *__b) {
3961
4296
  return (vector unsigned short)__builtin_altivec_lvxl(__a, __b);
3962
4297
  }
3963
4298
 
3964
4299
  static __inline__ vector unsigned short __ATTRS_o_ai
3965
- vec_ldl(int __a, const unsigned short *__b) {
4300
+ vec_ldl(long __a, const unsigned short *__b) {
3966
4301
  return (vector unsigned short)__builtin_altivec_lvxl(__a, __b);
3967
4302
  }
3968
4303
 
3969
4304
  static __inline__ vector bool short __ATTRS_o_ai
3970
- vec_ldl(int __a, const vector bool short *__b) {
4305
+ vec_ldl(long __a, const vector bool short *__b) {
3971
4306
  return (vector bool short)__builtin_altivec_lvxl(__a, __b);
3972
4307
  }
3973
4308
 
3974
- static __inline__ vector pixel __ATTRS_o_ai vec_ldl(int __a,
4309
+ static __inline__ vector pixel __ATTRS_o_ai vec_ldl(long __a,
3975
4310
  const vector pixel *__b) {
3976
4311
  return (vector pixel short)__builtin_altivec_lvxl(__a, __b);
3977
4312
  }
3978
4313
 
3979
- static __inline__ vector int __ATTRS_o_ai vec_ldl(int __a,
4314
+ static __inline__ vector int __ATTRS_o_ai vec_ldl(long __a,
3980
4315
  const vector int *__b) {
3981
4316
  return (vector int)__builtin_altivec_lvxl(__a, __b);
3982
4317
  }
3983
4318
 
3984
- static __inline__ vector int __ATTRS_o_ai vec_ldl(int __a, const int *__b) {
4319
+ static __inline__ vector int __ATTRS_o_ai vec_ldl(long __a, const int *__b) {
3985
4320
  return (vector int)__builtin_altivec_lvxl(__a, __b);
3986
4321
  }
3987
4322
 
3988
4323
  static __inline__ vector unsigned int __ATTRS_o_ai
3989
- vec_ldl(int __a, const vector unsigned int *__b) {
4324
+ vec_ldl(long __a, const vector unsigned int *__b) {
3990
4325
  return (vector unsigned int)__builtin_altivec_lvxl(__a, __b);
3991
4326
  }
3992
4327
 
3993
4328
  static __inline__ vector unsigned int __ATTRS_o_ai
3994
- vec_ldl(int __a, const unsigned int *__b) {
4329
+ vec_ldl(long __a, const unsigned int *__b) {
3995
4330
  return (vector unsigned int)__builtin_altivec_lvxl(__a, __b);
3996
4331
  }
3997
4332
 
3998
4333
  static __inline__ vector bool int __ATTRS_o_ai
3999
- vec_ldl(int __a, const vector bool int *__b) {
4334
+ vec_ldl(long __a, const vector bool int *__b) {
4000
4335
  return (vector bool int)__builtin_altivec_lvxl(__a, __b);
4001
4336
  }
4002
4337
 
4003
- static __inline__ vector float __ATTRS_o_ai vec_ldl(int __a,
4338
+ static __inline__ vector float __ATTRS_o_ai vec_ldl(long __a,
4004
4339
  const vector float *__b) {
4005
4340
  return (vector float)__builtin_altivec_lvxl(__a, __b);
4006
4341
  }
4007
4342
 
4008
- static __inline__ vector float __ATTRS_o_ai vec_ldl(int __a, const float *__b) {
4343
+ static __inline__ vector float __ATTRS_o_ai vec_ldl(long __a, const float *__b) {
4009
4344
  return (vector float)__builtin_altivec_lvxl(__a, __b);
4010
4345
  }
4011
4346
 
4012
4347
  /* vec_lvxl */
4013
4348
 
4014
4349
  static __inline__ vector signed char __ATTRS_o_ai
4015
- vec_lvxl(int __a, const vector signed char *__b) {
4350
+ vec_lvxl(long __a, const vector signed char *__b) {
4016
4351
  return (vector signed char)__builtin_altivec_lvxl(__a, __b);
4017
4352
  }
4018
4353
 
4019
4354
  static __inline__ vector signed char __ATTRS_o_ai
4020
- vec_lvxl(int __a, const signed char *__b) {
4355
+ vec_lvxl(long __a, const signed char *__b) {
4021
4356
  return (vector signed char)__builtin_altivec_lvxl(__a, __b);
4022
4357
  }
4023
4358
 
4024
4359
  static __inline__ vector unsigned char __ATTRS_o_ai
4025
- vec_lvxl(int __a, const vector unsigned char *__b) {
4360
+ vec_lvxl(long __a, const vector unsigned char *__b) {
4026
4361
  return (vector unsigned char)__builtin_altivec_lvxl(__a, __b);
4027
4362
  }
4028
4363
 
4029
4364
  static __inline__ vector unsigned char __ATTRS_o_ai
4030
- vec_lvxl(int __a, const unsigned char *__b) {
4365
+ vec_lvxl(long __a, const unsigned char *__b) {
4031
4366
  return (vector unsigned char)__builtin_altivec_lvxl(__a, __b);
4032
4367
  }
4033
4368
 
4034
4369
  static __inline__ vector bool char __ATTRS_o_ai
4035
- vec_lvxl(int __a, const vector bool char *__b) {
4370
+ vec_lvxl(long __a, const vector bool char *__b) {
4036
4371
  return (vector bool char)__builtin_altivec_lvxl(__a, __b);
4037
4372
  }
4038
4373
 
4039
- static __inline__ vector short __ATTRS_o_ai vec_lvxl(int __a,
4374
+ static __inline__ vector short __ATTRS_o_ai vec_lvxl(long __a,
4040
4375
  const vector short *__b) {
4041
4376
  return (vector short)__builtin_altivec_lvxl(__a, __b);
4042
4377
  }
4043
4378
 
4044
- static __inline__ vector short __ATTRS_o_ai vec_lvxl(int __a,
4379
+ static __inline__ vector short __ATTRS_o_ai vec_lvxl(long __a,
4045
4380
  const short *__b) {
4046
4381
  return (vector short)__builtin_altivec_lvxl(__a, __b);
4047
4382
  }
4048
4383
 
4049
4384
  static __inline__ vector unsigned short __ATTRS_o_ai
4050
- vec_lvxl(int __a, const vector unsigned short *__b) {
4385
+ vec_lvxl(long __a, const vector unsigned short *__b) {
4051
4386
  return (vector unsigned short)__builtin_altivec_lvxl(__a, __b);
4052
4387
  }
4053
4388
 
4054
4389
  static __inline__ vector unsigned short __ATTRS_o_ai
4055
- vec_lvxl(int __a, const unsigned short *__b) {
4390
+ vec_lvxl(long __a, const unsigned short *__b) {
4056
4391
  return (vector unsigned short)__builtin_altivec_lvxl(__a, __b);
4057
4392
  }
4058
4393
 
4059
4394
  static __inline__ vector bool short __ATTRS_o_ai
4060
- vec_lvxl(int __a, const vector bool short *__b) {
4395
+ vec_lvxl(long __a, const vector bool short *__b) {
4061
4396
  return (vector bool short)__builtin_altivec_lvxl(__a, __b);
4062
4397
  }
4063
4398
 
4064
- static __inline__ vector pixel __ATTRS_o_ai vec_lvxl(int __a,
4399
+ static __inline__ vector pixel __ATTRS_o_ai vec_lvxl(long __a,
4065
4400
  const vector pixel *__b) {
4066
4401
  return (vector pixel)__builtin_altivec_lvxl(__a, __b);
4067
4402
  }
4068
4403
 
4069
- static __inline__ vector int __ATTRS_o_ai vec_lvxl(int __a,
4404
+ static __inline__ vector int __ATTRS_o_ai vec_lvxl(long __a,
4070
4405
  const vector int *__b) {
4071
4406
  return (vector int)__builtin_altivec_lvxl(__a, __b);
4072
4407
  }
4073
4408
 
4074
- static __inline__ vector int __ATTRS_o_ai vec_lvxl(int __a, const int *__b) {
4409
+ static __inline__ vector int __ATTRS_o_ai vec_lvxl(long __a, const int *__b) {
4075
4410
  return (vector int)__builtin_altivec_lvxl(__a, __b);
4076
4411
  }
4077
4412
 
4078
4413
  static __inline__ vector unsigned int __ATTRS_o_ai
4079
- vec_lvxl(int __a, const vector unsigned int *__b) {
4414
+ vec_lvxl(long __a, const vector unsigned int *__b) {
4080
4415
  return (vector unsigned int)__builtin_altivec_lvxl(__a, __b);
4081
4416
  }
4082
4417
 
4083
4418
  static __inline__ vector unsigned int __ATTRS_o_ai
4084
- vec_lvxl(int __a, const unsigned int *__b) {
4419
+ vec_lvxl(long __a, const unsigned int *__b) {
4085
4420
  return (vector unsigned int)__builtin_altivec_lvxl(__a, __b);
4086
4421
  }
4087
4422
 
4088
4423
  static __inline__ vector bool int __ATTRS_o_ai
4089
- vec_lvxl(int __a, const vector bool int *__b) {
4424
+ vec_lvxl(long __a, const vector bool int *__b) {
4090
4425
  return (vector bool int)__builtin_altivec_lvxl(__a, __b);
4091
4426
  }
4092
4427
 
4093
- static __inline__ vector float __ATTRS_o_ai vec_lvxl(int __a,
4428
+ static __inline__ vector float __ATTRS_o_ai vec_lvxl(long __a,
4094
4429
  const vector float *__b) {
4095
4430
  return (vector float)__builtin_altivec_lvxl(__a, __b);
4096
4431
  }
4097
4432
 
4098
- static __inline__ vector float __ATTRS_o_ai vec_lvxl(int __a,
4433
+ static __inline__ vector float __ATTRS_o_ai vec_lvxl(long __a,
4099
4434
  const float *__b) {
4100
4435
  return (vector float)__builtin_altivec_lvxl(__a, __b);
4101
4436
  }
@@ -5695,7 +6030,7 @@ vec_msum(vector unsigned short __a, vector unsigned short __b,
5695
6030
 
5696
6031
  /* vec_msumc */
5697
6032
 
5698
- #ifdef __POWER10_VECTOR__
6033
+ #if defined(__POWER10_VECTOR__) && defined(__SIZEOF_INT128__)
5699
6034
  static __inline__ vector unsigned __int128 __ATTRS_o_ai
5700
6035
  vec_msumc(vector unsigned long long __a, vector unsigned long long __b,
5701
6036
  vector unsigned __int128 __c) {
@@ -5929,7 +6264,7 @@ vec_mule(vector unsigned int __a, vector unsigned int __b) {
5929
6264
  }
5930
6265
  #endif
5931
6266
 
5932
- #ifdef __POWER10_VECTOR__
6267
+ #if defined(__POWER10_VECTOR__) && defined(__SIZEOF_INT128__)
5933
6268
  static __inline__ vector signed __int128 __ATTRS_o_ai
5934
6269
  vec_mule(vector signed long long __a, vector signed long long __b) {
5935
6270
  #ifdef __LITTLE_ENDIAN__
@@ -6075,7 +6410,7 @@ vec_mulo(vector unsigned int __a, vector unsigned int __b) {
6075
6410
  }
6076
6411
  #endif
6077
6412
 
6078
- #ifdef __POWER10_VECTOR__
6413
+ #if defined(__POWER10_VECTOR__) && defined(__SIZEOF_INT128__)
6079
6414
  static __inline__ vector signed __int128 __ATTRS_o_ai
6080
6415
  vec_mulo(vector signed long long __a, vector signed long long __b) {
6081
6416
  #ifdef __LITTLE_ENDIAN__
@@ -7927,7 +8262,7 @@ vec_rl(vector unsigned long long __a, vector unsigned long long __b) {
7927
8262
  }
7928
8263
  #endif
7929
8264
 
7930
- #ifdef __POWER10_VECTOR__
8265
+ #if defined(__POWER10_VECTOR__) && defined(__SIZEOF_INT128__)
7931
8266
  static __inline__ vector signed __int128 __ATTRS_o_ai
7932
8267
  vec_rl(vector signed __int128 __a, vector unsigned __int128 __b) {
7933
8268
  return (__b << __a)|(__b >> ((__CHAR_BIT__ * sizeof(vector signed __int128)) - __a));
@@ -7954,7 +8289,7 @@ vec_rlmi(vector unsigned long long __a, vector unsigned long long __b,
7954
8289
  }
7955
8290
  #endif
7956
8291
 
7957
- #ifdef __POWER10_VECTOR__
8292
+ #if defined(__POWER10_VECTOR__) && defined(__SIZEOF_INT128__)
7958
8293
  static __inline__ vector unsigned __int128 __ATTRS_o_ai
7959
8294
  vec_rlmi(vector unsigned __int128 __a, vector unsigned __int128 __b,
7960
8295
  vector unsigned __int128 __c) {
@@ -7985,7 +8320,7 @@ vec_rlnm(vector unsigned long long __a, vector unsigned long long __b,
7985
8320
  }
7986
8321
  #endif
7987
8322
 
7988
- #ifdef __POWER10_VECTOR__
8323
+ #if defined(__POWER10_VECTOR__) && defined(__SIZEOF_INT128__)
7989
8324
  static __inline__ vector unsigned __int128 __ATTRS_o_ai
7990
8325
  vec_rlnm(vector unsigned __int128 __a, vector unsigned __int128 __b,
7991
8326
  vector unsigned __int128 __c) {
@@ -8060,11 +8395,7 @@ vec_vrlw(vector unsigned int __a, vector unsigned int __b) {
8060
8395
  /* vec_round */
8061
8396
 
8062
8397
  static __inline__ vector float __ATTRS_o_ai vec_round(vector float __a) {
8063
- #ifdef __VSX__
8064
- return __builtin_vsx_xvrspi(__a);
8065
- #else
8066
8398
  return __builtin_altivec_vrfin(__a);
8067
- #endif
8068
8399
  }
8069
8400
 
8070
8401
  #ifdef __VSX__
@@ -8082,6 +8413,16 @@ static __inline__ vector double __ATTRS_o_ai vec_rint(vector double __a) {
8082
8413
  return __builtin_vsx_xvrdpic(__a);
8083
8414
  }
8084
8415
 
8416
+ /* vec_roundc */
8417
+
8418
+ static __inline__ vector float __ATTRS_o_ai vec_roundc(vector float __a) {
8419
+ return __builtin_vsx_xvrspic(__a);
8420
+ }
8421
+
8422
+ static __inline__ vector double __ATTRS_o_ai vec_roundc(vector double __a) {
8423
+ return __builtin_vsx_xvrdpic(__a);
8424
+ }
8425
+
8085
8426
  /* vec_nearbyint */
8086
8427
 
8087
8428
  static __inline__ vector float __ATTRS_o_ai vec_nearbyint(vector float __a) {
@@ -8128,6 +8469,16 @@ static __inline__ vector double __ATTRS_o_ai vec_rsqrte(vector double __a) {
8128
8469
  }
8129
8470
  #endif
8130
8471
 
8472
+ static vector float __ATTRS_o_ai vec_rsqrt(vector float __a) {
8473
+ return __builtin_ppc_rsqrtf(__a);
8474
+ }
8475
+
8476
+ #ifdef __VSX__
8477
+ static vector double __ATTRS_o_ai vec_rsqrt(vector double __a) {
8478
+ return __builtin_ppc_rsqrtd(__a);
8479
+ }
8480
+ #endif
8481
+
8131
8482
  /* vec_vrsqrtefp */
8132
8483
 
8133
8484
  static __inline__ __vector float __attribute__((__always_inline__))
@@ -8484,6 +8835,52 @@ vec_sl(vector unsigned long long __a, vector unsigned long long __b) {
8484
8835
  __CHAR_BIT__));
8485
8836
  }
8486
8837
 
8838
+ static __inline__ vector long long __ATTRS_o_ai
8839
+ vec_sl(vector long long __a, vector unsigned long long __b) {
8840
+ return (vector long long)vec_sl((vector unsigned long long)__a, __b);
8841
+ }
8842
+ #else
8843
+ static __inline__ vector unsigned char __ATTRS_o_ai
8844
+ vec_vspltb(vector unsigned char __a, unsigned char __b);
8845
+ static __inline__ vector unsigned long long __ATTRS_o_ai
8846
+ vec_sl(vector unsigned long long __a, vector unsigned long long __b) {
8847
+ __b %= (vector unsigned long long)(sizeof(unsigned long long) * __CHAR_BIT__);
8848
+
8849
+ // Big endian element one (the right doubleword) can be left shifted as-is.
8850
+ // The other element needs to be swapped into the right doubleword and
8851
+ // shifted. Then the right doublewords of the two result vectors are merged.
8852
+ vector signed long long __rightelt =
8853
+ (vector signed long long)__builtin_altivec_vslo((vector signed int)__a,
8854
+ (vector signed int)__b);
8855
+ #ifdef __LITTLE_ENDIAN__
8856
+ __rightelt = (vector signed long long)__builtin_altivec_vsl(
8857
+ (vector signed int)__rightelt,
8858
+ (vector signed int)vec_vspltb((vector unsigned char)__b, 0));
8859
+ #else
8860
+ __rightelt = (vector signed long long)__builtin_altivec_vsl(
8861
+ (vector signed int)__rightelt,
8862
+ (vector signed int)vec_vspltb((vector unsigned char)__b, 15));
8863
+ #endif
8864
+ __a = __builtin_shufflevector(__a, __a, 1, 0);
8865
+ __b = __builtin_shufflevector(__b, __b, 1, 0);
8866
+ vector signed long long __leftelt =
8867
+ (vector signed long long)__builtin_altivec_vslo((vector signed int)__a,
8868
+ (vector signed int)__b);
8869
+ #ifdef __LITTLE_ENDIAN__
8870
+ __leftelt = (vector signed long long)__builtin_altivec_vsl(
8871
+ (vector signed int)__leftelt,
8872
+ (vector signed int)vec_vspltb((vector unsigned char)__b, 0));
8873
+ return (vector unsigned long long)__builtin_shufflevector(__rightelt,
8874
+ __leftelt, 0, 2);
8875
+ #else
8876
+ __leftelt = (vector signed long long)__builtin_altivec_vsl(
8877
+ (vector signed int)__leftelt,
8878
+ (vector signed int)vec_vspltb((vector unsigned char)__b, 15));
8879
+ return (vector unsigned long long)__builtin_shufflevector(__leftelt,
8880
+ __rightelt, 1, 3);
8881
+ #endif
8882
+ }
8883
+
8487
8884
  static __inline__ vector long long __ATTRS_o_ai
8488
8885
  vec_sl(vector long long __a, vector unsigned long long __b) {
8489
8886
  return (vector long long)vec_sl((vector unsigned long long)__a, __b);
@@ -8850,8 +9247,13 @@ static __inline__ vector unsigned int __ATTRS_o_ai vec_sldw(
8850
9247
  return vec_sld(__a, __b, ((__c << 2) & 0x0F));
8851
9248
  }
8852
9249
 
8853
- #ifdef __VSX__
8854
- static __inline__ vector signed long long __ATTRS_o_ai
9250
+ static __inline__ vector float __ATTRS_o_ai vec_sldw(
9251
+ vector float __a, vector float __b, unsigned const int __c) {
9252
+ return vec_sld(__a, __b, ((__c << 2) & 0x0F));
9253
+ }
9254
+
9255
+ #ifdef __VSX__
9256
+ static __inline__ vector signed long long __ATTRS_o_ai
8855
9257
  vec_sldw(vector signed long long __a, vector signed long long __b,
8856
9258
  unsigned const int __c) {
8857
9259
  return vec_sld(__a, __b, ((__c << 2) & 0x0F));
@@ -8862,6 +9264,11 @@ vec_sldw(vector unsigned long long __a, vector unsigned long long __b,
8862
9264
  unsigned const int __c) {
8863
9265
  return vec_sld(__a, __b, ((__c << 2) & 0x0F));
8864
9266
  }
9267
+
9268
+ static __inline__ vector double __ATTRS_o_ai vec_sldw(
9269
+ vector double __a, vector double __b, unsigned const int __c) {
9270
+ return vec_sld(__a, __b, ((__c << 2) & 0x0F));
9271
+ }
8865
9272
  #endif
8866
9273
 
8867
9274
  #ifdef __POWER9_VECTOR__
@@ -9939,6 +10346,50 @@ vec_sr(vector unsigned long long __a, vector unsigned long long __b) {
9939
10346
  __CHAR_BIT__));
9940
10347
  }
9941
10348
 
10349
+ static __inline__ vector long long __ATTRS_o_ai
10350
+ vec_sr(vector long long __a, vector unsigned long long __b) {
10351
+ return (vector long long)vec_sr((vector unsigned long long)__a, __b);
10352
+ }
10353
+ #else
10354
+ static __inline__ vector unsigned long long __ATTRS_o_ai
10355
+ vec_sr(vector unsigned long long __a, vector unsigned long long __b) {
10356
+ __b %= (vector unsigned long long)(sizeof(unsigned long long) * __CHAR_BIT__);
10357
+
10358
+ // Big endian element zero (the left doubleword) can be right shifted as-is.
10359
+ // However the shift amount must be in the right doubleword.
10360
+ // The other element needs to be swapped into the left doubleword and
10361
+ // shifted. Then the left doublewords of the two result vectors are merged.
10362
+ vector unsigned long long __swapshift =
10363
+ __builtin_shufflevector(__b, __b, 1, 0);
10364
+ vector unsigned long long __leftelt =
10365
+ (vector unsigned long long)__builtin_altivec_vsro(
10366
+ (vector signed int)__a, (vector signed int)__swapshift);
10367
+ #ifdef __LITTLE_ENDIAN__
10368
+ __leftelt = (vector unsigned long long)__builtin_altivec_vsr(
10369
+ (vector signed int)__leftelt,
10370
+ (vector signed int)vec_vspltb((vector unsigned char)__swapshift, 0));
10371
+ #else
10372
+ __leftelt = (vector unsigned long long)__builtin_altivec_vsr(
10373
+ (vector signed int)__leftelt,
10374
+ (vector signed int)vec_vspltb((vector unsigned char)__swapshift, 15));
10375
+ #endif
10376
+ __a = __builtin_shufflevector(__a, __a, 1, 0);
10377
+ vector unsigned long long __rightelt =
10378
+ (vector unsigned long long)__builtin_altivec_vsro((vector signed int)__a,
10379
+ (vector signed int)__b);
10380
+ #ifdef __LITTLE_ENDIAN__
10381
+ __rightelt = (vector unsigned long long)__builtin_altivec_vsr(
10382
+ (vector signed int)__rightelt,
10383
+ (vector signed int)vec_vspltb((vector unsigned char)__b, 0));
10384
+ return __builtin_shufflevector(__rightelt, __leftelt, 1, 3);
10385
+ #else
10386
+ __rightelt = (vector unsigned long long)__builtin_altivec_vsr(
10387
+ (vector signed int)__rightelt,
10388
+ (vector signed int)vec_vspltb((vector unsigned char)__b, 15));
10389
+ return __builtin_shufflevector(__leftelt, __rightelt, 0, 2);
10390
+ #endif
10391
+ }
10392
+
9942
10393
  static __inline__ vector long long __ATTRS_o_ai
9943
10394
  vec_sr(vector long long __a, vector unsigned long long __b) {
9944
10395
  return (vector long long)vec_sr((vector unsigned long long)__a, __b);
@@ -10029,6 +10480,18 @@ static __inline__ vector unsigned long long __ATTRS_o_ai
10029
10480
  vec_sra(vector unsigned long long __a, vector unsigned long long __b) {
10030
10481
  return (vector unsigned long long)((vector signed long long)__a >> __b);
10031
10482
  }
10483
+ #else
10484
+ static __inline__ vector signed long long __ATTRS_o_ai
10485
+ vec_sra(vector signed long long __a, vector unsigned long long __b) {
10486
+ __b %= (vector unsigned long long)(sizeof(unsigned long long) * __CHAR_BIT__);
10487
+ return __a >> __b;
10488
+ }
10489
+
10490
+ static __inline__ vector unsigned long long __ATTRS_o_ai
10491
+ vec_sra(vector unsigned long long __a, vector unsigned long long __b) {
10492
+ __b %= (vector unsigned long long)(sizeof(unsigned long long) * __CHAR_BIT__);
10493
+ return (vector unsigned long long)((vector signed long long)__a >> __b);
10494
+ }
10032
10495
  #endif
10033
10496
 
10034
10497
  /* vec_vsrab */
@@ -10635,420 +11098,420 @@ static __inline__ vector float __ATTRS_o_ai vec_vsro(vector float __a,
10635
11098
 
10636
11099
  /* vec_st */
10637
11100
 
10638
- static __inline__ void __ATTRS_o_ai vec_st(vector signed char __a, int __b,
11101
+ static __inline__ void __ATTRS_o_ai vec_st(vector signed char __a, long __b,
10639
11102
  vector signed char *__c) {
10640
11103
  __builtin_altivec_stvx((vector int)__a, __b, __c);
10641
11104
  }
10642
11105
 
10643
- static __inline__ void __ATTRS_o_ai vec_st(vector signed char __a, int __b,
11106
+ static __inline__ void __ATTRS_o_ai vec_st(vector signed char __a, long __b,
10644
11107
  signed char *__c) {
10645
11108
  __builtin_altivec_stvx((vector int)__a, __b, __c);
10646
11109
  }
10647
11110
 
10648
- static __inline__ void __ATTRS_o_ai vec_st(vector unsigned char __a, int __b,
11111
+ static __inline__ void __ATTRS_o_ai vec_st(vector unsigned char __a, long __b,
10649
11112
  vector unsigned char *__c) {
10650
11113
  __builtin_altivec_stvx((vector int)__a, __b, __c);
10651
11114
  }
10652
11115
 
10653
- static __inline__ void __ATTRS_o_ai vec_st(vector unsigned char __a, int __b,
11116
+ static __inline__ void __ATTRS_o_ai vec_st(vector unsigned char __a, long __b,
10654
11117
  unsigned char *__c) {
10655
11118
  __builtin_altivec_stvx((vector int)__a, __b, __c);
10656
11119
  }
10657
11120
 
10658
- static __inline__ void __ATTRS_o_ai vec_st(vector bool char __a, int __b,
11121
+ static __inline__ void __ATTRS_o_ai vec_st(vector bool char __a, long __b,
10659
11122
  signed char *__c) {
10660
11123
  __builtin_altivec_stvx((vector int)__a, __b, __c);
10661
11124
  }
10662
11125
 
10663
- static __inline__ void __ATTRS_o_ai vec_st(vector bool char __a, int __b,
11126
+ static __inline__ void __ATTRS_o_ai vec_st(vector bool char __a, long __b,
10664
11127
  unsigned char *__c) {
10665
11128
  __builtin_altivec_stvx((vector int)__a, __b, __c);
10666
11129
  }
10667
11130
 
10668
- static __inline__ void __ATTRS_o_ai vec_st(vector bool char __a, int __b,
11131
+ static __inline__ void __ATTRS_o_ai vec_st(vector bool char __a, long __b,
10669
11132
  vector bool char *__c) {
10670
11133
  __builtin_altivec_stvx((vector int)__a, __b, __c);
10671
11134
  }
10672
11135
 
10673
- static __inline__ void __ATTRS_o_ai vec_st(vector short __a, int __b,
11136
+ static __inline__ void __ATTRS_o_ai vec_st(vector short __a, long __b,
10674
11137
  vector short *__c) {
10675
11138
  __builtin_altivec_stvx((vector int)__a, __b, __c);
10676
11139
  }
10677
11140
 
10678
- static __inline__ void __ATTRS_o_ai vec_st(vector short __a, int __b,
11141
+ static __inline__ void __ATTRS_o_ai vec_st(vector short __a, long __b,
10679
11142
  short *__c) {
10680
11143
  __builtin_altivec_stvx((vector int)__a, __b, __c);
10681
11144
  }
10682
11145
 
10683
- static __inline__ void __ATTRS_o_ai vec_st(vector unsigned short __a, int __b,
11146
+ static __inline__ void __ATTRS_o_ai vec_st(vector unsigned short __a, long __b,
10684
11147
  vector unsigned short *__c) {
10685
11148
  __builtin_altivec_stvx((vector int)__a, __b, __c);
10686
11149
  }
10687
11150
 
10688
- static __inline__ void __ATTRS_o_ai vec_st(vector unsigned short __a, int __b,
11151
+ static __inline__ void __ATTRS_o_ai vec_st(vector unsigned short __a, long __b,
10689
11152
  unsigned short *__c) {
10690
11153
  __builtin_altivec_stvx((vector int)__a, __b, __c);
10691
11154
  }
10692
11155
 
10693
- static __inline__ void __ATTRS_o_ai vec_st(vector bool short __a, int __b,
11156
+ static __inline__ void __ATTRS_o_ai vec_st(vector bool short __a, long __b,
10694
11157
  short *__c) {
10695
11158
  __builtin_altivec_stvx((vector int)__a, __b, __c);
10696
11159
  }
10697
11160
 
10698
- static __inline__ void __ATTRS_o_ai vec_st(vector bool short __a, int __b,
11161
+ static __inline__ void __ATTRS_o_ai vec_st(vector bool short __a, long __b,
10699
11162
  unsigned short *__c) {
10700
11163
  __builtin_altivec_stvx((vector int)__a, __b, __c);
10701
11164
  }
10702
11165
 
10703
- static __inline__ void __ATTRS_o_ai vec_st(vector bool short __a, int __b,
11166
+ static __inline__ void __ATTRS_o_ai vec_st(vector bool short __a, long __b,
10704
11167
  vector bool short *__c) {
10705
11168
  __builtin_altivec_stvx((vector int)__a, __b, __c);
10706
11169
  }
10707
11170
 
10708
- static __inline__ void __ATTRS_o_ai vec_st(vector pixel __a, int __b,
11171
+ static __inline__ void __ATTRS_o_ai vec_st(vector pixel __a, long __b,
10709
11172
  short *__c) {
10710
11173
  __builtin_altivec_stvx((vector int)__a, __b, __c);
10711
11174
  }
10712
11175
 
10713
- static __inline__ void __ATTRS_o_ai vec_st(vector pixel __a, int __b,
11176
+ static __inline__ void __ATTRS_o_ai vec_st(vector pixel __a, long __b,
10714
11177
  unsigned short *__c) {
10715
11178
  __builtin_altivec_stvx((vector int)__a, __b, __c);
10716
11179
  }
10717
11180
 
10718
- static __inline__ void __ATTRS_o_ai vec_st(vector pixel __a, int __b,
11181
+ static __inline__ void __ATTRS_o_ai vec_st(vector pixel __a, long __b,
10719
11182
  vector pixel *__c) {
10720
11183
  __builtin_altivec_stvx((vector int)__a, __b, __c);
10721
11184
  }
10722
11185
 
10723
- static __inline__ void __ATTRS_o_ai vec_st(vector int __a, int __b,
11186
+ static __inline__ void __ATTRS_o_ai vec_st(vector int __a, long __b,
10724
11187
  vector int *__c) {
10725
11188
  __builtin_altivec_stvx(__a, __b, __c);
10726
11189
  }
10727
11190
 
10728
- static __inline__ void __ATTRS_o_ai vec_st(vector int __a, int __b, int *__c) {
11191
+ static __inline__ void __ATTRS_o_ai vec_st(vector int __a, long __b, int *__c) {
10729
11192
  __builtin_altivec_stvx(__a, __b, __c);
10730
11193
  }
10731
11194
 
10732
- static __inline__ void __ATTRS_o_ai vec_st(vector unsigned int __a, int __b,
11195
+ static __inline__ void __ATTRS_o_ai vec_st(vector unsigned int __a, long __b,
10733
11196
  vector unsigned int *__c) {
10734
11197
  __builtin_altivec_stvx((vector int)__a, __b, __c);
10735
11198
  }
10736
11199
 
10737
- static __inline__ void __ATTRS_o_ai vec_st(vector unsigned int __a, int __b,
11200
+ static __inline__ void __ATTRS_o_ai vec_st(vector unsigned int __a, long __b,
10738
11201
  unsigned int *__c) {
10739
11202
  __builtin_altivec_stvx((vector int)__a, __b, __c);
10740
11203
  }
10741
11204
 
10742
- static __inline__ void __ATTRS_o_ai vec_st(vector bool int __a, int __b,
11205
+ static __inline__ void __ATTRS_o_ai vec_st(vector bool int __a, long __b,
10743
11206
  int *__c) {
10744
11207
  __builtin_altivec_stvx((vector int)__a, __b, __c);
10745
11208
  }
10746
11209
 
10747
- static __inline__ void __ATTRS_o_ai vec_st(vector bool int __a, int __b,
11210
+ static __inline__ void __ATTRS_o_ai vec_st(vector bool int __a, long __b,
10748
11211
  unsigned int *__c) {
10749
11212
  __builtin_altivec_stvx((vector int)__a, __b, __c);
10750
11213
  }
10751
11214
 
10752
- static __inline__ void __ATTRS_o_ai vec_st(vector bool int __a, int __b,
11215
+ static __inline__ void __ATTRS_o_ai vec_st(vector bool int __a, long __b,
10753
11216
  vector bool int *__c) {
10754
11217
  __builtin_altivec_stvx((vector int)__a, __b, __c);
10755
11218
  }
10756
11219
 
10757
- static __inline__ void __ATTRS_o_ai vec_st(vector float __a, int __b,
11220
+ static __inline__ void __ATTRS_o_ai vec_st(vector float __a, long __b,
10758
11221
  vector float *__c) {
10759
11222
  __builtin_altivec_stvx((vector int)__a, __b, __c);
10760
11223
  }
10761
11224
 
10762
- static __inline__ void __ATTRS_o_ai vec_st(vector float __a, int __b,
11225
+ static __inline__ void __ATTRS_o_ai vec_st(vector float __a, long __b,
10763
11226
  float *__c) {
10764
11227
  __builtin_altivec_stvx((vector int)__a, __b, __c);
10765
11228
  }
10766
11229
 
10767
11230
  /* vec_stvx */
10768
11231
 
10769
- static __inline__ void __ATTRS_o_ai vec_stvx(vector signed char __a, int __b,
11232
+ static __inline__ void __ATTRS_o_ai vec_stvx(vector signed char __a, long __b,
10770
11233
  vector signed char *__c) {
10771
11234
  __builtin_altivec_stvx((vector int)__a, __b, __c);
10772
11235
  }
10773
11236
 
10774
- static __inline__ void __ATTRS_o_ai vec_stvx(vector signed char __a, int __b,
11237
+ static __inline__ void __ATTRS_o_ai vec_stvx(vector signed char __a, long __b,
10775
11238
  signed char *__c) {
10776
11239
  __builtin_altivec_stvx((vector int)__a, __b, __c);
10777
11240
  }
10778
11241
 
10779
- static __inline__ void __ATTRS_o_ai vec_stvx(vector unsigned char __a, int __b,
11242
+ static __inline__ void __ATTRS_o_ai vec_stvx(vector unsigned char __a, long __b,
10780
11243
  vector unsigned char *__c) {
10781
11244
  __builtin_altivec_stvx((vector int)__a, __b, __c);
10782
11245
  }
10783
11246
 
10784
- static __inline__ void __ATTRS_o_ai vec_stvx(vector unsigned char __a, int __b,
11247
+ static __inline__ void __ATTRS_o_ai vec_stvx(vector unsigned char __a, long __b,
10785
11248
  unsigned char *__c) {
10786
11249
  __builtin_altivec_stvx((vector int)__a, __b, __c);
10787
11250
  }
10788
11251
 
10789
- static __inline__ void __ATTRS_o_ai vec_stvx(vector bool char __a, int __b,
11252
+ static __inline__ void __ATTRS_o_ai vec_stvx(vector bool char __a, long __b,
10790
11253
  signed char *__c) {
10791
11254
  __builtin_altivec_stvx((vector int)__a, __b, __c);
10792
11255
  }
10793
11256
 
10794
- static __inline__ void __ATTRS_o_ai vec_stvx(vector bool char __a, int __b,
11257
+ static __inline__ void __ATTRS_o_ai vec_stvx(vector bool char __a, long __b,
10795
11258
  unsigned char *__c) {
10796
11259
  __builtin_altivec_stvx((vector int)__a, __b, __c);
10797
11260
  }
10798
11261
 
10799
- static __inline__ void __ATTRS_o_ai vec_stvx(vector bool char __a, int __b,
11262
+ static __inline__ void __ATTRS_o_ai vec_stvx(vector bool char __a, long __b,
10800
11263
  vector bool char *__c) {
10801
11264
  __builtin_altivec_stvx((vector int)__a, __b, __c);
10802
11265
  }
10803
11266
 
10804
- static __inline__ void __ATTRS_o_ai vec_stvx(vector short __a, int __b,
11267
+ static __inline__ void __ATTRS_o_ai vec_stvx(vector short __a, long __b,
10805
11268
  vector short *__c) {
10806
11269
  __builtin_altivec_stvx((vector int)__a, __b, __c);
10807
11270
  }
10808
11271
 
10809
- static __inline__ void __ATTRS_o_ai vec_stvx(vector short __a, int __b,
11272
+ static __inline__ void __ATTRS_o_ai vec_stvx(vector short __a, long __b,
10810
11273
  short *__c) {
10811
11274
  __builtin_altivec_stvx((vector int)__a, __b, __c);
10812
11275
  }
10813
11276
 
10814
- static __inline__ void __ATTRS_o_ai vec_stvx(vector unsigned short __a, int __b,
11277
+ static __inline__ void __ATTRS_o_ai vec_stvx(vector unsigned short __a, long __b,
10815
11278
  vector unsigned short *__c) {
10816
11279
  __builtin_altivec_stvx((vector int)__a, __b, __c);
10817
11280
  }
10818
11281
 
10819
- static __inline__ void __ATTRS_o_ai vec_stvx(vector unsigned short __a, int __b,
11282
+ static __inline__ void __ATTRS_o_ai vec_stvx(vector unsigned short __a, long __b,
10820
11283
  unsigned short *__c) {
10821
11284
  __builtin_altivec_stvx((vector int)__a, __b, __c);
10822
11285
  }
10823
11286
 
10824
- static __inline__ void __ATTRS_o_ai vec_stvx(vector bool short __a, int __b,
11287
+ static __inline__ void __ATTRS_o_ai vec_stvx(vector bool short __a, long __b,
10825
11288
  short *__c) {
10826
11289
  __builtin_altivec_stvx((vector int)__a, __b, __c);
10827
11290
  }
10828
11291
 
10829
- static __inline__ void __ATTRS_o_ai vec_stvx(vector bool short __a, int __b,
11292
+ static __inline__ void __ATTRS_o_ai vec_stvx(vector bool short __a, long __b,
10830
11293
  unsigned short *__c) {
10831
11294
  __builtin_altivec_stvx((vector int)__a, __b, __c);
10832
11295
  }
10833
11296
 
10834
- static __inline__ void __ATTRS_o_ai vec_stvx(vector bool short __a, int __b,
11297
+ static __inline__ void __ATTRS_o_ai vec_stvx(vector bool short __a, long __b,
10835
11298
  vector bool short *__c) {
10836
11299
  __builtin_altivec_stvx((vector int)__a, __b, __c);
10837
11300
  }
10838
11301
 
10839
- static __inline__ void __ATTRS_o_ai vec_stvx(vector pixel __a, int __b,
11302
+ static __inline__ void __ATTRS_o_ai vec_stvx(vector pixel __a, long __b,
10840
11303
  short *__c) {
10841
11304
  __builtin_altivec_stvx((vector int)__a, __b, __c);
10842
11305
  }
10843
11306
 
10844
- static __inline__ void __ATTRS_o_ai vec_stvx(vector pixel __a, int __b,
11307
+ static __inline__ void __ATTRS_o_ai vec_stvx(vector pixel __a, long __b,
10845
11308
  unsigned short *__c) {
10846
11309
  __builtin_altivec_stvx((vector int)__a, __b, __c);
10847
11310
  }
10848
11311
 
10849
- static __inline__ void __ATTRS_o_ai vec_stvx(vector pixel __a, int __b,
11312
+ static __inline__ void __ATTRS_o_ai vec_stvx(vector pixel __a, long __b,
10850
11313
  vector pixel *__c) {
10851
11314
  __builtin_altivec_stvx((vector int)__a, __b, __c);
10852
11315
  }
10853
11316
 
10854
- static __inline__ void __ATTRS_o_ai vec_stvx(vector int __a, int __b,
11317
+ static __inline__ void __ATTRS_o_ai vec_stvx(vector int __a, long __b,
10855
11318
  vector int *__c) {
10856
11319
  __builtin_altivec_stvx(__a, __b, __c);
10857
11320
  }
10858
11321
 
10859
- static __inline__ void __ATTRS_o_ai vec_stvx(vector int __a, int __b,
11322
+ static __inline__ void __ATTRS_o_ai vec_stvx(vector int __a, long __b,
10860
11323
  int *__c) {
10861
11324
  __builtin_altivec_stvx(__a, __b, __c);
10862
11325
  }
10863
11326
 
10864
- static __inline__ void __ATTRS_o_ai vec_stvx(vector unsigned int __a, int __b,
11327
+ static __inline__ void __ATTRS_o_ai vec_stvx(vector unsigned int __a, long __b,
10865
11328
  vector unsigned int *__c) {
10866
11329
  __builtin_altivec_stvx((vector int)__a, __b, __c);
10867
11330
  }
10868
11331
 
10869
- static __inline__ void __ATTRS_o_ai vec_stvx(vector unsigned int __a, int __b,
11332
+ static __inline__ void __ATTRS_o_ai vec_stvx(vector unsigned int __a, long __b,
10870
11333
  unsigned int *__c) {
10871
11334
  __builtin_altivec_stvx((vector int)__a, __b, __c);
10872
11335
  }
10873
11336
 
10874
- static __inline__ void __ATTRS_o_ai vec_stvx(vector bool int __a, int __b,
11337
+ static __inline__ void __ATTRS_o_ai vec_stvx(vector bool int __a, long __b,
10875
11338
  int *__c) {
10876
11339
  __builtin_altivec_stvx((vector int)__a, __b, __c);
10877
11340
  }
10878
11341
 
10879
- static __inline__ void __ATTRS_o_ai vec_stvx(vector bool int __a, int __b,
11342
+ static __inline__ void __ATTRS_o_ai vec_stvx(vector bool int __a, long __b,
10880
11343
  unsigned int *__c) {
10881
11344
  __builtin_altivec_stvx((vector int)__a, __b, __c);
10882
11345
  }
10883
11346
 
10884
- static __inline__ void __ATTRS_o_ai vec_stvx(vector bool int __a, int __b,
11347
+ static __inline__ void __ATTRS_o_ai vec_stvx(vector bool int __a, long __b,
10885
11348
  vector bool int *__c) {
10886
11349
  __builtin_altivec_stvx((vector int)__a, __b, __c);
10887
11350
  }
10888
11351
 
10889
- static __inline__ void __ATTRS_o_ai vec_stvx(vector float __a, int __b,
11352
+ static __inline__ void __ATTRS_o_ai vec_stvx(vector float __a, long __b,
10890
11353
  vector float *__c) {
10891
11354
  __builtin_altivec_stvx((vector int)__a, __b, __c);
10892
11355
  }
10893
11356
 
10894
- static __inline__ void __ATTRS_o_ai vec_stvx(vector float __a, int __b,
11357
+ static __inline__ void __ATTRS_o_ai vec_stvx(vector float __a, long __b,
10895
11358
  float *__c) {
10896
11359
  __builtin_altivec_stvx((vector int)__a, __b, __c);
10897
11360
  }
10898
11361
 
10899
11362
  /* vec_ste */
10900
11363
 
10901
- static __inline__ void __ATTRS_o_ai vec_ste(vector signed char __a, int __b,
11364
+ static __inline__ void __ATTRS_o_ai vec_ste(vector signed char __a, long __b,
10902
11365
  signed char *__c) {
10903
11366
  __builtin_altivec_stvebx((vector char)__a, __b, __c);
10904
11367
  }
10905
11368
 
10906
- static __inline__ void __ATTRS_o_ai vec_ste(vector unsigned char __a, int __b,
11369
+ static __inline__ void __ATTRS_o_ai vec_ste(vector unsigned char __a, long __b,
10907
11370
  unsigned char *__c) {
10908
11371
  __builtin_altivec_stvebx((vector char)__a, __b, __c);
10909
11372
  }
10910
11373
 
10911
- static __inline__ void __ATTRS_o_ai vec_ste(vector bool char __a, int __b,
11374
+ static __inline__ void __ATTRS_o_ai vec_ste(vector bool char __a, long __b,
10912
11375
  signed char *__c) {
10913
11376
  __builtin_altivec_stvebx((vector char)__a, __b, __c);
10914
11377
  }
10915
11378
 
10916
- static __inline__ void __ATTRS_o_ai vec_ste(vector bool char __a, int __b,
11379
+ static __inline__ void __ATTRS_o_ai vec_ste(vector bool char __a, long __b,
10917
11380
  unsigned char *__c) {
10918
11381
  __builtin_altivec_stvebx((vector char)__a, __b, __c);
10919
11382
  }
10920
11383
 
10921
- static __inline__ void __ATTRS_o_ai vec_ste(vector short __a, int __b,
11384
+ static __inline__ void __ATTRS_o_ai vec_ste(vector short __a, long __b,
10922
11385
  short *__c) {
10923
11386
  __builtin_altivec_stvehx(__a, __b, __c);
10924
11387
  }
10925
11388
 
10926
- static __inline__ void __ATTRS_o_ai vec_ste(vector unsigned short __a, int __b,
11389
+ static __inline__ void __ATTRS_o_ai vec_ste(vector unsigned short __a, long __b,
10927
11390
  unsigned short *__c) {
10928
11391
  __builtin_altivec_stvehx((vector short)__a, __b, __c);
10929
11392
  }
10930
11393
 
10931
- static __inline__ void __ATTRS_o_ai vec_ste(vector bool short __a, int __b,
11394
+ static __inline__ void __ATTRS_o_ai vec_ste(vector bool short __a, long __b,
10932
11395
  short *__c) {
10933
11396
  __builtin_altivec_stvehx((vector short)__a, __b, __c);
10934
11397
  }
10935
11398
 
10936
- static __inline__ void __ATTRS_o_ai vec_ste(vector bool short __a, int __b,
11399
+ static __inline__ void __ATTRS_o_ai vec_ste(vector bool short __a, long __b,
10937
11400
  unsigned short *__c) {
10938
11401
  __builtin_altivec_stvehx((vector short)__a, __b, __c);
10939
11402
  }
10940
11403
 
10941
- static __inline__ void __ATTRS_o_ai vec_ste(vector pixel __a, int __b,
11404
+ static __inline__ void __ATTRS_o_ai vec_ste(vector pixel __a, long __b,
10942
11405
  short *__c) {
10943
11406
  __builtin_altivec_stvehx((vector short)__a, __b, __c);
10944
11407
  }
10945
11408
 
10946
- static __inline__ void __ATTRS_o_ai vec_ste(vector pixel __a, int __b,
11409
+ static __inline__ void __ATTRS_o_ai vec_ste(vector pixel __a, long __b,
10947
11410
  unsigned short *__c) {
10948
11411
  __builtin_altivec_stvehx((vector short)__a, __b, __c);
10949
11412
  }
10950
11413
 
10951
- static __inline__ void __ATTRS_o_ai vec_ste(vector int __a, int __b, int *__c) {
11414
+ static __inline__ void __ATTRS_o_ai vec_ste(vector int __a, long __b, int *__c) {
10952
11415
  __builtin_altivec_stvewx(__a, __b, __c);
10953
11416
  }
10954
11417
 
10955
- static __inline__ void __ATTRS_o_ai vec_ste(vector unsigned int __a, int __b,
11418
+ static __inline__ void __ATTRS_o_ai vec_ste(vector unsigned int __a, long __b,
10956
11419
  unsigned int *__c) {
10957
11420
  __builtin_altivec_stvewx((vector int)__a, __b, __c);
10958
11421
  }
10959
11422
 
10960
- static __inline__ void __ATTRS_o_ai vec_ste(vector bool int __a, int __b,
11423
+ static __inline__ void __ATTRS_o_ai vec_ste(vector bool int __a, long __b,
10961
11424
  int *__c) {
10962
11425
  __builtin_altivec_stvewx((vector int)__a, __b, __c);
10963
11426
  }
10964
11427
 
10965
- static __inline__ void __ATTRS_o_ai vec_ste(vector bool int __a, int __b,
11428
+ static __inline__ void __ATTRS_o_ai vec_ste(vector bool int __a, long __b,
10966
11429
  unsigned int *__c) {
10967
11430
  __builtin_altivec_stvewx((vector int)__a, __b, __c);
10968
11431
  }
10969
11432
 
10970
- static __inline__ void __ATTRS_o_ai vec_ste(vector float __a, int __b,
11433
+ static __inline__ void __ATTRS_o_ai vec_ste(vector float __a, long __b,
10971
11434
  float *__c) {
10972
11435
  __builtin_altivec_stvewx((vector int)__a, __b, __c);
10973
11436
  }
10974
11437
 
10975
11438
  /* vec_stvebx */
10976
11439
 
10977
- static __inline__ void __ATTRS_o_ai vec_stvebx(vector signed char __a, int __b,
11440
+ static __inline__ void __ATTRS_o_ai vec_stvebx(vector signed char __a, long __b,
10978
11441
  signed char *__c) {
10979
11442
  __builtin_altivec_stvebx((vector char)__a, __b, __c);
10980
11443
  }
10981
11444
 
10982
11445
  static __inline__ void __ATTRS_o_ai vec_stvebx(vector unsigned char __a,
10983
- int __b, unsigned char *__c) {
11446
+ long __b, unsigned char *__c) {
10984
11447
  __builtin_altivec_stvebx((vector char)__a, __b, __c);
10985
11448
  }
10986
11449
 
10987
- static __inline__ void __ATTRS_o_ai vec_stvebx(vector bool char __a, int __b,
11450
+ static __inline__ void __ATTRS_o_ai vec_stvebx(vector bool char __a, long __b,
10988
11451
  signed char *__c) {
10989
11452
  __builtin_altivec_stvebx((vector char)__a, __b, __c);
10990
11453
  }
10991
11454
 
10992
- static __inline__ void __ATTRS_o_ai vec_stvebx(vector bool char __a, int __b,
11455
+ static __inline__ void __ATTRS_o_ai vec_stvebx(vector bool char __a, long __b,
10993
11456
  unsigned char *__c) {
10994
11457
  __builtin_altivec_stvebx((vector char)__a, __b, __c);
10995
11458
  }
10996
11459
 
10997
11460
  /* vec_stvehx */
10998
11461
 
10999
- static __inline__ void __ATTRS_o_ai vec_stvehx(vector short __a, int __b,
11462
+ static __inline__ void __ATTRS_o_ai vec_stvehx(vector short __a, long __b,
11000
11463
  short *__c) {
11001
11464
  __builtin_altivec_stvehx(__a, __b, __c);
11002
11465
  }
11003
11466
 
11004
11467
  static __inline__ void __ATTRS_o_ai vec_stvehx(vector unsigned short __a,
11005
- int __b, unsigned short *__c) {
11468
+ long __b, unsigned short *__c) {
11006
11469
  __builtin_altivec_stvehx((vector short)__a, __b, __c);
11007
11470
  }
11008
11471
 
11009
- static __inline__ void __ATTRS_o_ai vec_stvehx(vector bool short __a, int __b,
11472
+ static __inline__ void __ATTRS_o_ai vec_stvehx(vector bool short __a, long __b,
11010
11473
  short *__c) {
11011
11474
  __builtin_altivec_stvehx((vector short)__a, __b, __c);
11012
11475
  }
11013
11476
 
11014
- static __inline__ void __ATTRS_o_ai vec_stvehx(vector bool short __a, int __b,
11477
+ static __inline__ void __ATTRS_o_ai vec_stvehx(vector bool short __a, long __b,
11015
11478
  unsigned short *__c) {
11016
11479
  __builtin_altivec_stvehx((vector short)__a, __b, __c);
11017
11480
  }
11018
11481
 
11019
- static __inline__ void __ATTRS_o_ai vec_stvehx(vector pixel __a, int __b,
11482
+ static __inline__ void __ATTRS_o_ai vec_stvehx(vector pixel __a, long __b,
11020
11483
  short *__c) {
11021
11484
  __builtin_altivec_stvehx((vector short)__a, __b, __c);
11022
11485
  }
11023
11486
 
11024
- static __inline__ void __ATTRS_o_ai vec_stvehx(vector pixel __a, int __b,
11487
+ static __inline__ void __ATTRS_o_ai vec_stvehx(vector pixel __a, long __b,
11025
11488
  unsigned short *__c) {
11026
11489
  __builtin_altivec_stvehx((vector short)__a, __b, __c);
11027
11490
  }
11028
11491
 
11029
11492
  /* vec_stvewx */
11030
11493
 
11031
- static __inline__ void __ATTRS_o_ai vec_stvewx(vector int __a, int __b,
11494
+ static __inline__ void __ATTRS_o_ai vec_stvewx(vector int __a, long __b,
11032
11495
  int *__c) {
11033
11496
  __builtin_altivec_stvewx(__a, __b, __c);
11034
11497
  }
11035
11498
 
11036
- static __inline__ void __ATTRS_o_ai vec_stvewx(vector unsigned int __a, int __b,
11499
+ static __inline__ void __ATTRS_o_ai vec_stvewx(vector unsigned int __a, long __b,
11037
11500
  unsigned int *__c) {
11038
11501
  __builtin_altivec_stvewx((vector int)__a, __b, __c);
11039
11502
  }
11040
11503
 
11041
- static __inline__ void __ATTRS_o_ai vec_stvewx(vector bool int __a, int __b,
11504
+ static __inline__ void __ATTRS_o_ai vec_stvewx(vector bool int __a, long __b,
11042
11505
  int *__c) {
11043
11506
  __builtin_altivec_stvewx((vector int)__a, __b, __c);
11044
11507
  }
11045
11508
 
11046
- static __inline__ void __ATTRS_o_ai vec_stvewx(vector bool int __a, int __b,
11509
+ static __inline__ void __ATTRS_o_ai vec_stvewx(vector bool int __a, long __b,
11047
11510
  unsigned int *__c) {
11048
11511
  __builtin_altivec_stvewx((vector int)__a, __b, __c);
11049
11512
  }
11050
11513
 
11051
- static __inline__ void __ATTRS_o_ai vec_stvewx(vector float __a, int __b,
11514
+ static __inline__ void __ATTRS_o_ai vec_stvewx(vector float __a, long __b,
11052
11515
  float *__c) {
11053
11516
  __builtin_altivec_stvewx((vector int)__a, __b, __c);
11054
11517
  }
@@ -11409,7 +11872,8 @@ vec_sub(vector unsigned int __a, vector bool int __b) {
11409
11872
  return __a - (vector unsigned int)__b;
11410
11873
  }
11411
11874
 
11412
- #if defined(__POWER8_VECTOR__) && defined(__powerpc64__)
11875
+ #if defined(__POWER8_VECTOR__) && defined(__powerpc64__) && \
11876
+ defined(__SIZEOF_INT128__)
11413
11877
  static __inline__ vector signed __int128 __ATTRS_o_ai
11414
11878
  vec_sub(vector signed __int128 __a, vector signed __int128 __b) {
11415
11879
  return __a - __b;
@@ -11419,7 +11883,8 @@ static __inline__ vector unsigned __int128 __ATTRS_o_ai
11419
11883
  vec_sub(vector unsigned __int128 __a, vector unsigned __int128 __b) {
11420
11884
  return __a - __b;
11421
11885
  }
11422
- #endif // defined(__POWER8_VECTOR__) && defined(__powerpc64__)
11886
+ #endif // defined(__POWER8_VECTOR__) && defined(__powerpc64__) &&
11887
+ // defined(__SIZEOF_INT128__)
11423
11888
 
11424
11889
  #ifdef __VSX__
11425
11890
  static __inline__ vector signed long long __ATTRS_o_ai
@@ -11567,7 +12032,8 @@ vec_subc(vector unsigned int __a, vector unsigned int __b) {
11567
12032
  return __builtin_altivec_vsubcuw(__a, __b);
11568
12033
  }
11569
12034
 
11570
- #if defined(__POWER8_VECTOR__) && defined(__powerpc64__)
12035
+ #ifdef __POWER8_VECTOR__
12036
+ #ifdef __SIZEOF_INT128__
11571
12037
  static __inline__ vector unsigned __int128 __ATTRS_o_ai
11572
12038
  vec_subc(vector unsigned __int128 __a, vector unsigned __int128 __b) {
11573
12039
  return __builtin_altivec_vsubcuq(__a, __b);
@@ -11577,7 +12043,13 @@ static __inline__ vector signed __int128 __ATTRS_o_ai
11577
12043
  vec_subc(vector signed __int128 __a, vector signed __int128 __b) {
11578
12044
  return __builtin_altivec_vsubcuq(__a, __b);
11579
12045
  }
11580
- #endif // defined(__POWER8_VECTOR__) && defined(__powerpc64__)
12046
+ #endif
12047
+
12048
+ static __inline__ vector unsigned char __attribute__((__always_inline__))
12049
+ vec_subc_u128(vector unsigned char __a, vector unsigned char __b) {
12050
+ return (vector unsigned char)__builtin_altivec_vsubcuq(__a, __b);
12051
+ }
12052
+ #endif // __POWER8_VECTOR__
11581
12053
 
11582
12054
  /* vec_vsubcuw */
11583
12055
 
@@ -11780,9 +12252,10 @@ vec_vsubuws(vector unsigned int __a, vector bool int __b) {
11780
12252
  return __builtin_altivec_vsubuws(__a, (vector unsigned int)__b);
11781
12253
  }
11782
12254
 
11783
- #if defined(__POWER8_VECTOR__) && defined(__powerpc64__)
12255
+ #ifdef __POWER8_VECTOR__
11784
12256
  /* vec_vsubuqm */
11785
12257
 
12258
+ #ifdef __SIZEOF_INT128__
11786
12259
  static __inline__ vector signed __int128 __ATTRS_o_ai
11787
12260
  vec_vsubuqm(vector signed __int128 __a, vector signed __int128 __b) {
11788
12261
  return __a - __b;
@@ -11792,10 +12265,16 @@ static __inline__ vector unsigned __int128 __ATTRS_o_ai
11792
12265
  vec_vsubuqm(vector unsigned __int128 __a, vector unsigned __int128 __b) {
11793
12266
  return __a - __b;
11794
12267
  }
12268
+ #endif
11795
12269
 
11796
- /* vec_vsubeuqm */
12270
+ static __inline__ vector unsigned char __attribute__((__always_inline__))
12271
+ vec_sub_u128(vector unsigned char __a, vector unsigned char __b) {
12272
+ return __builtin_altivec_vsubuqm(__a, __b);
12273
+ }
11797
12274
 
12275
+ /* vec_vsubeuqm */
11798
12276
 
12277
+ #ifdef __SIZEOF_INT128__
11799
12278
  static __inline__ vector signed __int128 __ATTRS_o_ai
11800
12279
  vec_vsubeuqm(vector signed __int128 __a, vector signed __int128 __b,
11801
12280
  vector signed __int128 __c) {
@@ -11819,9 +12298,17 @@ vec_sube(vector unsigned __int128 __a, vector unsigned __int128 __b,
11819
12298
  vector unsigned __int128 __c) {
11820
12299
  return __builtin_altivec_vsubeuqm(__a, __b, __c);
11821
12300
  }
12301
+ #endif
12302
+
12303
+ static __inline__ vector unsigned char __attribute__((__always_inline__))
12304
+ vec_sube_u128(vector unsigned char __a, vector unsigned char __b,
12305
+ vector unsigned char __c) {
12306
+ return (vector unsigned char)__builtin_altivec_vsubeuqm(__a, __b, __c);
12307
+ }
11822
12308
 
11823
12309
  /* vec_vsubcuq */
11824
12310
 
12311
+ #ifdef __SIZEOF_INT128__
11825
12312
  static __inline__ vector signed __int128 __ATTRS_o_ai
11826
12313
  vec_vsubcuq(vector signed __int128 __a, vector signed __int128 __b) {
11827
12314
  return __builtin_altivec_vsubcuq(__a, __b);
@@ -11845,7 +12332,9 @@ vec_vsubecuq(vector unsigned __int128 __a, vector unsigned __int128 __b,
11845
12332
  vector unsigned __int128 __c) {
11846
12333
  return __builtin_altivec_vsubecuq(__a, __b, __c);
11847
12334
  }
12335
+ #endif
11848
12336
 
12337
+ #ifdef __powerpc64__
11849
12338
  static __inline__ vector signed int __ATTRS_o_ai
11850
12339
  vec_subec(vector signed int __a, vector signed int __b,
11851
12340
  vector signed int __c) {
@@ -11857,7 +12346,9 @@ vec_subec(vector unsigned int __a, vector unsigned int __b,
11857
12346
  vector unsigned int __c) {
11858
12347
  return vec_addec(__a, ~__b, __c);
11859
12348
  }
12349
+ #endif
11860
12350
 
12351
+ #ifdef __SIZEOF_INT128__
11861
12352
  static __inline__ vector signed __int128 __ATTRS_o_ai
11862
12353
  vec_subec(vector signed __int128 __a, vector signed __int128 __b,
11863
12354
  vector signed __int128 __c) {
@@ -11869,7 +12360,14 @@ vec_subec(vector unsigned __int128 __a, vector unsigned __int128 __b,
11869
12360
  vector unsigned __int128 __c) {
11870
12361
  return __builtin_altivec_vsubecuq(__a, __b, __c);
11871
12362
  }
11872
- #endif // defined(__POWER8_VECTOR__) && defined(__powerpc64__)
12363
+ #endif
12364
+
12365
+ static __inline__ vector unsigned char __attribute__((__always_inline__))
12366
+ vec_subec_u128(vector unsigned char __a, vector unsigned char __b,
12367
+ vector unsigned char __c) {
12368
+ return (vector unsigned char)__builtin_altivec_vsubecuq(__a, __b, __c);
12369
+ }
12370
+ #endif // __POWER8_VECTOR__
11873
12371
 
11874
12372
  static __inline__ vector signed int __ATTRS_o_ai
11875
12373
  vec_sube(vector signed int __a, vector signed int __b,
@@ -12012,6 +12510,17 @@ static __inline__ vector double __ATTRS_o_ai vec_trunc(vector double __a) {
12012
12510
  }
12013
12511
  #endif
12014
12512
 
12513
+ /* vec_roundz */
12514
+ static __inline__ vector float __ATTRS_o_ai vec_roundz(vector float __a) {
12515
+ return vec_trunc(__a);
12516
+ }
12517
+
12518
+ #ifdef __VSX__
12519
+ static __inline__ vector double __ATTRS_o_ai vec_roundz(vector double __a) {
12520
+ return vec_trunc(__a);
12521
+ }
12522
+ #endif
12523
+
12015
12524
  /* vec_vrfiz */
12016
12525
 
12017
12526
  static __inline__ vector float __attribute__((__always_inline__))
@@ -12023,6 +12532,13 @@ vec_vrfiz(vector float __a) {
12023
12532
 
12024
12533
  /* The vector unpack instructions all have a big-endian bias, so for
12025
12534
  little endian we must reverse the meanings of "high" and "low." */
12535
+ #ifdef __LITTLE_ENDIAN__
12536
+ #define vec_vupkhpx(__a) __builtin_altivec_vupklpx((vector short)(__a))
12537
+ #define vec_vupklpx(__a) __builtin_altivec_vupkhpx((vector short)(__a))
12538
+ #else
12539
+ #define vec_vupkhpx(__a) __builtin_altivec_vupkhpx((vector short)(__a))
12540
+ #define vec_vupklpx(__a) __builtin_altivec_vupklpx((vector short)(__a))
12541
+ #endif
12026
12542
 
12027
12543
  static __inline__ vector short __ATTRS_o_ai
12028
12544
  vec_unpackh(vector signed char __a) {
@@ -12558,6 +13074,16 @@ static __inline__ void __ATTRS_o_ai vec_vsx_st(vector unsigned char __a,
12558
13074
  #ifdef __VSX__
12559
13075
  #define vec_xxpermdi __builtin_vsx_xxpermdi
12560
13076
  #define vec_xxsldwi __builtin_vsx_xxsldwi
13077
+ #define vec_permi(__a, __b, __c) \
13078
+ _Generic((__a), vector signed long long \
13079
+ : __builtin_shufflevector((__a), (__b), (((__c) >> 1) & 0x1), \
13080
+ (((__c)&0x1) + 2)), \
13081
+ vector unsigned long long \
13082
+ : __builtin_shufflevector((__a), (__b), (((__c) >> 1) & 0x1), \
13083
+ (((__c)&0x1) + 2)), \
13084
+ vector double \
13085
+ : __builtin_shufflevector((__a), (__b), (((__c) >> 1) & 0x1), \
13086
+ (((__c)&0x1) + 2)))
12561
13087
  #endif
12562
13088
 
12563
13089
  /* vec_xor */
@@ -12915,73 +13441,75 @@ vec_vxor(vector bool long long __a, vector bool long long __b) {
12915
13441
  /* vec_extract */
12916
13442
 
12917
13443
  static __inline__ signed char __ATTRS_o_ai vec_extract(vector signed char __a,
12918
- int __b) {
12919
- return __a[__b];
13444
+ unsigned int __b) {
13445
+ return __a[__b & 0xf];
12920
13446
  }
12921
13447
 
12922
13448
  static __inline__ unsigned char __ATTRS_o_ai
12923
- vec_extract(vector unsigned char __a, int __b) {
12924
- return __a[__b];
13449
+ vec_extract(vector unsigned char __a, unsigned int __b) {
13450
+ return __a[__b & 0xf];
12925
13451
  }
12926
13452
 
12927
13453
  static __inline__ unsigned char __ATTRS_o_ai vec_extract(vector bool char __a,
12928
- int __b) {
12929
- return __a[__b];
13454
+ unsigned int __b) {
13455
+ return __a[__b & 0xf];
12930
13456
  }
12931
13457
 
12932
13458
  static __inline__ signed short __ATTRS_o_ai vec_extract(vector signed short __a,
12933
- int __b) {
12934
- return __a[__b];
13459
+ unsigned int __b) {
13460
+ return __a[__b & 0x7];
12935
13461
  }
12936
13462
 
12937
13463
  static __inline__ unsigned short __ATTRS_o_ai
12938
- vec_extract(vector unsigned short __a, int __b) {
12939
- return __a[__b];
13464
+ vec_extract(vector unsigned short __a, unsigned int __b) {
13465
+ return __a[__b & 0x7];
12940
13466
  }
12941
13467
 
12942
13468
  static __inline__ unsigned short __ATTRS_o_ai vec_extract(vector bool short __a,
12943
- int __b) {
12944
- return __a[__b];
13469
+ unsigned int __b) {
13470
+ return __a[__b & 0x7];
12945
13471
  }
12946
13472
 
12947
13473
  static __inline__ signed int __ATTRS_o_ai vec_extract(vector signed int __a,
12948
- int __b) {
12949
- return __a[__b];
13474
+ unsigned int __b) {
13475
+ return __a[__b & 0x3];
12950
13476
  }
12951
13477
 
12952
13478
  static __inline__ unsigned int __ATTRS_o_ai vec_extract(vector unsigned int __a,
12953
- int __b) {
12954
- return __a[__b];
13479
+ unsigned int __b) {
13480
+ return __a[__b & 0x3];
12955
13481
  }
12956
13482
 
12957
13483
  static __inline__ unsigned int __ATTRS_o_ai vec_extract(vector bool int __a,
12958
- int __b) {
12959
- return __a[__b];
13484
+ unsigned int __b) {
13485
+ return __a[__b & 0x3];
12960
13486
  }
12961
13487
 
12962
13488
  #ifdef __VSX__
12963
13489
  static __inline__ signed long long __ATTRS_o_ai
12964
- vec_extract(vector signed long long __a, int __b) {
12965
- return __a[__b];
13490
+ vec_extract(vector signed long long __a, unsigned int __b) {
13491
+ return __a[__b & 0x1];
12966
13492
  }
12967
13493
 
12968
13494
  static __inline__ unsigned long long __ATTRS_o_ai
12969
- vec_extract(vector unsigned long long __a, int __b) {
12970
- return __a[__b];
13495
+ vec_extract(vector unsigned long long __a, unsigned int __b) {
13496
+ return __a[__b & 0x1];
12971
13497
  }
12972
13498
 
12973
13499
  static __inline__ unsigned long long __ATTRS_o_ai
12974
- vec_extract(vector bool long long __a, int __b) {
12975
- return __a[__b];
13500
+ vec_extract(vector bool long long __a, unsigned int __b) {
13501
+ return __a[__b & 0x1];
12976
13502
  }
12977
13503
 
12978
- static __inline__ double __ATTRS_o_ai vec_extract(vector double __a, int __b) {
12979
- return __a[__b];
13504
+ static __inline__ double __ATTRS_o_ai vec_extract(vector double __a,
13505
+ unsigned int __b) {
13506
+ return __a[__b & 0x1];
12980
13507
  }
12981
13508
  #endif
12982
13509
 
12983
- static __inline__ float __ATTRS_o_ai vec_extract(vector float __a, int __b) {
12984
- return __a[__b];
13510
+ static __inline__ float __ATTRS_o_ai vec_extract(vector float __a,
13511
+ unsigned int __b) {
13512
+ return __a[__b & 0x3];
12985
13513
  }
12986
13514
 
12987
13515
  #ifdef __POWER9_VECTOR__
@@ -14022,49 +14550,71 @@ static __inline__ void __ATTRS_o_ai vec_stvrxl(vector float __a, int __b,
14022
14550
  static __inline__ vector signed char __ATTRS_o_ai vec_promote(signed char __a,
14023
14551
  int __b) {
14024
14552
  vector signed char __res = (vector signed char)(0);
14025
- __res[__b] = __a;
14553
+ __res[__b & 0x7] = __a;
14026
14554
  return __res;
14027
14555
  }
14028
14556
 
14029
14557
  static __inline__ vector unsigned char __ATTRS_o_ai
14030
14558
  vec_promote(unsigned char __a, int __b) {
14031
14559
  vector unsigned char __res = (vector unsigned char)(0);
14032
- __res[__b] = __a;
14560
+ __res[__b & 0x7] = __a;
14033
14561
  return __res;
14034
14562
  }
14035
14563
 
14036
14564
  static __inline__ vector short __ATTRS_o_ai vec_promote(short __a, int __b) {
14037
14565
  vector short __res = (vector short)(0);
14038
- __res[__b] = __a;
14566
+ __res[__b & 0x7] = __a;
14039
14567
  return __res;
14040
14568
  }
14041
14569
 
14042
14570
  static __inline__ vector unsigned short __ATTRS_o_ai
14043
14571
  vec_promote(unsigned short __a, int __b) {
14044
14572
  vector unsigned short __res = (vector unsigned short)(0);
14045
- __res[__b] = __a;
14573
+ __res[__b & 0x7] = __a;
14046
14574
  return __res;
14047
14575
  }
14048
14576
 
14049
14577
  static __inline__ vector int __ATTRS_o_ai vec_promote(int __a, int __b) {
14050
14578
  vector int __res = (vector int)(0);
14051
- __res[__b] = __a;
14579
+ __res[__b & 0x3] = __a;
14052
14580
  return __res;
14053
14581
  }
14054
14582
 
14055
14583
  static __inline__ vector unsigned int __ATTRS_o_ai vec_promote(unsigned int __a,
14056
14584
  int __b) {
14057
14585
  vector unsigned int __res = (vector unsigned int)(0);
14058
- __res[__b] = __a;
14586
+ __res[__b & 0x3] = __a;
14059
14587
  return __res;
14060
14588
  }
14061
14589
 
14062
14590
  static __inline__ vector float __ATTRS_o_ai vec_promote(float __a, int __b) {
14063
14591
  vector float __res = (vector float)(0);
14064
- __res[__b] = __a;
14592
+ __res[__b & 0x3] = __a;
14593
+ return __res;
14594
+ }
14595
+
14596
+ #ifdef __VSX__
14597
+ static __inline__ vector double __ATTRS_o_ai vec_promote(double __a, int __b) {
14598
+ vector double __res = (vector double)(0);
14599
+ __res[__b & 0x1] = __a;
14600
+ return __res;
14601
+ }
14602
+
14603
+ static __inline__ vector signed long long __ATTRS_o_ai
14604
+ vec_promote(signed long long __a, int __b) {
14605
+ vector signed long long __res = (vector signed long long)(0);
14606
+ __res[__b & 0x1] = __a;
14065
14607
  return __res;
14066
14608
  }
14067
14609
 
14610
+ static __inline__ vector unsigned long long __ATTRS_o_ai
14611
+ vec_promote(unsigned long long __a, int __b) {
14612
+ vector unsigned long long __res = (vector unsigned long long)(0);
14613
+ __res[__b & 0x1] = __a;
14614
+ return __res;
14615
+ }
14616
+ #endif
14617
+
14068
14618
  /* vec_splats */
14069
14619
 
14070
14620
  static __inline__ vector signed char __ATTRS_o_ai vec_splats(signed char __a) {
@@ -14105,7 +14655,8 @@ vec_splats(unsigned long long __a) {
14105
14655
  return (vector unsigned long long)(__a);
14106
14656
  }
14107
14657
 
14108
- #if defined(__POWER8_VECTOR__) && defined(__powerpc64__)
14658
+ #if defined(__POWER8_VECTOR__) && defined(__powerpc64__) && \
14659
+ defined(__SIZEOF_INT128__)
14109
14660
  static __inline__ vector signed __int128 __ATTRS_o_ai
14110
14661
  vec_splats(signed __int128 __a) {
14111
14662
  return (vector signed __int128)(__a);
@@ -14258,7 +14809,7 @@ static __inline__ int __ATTRS_o_ai vec_all_eq(vector bool int __a,
14258
14809
  (vector int)__b);
14259
14810
  }
14260
14811
 
14261
- #ifdef __POWER8_VECTOR__
14812
+ #ifdef __VSX__
14262
14813
  static __inline__ int __ATTRS_o_ai vec_all_eq(vector signed long long __a,
14263
14814
  vector signed long long __b) {
14264
14815
  return __builtin_altivec_vcmpequd_p(__CR6_LT, __a, __b);
@@ -14316,7 +14867,7 @@ static __inline__ int __ATTRS_o_ai vec_all_eq(vector double __a,
14316
14867
  }
14317
14868
  #endif
14318
14869
 
14319
- #ifdef __POWER10_VECTOR__
14870
+ #if defined(__POWER10_VECTOR__) && defined(__SIZEOF_INT128__)
14320
14871
  static __inline__ int __ATTRS_o_ai vec_all_eq(vector signed __int128 __a,
14321
14872
  vector signed __int128 __b) {
14322
14873
  return __builtin_altivec_vcmpequq_p(__CR6_LT, __a, __b);
@@ -14352,8 +14903,7 @@ static __inline__ int __ATTRS_o_ai vec_all_ge(vector unsigned char __a,
14352
14903
 
14353
14904
  static __inline__ int __ATTRS_o_ai vec_all_ge(vector bool char __a,
14354
14905
  vector signed char __b) {
14355
- return __builtin_altivec_vcmpgtub_p(__CR6_EQ, (vector unsigned char)__b,
14356
- (vector unsigned char)__a);
14906
+ return __builtin_altivec_vcmpgtsb_p(__CR6_EQ, __b, (vector signed char)__a);
14357
14907
  }
14358
14908
 
14359
14909
  static __inline__ int __ATTRS_o_ai vec_all_ge(vector bool char __a,
@@ -14390,8 +14940,7 @@ static __inline__ int __ATTRS_o_ai vec_all_ge(vector unsigned short __a,
14390
14940
 
14391
14941
  static __inline__ int __ATTRS_o_ai vec_all_ge(vector bool short __a,
14392
14942
  vector short __b) {
14393
- return __builtin_altivec_vcmpgtuh_p(__CR6_EQ, (vector unsigned short)__b,
14394
- (vector unsigned short)__a);
14943
+ return __builtin_altivec_vcmpgtsh_p(__CR6_EQ, __b, (vector signed short)__a);
14395
14944
  }
14396
14945
 
14397
14946
  static __inline__ int __ATTRS_o_ai vec_all_ge(vector bool short __a,
@@ -14427,8 +14976,7 @@ static __inline__ int __ATTRS_o_ai vec_all_ge(vector unsigned int __a,
14427
14976
 
14428
14977
  static __inline__ int __ATTRS_o_ai vec_all_ge(vector bool int __a,
14429
14978
  vector int __b) {
14430
- return __builtin_altivec_vcmpgtuw_p(__CR6_EQ, (vector unsigned int)__b,
14431
- (vector unsigned int)__a);
14979
+ return __builtin_altivec_vcmpgtsw_p(__CR6_EQ, __b, (vector signed int)__a);
14432
14980
  }
14433
14981
 
14434
14982
  static __inline__ int __ATTRS_o_ai vec_all_ge(vector bool int __a,
@@ -14442,7 +14990,7 @@ static __inline__ int __ATTRS_o_ai vec_all_ge(vector bool int __a,
14442
14990
  (vector unsigned int)__a);
14443
14991
  }
14444
14992
 
14445
- #ifdef __POWER8_VECTOR__
14993
+ #ifdef __VSX__
14446
14994
  static __inline__ int __ATTRS_o_ai vec_all_ge(vector signed long long __a,
14447
14995
  vector signed long long __b) {
14448
14996
  return __builtin_altivec_vcmpgtsd_p(__CR6_EQ, __b, __a);
@@ -14466,8 +15014,8 @@ static __inline__ int __ATTRS_o_ai vec_all_ge(vector unsigned long long __a,
14466
15014
 
14467
15015
  static __inline__ int __ATTRS_o_ai vec_all_ge(vector bool long long __a,
14468
15016
  vector signed long long __b) {
14469
- return __builtin_altivec_vcmpgtud_p(__CR6_EQ, (vector unsigned long long)__b,
14470
- (vector unsigned long long)__a);
15017
+ return __builtin_altivec_vcmpgtsd_p(__CR6_EQ, __b,
15018
+ (vector signed long long)__a);
14471
15019
  }
14472
15020
 
14473
15021
  static __inline__ int __ATTRS_o_ai vec_all_ge(vector bool long long __a,
@@ -14499,7 +15047,7 @@ static __inline__ int __ATTRS_o_ai vec_all_ge(vector double __a,
14499
15047
  }
14500
15048
  #endif
14501
15049
 
14502
- #ifdef __POWER10_VECTOR__
15050
+ #if defined(__POWER10_VECTOR__) && defined(__SIZEOF_INT128__)
14503
15051
  static __inline__ int __ATTRS_o_ai vec_all_ge(vector signed __int128 __a,
14504
15052
  vector signed __int128 __b) {
14505
15053
  return __builtin_altivec_vcmpgtsq_p(__CR6_EQ, __b, __a);
@@ -14535,8 +15083,7 @@ static __inline__ int __ATTRS_o_ai vec_all_gt(vector unsigned char __a,
14535
15083
 
14536
15084
  static __inline__ int __ATTRS_o_ai vec_all_gt(vector bool char __a,
14537
15085
  vector signed char __b) {
14538
- return __builtin_altivec_vcmpgtub_p(__CR6_LT, (vector unsigned char)__a,
14539
- (vector unsigned char)__b);
15086
+ return __builtin_altivec_vcmpgtsb_p(__CR6_LT, (vector signed char)__a, __b);
14540
15087
  }
14541
15088
 
14542
15089
  static __inline__ int __ATTRS_o_ai vec_all_gt(vector bool char __a,
@@ -14573,8 +15120,7 @@ static __inline__ int __ATTRS_o_ai vec_all_gt(vector unsigned short __a,
14573
15120
 
14574
15121
  static __inline__ int __ATTRS_o_ai vec_all_gt(vector bool short __a,
14575
15122
  vector short __b) {
14576
- return __builtin_altivec_vcmpgtuh_p(__CR6_LT, (vector unsigned short)__a,
14577
- (vector unsigned short)__b);
15123
+ return __builtin_altivec_vcmpgtsh_p(__CR6_LT, (vector signed short)__a, __b);
14578
15124
  }
14579
15125
 
14580
15126
  static __inline__ int __ATTRS_o_ai vec_all_gt(vector bool short __a,
@@ -14610,8 +15156,7 @@ static __inline__ int __ATTRS_o_ai vec_all_gt(vector unsigned int __a,
14610
15156
 
14611
15157
  static __inline__ int __ATTRS_o_ai vec_all_gt(vector bool int __a,
14612
15158
  vector int __b) {
14613
- return __builtin_altivec_vcmpgtuw_p(__CR6_LT, (vector unsigned int)__a,
14614
- (vector unsigned int)__b);
15159
+ return __builtin_altivec_vcmpgtsw_p(__CR6_LT, (vector signed int)__a, __b);
14615
15160
  }
14616
15161
 
14617
15162
  static __inline__ int __ATTRS_o_ai vec_all_gt(vector bool int __a,
@@ -14625,7 +15170,7 @@ static __inline__ int __ATTRS_o_ai vec_all_gt(vector bool int __a,
14625
15170
  (vector unsigned int)__b);
14626
15171
  }
14627
15172
 
14628
- #ifdef __POWER8_VECTOR__
15173
+ #ifdef __VSX__
14629
15174
  static __inline__ int __ATTRS_o_ai vec_all_gt(vector signed long long __a,
14630
15175
  vector signed long long __b) {
14631
15176
  return __builtin_altivec_vcmpgtsd_p(__CR6_LT, __a, __b);
@@ -14649,8 +15194,8 @@ static __inline__ int __ATTRS_o_ai vec_all_gt(vector unsigned long long __a,
14649
15194
 
14650
15195
  static __inline__ int __ATTRS_o_ai vec_all_gt(vector bool long long __a,
14651
15196
  vector signed long long __b) {
14652
- return __builtin_altivec_vcmpgtud_p(__CR6_LT, (vector unsigned long long)__a,
14653
- (vector unsigned long long)__b);
15197
+ return __builtin_altivec_vcmpgtsd_p(__CR6_LT, (vector signed long long)__a,
15198
+ __b);
14654
15199
  }
14655
15200
 
14656
15201
  static __inline__ int __ATTRS_o_ai vec_all_gt(vector bool long long __a,
@@ -14682,7 +15227,7 @@ static __inline__ int __ATTRS_o_ai vec_all_gt(vector double __a,
14682
15227
  }
14683
15228
  #endif
14684
15229
 
14685
- #ifdef __POWER10_VECTOR__
15230
+ #if defined(__POWER10_VECTOR__) && defined(__SIZEOF_INT128__)
14686
15231
  static __inline__ int __ATTRS_o_ai vec_all_gt(vector signed __int128 __a,
14687
15232
  vector signed __int128 __b) {
14688
15233
  return __builtin_altivec_vcmpgtsq_p(__CR6_LT, __a, __b);
@@ -14725,8 +15270,7 @@ static __inline__ int __ATTRS_o_ai vec_all_le(vector unsigned char __a,
14725
15270
 
14726
15271
  static __inline__ int __ATTRS_o_ai vec_all_le(vector bool char __a,
14727
15272
  vector signed char __b) {
14728
- return __builtin_altivec_vcmpgtub_p(__CR6_EQ, (vector unsigned char)__a,
14729
- (vector unsigned char)__b);
15273
+ return __builtin_altivec_vcmpgtsb_p(__CR6_EQ, (vector signed char)__a, __b);
14730
15274
  }
14731
15275
 
14732
15276
  static __inline__ int __ATTRS_o_ai vec_all_le(vector bool char __a,
@@ -14763,8 +15307,7 @@ static __inline__ int __ATTRS_o_ai vec_all_le(vector unsigned short __a,
14763
15307
 
14764
15308
  static __inline__ int __ATTRS_o_ai vec_all_le(vector bool short __a,
14765
15309
  vector short __b) {
14766
- return __builtin_altivec_vcmpgtuh_p(__CR6_EQ, (vector unsigned short)__a,
14767
- (vector unsigned short)__b);
15310
+ return __builtin_altivec_vcmpgtsh_p(__CR6_EQ, (vector signed short)__a, __b);
14768
15311
  }
14769
15312
 
14770
15313
  static __inline__ int __ATTRS_o_ai vec_all_le(vector bool short __a,
@@ -14800,8 +15343,7 @@ static __inline__ int __ATTRS_o_ai vec_all_le(vector unsigned int __a,
14800
15343
 
14801
15344
  static __inline__ int __ATTRS_o_ai vec_all_le(vector bool int __a,
14802
15345
  vector int __b) {
14803
- return __builtin_altivec_vcmpgtuw_p(__CR6_EQ, (vector unsigned int)__a,
14804
- (vector unsigned int)__b);
15346
+ return __builtin_altivec_vcmpgtsw_p(__CR6_EQ, (vector signed int)__a, __b);
14805
15347
  }
14806
15348
 
14807
15349
  static __inline__ int __ATTRS_o_ai vec_all_le(vector bool int __a,
@@ -14815,7 +15357,7 @@ static __inline__ int __ATTRS_o_ai vec_all_le(vector bool int __a,
14815
15357
  (vector unsigned int)__b);
14816
15358
  }
14817
15359
 
14818
- #ifdef __POWER8_VECTOR__
15360
+ #ifdef __VSX__
14819
15361
  static __inline__ int __ATTRS_o_ai vec_all_le(vector signed long long __a,
14820
15362
  vector signed long long __b) {
14821
15363
  return __builtin_altivec_vcmpgtsd_p(__CR6_EQ, __a, __b);
@@ -14840,8 +15382,8 @@ static __inline__ int __ATTRS_o_ai vec_all_le(vector unsigned long long __a,
14840
15382
 
14841
15383
  static __inline__ int __ATTRS_o_ai vec_all_le(vector bool long long __a,
14842
15384
  vector signed long long __b) {
14843
- return __builtin_altivec_vcmpgtud_p(__CR6_EQ, (vector unsigned long long)__a,
14844
- (vector unsigned long long)__b);
15385
+ return __builtin_altivec_vcmpgtsd_p(__CR6_EQ, (vector signed long long)__a,
15386
+ __b);
14845
15387
  }
14846
15388
 
14847
15389
  static __inline__ int __ATTRS_o_ai vec_all_le(vector bool long long __a,
@@ -14873,7 +15415,7 @@ static __inline__ int __ATTRS_o_ai vec_all_le(vector double __a,
14873
15415
  }
14874
15416
  #endif
14875
15417
 
14876
- #ifdef __POWER10_VECTOR__
15418
+ #if defined(__POWER10_VECTOR__) && defined(__SIZEOF_INT128__)
14877
15419
  static __inline__ int __ATTRS_o_ai vec_all_le(vector signed __int128 __a,
14878
15420
  vector signed __int128 __b) {
14879
15421
  return __builtin_altivec_vcmpgtsq_p(__CR6_EQ, __a, __b);
@@ -14909,8 +15451,7 @@ static __inline__ int __ATTRS_o_ai vec_all_lt(vector unsigned char __a,
14909
15451
 
14910
15452
  static __inline__ int __ATTRS_o_ai vec_all_lt(vector bool char __a,
14911
15453
  vector signed char __b) {
14912
- return __builtin_altivec_vcmpgtub_p(__CR6_LT, (vector unsigned char)__b,
14913
- (vector unsigned char)__a);
15454
+ return __builtin_altivec_vcmpgtsb_p(__CR6_LT, __b, (vector signed char)__a);
14914
15455
  }
14915
15456
 
14916
15457
  static __inline__ int __ATTRS_o_ai vec_all_lt(vector bool char __a,
@@ -14947,8 +15488,7 @@ static __inline__ int __ATTRS_o_ai vec_all_lt(vector unsigned short __a,
14947
15488
 
14948
15489
  static __inline__ int __ATTRS_o_ai vec_all_lt(vector bool short __a,
14949
15490
  vector short __b) {
14950
- return __builtin_altivec_vcmpgtuh_p(__CR6_LT, (vector unsigned short)__b,
14951
- (vector unsigned short)__a);
15491
+ return __builtin_altivec_vcmpgtsh_p(__CR6_LT, __b, (vector signed short)__a);
14952
15492
  }
14953
15493
 
14954
15494
  static __inline__ int __ATTRS_o_ai vec_all_lt(vector bool short __a,
@@ -14984,8 +15524,7 @@ static __inline__ int __ATTRS_o_ai vec_all_lt(vector unsigned int __a,
14984
15524
 
14985
15525
  static __inline__ int __ATTRS_o_ai vec_all_lt(vector bool int __a,
14986
15526
  vector int __b) {
14987
- return __builtin_altivec_vcmpgtuw_p(__CR6_LT, (vector unsigned int)__b,
14988
- (vector unsigned int)__a);
15527
+ return __builtin_altivec_vcmpgtsw_p(__CR6_LT, __b, (vector signed int)__a);
14989
15528
  }
14990
15529
 
14991
15530
  static __inline__ int __ATTRS_o_ai vec_all_lt(vector bool int __a,
@@ -14999,7 +15538,7 @@ static __inline__ int __ATTRS_o_ai vec_all_lt(vector bool int __a,
14999
15538
  (vector unsigned int)__a);
15000
15539
  }
15001
15540
 
15002
- #ifdef __POWER8_VECTOR__
15541
+ #ifdef __VSX__
15003
15542
  static __inline__ int __ATTRS_o_ai vec_all_lt(vector signed long long __a,
15004
15543
  vector signed long long __b) {
15005
15544
  return __builtin_altivec_vcmpgtsd_p(__CR6_LT, __b, __a);
@@ -15024,8 +15563,8 @@ static __inline__ int __ATTRS_o_ai vec_all_lt(vector unsigned long long __a,
15024
15563
 
15025
15564
  static __inline__ int __ATTRS_o_ai vec_all_lt(vector bool long long __a,
15026
15565
  vector signed long long __b) {
15027
- return __builtin_altivec_vcmpgtud_p(__CR6_LT, (vector unsigned long long)__b,
15028
- (vector unsigned long long)__a);
15566
+ return __builtin_altivec_vcmpgtsd_p(__CR6_LT, __b,
15567
+ (vector signed long long)__a);
15029
15568
  }
15030
15569
 
15031
15570
  static __inline__ int __ATTRS_o_ai vec_all_lt(vector bool long long __a,
@@ -15057,7 +15596,7 @@ static __inline__ int __ATTRS_o_ai vec_all_lt(vector double __a,
15057
15596
  }
15058
15597
  #endif
15059
15598
 
15060
- #ifdef __POWER10_VECTOR__
15599
+ #if defined(__POWER10_VECTOR__) && defined(__SIZEOF_INT128__)
15061
15600
  static __inline__ int __ATTRS_o_ai vec_all_lt(vector signed __int128 __a,
15062
15601
  vector signed __int128 __b) {
15063
15602
  return __builtin_altivec_vcmpgtsq_p(__CR6_LT, __b, __a);
@@ -15214,7 +15753,7 @@ static __inline__ int __ATTRS_o_ai vec_all_ne(vector bool int __a,
15214
15753
  (vector int)__b);
15215
15754
  }
15216
15755
 
15217
- #ifdef __POWER8_VECTOR__
15756
+ #ifdef __VSX__
15218
15757
  static __inline__ int __ATTRS_o_ai vec_all_ne(vector signed long long __a,
15219
15758
  vector signed long long __b) {
15220
15759
  return __builtin_altivec_vcmpequd_p(__CR6_EQ, __a, __b);
@@ -15273,7 +15812,7 @@ static __inline__ int __ATTRS_o_ai vec_all_ne(vector double __a,
15273
15812
  }
15274
15813
  #endif
15275
15814
 
15276
- #ifdef __POWER10_VECTOR__
15815
+ #if defined(__POWER10_VECTOR__) && defined(__SIZEOF_INT128__)
15277
15816
  static __inline__ int __ATTRS_o_ai vec_all_ne(vector signed __int128 __a,
15278
15817
  vector signed __int128 __b) {
15279
15818
  return __builtin_altivec_vcmpequq_p(__CR6_EQ, __a, __b);
@@ -15323,25 +15862,57 @@ static __inline__ int __ATTRS_o_ai vec_all_ngt(vector double __a,
15323
15862
 
15324
15863
  /* vec_all_nle */
15325
15864
 
15326
- static __inline__ int __attribute__((__always_inline__))
15865
+ static __inline__ int __ATTRS_o_ai
15327
15866
  vec_all_nle(vector float __a, vector float __b) {
15867
+ #ifdef __VSX__
15868
+ return __builtin_vsx_xvcmpgesp_p(__CR6_EQ, __b, __a);
15869
+ #else
15328
15870
  return __builtin_altivec_vcmpgefp_p(__CR6_EQ, __b, __a);
15871
+ #endif
15872
+ }
15873
+
15874
+ #ifdef __VSX__
15875
+ static __inline__ int __ATTRS_o_ai vec_all_nle(vector double __a,
15876
+ vector double __b) {
15877
+ return __builtin_vsx_xvcmpgedp_p(__CR6_EQ, __b, __a);
15329
15878
  }
15879
+ #endif
15330
15880
 
15331
15881
  /* vec_all_nlt */
15332
15882
 
15333
- static __inline__ int __attribute__((__always_inline__))
15883
+ static __inline__ int __ATTRS_o_ai
15334
15884
  vec_all_nlt(vector float __a, vector float __b) {
15885
+ #ifdef __VSX__
15886
+ return __builtin_vsx_xvcmpgtsp_p(__CR6_EQ, __b, __a);
15887
+ #else
15335
15888
  return __builtin_altivec_vcmpgtfp_p(__CR6_EQ, __b, __a);
15889
+ #endif
15336
15890
  }
15337
15891
 
15892
+ #ifdef __VSX__
15893
+ static __inline__ int __ATTRS_o_ai vec_all_nlt(vector double __a,
15894
+ vector double __b) {
15895
+ return __builtin_vsx_xvcmpgtdp_p(__CR6_EQ, __b, __a);
15896
+ }
15897
+ #endif
15898
+
15338
15899
  /* vec_all_numeric */
15339
15900
 
15340
- static __inline__ int __attribute__((__always_inline__))
15901
+ static __inline__ int __ATTRS_o_ai
15341
15902
  vec_all_numeric(vector float __a) {
15903
+ #ifdef __VSX__
15904
+ return __builtin_vsx_xvcmpeqsp_p(__CR6_LT, __a, __a);
15905
+ #else
15342
15906
  return __builtin_altivec_vcmpeqfp_p(__CR6_LT, __a, __a);
15907
+ #endif
15343
15908
  }
15344
15909
 
15910
+ #ifdef __VSX__
15911
+ static __inline__ int __ATTRS_o_ai vec_all_numeric(vector double __a) {
15912
+ return __builtin_vsx_xvcmpeqdp_p(__CR6_LT, __a, __a);
15913
+ }
15914
+ #endif
15915
+
15345
15916
  /* vec_any_eq */
15346
15917
 
15347
15918
  static __inline__ int __ATTRS_o_ai vec_any_eq(vector signed char __a,
@@ -15471,7 +16042,7 @@ static __inline__ int __ATTRS_o_ai vec_any_eq(vector bool int __a,
15471
16042
  (vector int)__b);
15472
16043
  }
15473
16044
 
15474
- #ifdef __POWER8_VECTOR__
16045
+ #ifdef __VSX__
15475
16046
  static __inline__ int __ATTRS_o_ai vec_any_eq(vector signed long long __a,
15476
16047
  vector signed long long __b) {
15477
16048
  return __builtin_altivec_vcmpequd_p(__CR6_EQ_REV, __a, __b);
@@ -15530,7 +16101,7 @@ static __inline__ int __ATTRS_o_ai vec_any_eq(vector double __a,
15530
16101
  }
15531
16102
  #endif
15532
16103
 
15533
- #ifdef __POWER10_VECTOR__
16104
+ #if defined(__POWER10_VECTOR__) && defined(__SIZEOF_INT128__)
15534
16105
  static __inline__ int __ATTRS_o_ai vec_any_eq(vector signed __int128 __a,
15535
16106
  vector signed __int128 __b) {
15536
16107
  return __builtin_altivec_vcmpequq_p(__CR6_EQ_REV, __a, __b);
@@ -15568,8 +16139,8 @@ static __inline__ int __ATTRS_o_ai vec_any_ge(vector unsigned char __a,
15568
16139
 
15569
16140
  static __inline__ int __ATTRS_o_ai vec_any_ge(vector bool char __a,
15570
16141
  vector signed char __b) {
15571
- return __builtin_altivec_vcmpgtub_p(__CR6_LT_REV, (vector unsigned char)__b,
15572
- (vector unsigned char)__a);
16142
+ return __builtin_altivec_vcmpgtsb_p(__CR6_LT_REV, __b,
16143
+ (vector signed char)__a);
15573
16144
  }
15574
16145
 
15575
16146
  static __inline__ int __ATTRS_o_ai vec_any_ge(vector bool char __a,
@@ -15607,8 +16178,8 @@ static __inline__ int __ATTRS_o_ai vec_any_ge(vector unsigned short __a,
15607
16178
 
15608
16179
  static __inline__ int __ATTRS_o_ai vec_any_ge(vector bool short __a,
15609
16180
  vector short __b) {
15610
- return __builtin_altivec_vcmpgtuh_p(__CR6_LT_REV, (vector unsigned short)__b,
15611
- (vector unsigned short)__a);
16181
+ return __builtin_altivec_vcmpgtsh_p(__CR6_LT_REV, __b,
16182
+ (vector signed short)__a);
15612
16183
  }
15613
16184
 
15614
16185
  static __inline__ int __ATTRS_o_ai vec_any_ge(vector bool short __a,
@@ -15645,8 +16216,8 @@ static __inline__ int __ATTRS_o_ai vec_any_ge(vector unsigned int __a,
15645
16216
 
15646
16217
  static __inline__ int __ATTRS_o_ai vec_any_ge(vector bool int __a,
15647
16218
  vector int __b) {
15648
- return __builtin_altivec_vcmpgtuw_p(__CR6_LT_REV, (vector unsigned int)__b,
15649
- (vector unsigned int)__a);
16219
+ return __builtin_altivec_vcmpgtsw_p(__CR6_LT_REV, __b,
16220
+ (vector signed int)__a);
15650
16221
  }
15651
16222
 
15652
16223
  static __inline__ int __ATTRS_o_ai vec_any_ge(vector bool int __a,
@@ -15661,7 +16232,7 @@ static __inline__ int __ATTRS_o_ai vec_any_ge(vector bool int __a,
15661
16232
  (vector unsigned int)__a);
15662
16233
  }
15663
16234
 
15664
- #ifdef __POWER8_VECTOR__
16235
+ #ifdef __VSX__
15665
16236
  static __inline__ int __ATTRS_o_ai vec_any_ge(vector signed long long __a,
15666
16237
  vector signed long long __b) {
15667
16238
  return __builtin_altivec_vcmpgtsd_p(__CR6_LT_REV, __b, __a);
@@ -15686,9 +16257,8 @@ static __inline__ int __ATTRS_o_ai vec_any_ge(vector unsigned long long __a,
15686
16257
 
15687
16258
  static __inline__ int __ATTRS_o_ai vec_any_ge(vector bool long long __a,
15688
16259
  vector signed long long __b) {
15689
- return __builtin_altivec_vcmpgtud_p(__CR6_LT_REV,
15690
- (vector unsigned long long)__b,
15691
- (vector unsigned long long)__a);
16260
+ return __builtin_altivec_vcmpgtsd_p(__CR6_LT_REV, __b,
16261
+ (vector signed long long)__a);
15692
16262
  }
15693
16263
 
15694
16264
  static __inline__ int __ATTRS_o_ai vec_any_ge(vector bool long long __a,
@@ -15721,7 +16291,7 @@ static __inline__ int __ATTRS_o_ai vec_any_ge(vector double __a,
15721
16291
  }
15722
16292
  #endif
15723
16293
 
15724
- #ifdef __POWER10_VECTOR__
16294
+ #if defined(__POWER10_VECTOR__) && defined(__SIZEOF_INT128__)
15725
16295
  static __inline__ int __ATTRS_o_ai vec_any_ge(vector signed __int128 __a,
15726
16296
  vector signed __int128 __b) {
15727
16297
  return __builtin_altivec_vcmpgtsq_p(__CR6_LT_REV, __b, __a);
@@ -15759,8 +16329,8 @@ static __inline__ int __ATTRS_o_ai vec_any_gt(vector unsigned char __a,
15759
16329
 
15760
16330
  static __inline__ int __ATTRS_o_ai vec_any_gt(vector bool char __a,
15761
16331
  vector signed char __b) {
15762
- return __builtin_altivec_vcmpgtub_p(__CR6_EQ_REV, (vector unsigned char)__a,
15763
- (vector unsigned char)__b);
16332
+ return __builtin_altivec_vcmpgtsb_p(__CR6_EQ_REV, (vector signed char)__a,
16333
+ __b);
15764
16334
  }
15765
16335
 
15766
16336
  static __inline__ int __ATTRS_o_ai vec_any_gt(vector bool char __a,
@@ -15798,8 +16368,8 @@ static __inline__ int __ATTRS_o_ai vec_any_gt(vector unsigned short __a,
15798
16368
 
15799
16369
  static __inline__ int __ATTRS_o_ai vec_any_gt(vector bool short __a,
15800
16370
  vector short __b) {
15801
- return __builtin_altivec_vcmpgtuh_p(__CR6_EQ_REV, (vector unsigned short)__a,
15802
- (vector unsigned short)__b);
16371
+ return __builtin_altivec_vcmpgtsh_p(__CR6_EQ_REV, (vector signed short)__a,
16372
+ __b);
15803
16373
  }
15804
16374
 
15805
16375
  static __inline__ int __ATTRS_o_ai vec_any_gt(vector bool short __a,
@@ -15836,8 +16406,8 @@ static __inline__ int __ATTRS_o_ai vec_any_gt(vector unsigned int __a,
15836
16406
 
15837
16407
  static __inline__ int __ATTRS_o_ai vec_any_gt(vector bool int __a,
15838
16408
  vector int __b) {
15839
- return __builtin_altivec_vcmpgtuw_p(__CR6_EQ_REV, (vector unsigned int)__a,
15840
- (vector unsigned int)__b);
16409
+ return __builtin_altivec_vcmpgtsw_p(__CR6_EQ_REV, (vector signed int)__a,
16410
+ __b);
15841
16411
  }
15842
16412
 
15843
16413
  static __inline__ int __ATTRS_o_ai vec_any_gt(vector bool int __a,
@@ -15852,7 +16422,7 @@ static __inline__ int __ATTRS_o_ai vec_any_gt(vector bool int __a,
15852
16422
  (vector unsigned int)__b);
15853
16423
  }
15854
16424
 
15855
- #ifdef __POWER8_VECTOR__
16425
+ #ifdef __VSX__
15856
16426
  static __inline__ int __ATTRS_o_ai vec_any_gt(vector signed long long __a,
15857
16427
  vector signed long long __b) {
15858
16428
  return __builtin_altivec_vcmpgtsd_p(__CR6_EQ_REV, __a, __b);
@@ -15877,9 +16447,8 @@ static __inline__ int __ATTRS_o_ai vec_any_gt(vector unsigned long long __a,
15877
16447
 
15878
16448
  static __inline__ int __ATTRS_o_ai vec_any_gt(vector bool long long __a,
15879
16449
  vector signed long long __b) {
15880
- return __builtin_altivec_vcmpgtud_p(__CR6_EQ_REV,
15881
- (vector unsigned long long)__a,
15882
- (vector unsigned long long)__b);
16450
+ return __builtin_altivec_vcmpgtsd_p(__CR6_EQ_REV,
16451
+ (vector signed long long)__a, __b);
15883
16452
  }
15884
16453
 
15885
16454
  static __inline__ int __ATTRS_o_ai vec_any_gt(vector bool long long __a,
@@ -15912,7 +16481,7 @@ static __inline__ int __ATTRS_o_ai vec_any_gt(vector double __a,
15912
16481
  }
15913
16482
  #endif
15914
16483
 
15915
- #ifdef __POWER10_VECTOR__
16484
+ #if defined(__POWER10_VECTOR__) && defined(__SIZEOF_INT128__)
15916
16485
  static __inline__ int __ATTRS_o_ai vec_any_gt(vector signed __int128 __a,
15917
16486
  vector signed __int128 __b) {
15918
16487
  return __builtin_altivec_vcmpgtsq_p(__CR6_EQ_REV, __a, __b);
@@ -15950,8 +16519,8 @@ static __inline__ int __ATTRS_o_ai vec_any_le(vector unsigned char __a,
15950
16519
 
15951
16520
  static __inline__ int __ATTRS_o_ai vec_any_le(vector bool char __a,
15952
16521
  vector signed char __b) {
15953
- return __builtin_altivec_vcmpgtub_p(__CR6_LT_REV, (vector unsigned char)__a,
15954
- (vector unsigned char)__b);
16522
+ return __builtin_altivec_vcmpgtsb_p(__CR6_LT_REV, (vector signed char)__a,
16523
+ __b);
15955
16524
  }
15956
16525
 
15957
16526
  static __inline__ int __ATTRS_o_ai vec_any_le(vector bool char __a,
@@ -15989,8 +16558,8 @@ static __inline__ int __ATTRS_o_ai vec_any_le(vector unsigned short __a,
15989
16558
 
15990
16559
  static __inline__ int __ATTRS_o_ai vec_any_le(vector bool short __a,
15991
16560
  vector short __b) {
15992
- return __builtin_altivec_vcmpgtuh_p(__CR6_LT_REV, (vector unsigned short)__a,
15993
- (vector unsigned short)__b);
16561
+ return __builtin_altivec_vcmpgtsh_p(__CR6_LT_REV, (vector signed short)__a,
16562
+ __b);
15994
16563
  }
15995
16564
 
15996
16565
  static __inline__ int __ATTRS_o_ai vec_any_le(vector bool short __a,
@@ -16027,8 +16596,8 @@ static __inline__ int __ATTRS_o_ai vec_any_le(vector unsigned int __a,
16027
16596
 
16028
16597
  static __inline__ int __ATTRS_o_ai vec_any_le(vector bool int __a,
16029
16598
  vector int __b) {
16030
- return __builtin_altivec_vcmpgtuw_p(__CR6_LT_REV, (vector unsigned int)__a,
16031
- (vector unsigned int)__b);
16599
+ return __builtin_altivec_vcmpgtsw_p(__CR6_LT_REV, (vector signed int)__a,
16600
+ __b);
16032
16601
  }
16033
16602
 
16034
16603
  static __inline__ int __ATTRS_o_ai vec_any_le(vector bool int __a,
@@ -16043,7 +16612,7 @@ static __inline__ int __ATTRS_o_ai vec_any_le(vector bool int __a,
16043
16612
  (vector unsigned int)__b);
16044
16613
  }
16045
16614
 
16046
- #ifdef __POWER8_VECTOR__
16615
+ #ifdef __VSX__
16047
16616
  static __inline__ int __ATTRS_o_ai vec_any_le(vector signed long long __a,
16048
16617
  vector signed long long __b) {
16049
16618
  return __builtin_altivec_vcmpgtsd_p(__CR6_LT_REV, __a, __b);
@@ -16068,9 +16637,8 @@ static __inline__ int __ATTRS_o_ai vec_any_le(vector unsigned long long __a,
16068
16637
 
16069
16638
  static __inline__ int __ATTRS_o_ai vec_any_le(vector bool long long __a,
16070
16639
  vector signed long long __b) {
16071
- return __builtin_altivec_vcmpgtud_p(__CR6_LT_REV,
16072
- (vector unsigned long long)__a,
16073
- (vector unsigned long long)__b);
16640
+ return __builtin_altivec_vcmpgtsd_p(__CR6_LT_REV,
16641
+ (vector signed long long)__a, __b);
16074
16642
  }
16075
16643
 
16076
16644
  static __inline__ int __ATTRS_o_ai vec_any_le(vector bool long long __a,
@@ -16103,7 +16671,7 @@ static __inline__ int __ATTRS_o_ai vec_any_le(vector double __a,
16103
16671
  }
16104
16672
  #endif
16105
16673
 
16106
- #ifdef __POWER10_VECTOR__
16674
+ #if defined(__POWER10_VECTOR__) && defined(__SIZEOF_INT128__)
16107
16675
  static __inline__ int __ATTRS_o_ai vec_any_le(vector signed __int128 __a,
16108
16676
  vector signed __int128 __b) {
16109
16677
  return __builtin_altivec_vcmpgtsq_p(__CR6_LT_REV, __a, __b);
@@ -16141,8 +16709,8 @@ static __inline__ int __ATTRS_o_ai vec_any_lt(vector unsigned char __a,
16141
16709
 
16142
16710
  static __inline__ int __ATTRS_o_ai vec_any_lt(vector bool char __a,
16143
16711
  vector signed char __b) {
16144
- return __builtin_altivec_vcmpgtub_p(__CR6_EQ_REV, (vector unsigned char)__b,
16145
- (vector unsigned char)__a);
16712
+ return __builtin_altivec_vcmpgtsb_p(__CR6_EQ_REV, __b,
16713
+ (vector signed char)__a);
16146
16714
  }
16147
16715
 
16148
16716
  static __inline__ int __ATTRS_o_ai vec_any_lt(vector bool char __a,
@@ -16180,8 +16748,8 @@ static __inline__ int __ATTRS_o_ai vec_any_lt(vector unsigned short __a,
16180
16748
 
16181
16749
  static __inline__ int __ATTRS_o_ai vec_any_lt(vector bool short __a,
16182
16750
  vector short __b) {
16183
- return __builtin_altivec_vcmpgtuh_p(__CR6_EQ_REV, (vector unsigned short)__b,
16184
- (vector unsigned short)__a);
16751
+ return __builtin_altivec_vcmpgtsh_p(__CR6_EQ_REV, __b,
16752
+ (vector signed short)__a);
16185
16753
  }
16186
16754
 
16187
16755
  static __inline__ int __ATTRS_o_ai vec_any_lt(vector bool short __a,
@@ -16218,8 +16786,8 @@ static __inline__ int __ATTRS_o_ai vec_any_lt(vector unsigned int __a,
16218
16786
 
16219
16787
  static __inline__ int __ATTRS_o_ai vec_any_lt(vector bool int __a,
16220
16788
  vector int __b) {
16221
- return __builtin_altivec_vcmpgtuw_p(__CR6_EQ_REV, (vector unsigned int)__b,
16222
- (vector unsigned int)__a);
16789
+ return __builtin_altivec_vcmpgtsw_p(__CR6_EQ_REV, __b,
16790
+ (vector signed int)__a);
16223
16791
  }
16224
16792
 
16225
16793
  static __inline__ int __ATTRS_o_ai vec_any_lt(vector bool int __a,
@@ -16234,7 +16802,7 @@ static __inline__ int __ATTRS_o_ai vec_any_lt(vector bool int __a,
16234
16802
  (vector unsigned int)__a);
16235
16803
  }
16236
16804
 
16237
- #ifdef __POWER8_VECTOR__
16805
+ #ifdef __VSX__
16238
16806
  static __inline__ int __ATTRS_o_ai vec_any_lt(vector signed long long __a,
16239
16807
  vector signed long long __b) {
16240
16808
  return __builtin_altivec_vcmpgtsd_p(__CR6_EQ_REV, __b, __a);
@@ -16259,9 +16827,8 @@ static __inline__ int __ATTRS_o_ai vec_any_lt(vector unsigned long long __a,
16259
16827
 
16260
16828
  static __inline__ int __ATTRS_o_ai vec_any_lt(vector bool long long __a,
16261
16829
  vector signed long long __b) {
16262
- return __builtin_altivec_vcmpgtud_p(__CR6_EQ_REV,
16263
- (vector unsigned long long)__b,
16264
- (vector unsigned long long)__a);
16830
+ return __builtin_altivec_vcmpgtsd_p(__CR6_EQ_REV, __b,
16831
+ (vector signed long long)__a);
16265
16832
  }
16266
16833
 
16267
16834
  static __inline__ int __ATTRS_o_ai vec_any_lt(vector bool long long __a,
@@ -16294,7 +16861,7 @@ static __inline__ int __ATTRS_o_ai vec_any_lt(vector double __a,
16294
16861
  }
16295
16862
  #endif
16296
16863
 
16297
- #ifdef __POWER10_VECTOR__
16864
+ #if defined(__POWER10_VECTOR__) && defined(__SIZEOF_INT128__)
16298
16865
  static __inline__ int __ATTRS_o_ai vec_any_lt(vector signed __int128 __a,
16299
16866
  vector signed __int128 __b) {
16300
16867
  return __builtin_altivec_vcmpgtsq_p(__CR6_EQ_REV, __b, __a);
@@ -16308,10 +16875,18 @@ static __inline__ int __ATTRS_o_ai vec_any_lt(vector unsigned __int128 __a,
16308
16875
 
16309
16876
  /* vec_any_nan */
16310
16877
 
16311
- static __inline__ int __attribute__((__always_inline__))
16312
- vec_any_nan(vector float __a) {
16878
+ static __inline__ int __ATTRS_o_ai vec_any_nan(vector float __a) {
16879
+ #ifdef __VSX__
16880
+ return __builtin_vsx_xvcmpeqsp_p(__CR6_LT_REV, __a, __a);
16881
+ #else
16313
16882
  return __builtin_altivec_vcmpeqfp_p(__CR6_LT_REV, __a, __a);
16883
+ #endif
16314
16884
  }
16885
+ #ifdef __VSX__
16886
+ static __inline__ int __ATTRS_o_ai vec_any_nan(vector double __a) {
16887
+ return __builtin_vsx_xvcmpeqdp_p(__CR6_LT_REV, __a, __a);
16888
+ }
16889
+ #endif
16315
16890
 
16316
16891
  /* vec_any_ne */
16317
16892
 
@@ -16442,7 +17017,7 @@ static __inline__ int __ATTRS_o_ai vec_any_ne(vector bool int __a,
16442
17017
  (vector int)__b);
16443
17018
  }
16444
17019
 
16445
- #ifdef __POWER8_VECTOR__
17020
+ #ifdef __VSX__
16446
17021
  static __inline__ int __ATTRS_o_ai vec_any_ne(vector signed long long __a,
16447
17022
  vector signed long long __b) {
16448
17023
  return __builtin_altivec_vcmpequd_p(__CR6_LT_REV, __a, __b);
@@ -16501,7 +17076,7 @@ static __inline__ int __ATTRS_o_ai vec_any_ne(vector double __a,
16501
17076
  }
16502
17077
  #endif
16503
17078
 
16504
- #ifdef __POWER10_VECTOR__
17079
+ #if defined(__POWER10_VECTOR__) && defined(__SIZEOF_INT128__)
16505
17080
  static __inline__ int __ATTRS_o_ai vec_any_ne(vector signed __int128 __a,
16506
17081
  vector signed __int128 __b) {
16507
17082
  return __builtin_altivec_vcmpequq_p(__CR6_LT_REV, __a, __b);
@@ -16515,38 +17090,91 @@ static __inline__ int __ATTRS_o_ai vec_any_ne(vector unsigned __int128 __a,
16515
17090
 
16516
17091
  /* vec_any_nge */
16517
17092
 
16518
- static __inline__ int __attribute__((__always_inline__))
16519
- vec_any_nge(vector float __a, vector float __b) {
17093
+ static __inline__ int __ATTRS_o_ai vec_any_nge(vector float __a,
17094
+ vector float __b) {
17095
+ #ifdef __VSX__
17096
+ return __builtin_vsx_xvcmpgesp_p(__CR6_LT_REV, __a, __b);
17097
+ #else
16520
17098
  return __builtin_altivec_vcmpgefp_p(__CR6_LT_REV, __a, __b);
17099
+ #endif
16521
17100
  }
16522
17101
 
17102
+ #ifdef __VSX__
17103
+ static __inline__ int __ATTRS_o_ai vec_any_nge(vector double __a,
17104
+ vector double __b) {
17105
+ return __builtin_vsx_xvcmpgedp_p(__CR6_LT_REV, __a, __b);
17106
+ }
17107
+ #endif
17108
+
16523
17109
  /* vec_any_ngt */
16524
17110
 
16525
- static __inline__ int __attribute__((__always_inline__))
16526
- vec_any_ngt(vector float __a, vector float __b) {
17111
+ static __inline__ int __ATTRS_o_ai vec_any_ngt(vector float __a,
17112
+ vector float __b) {
17113
+ #ifdef __VSX__
17114
+ return __builtin_vsx_xvcmpgtsp_p(__CR6_LT_REV, __a, __b);
17115
+ #else
16527
17116
  return __builtin_altivec_vcmpgtfp_p(__CR6_LT_REV, __a, __b);
17117
+ #endif
16528
17118
  }
16529
17119
 
17120
+ #ifdef __VSX__
17121
+ static __inline__ int __ATTRS_o_ai vec_any_ngt(vector double __a,
17122
+ vector double __b) {
17123
+ return __builtin_vsx_xvcmpgtdp_p(__CR6_LT_REV, __a, __b);
17124
+ }
17125
+ #endif
17126
+
16530
17127
  /* vec_any_nle */
16531
17128
 
16532
- static __inline__ int __attribute__((__always_inline__))
16533
- vec_any_nle(vector float __a, vector float __b) {
17129
+ static __inline__ int __ATTRS_o_ai vec_any_nle(vector float __a,
17130
+ vector float __b) {
17131
+ #ifdef __VSX__
17132
+ return __builtin_vsx_xvcmpgesp_p(__CR6_LT_REV, __b, __a);
17133
+ #else
16534
17134
  return __builtin_altivec_vcmpgefp_p(__CR6_LT_REV, __b, __a);
17135
+ #endif
16535
17136
  }
16536
17137
 
17138
+ #ifdef __VSX__
17139
+ static __inline__ int __ATTRS_o_ai vec_any_nle(vector double __a,
17140
+ vector double __b) {
17141
+ return __builtin_vsx_xvcmpgedp_p(__CR6_LT_REV, __b, __a);
17142
+ }
17143
+ #endif
17144
+
16537
17145
  /* vec_any_nlt */
16538
17146
 
16539
- static __inline__ int __attribute__((__always_inline__))
16540
- vec_any_nlt(vector float __a, vector float __b) {
17147
+ static __inline__ int __ATTRS_o_ai vec_any_nlt(vector float __a,
17148
+ vector float __b) {
17149
+ #ifdef __VSX__
17150
+ return __builtin_vsx_xvcmpgtsp_p(__CR6_LT_REV, __b, __a);
17151
+ #else
16541
17152
  return __builtin_altivec_vcmpgtfp_p(__CR6_LT_REV, __b, __a);
17153
+ #endif
16542
17154
  }
16543
17155
 
17156
+ #ifdef __VSX__
17157
+ static __inline__ int __ATTRS_o_ai vec_any_nlt(vector double __a,
17158
+ vector double __b) {
17159
+ return __builtin_vsx_xvcmpgtdp_p(__CR6_LT_REV, __b, __a);
17160
+ }
17161
+ #endif
17162
+
16544
17163
  /* vec_any_numeric */
16545
17164
 
16546
- static __inline__ int __attribute__((__always_inline__))
16547
- vec_any_numeric(vector float __a) {
17165
+ static __inline__ int __ATTRS_o_ai vec_any_numeric(vector float __a) {
17166
+ #ifdef __VSX__
17167
+ return __builtin_vsx_xvcmpeqsp_p(__CR6_EQ_REV, __a, __a);
17168
+ #else
16548
17169
  return __builtin_altivec_vcmpeqfp_p(__CR6_EQ_REV, __a, __a);
17170
+ #endif
17171
+ }
17172
+
17173
+ #ifdef __VSX__
17174
+ static __inline__ int __ATTRS_o_ai vec_any_numeric(vector double __a) {
17175
+ return __builtin_vsx_xvcmpeqdp_p(__CR6_EQ_REV, __a, __a);
16549
17176
  }
17177
+ #endif
16550
17178
 
16551
17179
  /* vec_any_out */
16552
17180
 
@@ -16696,6 +17324,16 @@ vec_vgbbd(vector unsigned char __a) {
16696
17324
  return __builtin_altivec_vgbbd(__a);
16697
17325
  }
16698
17326
 
17327
+ static __inline__ vector signed long long __ATTRS_o_ai
17328
+ vec_gbb(vector signed long long __a) {
17329
+ return __builtin_altivec_vgbbd((vector unsigned char)__a);
17330
+ }
17331
+
17332
+ static __inline__ vector unsigned long long __ATTRS_o_ai
17333
+ vec_gbb(vector unsigned long long __a) {
17334
+ return __builtin_altivec_vgbbd((vector unsigned char)__a);
17335
+ }
17336
+
16699
17337
  static __inline__ vector long long __ATTRS_o_ai
16700
17338
  vec_vbpermq(vector signed char __a, vector signed char __b) {
16701
17339
  return __builtin_altivec_vbpermq((vector unsigned char)__a,
@@ -16707,7 +17345,7 @@ vec_vbpermq(vector unsigned char __a, vector unsigned char __b) {
16707
17345
  return __builtin_altivec_vbpermq(__a, __b);
16708
17346
  }
16709
17347
 
16710
- #ifdef __powerpc64__
17348
+ #if defined(__powerpc64__) && defined(__SIZEOF_INT128__)
16711
17349
  static __inline__ vector unsigned long long __attribute__((__always_inline__))
16712
17350
  vec_bperm(vector unsigned __int128 __a, vector unsigned char __b) {
16713
17351
  return __builtin_altivec_vbpermq((vector unsigned char)__a,
@@ -16882,7 +17520,8 @@ vec_revb(vector double __a) {
16882
17520
  }
16883
17521
  #endif /* End __VSX__ */
16884
17522
 
16885
- #if defined(__POWER8_VECTOR__) && defined(__powerpc64__)
17523
+ #if defined(__POWER8_VECTOR__) && defined(__powerpc64__) && \
17524
+ defined(__SIZEOF_INT128__)
16886
17525
  static __inline__ vector signed __int128 __ATTRS_o_ai
16887
17526
  vec_revb(vector signed __int128 __a) {
16888
17527
  vector unsigned char __indices =
@@ -16904,6 +17543,8 @@ vec_revb(vector unsigned __int128 __a) {
16904
17543
 
16905
17544
  /* vec_xl */
16906
17545
 
17546
+ #define vec_xld2 vec_xl
17547
+ #define vec_xlw4 vec_xl
16907
17548
  typedef vector signed char unaligned_vec_schar __attribute__((aligned(1)));
16908
17549
  typedef vector unsigned char unaligned_vec_uchar __attribute__((aligned(1)));
16909
17550
  typedef vector signed short unaligned_vec_sshort __attribute__((aligned(1)));
@@ -16912,41 +17553,41 @@ typedef vector signed int unaligned_vec_sint __attribute__((aligned(1)));
16912
17553
  typedef vector unsigned int unaligned_vec_uint __attribute__((aligned(1)));
16913
17554
  typedef vector float unaligned_vec_float __attribute__((aligned(1)));
16914
17555
 
16915
- static inline __ATTRS_o_ai vector signed char vec_xl(signed long long __offset,
17556
+ static inline __ATTRS_o_ai vector signed char vec_xl(ptrdiff_t __offset,
16916
17557
  const signed char *__ptr) {
16917
17558
  return *(unaligned_vec_schar *)(__ptr + __offset);
16918
17559
  }
16919
17560
 
16920
17561
  static inline __ATTRS_o_ai vector unsigned char
16921
- vec_xl(signed long long __offset, const unsigned char *__ptr) {
17562
+ vec_xl(ptrdiff_t __offset, const unsigned char *__ptr) {
16922
17563
  return *(unaligned_vec_uchar*)(__ptr + __offset);
16923
17564
  }
16924
17565
 
16925
- static inline __ATTRS_o_ai vector signed short vec_xl(signed long long __offset,
16926
- const signed short *__ptr) {
17566
+ static inline __ATTRS_o_ai vector signed short
17567
+ vec_xl(ptrdiff_t __offset, const signed short *__ptr) {
16927
17568
  signed char *__addr = (signed char *)__ptr + __offset;
16928
17569
  return *(unaligned_vec_sshort *)__addr;
16929
17570
  }
16930
17571
 
16931
17572
  static inline __ATTRS_o_ai vector unsigned short
16932
- vec_xl(signed long long __offset, const unsigned short *__ptr) {
17573
+ vec_xl(ptrdiff_t __offset, const unsigned short *__ptr) {
16933
17574
  signed char *__addr = (signed char *)__ptr + __offset;
16934
17575
  return *(unaligned_vec_ushort *)__addr;
16935
17576
  }
16936
17577
 
16937
- static inline __ATTRS_o_ai vector signed int vec_xl(signed long long __offset,
17578
+ static inline __ATTRS_o_ai vector signed int vec_xl(ptrdiff_t __offset,
16938
17579
  const signed int *__ptr) {
16939
17580
  signed char *__addr = (signed char *)__ptr + __offset;
16940
17581
  return *(unaligned_vec_sint *)__addr;
16941
17582
  }
16942
17583
 
16943
- static inline __ATTRS_o_ai vector unsigned int vec_xl(signed long long __offset,
16944
- const unsigned int *__ptr) {
17584
+ static inline __ATTRS_o_ai vector unsigned int
17585
+ vec_xl(ptrdiff_t __offset, const unsigned int *__ptr) {
16945
17586
  signed char *__addr = (signed char *)__ptr + __offset;
16946
17587
  return *(unaligned_vec_uint *)__addr;
16947
17588
  }
16948
17589
 
16949
- static inline __ATTRS_o_ai vector float vec_xl(signed long long __offset,
17590
+ static inline __ATTRS_o_ai vector float vec_xl(ptrdiff_t __offset,
16950
17591
  const float *__ptr) {
16951
17592
  signed char *__addr = (signed char *)__ptr + __offset;
16952
17593
  return *(unaligned_vec_float *)__addr;
@@ -16958,36 +17599,37 @@ typedef vector unsigned long long unaligned_vec_ull __attribute__((aligned(1)));
16958
17599
  typedef vector double unaligned_vec_double __attribute__((aligned(1)));
16959
17600
 
16960
17601
  static inline __ATTRS_o_ai vector signed long long
16961
- vec_xl(signed long long __offset, const signed long long *__ptr) {
17602
+ vec_xl(ptrdiff_t __offset, const signed long long *__ptr) {
16962
17603
  signed char *__addr = (signed char *)__ptr + __offset;
16963
17604
  return *(unaligned_vec_sll *)__addr;
16964
17605
  }
16965
17606
 
16966
17607
  static inline __ATTRS_o_ai vector unsigned long long
16967
- vec_xl(signed long long __offset, const unsigned long long *__ptr) {
17608
+ vec_xl(ptrdiff_t __offset, const unsigned long long *__ptr) {
16968
17609
  signed char *__addr = (signed char *)__ptr + __offset;
16969
17610
  return *(unaligned_vec_ull *)__addr;
16970
17611
  }
16971
17612
 
16972
- static inline __ATTRS_o_ai vector double vec_xl(signed long long __offset,
17613
+ static inline __ATTRS_o_ai vector double vec_xl(ptrdiff_t __offset,
16973
17614
  const double *__ptr) {
16974
17615
  signed char *__addr = (signed char *)__ptr + __offset;
16975
17616
  return *(unaligned_vec_double *)__addr;
16976
17617
  }
16977
17618
  #endif
16978
17619
 
16979
- #if defined(__POWER8_VECTOR__) && defined(__powerpc64__)
17620
+ #if defined(__POWER8_VECTOR__) && defined(__powerpc64__) && \
17621
+ defined(__SIZEOF_INT128__)
16980
17622
  typedef vector signed __int128 unaligned_vec_si128 __attribute__((aligned(1)));
16981
17623
  typedef vector unsigned __int128 unaligned_vec_ui128
16982
17624
  __attribute__((aligned(1)));
16983
17625
  static inline __ATTRS_o_ai vector signed __int128
16984
- vec_xl(signed long long __offset, const signed __int128 *__ptr) {
17626
+ vec_xl(ptrdiff_t __offset, const signed __int128 *__ptr) {
16985
17627
  signed char *__addr = (signed char *)__ptr + __offset;
16986
17628
  return *(unaligned_vec_si128 *)__addr;
16987
17629
  }
16988
17630
 
16989
17631
  static inline __ATTRS_o_ai vector unsigned __int128
16990
- vec_xl(signed long long __offset, const unsigned __int128 *__ptr) {
17632
+ vec_xl(ptrdiff_t __offset, const unsigned __int128 *__ptr) {
16991
17633
  signed char *__addr = (signed char *)__ptr + __offset;
16992
17634
  return *(unaligned_vec_ui128 *)__addr;
16993
17635
  }
@@ -16997,27 +17639,27 @@ vec_xl(signed long long __offset, const unsigned __int128 *__ptr) {
16997
17639
 
16998
17640
  #ifdef __LITTLE_ENDIAN__
16999
17641
  static __inline__ vector signed char __ATTRS_o_ai
17000
- vec_xl_be(signed long long __offset, const signed char *__ptr) {
17642
+ vec_xl_be(ptrdiff_t __offset, const signed char *__ptr) {
17001
17643
  vector signed char __vec = (vector signed char)__builtin_vsx_lxvd2x_be(__offset, __ptr);
17002
17644
  return __builtin_shufflevector(__vec, __vec, 7, 6, 5, 4, 3, 2, 1, 0, 15, 14,
17003
17645
  13, 12, 11, 10, 9, 8);
17004
17646
  }
17005
17647
 
17006
17648
  static __inline__ vector unsigned char __ATTRS_o_ai
17007
- vec_xl_be(signed long long __offset, const unsigned char *__ptr) {
17649
+ vec_xl_be(ptrdiff_t __offset, const unsigned char *__ptr) {
17008
17650
  vector unsigned char __vec = (vector unsigned char)__builtin_vsx_lxvd2x_be(__offset, __ptr);
17009
17651
  return __builtin_shufflevector(__vec, __vec, 7, 6, 5, 4, 3, 2, 1, 0, 15, 14,
17010
17652
  13, 12, 11, 10, 9, 8);
17011
17653
  }
17012
17654
 
17013
- static __inline__ vector signed short __ATTRS_o_ai
17014
- vec_xl_be(signed long long __offset, const signed short *__ptr) {
17655
+ static __inline__ vector signed short __ATTRS_o_ai
17656
+ vec_xl_be(ptrdiff_t __offset, const signed short *__ptr) {
17015
17657
  vector signed short __vec = (vector signed short)__builtin_vsx_lxvd2x_be(__offset, __ptr);
17016
17658
  return __builtin_shufflevector(__vec, __vec, 3, 2, 1, 0, 7, 6, 5, 4);
17017
17659
  }
17018
17660
 
17019
17661
  static __inline__ vector unsigned short __ATTRS_o_ai
17020
- vec_xl_be(signed long long __offset, const unsigned short *__ptr) {
17662
+ vec_xl_be(ptrdiff_t __offset, const unsigned short *__ptr) {
17021
17663
  vector unsigned short __vec = (vector unsigned short)__builtin_vsx_lxvd2x_be(__offset, __ptr);
17022
17664
  return __builtin_shufflevector(__vec, __vec, 3, 2, 1, 0, 7, 6, 5, 4);
17023
17665
  }
@@ -17054,7 +17696,8 @@ vec_xl_be(signed long long __offset, const double *__ptr) {
17054
17696
  }
17055
17697
  #endif
17056
17698
 
17057
- #if defined(__POWER8_VECTOR__) && defined(__powerpc64__)
17699
+ #if defined(__POWER8_VECTOR__) && defined(__powerpc64__) && \
17700
+ defined(__SIZEOF_INT128__)
17058
17701
  static __inline__ vector signed __int128 __ATTRS_o_ai
17059
17702
  vec_xl_be(signed long long __offset, const signed __int128 *__ptr) {
17060
17703
  return vec_xl(__offset, __ptr);
@@ -17069,98 +17712,153 @@ vec_xl_be(signed long long __offset, const unsigned __int128 *__ptr) {
17069
17712
  #define vec_xl_be vec_xl
17070
17713
  #endif
17071
17714
 
17072
- #if defined(__POWER10_VECTOR__) && defined(__VSX__)
17715
+ #if defined(__POWER10_VECTOR__) && defined(__VSX__) && \
17716
+ defined(__SIZEOF_INT128__)
17073
17717
 
17074
17718
  /* vect_xl_sext */
17075
17719
 
17076
17720
  static __inline__ vector unsigned __int128 __ATTRS_o_ai
17077
- vec_xl_sext(signed long long __offset, const signed char *__pointer) {
17721
+ vec_xl_sext(ptrdiff_t __offset, const signed char *__pointer) {
17078
17722
  return (vector unsigned __int128)*(__pointer + __offset);
17079
17723
  }
17080
17724
 
17081
17725
  static __inline__ vector unsigned __int128 __ATTRS_o_ai
17082
- vec_xl_sext(signed long long __offset, const signed short *__pointer) {
17726
+ vec_xl_sext(ptrdiff_t __offset, const signed short *__pointer) {
17083
17727
  return (vector unsigned __int128)*(__pointer + __offset);
17084
17728
  }
17085
17729
 
17086
17730
  static __inline__ vector unsigned __int128 __ATTRS_o_ai
17087
- vec_xl_sext(signed long long __offset, const signed int *__pointer) {
17731
+ vec_xl_sext(ptrdiff_t __offset, const signed int *__pointer) {
17088
17732
  return (vector unsigned __int128)*(__pointer + __offset);
17089
17733
  }
17090
17734
 
17091
17735
  static __inline__ vector unsigned __int128 __ATTRS_o_ai
17092
- vec_xl_sext(signed long long __offset, const signed long long *__pointer) {
17736
+ vec_xl_sext(ptrdiff_t __offset, const signed long long *__pointer) {
17093
17737
  return (vector unsigned __int128)*(__pointer + __offset);
17094
17738
  }
17095
17739
 
17096
17740
  /* vec_xl_zext */
17097
17741
 
17098
17742
  static __inline__ vector unsigned __int128 __ATTRS_o_ai
17099
- vec_xl_zext(signed long long __offset, const unsigned char *__pointer) {
17743
+ vec_xl_zext(ptrdiff_t __offset, const unsigned char *__pointer) {
17100
17744
  return (vector unsigned __int128)*(__pointer + __offset);
17101
17745
  }
17102
17746
 
17103
17747
  static __inline__ vector unsigned __int128 __ATTRS_o_ai
17104
- vec_xl_zext(signed long long __offset, const unsigned short *__pointer) {
17748
+ vec_xl_zext(ptrdiff_t __offset, const unsigned short *__pointer) {
17105
17749
  return (vector unsigned __int128)*(__pointer + __offset);
17106
17750
  }
17107
17751
 
17108
17752
  static __inline__ vector unsigned __int128 __ATTRS_o_ai
17109
- vec_xl_zext(signed long long __offset, const unsigned int *__pointer) {
17753
+ vec_xl_zext(ptrdiff_t __offset, const unsigned int *__pointer) {
17110
17754
  return (vector unsigned __int128)*(__pointer + __offset);
17111
17755
  }
17112
17756
 
17113
17757
  static __inline__ vector unsigned __int128 __ATTRS_o_ai
17114
- vec_xl_zext(signed long long __offset, const unsigned long long *__pointer) {
17758
+ vec_xl_zext(ptrdiff_t __offset, const unsigned long long *__pointer) {
17115
17759
  return (vector unsigned __int128)*(__pointer + __offset);
17116
17760
  }
17117
17761
 
17118
17762
  #endif
17119
17763
 
17764
+ /* vec_xlds */
17765
+ #ifdef __VSX__
17766
+ static __inline__ vector signed long long __ATTRS_o_ai
17767
+ vec_xlds(ptrdiff_t __offset, const signed long long *__ptr) {
17768
+ signed long long *__addr = (signed long long*)((signed char *)__ptr + __offset);
17769
+ return (vector signed long long) *__addr;
17770
+ }
17771
+
17772
+ static __inline__ vector unsigned long long __ATTRS_o_ai
17773
+ vec_xlds(ptrdiff_t __offset, const unsigned long long *__ptr) {
17774
+ unsigned long long *__addr = (unsigned long long *)((signed char *)__ptr + __offset);
17775
+ return (unaligned_vec_ull) *__addr;
17776
+ }
17777
+
17778
+ static __inline__ vector double __ATTRS_o_ai vec_xlds(ptrdiff_t __offset,
17779
+ const double *__ptr) {
17780
+ double *__addr = (double*)((signed char *)__ptr + __offset);
17781
+ return (unaligned_vec_double) *__addr;
17782
+ }
17783
+
17784
+ /* vec_load_splats */
17785
+ static __inline__ vector signed int __ATTRS_o_ai
17786
+ vec_load_splats(signed long long __offset, const signed int *__ptr) {
17787
+ signed int *__addr = (signed int*)((signed char *)__ptr + __offset);
17788
+ return (vector signed int)*__addr;
17789
+ }
17790
+
17791
+ static __inline__ vector signed int __ATTRS_o_ai
17792
+ vec_load_splats(unsigned long long __offset, const signed int *__ptr) {
17793
+ signed int *__addr = (signed int*)((signed char *)__ptr + __offset);
17794
+ return (vector signed int)*__addr;
17795
+ }
17796
+
17797
+ static __inline__ vector unsigned int __ATTRS_o_ai
17798
+ vec_load_splats(signed long long __offset, const unsigned int *__ptr) {
17799
+ unsigned int *__addr = (unsigned int*)((signed char *)__ptr + __offset);
17800
+ return (vector unsigned int)*__addr;
17801
+ }
17802
+
17803
+ static __inline__ vector unsigned int __ATTRS_o_ai
17804
+ vec_load_splats(unsigned long long __offset, const unsigned int *__ptr) {
17805
+ unsigned int *__addr = (unsigned int*)((signed char *)__ptr + __offset);
17806
+ return (vector unsigned int)*__addr;
17807
+ }
17808
+
17809
+ static __inline__ vector float __ATTRS_o_ai
17810
+ vec_load_splats(signed long long __offset, const float *__ptr) {
17811
+ float *__addr = (float*)((signed char *)__ptr + __offset);
17812
+ return (vector float)*__addr;
17813
+ }
17814
+
17815
+ static __inline__ vector float __ATTRS_o_ai
17816
+ vec_load_splats(unsigned long long __offset, const float *__ptr) {
17817
+ float *__addr = (float*)((signed char *)__ptr + __offset);
17818
+ return (vector float)*__addr;
17819
+ }
17820
+ #endif
17821
+
17120
17822
  /* vec_xst */
17121
17823
 
17122
- static inline __ATTRS_o_ai void vec_xst(vector signed char __vec,
17123
- signed long long __offset,
17124
- signed char *__ptr) {
17824
+ #define vec_xstd2 vec_xst
17825
+ #define vec_xstw4 vec_xst
17826
+ static inline __ATTRS_o_ai void
17827
+ vec_xst(vector signed char __vec, ptrdiff_t __offset, signed char *__ptr) {
17125
17828
  *(unaligned_vec_schar *)(__ptr + __offset) = __vec;
17126
17829
  }
17127
17830
 
17128
- static inline __ATTRS_o_ai void vec_xst(vector unsigned char __vec,
17129
- signed long long __offset,
17130
- unsigned char *__ptr) {
17831
+ static inline __ATTRS_o_ai void
17832
+ vec_xst(vector unsigned char __vec, ptrdiff_t __offset, unsigned char *__ptr) {
17131
17833
  *(unaligned_vec_uchar *)(__ptr + __offset) = __vec;
17132
17834
  }
17133
17835
 
17134
- static inline __ATTRS_o_ai void vec_xst(vector signed short __vec,
17135
- signed long long __offset,
17136
- signed short *__ptr) {
17836
+ static inline __ATTRS_o_ai void
17837
+ vec_xst(vector signed short __vec, ptrdiff_t __offset, signed short *__ptr) {
17137
17838
  signed char *__addr = (signed char *)__ptr + __offset;
17138
17839
  *(unaligned_vec_sshort *)__addr = __vec;
17139
17840
  }
17140
17841
 
17141
17842
  static inline __ATTRS_o_ai void vec_xst(vector unsigned short __vec,
17142
- signed long long __offset,
17843
+ ptrdiff_t __offset,
17143
17844
  unsigned short *__ptr) {
17144
17845
  signed char *__addr = (signed char *)__ptr + __offset;
17145
17846
  *(unaligned_vec_ushort *)__addr = __vec;
17146
17847
  }
17147
17848
 
17148
17849
  static inline __ATTRS_o_ai void vec_xst(vector signed int __vec,
17149
- signed long long __offset,
17150
- signed int *__ptr) {
17850
+ ptrdiff_t __offset, signed int *__ptr) {
17151
17851
  signed char *__addr = (signed char *)__ptr + __offset;
17152
17852
  *(unaligned_vec_sint *)__addr = __vec;
17153
17853
  }
17154
17854
 
17155
- static inline __ATTRS_o_ai void vec_xst(vector unsigned int __vec,
17156
- signed long long __offset,
17157
- unsigned int *__ptr) {
17855
+ static inline __ATTRS_o_ai void
17856
+ vec_xst(vector unsigned int __vec, ptrdiff_t __offset, unsigned int *__ptr) {
17158
17857
  signed char *__addr = (signed char *)__ptr + __offset;
17159
17858
  *(unaligned_vec_uint *)__addr = __vec;
17160
17859
  }
17161
17860
 
17162
- static inline __ATTRS_o_ai void vec_xst(vector float __vec,
17163
- signed long long __offset,
17861
+ static inline __ATTRS_o_ai void vec_xst(vector float __vec, ptrdiff_t __offset,
17164
17862
  float *__ptr) {
17165
17863
  signed char *__addr = (signed char *)__ptr + __offset;
17166
17864
  *(unaligned_vec_float *)__addr = __vec;
@@ -17168,37 +17866,37 @@ static inline __ATTRS_o_ai void vec_xst(vector float __vec,
17168
17866
 
17169
17867
  #ifdef __VSX__
17170
17868
  static inline __ATTRS_o_ai void vec_xst(vector signed long long __vec,
17171
- signed long long __offset,
17869
+ ptrdiff_t __offset,
17172
17870
  signed long long *__ptr) {
17173
17871
  signed char *__addr = (signed char *)__ptr + __offset;
17174
17872
  *(unaligned_vec_sll *)__addr = __vec;
17175
17873
  }
17176
17874
 
17177
17875
  static inline __ATTRS_o_ai void vec_xst(vector unsigned long long __vec,
17178
- signed long long __offset,
17876
+ ptrdiff_t __offset,
17179
17877
  unsigned long long *__ptr) {
17180
17878
  signed char *__addr = (signed char *)__ptr + __offset;
17181
17879
  *(unaligned_vec_ull *)__addr = __vec;
17182
17880
  }
17183
17881
 
17184
- static inline __ATTRS_o_ai void vec_xst(vector double __vec,
17185
- signed long long __offset,
17882
+ static inline __ATTRS_o_ai void vec_xst(vector double __vec, ptrdiff_t __offset,
17186
17883
  double *__ptr) {
17187
17884
  signed char *__addr = (signed char *)__ptr + __offset;
17188
17885
  *(unaligned_vec_double *)__addr = __vec;
17189
17886
  }
17190
17887
  #endif
17191
17888
 
17192
- #if defined(__POWER8_VECTOR__) && defined(__powerpc64__)
17889
+ #if defined(__POWER8_VECTOR__) && defined(__powerpc64__) && \
17890
+ defined(__SIZEOF_INT128__)
17193
17891
  static inline __ATTRS_o_ai void vec_xst(vector signed __int128 __vec,
17194
- signed long long __offset,
17892
+ ptrdiff_t __offset,
17195
17893
  signed __int128 *__ptr) {
17196
17894
  signed char *__addr = (signed char *)__ptr + __offset;
17197
17895
  *(unaligned_vec_si128 *)__addr = __vec;
17198
17896
  }
17199
17897
 
17200
17898
  static inline __ATTRS_o_ai void vec_xst(vector unsigned __int128 __vec,
17201
- signed long long __offset,
17899
+ ptrdiff_t __offset,
17202
17900
  unsigned __int128 *__ptr) {
17203
17901
  signed char *__addr = (signed char *)__ptr + __offset;
17204
17902
  *(unaligned_vec_ui128 *)__addr = __vec;
@@ -17207,51 +17905,52 @@ static inline __ATTRS_o_ai void vec_xst(vector unsigned __int128 __vec,
17207
17905
 
17208
17906
  /* vec_xst_trunc */
17209
17907
 
17210
- #if defined(__POWER10_VECTOR__) && defined(__VSX__)
17908
+ #if defined(__POWER10_VECTOR__) && defined(__VSX__) && \
17909
+ defined(__SIZEOF_INT128__)
17211
17910
  static inline __ATTRS_o_ai void vec_xst_trunc(vector signed __int128 __vec,
17212
- signed long long __offset,
17911
+ ptrdiff_t __offset,
17213
17912
  signed char *__ptr) {
17214
17913
  *(__ptr + __offset) = (signed char)__vec[0];
17215
17914
  }
17216
17915
 
17217
17916
  static inline __ATTRS_o_ai void vec_xst_trunc(vector unsigned __int128 __vec,
17218
- signed long long __offset,
17917
+ ptrdiff_t __offset,
17219
17918
  unsigned char *__ptr) {
17220
17919
  *(__ptr + __offset) = (unsigned char)__vec[0];
17221
17920
  }
17222
17921
 
17223
17922
  static inline __ATTRS_o_ai void vec_xst_trunc(vector signed __int128 __vec,
17224
- signed long long __offset,
17923
+ ptrdiff_t __offset,
17225
17924
  signed short *__ptr) {
17226
17925
  *(__ptr + __offset) = (signed short)__vec[0];
17227
17926
  }
17228
17927
 
17229
17928
  static inline __ATTRS_o_ai void vec_xst_trunc(vector unsigned __int128 __vec,
17230
- signed long long __offset,
17929
+ ptrdiff_t __offset,
17231
17930
  unsigned short *__ptr) {
17232
17931
  *(__ptr + __offset) = (unsigned short)__vec[0];
17233
17932
  }
17234
17933
 
17235
17934
  static inline __ATTRS_o_ai void vec_xst_trunc(vector signed __int128 __vec,
17236
- signed long long __offset,
17935
+ ptrdiff_t __offset,
17237
17936
  signed int *__ptr) {
17238
17937
  *(__ptr + __offset) = (signed int)__vec[0];
17239
17938
  }
17240
17939
 
17241
17940
  static inline __ATTRS_o_ai void vec_xst_trunc(vector unsigned __int128 __vec,
17242
- signed long long __offset,
17941
+ ptrdiff_t __offset,
17243
17942
  unsigned int *__ptr) {
17244
17943
  *(__ptr + __offset) = (unsigned int)__vec[0];
17245
17944
  }
17246
17945
 
17247
17946
  static inline __ATTRS_o_ai void vec_xst_trunc(vector signed __int128 __vec,
17248
- signed long long __offset,
17947
+ ptrdiff_t __offset,
17249
17948
  signed long long *__ptr) {
17250
17949
  *(__ptr + __offset) = (signed long long)__vec[0];
17251
17950
  }
17252
17951
 
17253
17952
  static inline __ATTRS_o_ai void vec_xst_trunc(vector unsigned __int128 __vec,
17254
- signed long long __offset,
17953
+ ptrdiff_t __offset,
17255
17954
  unsigned long long *__ptr) {
17256
17955
  *(__ptr + __offset) = (unsigned long long)__vec[0];
17257
17956
  }
@@ -17336,7 +18035,8 @@ static __inline__ void __ATTRS_o_ai vec_xst_be(vector double __vec,
17336
18035
  }
17337
18036
  #endif
17338
18037
 
17339
- #if defined(__POWER8_VECTOR__) && defined(__powerpc64__)
18038
+ #if defined(__POWER8_VECTOR__) && defined(__powerpc64__) && \
18039
+ defined(__SIZEOF_INT128__)
17340
18040
  static __inline__ void __ATTRS_o_ai vec_xst_be(vector signed __int128 __vec,
17341
18041
  signed long long __offset,
17342
18042
  signed __int128 *__ptr) {
@@ -17375,7 +18075,7 @@ static vector double __ATTRS_o_ai vec_neg(vector double __a) {
17375
18075
 
17376
18076
  #endif
17377
18077
 
17378
- #if defined(__POWER8_VECTOR__) && defined(__powerpc64__)
18078
+ #ifdef __VSX__
17379
18079
  static vector long long __ATTRS_o_ai vec_neg(vector long long __a) {
17380
18080
  return -__a;
17381
18081
  }
@@ -17404,7 +18104,7 @@ static vector double __ATTRS_o_ai vec_nabs(vector double __a) {
17404
18104
 
17405
18105
  #endif
17406
18106
 
17407
- #if defined(__POWER8_VECTOR__) && defined(__powerpc64__)
18107
+ #ifdef __POWER8_VECTOR__
17408
18108
  static vector long long __ATTRS_o_ai vec_nabs(vector long long __a) {
17409
18109
  return __builtin_altivec_vminsd(__a, -__a);
17410
18110
  }
@@ -17422,6 +18122,18 @@ static vector signed char __ATTRS_o_ai vec_nabs(vector signed char __a) {
17422
18122
  return __builtin_altivec_vminsb(__a, -__a);
17423
18123
  }
17424
18124
 
18125
+ static vector float __ATTRS_o_ai vec_recipdiv(vector float __a,
18126
+ vector float __b) {
18127
+ return __builtin_ppc_recipdivf(__a, __b);
18128
+ }
18129
+
18130
+ #ifdef __VSX__
18131
+ static vector double __ATTRS_o_ai vec_recipdiv(vector double __a,
18132
+ vector double __b) {
18133
+ return __builtin_ppc_recipdivd(__a, __b);
18134
+ }
18135
+ #endif
18136
+
17425
18137
  #ifdef __POWER10_VECTOR__
17426
18138
 
17427
18139
  /* vec_extractm */
@@ -17446,10 +18158,12 @@ vec_extractm(vector unsigned long long __a) {
17446
18158
  return __builtin_altivec_vextractdm(__a);
17447
18159
  }
17448
18160
 
18161
+ #ifdef __SIZEOF_INT128__
17449
18162
  static __inline__ unsigned int __ATTRS_o_ai
17450
18163
  vec_extractm(vector unsigned __int128 __a) {
17451
18164
  return __builtin_altivec_vextractqm(__a);
17452
18165
  }
18166
+ #endif
17453
18167
 
17454
18168
  /* vec_expandm */
17455
18169
 
@@ -17473,10 +18187,12 @@ vec_expandm(vector unsigned long long __a) {
17473
18187
  return __builtin_altivec_vexpanddm(__a);
17474
18188
  }
17475
18189
 
18190
+ #ifdef __SIZEOF_INT128__
17476
18191
  static __inline__ vector unsigned __int128 __ATTRS_o_ai
17477
18192
  vec_expandm(vector unsigned __int128 __a) {
17478
18193
  return __builtin_altivec_vexpandqm(__a);
17479
18194
  }
18195
+ #endif
17480
18196
 
17481
18197
  /* vec_cntm */
17482
18198
 
@@ -17512,10 +18228,12 @@ vec_gendm(unsigned long long __bm) {
17512
18228
  return __builtin_altivec_mtvsrdm(__bm);
17513
18229
  }
17514
18230
 
18231
+ #ifdef __SIZEOF_INT128__
17515
18232
  static __inline__ vector unsigned __int128 __ATTRS_o_ai
17516
18233
  vec_genqm(unsigned long long __bm) {
17517
18234
  return __builtin_altivec_mtvsrqm(__bm);
17518
18235
  }
18236
+ #endif
17519
18237
 
17520
18238
  /* vec_pdep */
17521
18239
 
@@ -17544,6 +18262,7 @@ vec_cfuge(vector unsigned long long __a, vector unsigned long long __b) {
17544
18262
 
17545
18263
  /* vec_ternarylogic */
17546
18264
  #ifdef __VSX__
18265
+ #ifdef __SIZEOF_INT128__
17547
18266
  #define vec_ternarylogic(__a, __b, __c, __imm) \
17548
18267
  _Generic((__a), vector unsigned char \
17549
18268
  : __builtin_vsx_xxeval((vector unsigned long long)(__a), \
@@ -17565,6 +18284,25 @@ vec_cfuge(vector unsigned long long __a, vector unsigned long long __b) {
17565
18284
  : __builtin_vsx_xxeval((vector unsigned long long)(__a), \
17566
18285
  (vector unsigned long long)(__b), \
17567
18286
  (vector unsigned long long)(__c), (__imm)))
18287
+ #else
18288
+ #define vec_ternarylogic(__a, __b, __c, __imm) \
18289
+ _Generic((__a), vector unsigned char \
18290
+ : __builtin_vsx_xxeval((vector unsigned long long)(__a), \
18291
+ (vector unsigned long long)(__b), \
18292
+ (vector unsigned long long)(__c), (__imm)), \
18293
+ vector unsigned short \
18294
+ : __builtin_vsx_xxeval((vector unsigned long long)(__a), \
18295
+ (vector unsigned long long)(__b), \
18296
+ (vector unsigned long long)(__c), (__imm)), \
18297
+ vector unsigned int \
18298
+ : __builtin_vsx_xxeval((vector unsigned long long)(__a), \
18299
+ (vector unsigned long long)(__b), \
18300
+ (vector unsigned long long)(__c), (__imm)), \
18301
+ vector unsigned long long \
18302
+ : __builtin_vsx_xxeval((vector unsigned long long)(__a), \
18303
+ (vector unsigned long long)(__b), \
18304
+ (vector unsigned long long)(__c), (__imm)))
18305
+ #endif /* __SIZEOF_INT128__ */
17568
18306
  #endif /* __VSX__ */
17569
18307
 
17570
18308
  /* vec_genpcvm */
@@ -17657,6 +18395,7 @@ vec_mod(vector unsigned long long __a, vector unsigned long long __b) {
17657
18395
  return __a % __b;
17658
18396
  }
17659
18397
 
18398
+ #ifdef __SIZEOF_INT128__
17660
18399
  static __inline__ vector signed __int128 __ATTRS_o_ai
17661
18400
  vec_mod(vector signed __int128 __a, vector signed __int128 __b) {
17662
18401
  return __a % __b;
@@ -17666,6 +18405,7 @@ static __inline__ vector unsigned __int128 __ATTRS_o_ai
17666
18405
  vec_mod(vector unsigned __int128 __a, vector unsigned __int128 __b) {
17667
18406
  return __a % __b;
17668
18407
  }
18408
+ #endif
17669
18409
 
17670
18410
  /* vec_sldbi */
17671
18411
 
@@ -18188,6 +18928,7 @@ static __inline__ int __ATTRS_o_ai vec_strir_p(vector signed short __a) {
18188
18928
 
18189
18929
  /* vs[l | r | ra] */
18190
18930
 
18931
+ #ifdef __SIZEOF_INT128__
18191
18932
  static __inline__ vector unsigned __int128 __ATTRS_o_ai
18192
18933
  vec_sl(vector unsigned __int128 __a, vector unsigned __int128 __b) {
18193
18934
  return __a << (__b % (vector unsigned __int128)(sizeof(unsigned __int128) *
@@ -18232,6 +18973,7 @@ vec_sra(vector signed __int128 __a, vector unsigned __int128 __b) {
18232
18973
  __CHAR_BIT__));
18233
18974
  }
18234
18975
 
18976
+ #endif /* __SIZEOF_INT128__ */
18235
18977
  #endif /* __POWER10_VECTOR__ */
18236
18978
 
18237
18979
  #undef __ATTRS_o_ai