@cpp-linter/clang-tidy-win32-x64 12.0.1 → 14.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 (178) hide show
  1. package/README.md +2 -2
  2. package/bin/clang-tidy.exe +2 -2
  3. package/lib/clang/{12.0.1 → 14.0.0}/include/__clang_cuda_complex_builtins.h +3 -3
  4. package/lib/clang/{12.0.1 → 14.0.0}/include/__clang_cuda_device_functions.h +174 -102
  5. package/lib/clang/{12.0.1 → 14.0.0}/include/__clang_cuda_intrinsics.h +32 -0
  6. package/lib/clang/{12.0.1 → 14.0.0}/include/__clang_cuda_libdevice_declares.h +6 -0
  7. package/lib/clang/{12.0.1 → 14.0.0}/include/__clang_cuda_math.h +3 -3
  8. package/lib/clang/{12.0.1 → 14.0.0}/include/__clang_cuda_runtime_wrapper.h +68 -8
  9. package/lib/clang/14.0.0/include/__clang_cuda_texture_intrinsics.h +740 -0
  10. package/lib/clang/{12.0.1 → 14.0.0}/include/__clang_hip_cmath.h +272 -94
  11. package/lib/clang/{12.0.1 → 14.0.0}/include/__clang_hip_libdevice_declares.h +24 -12
  12. package/lib/clang/{12.0.1 → 14.0.0}/include/__clang_hip_math.h +48 -2
  13. package/lib/clang/14.0.0/include/__clang_hip_runtime_wrapper.h +137 -0
  14. package/lib/clang/{12.0.1 → 14.0.0}/include/__wmmintrin_aes.h +1 -1
  15. package/lib/clang/{12.0.1 → 14.0.0}/include/altivec.h +1348 -496
  16. package/lib/clang/{12.0.1 → 14.0.0}/include/ammintrin.h +4 -0
  17. package/lib/clang/14.0.0/include/amxintrin.h +494 -0
  18. package/lib/clang/{12.0.1 → 14.0.0}/include/arm_acle.h +61 -0
  19. package/lib/clang/{12.0.1 → 14.0.0}/include/arm_neon.h +5544 -4634
  20. package/lib/clang/14.0.0/include/arm_neon_sve_bridge.h +184 -0
  21. package/lib/clang/{12.0.1 → 14.0.0}/include/arm_sve.h +11791 -5896
  22. package/lib/clang/{12.0.1 → 14.0.0}/include/avx2intrin.h +181 -181
  23. package/lib/clang/{12.0.1 → 14.0.0}/include/avx512bf16intrin.h +3 -3
  24. package/lib/clang/{12.0.1 → 14.0.0}/include/avx512bwintrin.h +71 -71
  25. package/lib/clang/{12.0.1 → 14.0.0}/include/avx512dqintrin.h +365 -365
  26. package/lib/clang/{12.0.1 → 14.0.0}/include/avx512erintrin.h +102 -102
  27. package/lib/clang/{12.0.1 → 14.0.0}/include/avx512fintrin.h +1750 -1606
  28. package/lib/clang/14.0.0/include/avx512fp16intrin.h +3349 -0
  29. package/lib/clang/{12.0.1 → 14.0.0}/include/avx512vbmi2intrin.h +48 -48
  30. package/lib/clang/{12.0.1 → 14.0.0}/include/avx512vlbf16intrin.h +51 -3
  31. package/lib/clang/{12.0.1 → 14.0.0}/include/avx512vlbwintrin.h +94 -94
  32. package/lib/clang/{12.0.1 → 14.0.0}/include/avx512vldqintrin.h +134 -134
  33. package/lib/clang/14.0.0/include/avx512vlfp16intrin.h +2068 -0
  34. package/lib/clang/{12.0.1 → 14.0.0}/include/avx512vlintrin.h +563 -563
  35. package/lib/clang/{12.0.1 → 14.0.0}/include/avx512vlvbmi2intrin.h +96 -96
  36. package/lib/clang/{12.0.1 → 14.0.0}/include/avx512vlvnniintrin.h +8 -8
  37. package/lib/clang/{12.0.1 → 14.0.0}/include/avxintrin.h +189 -192
  38. package/lib/clang/14.0.0/include/builtins.h +16 -0
  39. package/lib/clang/{12.0.1 → 14.0.0}/include/cetintrin.h +10 -0
  40. package/lib/clang/{12.0.1 → 14.0.0}/include/cpuid.h +2 -1
  41. package/lib/clang/14.0.0/include/crc32intrin.h +100 -0
  42. package/lib/clang/{12.0.1 → 14.0.0}/include/cuda_wrappers/complex +8 -0
  43. package/lib/clang/{12.0.1 → 14.0.0}/include/emmintrin.h +21 -17
  44. package/lib/clang/{12.0.1 → 14.0.0}/include/f16cintrin.h +4 -4
  45. package/lib/clang/{12.0.1 → 14.0.0}/include/float.h +15 -6
  46. package/lib/clang/{12.0.1 → 14.0.0}/include/gfniintrin.h +47 -48
  47. package/lib/clang/14.0.0/include/hexagon_circ_brev_intrinsics.h +298 -0
  48. package/lib/clang/14.0.0/include/hexagon_protos.h +8439 -0
  49. package/lib/clang/14.0.0/include/hexagon_types.h +2621 -0
  50. package/lib/clang/14.0.0/include/hvx_hexagon_protos.h +5183 -0
  51. package/lib/clang/{12.0.1 → 14.0.0}/include/ia32intrin.h +6 -6
  52. package/lib/clang/{12.0.1 → 14.0.0}/include/immintrin.h +31 -13
  53. package/lib/clang/{12.0.1 → 14.0.0}/include/intrin.h +63 -19
  54. package/lib/clang/{12.0.1 → 14.0.0}/include/keylockerintrin.h +32 -8
  55. package/lib/clang/{12.0.1 → 14.0.0}/include/limits.h +20 -0
  56. package/lib/clang/{12.0.1 → 14.0.0}/include/mmintrin.h +4 -0
  57. package/lib/clang/{12.0.1 → 14.0.0}/include/nmmintrin.h +4 -0
  58. package/lib/clang/{12.0.1 → 14.0.0}/include/opencl-c-base.h +206 -7
  59. package/lib/clang/{12.0.1 → 14.0.0}/include/opencl-c.h +2187 -797
  60. package/lib/clang/14.0.0/include/openmp_wrappers/__clang_openmp_device_functions.h +106 -0
  61. package/lib/clang/{12.0.1 → 14.0.0}/include/openmp_wrappers/cmath +54 -0
  62. package/lib/clang/{12.0.1 → 14.0.0}/include/openmp_wrappers/complex +11 -8
  63. package/lib/clang/{12.0.1 → 14.0.0}/include/openmp_wrappers/complex.h +9 -1
  64. package/lib/clang/{12.0.1 → 14.0.0}/include/openmp_wrappers/math.h +10 -0
  65. package/lib/clang/{12.0.1 → 14.0.0}/include/openmp_wrappers/new +2 -24
  66. package/lib/clang/{12.0.1 → 14.0.0}/include/pmmintrin.h +4 -0
  67. package/lib/clang/{12.0.1 → 14.0.0}/include/ppc_wrappers/emmintrin.h +3 -2
  68. package/lib/clang/{12.0.1 → 14.0.0}/include/ppc_wrappers/mm_malloc.h +2 -2
  69. package/lib/clang/{12.0.1 → 14.0.0}/include/ppc_wrappers/mmintrin.h +3 -2
  70. package/lib/clang/{12.0.1 → 14.0.0}/include/ppc_wrappers/pmmintrin.h +3 -2
  71. package/lib/clang/{12.0.1 → 14.0.0}/include/ppc_wrappers/smmintrin.h +4 -3
  72. package/lib/clang/{12.0.1 → 14.0.0}/include/ppc_wrappers/tmmintrin.h +3 -2
  73. package/lib/clang/{12.0.1 → 14.0.0}/include/ppc_wrappers/xmmintrin.h +3 -2
  74. package/lib/clang/{12.0.1 → 14.0.0}/include/prfchwintrin.h +5 -2
  75. package/lib/clang/14.0.0/include/riscv_vector.h +95423 -0
  76. package/lib/clang/{12.0.1 → 14.0.0}/include/smmintrin.h +80 -159
  77. package/lib/clang/{12.0.1 → 14.0.0}/include/stdatomic.h +14 -1
  78. package/lib/clang/{12.0.1 → 14.0.0}/include/stdint.h +168 -0
  79. package/lib/clang/{12.0.1 → 14.0.0}/include/tmmintrin.h +10 -6
  80. package/lib/clang/{12.0.1 → 14.0.0}/include/uintrintrin.h +7 -0
  81. package/lib/clang/{12.0.1 → 14.0.0}/include/unwind.h +2 -1
  82. package/lib/clang/{12.0.1 → 14.0.0}/include/vaesintrin.h +22 -21
  83. package/lib/clang/{12.0.1 → 14.0.0}/include/vecintrin.h +206 -77
  84. package/lib/clang/{12.0.1 → 14.0.0}/include/vpclmulqdqintrin.h +8 -6
  85. package/lib/clang/14.0.0/include/wasm_simd128.h +1877 -0
  86. package/lib/clang/{12.0.1 → 14.0.0}/include/wmmintrin.h +4 -0
  87. package/lib/clang/{12.0.1 → 14.0.0}/include/x86gprintrin.h +12 -0
  88. package/lib/clang/{12.0.1 → 14.0.0}/include/xmmintrin.h +9 -5
  89. package/lib/clang/{12.0.1 → 14.0.0}/include/xopintrin.h +31 -31
  90. package/package.json +6 -6
  91. package/lib/clang/12.0.1/include/__clang_hip_runtime_wrapper.h +0 -69
  92. package/lib/clang/12.0.1/include/amxintrin.h +0 -278
  93. package/lib/clang/12.0.1/include/openmp_wrappers/__clang_openmp_device_functions.h +0 -42
  94. package/lib/clang/12.0.1/include/wasm_simd128.h +0 -1167
  95. /package/lib/clang/{12.0.1 → 14.0.0}/include/__clang_cuda_builtin_vars.h +0 -0
  96. /package/lib/clang/{12.0.1 → 14.0.0}/include/__clang_cuda_cmath.h +0 -0
  97. /package/lib/clang/{12.0.1 → 14.0.0}/include/__clang_cuda_math_forward_declares.h +0 -0
  98. /package/lib/clang/{12.0.1 → 14.0.0}/include/__stddef_max_align_t.h +0 -0
  99. /package/lib/clang/{12.0.1 → 14.0.0}/include/__wmmintrin_pclmul.h +0 -0
  100. /package/lib/clang/{12.0.1 → 14.0.0}/include/adxintrin.h +0 -0
  101. /package/lib/clang/{12.0.1 → 14.0.0}/include/arm64intr.h +0 -0
  102. /package/lib/clang/{12.0.1 → 14.0.0}/include/arm_bf16.h +0 -0
  103. /package/lib/clang/{12.0.1 → 14.0.0}/include/arm_cde.h +0 -0
  104. /package/lib/clang/{12.0.1 → 14.0.0}/include/arm_cmse.h +0 -0
  105. /package/lib/clang/{12.0.1 → 14.0.0}/include/arm_fp16.h +0 -0
  106. /package/lib/clang/{12.0.1 → 14.0.0}/include/arm_mve.h +0 -0
  107. /package/lib/clang/{12.0.1 → 14.0.0}/include/armintr.h +0 -0
  108. /package/lib/clang/{12.0.1 → 14.0.0}/include/avx512bitalgintrin.h +0 -0
  109. /package/lib/clang/{12.0.1 → 14.0.0}/include/avx512cdintrin.h +0 -0
  110. /package/lib/clang/{12.0.1 → 14.0.0}/include/avx512ifmaintrin.h +0 -0
  111. /package/lib/clang/{12.0.1 → 14.0.0}/include/avx512ifmavlintrin.h +0 -0
  112. /package/lib/clang/{12.0.1 → 14.0.0}/include/avx512pfintrin.h +0 -0
  113. /package/lib/clang/{12.0.1 → 14.0.0}/include/avx512vbmiintrin.h +0 -0
  114. /package/lib/clang/{12.0.1 → 14.0.0}/include/avx512vbmivlintrin.h +0 -0
  115. /package/lib/clang/{12.0.1 → 14.0.0}/include/avx512vlbitalgintrin.h +0 -0
  116. /package/lib/clang/{12.0.1 → 14.0.0}/include/avx512vlcdintrin.h +0 -0
  117. /package/lib/clang/{12.0.1 → 14.0.0}/include/avx512vlvp2intersectintrin.h +0 -0
  118. /package/lib/clang/{12.0.1 → 14.0.0}/include/avx512vnniintrin.h +0 -0
  119. /package/lib/clang/{12.0.1 → 14.0.0}/include/avx512vp2intersectintrin.h +0 -0
  120. /package/lib/clang/{12.0.1 → 14.0.0}/include/avx512vpopcntdqintrin.h +0 -0
  121. /package/lib/clang/{12.0.1 → 14.0.0}/include/avx512vpopcntdqvlintrin.h +0 -0
  122. /package/lib/clang/{12.0.1 → 14.0.0}/include/avxvnniintrin.h +0 -0
  123. /package/lib/clang/{12.0.1 → 14.0.0}/include/bmi2intrin.h +0 -0
  124. /package/lib/clang/{12.0.1 → 14.0.0}/include/bmiintrin.h +0 -0
  125. /package/lib/clang/{12.0.1 → 14.0.0}/include/cet.h +0 -0
  126. /package/lib/clang/{12.0.1 → 14.0.0}/include/cldemoteintrin.h +0 -0
  127. /package/lib/clang/{12.0.1 → 14.0.0}/include/clflushoptintrin.h +0 -0
  128. /package/lib/clang/{12.0.1 → 14.0.0}/include/clwbintrin.h +0 -0
  129. /package/lib/clang/{12.0.1 → 14.0.0}/include/clzerointrin.h +0 -0
  130. /package/lib/clang/{12.0.1 → 14.0.0}/include/cuda_wrappers/algorithm +0 -0
  131. /package/lib/clang/{12.0.1 → 14.0.0}/include/cuda_wrappers/new +0 -0
  132. /package/lib/clang/{12.0.1 → 14.0.0}/include/enqcmdintrin.h +0 -0
  133. /package/lib/clang/{12.0.1 → 14.0.0}/include/fma4intrin.h +0 -0
  134. /package/lib/clang/{12.0.1 → 14.0.0}/include/fmaintrin.h +0 -0
  135. /package/lib/clang/{12.0.1 → 14.0.0}/include/fxsrintrin.h +0 -0
  136. /package/lib/clang/{12.0.1 → 14.0.0}/include/hresetintrin.h +0 -0
  137. /package/lib/clang/{12.0.1 → 14.0.0}/include/htmintrin.h +0 -0
  138. /package/lib/clang/{12.0.1 → 14.0.0}/include/htmxlintrin.h +0 -0
  139. /package/lib/clang/{12.0.1 → 14.0.0}/include/inttypes.h +0 -0
  140. /package/lib/clang/{12.0.1 → 14.0.0}/include/invpcidintrin.h +0 -0
  141. /package/lib/clang/{12.0.1 → 14.0.0}/include/iso646.h +0 -0
  142. /package/lib/clang/{12.0.1 → 14.0.0}/include/lwpintrin.h +0 -0
  143. /package/lib/clang/{12.0.1 → 14.0.0}/include/lzcntintrin.h +0 -0
  144. /package/lib/clang/{12.0.1 → 14.0.0}/include/mm3dnow.h +0 -0
  145. /package/lib/clang/{12.0.1 → 14.0.0}/include/mm_malloc.h +0 -0
  146. /package/lib/clang/{12.0.1 → 14.0.0}/include/module.modulemap +0 -0
  147. /package/lib/clang/{12.0.1 → 14.0.0}/include/movdirintrin.h +0 -0
  148. /package/lib/clang/{12.0.1 → 14.0.0}/include/msa.h +0 -0
  149. /package/lib/clang/{12.0.1 → 14.0.0}/include/mwaitxintrin.h +0 -0
  150. /package/lib/clang/{12.0.1 → 14.0.0}/include/openmp_wrappers/complex_cmath.h +0 -0
  151. /package/lib/clang/{12.0.1 → 14.0.0}/include/pconfigintrin.h +0 -0
  152. /package/lib/clang/{12.0.1 → 14.0.0}/include/pkuintrin.h +0 -0
  153. /package/lib/clang/{12.0.1 → 14.0.0}/include/popcntintrin.h +0 -0
  154. /package/lib/clang/{12.0.1 → 14.0.0}/include/ptwriteintrin.h +0 -0
  155. /package/lib/clang/{12.0.1 → 14.0.0}/include/rdseedintrin.h +0 -0
  156. /package/lib/clang/{12.0.1 → 14.0.0}/include/rtmintrin.h +0 -0
  157. /package/lib/clang/{12.0.1 → 14.0.0}/include/s390intrin.h +0 -0
  158. /package/lib/clang/{12.0.1 → 14.0.0}/include/serializeintrin.h +0 -0
  159. /package/lib/clang/{12.0.1 → 14.0.0}/include/sgxintrin.h +0 -0
  160. /package/lib/clang/{12.0.1 → 14.0.0}/include/shaintrin.h +0 -0
  161. /package/lib/clang/{12.0.1 → 14.0.0}/include/stdalign.h +0 -0
  162. /package/lib/clang/{12.0.1 → 14.0.0}/include/stdarg.h +0 -0
  163. /package/lib/clang/{12.0.1 → 14.0.0}/include/stdbool.h +0 -0
  164. /package/lib/clang/{12.0.1 → 14.0.0}/include/stddef.h +0 -0
  165. /package/lib/clang/{12.0.1 → 14.0.0}/include/stdnoreturn.h +0 -0
  166. /package/lib/clang/{12.0.1 → 14.0.0}/include/tbmintrin.h +0 -0
  167. /package/lib/clang/{12.0.1 → 14.0.0}/include/tgmath.h +0 -0
  168. /package/lib/clang/{12.0.1 → 14.0.0}/include/tsxldtrkintrin.h +0 -0
  169. /package/lib/clang/{12.0.1 → 14.0.0}/include/vadefs.h +0 -0
  170. /package/lib/clang/{12.0.1 → 14.0.0}/include/varargs.h +0 -0
  171. /package/lib/clang/{12.0.1 → 14.0.0}/include/waitpkgintrin.h +0 -0
  172. /package/lib/clang/{12.0.1 → 14.0.0}/include/wbnoinvdintrin.h +0 -0
  173. /package/lib/clang/{12.0.1 → 14.0.0}/include/x86intrin.h +0 -0
  174. /package/lib/clang/{12.0.1 → 14.0.0}/include/xsavecintrin.h +0 -0
  175. /package/lib/clang/{12.0.1 → 14.0.0}/include/xsaveintrin.h +0 -0
  176. /package/lib/clang/{12.0.1 → 14.0.0}/include/xsaveoptintrin.h +0 -0
  177. /package/lib/clang/{12.0.1 → 14.0.0}/include/xsavesintrin.h +0 -0
  178. /package/lib/clang/{12.0.1 → 14.0.0}/include/xtestintrin.h +0 -0
@@ -19,6 +19,10 @@
19
19
  #define __CR6_EQ_REV 1
20
20
  #define __CR6_LT 2
21
21
  #define __CR6_LT_REV 3
22
+ #define __CR6_GT 4
23
+ #define __CR6_GT_REV 5
24
+ #define __CR6_SO 6
25
+ #define __CR6_SO_REV 7
22
26
 
23
27
  /* Constants for vec_test_data_class */
24
28
  #define __VEC_CLASS_FP_SUBNORMAL_N (1 << 0)
@@ -41,9 +45,7 @@
41
45
 
42
46
  #define __ATTRS_o_ai __attribute__((__overloadable__, __always_inline__))
43
47
 
44
- #ifdef __POWER9_VECTOR__
45
48
  #include <stddef.h>
46
- #endif
47
49
 
48
50
  static __inline__ vector signed char __ATTRS_o_ai vec_perm(
49
51
  vector signed char __a, vector signed char __b, vector unsigned char __c);
@@ -126,7 +128,7 @@ vec_abs(vector signed int __a) {
126
128
  return __builtin_altivec_vmaxsw(__a, -__a);
127
129
  }
128
130
 
129
- #if defined(__POWER8_VECTOR__) && defined(__powerpc64__)
131
+ #ifdef __POWER8_VECTOR__
130
132
  static __inline__ vector signed long long __ATTRS_o_ai
131
133
  vec_abs(vector signed long long __a) {
132
134
  return __builtin_altivec_vmaxsd(__a, -__a);
@@ -284,7 +286,7 @@ vec_add(vector unsigned int __a, vector bool int __b) {
284
286
  return __a + (vector unsigned int)__b;
285
287
  }
286
288
 
287
- #if defined(__POWER8_VECTOR__) && defined(__powerpc64__)
289
+ #ifdef __POWER8_VECTOR__
288
290
  static __inline__ vector signed long long __ATTRS_o_ai
289
291
  vec_add(vector signed long long __a, vector signed long long __b) {
290
292
  return __a + __b;
@@ -295,6 +297,7 @@ vec_add(vector unsigned long long __a, vector unsigned long long __b) {
295
297
  return __a + __b;
296
298
  }
297
299
 
300
+ #ifdef __SIZEOF_INT128__
298
301
  static __inline__ vector signed __int128 __ATTRS_o_ai
299
302
  vec_add(vector signed __int128 __a, vector signed __int128 __b) {
300
303
  return __a + __b;
@@ -304,7 +307,37 @@ static __inline__ vector unsigned __int128 __ATTRS_o_ai
304
307
  vec_add(vector unsigned __int128 __a, vector unsigned __int128 __b) {
305
308
  return __a + __b;
306
309
  }
307
- #endif // defined(__POWER8_VECTOR__) && defined(__powerpc64__)
310
+ #endif
311
+
312
+ static __inline__ vector unsigned char __attribute__((__always_inline__))
313
+ vec_add_u128(vector unsigned char __a, vector unsigned char __b) {
314
+ return __builtin_altivec_vadduqm(__a, __b);
315
+ }
316
+ #elif defined(__VSX__)
317
+ static __inline__ vector signed long long __ATTRS_o_ai
318
+ vec_add(vector signed long long __a, vector signed long long __b) {
319
+ #ifdef __LITTLE_ENDIAN__
320
+ // Little endian systems on CPU's prior to Power8 don't really exist
321
+ // so scalarizing is fine.
322
+ return __a + __b;
323
+ #else
324
+ vector unsigned int __res =
325
+ (vector unsigned int)__a + (vector unsigned int)__b;
326
+ vector unsigned int __carry = __builtin_altivec_vaddcuw(
327
+ (vector unsigned int)__a, (vector unsigned int)__b);
328
+ __carry = __builtin_shufflevector((vector unsigned char)__carry,
329
+ (vector unsigned char)__carry, 0, 0, 0, 7,
330
+ 0, 0, 0, 0, 0, 0, 0, 15, 0, 0, 0, 0);
331
+ return (vector signed long long)(__res + __carry);
332
+ #endif
333
+ }
334
+
335
+ static __inline__ vector unsigned long long __ATTRS_o_ai
336
+ vec_add(vector unsigned long long __a, vector unsigned long long __b) {
337
+ return (vector unsigned long long)vec_add((vector signed long long)__a,
338
+ (vector signed long long)__b);
339
+ }
340
+ #endif // __POWER8_VECTOR__
308
341
 
309
342
  static __inline__ vector float __ATTRS_o_ai vec_add(vector float __a,
310
343
  vector float __b) {
@@ -320,7 +353,8 @@ static __inline__ vector double __ATTRS_o_ai vec_add(vector double __a,
320
353
 
321
354
  /* vec_adde */
322
355
 
323
- #if defined(__POWER8_VECTOR__) && defined(__powerpc64__)
356
+ #ifdef __POWER8_VECTOR__
357
+ #ifdef __SIZEOF_INT128__
324
358
  static __inline__ vector signed __int128 __ATTRS_o_ai
325
359
  vec_adde(vector signed __int128 __a, vector signed __int128 __b,
326
360
  vector signed __int128 __c) {
@@ -334,6 +368,13 @@ vec_adde(vector unsigned __int128 __a, vector unsigned __int128 __b,
334
368
  }
335
369
  #endif
336
370
 
371
+ static __inline__ vector unsigned char __attribute__((__always_inline__))
372
+ vec_adde_u128(vector unsigned char __a, vector unsigned char __b,
373
+ vector unsigned char __c) {
374
+ return (vector unsigned char)__builtin_altivec_vaddeuqm(__a, __b, __c);
375
+ }
376
+ #endif
377
+
337
378
  static __inline__ vector signed int __ATTRS_o_ai
338
379
  vec_adde(vector signed int __a, vector signed int __b,
339
380
  vector signed int __c) {
@@ -352,7 +393,8 @@ vec_adde(vector unsigned int __a, vector unsigned int __b,
352
393
 
353
394
  /* vec_addec */
354
395
 
355
- #if defined(__POWER8_VECTOR__) && defined(__powerpc64__)
396
+ #ifdef __POWER8_VECTOR__
397
+ #ifdef __SIZEOF_INT128__
356
398
  static __inline__ vector signed __int128 __ATTRS_o_ai
357
399
  vec_addec(vector signed __int128 __a, vector signed __int128 __b,
358
400
  vector signed __int128 __c) {
@@ -364,7 +406,15 @@ vec_addec(vector unsigned __int128 __a, vector unsigned __int128 __b,
364
406
  vector unsigned __int128 __c) {
365
407
  return __builtin_altivec_vaddecuq(__a, __b, __c);
366
408
  }
409
+ #endif
410
+
411
+ static __inline__ vector unsigned char __attribute__((__always_inline__))
412
+ vec_addec_u128(vector unsigned char __a, vector unsigned char __b,
413
+ vector unsigned char __c) {
414
+ return (vector unsigned char)__builtin_altivec_vaddecuq(__a, __b, __c);
415
+ }
367
416
 
417
+ #ifdef __powerpc64__
368
418
  static __inline__ vector signed int __ATTRS_o_ai
369
419
  vec_addec(vector signed int __a, vector signed int __b,
370
420
  vector signed int __c) {
@@ -407,8 +457,8 @@ vec_addec(vector unsigned int __a, vector unsigned int __b,
407
457
  vector unsigned int ret = { __result[0], __result[1], __result[2], __result[3] };
408
458
  return ret;
409
459
  }
410
-
411
- #endif
460
+ #endif // __powerpc64__
461
+ #endif // __POWER8_VECTOR__
412
462
 
413
463
  /* vec_vaddubm */
414
464
 
@@ -534,7 +584,8 @@ vec_addc(vector unsigned int __a, vector unsigned int __b) {
534
584
  return __builtin_altivec_vaddcuw(__a, __b);
535
585
  }
536
586
 
537
- #if defined(__POWER8_VECTOR__) && defined(__powerpc64__)
587
+ #ifdef __POWER8_VECTOR__
588
+ #ifdef __SIZEOF_INT128__
538
589
  static __inline__ vector signed __int128 __ATTRS_o_ai
539
590
  vec_addc(vector signed __int128 __a, vector signed __int128 __b) {
540
591
  return (vector signed __int128)__builtin_altivec_vaddcuq(
@@ -545,6 +596,12 @@ static __inline__ vector unsigned __int128 __ATTRS_o_ai
545
596
  vec_addc(vector unsigned __int128 __a, vector unsigned __int128 __b) {
546
597
  return __builtin_altivec_vaddcuq(__a, __b);
547
598
  }
599
+ #endif
600
+
601
+ static __inline__ vector unsigned char __attribute__((__always_inline__))
602
+ vec_addc_u128(vector unsigned char __a, vector unsigned char __b) {
603
+ return (vector unsigned char)__builtin_altivec_vaddcuq(__a, __b);
604
+ }
548
605
  #endif // defined(__POWER8_VECTOR__) && defined(__powerpc64__)
549
606
 
550
607
  /* vec_vaddcuw */
@@ -748,7 +805,8 @@ vec_vadduws(vector unsigned int __a, vector bool int __b) {
748
805
  return __builtin_altivec_vadduws(__a, (vector unsigned int)__b);
749
806
  }
750
807
 
751
- #if defined(__POWER8_VECTOR__) && defined(__powerpc64__)
808
+ #if defined(__POWER8_VECTOR__) && defined(__powerpc64__) && \
809
+ defined(__SIZEOF_INT128__)
752
810
  /* vec_vadduqm */
753
811
 
754
812
  static __inline__ vector signed __int128 __ATTRS_o_ai
@@ -1598,6 +1656,17 @@ static __inline__ vector double __ATTRS_o_ai vec_ceil(vector double __a) {
1598
1656
  }
1599
1657
  #endif
1600
1658
 
1659
+ /* vec_roundp */
1660
+ static __inline__ vector float __ATTRS_o_ai vec_roundp(vector float __a) {
1661
+ return vec_ceil(__a);
1662
+ }
1663
+
1664
+ #ifdef __VSX__
1665
+ static __inline__ vector double __ATTRS_o_ai vec_roundp(vector double __a) {
1666
+ return vec_ceil(__a);
1667
+ }
1668
+ #endif
1669
+
1601
1670
  /* vec_vrfip */
1602
1671
 
1603
1672
  static __inline__ vector float __attribute__((__always_inline__))
@@ -1690,7 +1759,31 @@ vec_cmpeq(vector bool long long __a, vector bool long long __b) {
1690
1759
  return (vector bool long long)__builtin_altivec_vcmpequd(
1691
1760
  (vector long long)__a, (vector long long)__b);
1692
1761
  }
1762
+ #elif defined(__VSX__)
1763
+ static __inline__ vector bool long long __ATTRS_o_ai
1764
+ vec_cmpeq(vector signed long long __a, vector signed long long __b) {
1765
+ vector bool int __wordcmp =
1766
+ vec_cmpeq((vector signed int)__a, (vector signed int)__b);
1767
+ #ifdef __LITTLE_ENDIAN__
1768
+ __wordcmp &= __builtin_shufflevector(__wordcmp, __wordcmp, 3, 0, 1, 2);
1769
+ return (vector bool long long)__builtin_shufflevector(__wordcmp, __wordcmp, 1,
1770
+ 1, 3, 3);
1771
+ #else
1772
+ __wordcmp &= __builtin_shufflevector(__wordcmp, __wordcmp, 1, 2, 3, 0);
1773
+ return (vector bool long long)__builtin_shufflevector(__wordcmp, __wordcmp, 0,
1774
+ 0, 2, 2);
1775
+ #endif
1776
+ }
1777
+
1778
+ static __inline__ vector bool long long __ATTRS_o_ai
1779
+ vec_cmpeq(vector unsigned long long __a, vector unsigned long long __b) {
1780
+ return vec_cmpeq((vector signed long long)__a, (vector signed long long)__b);
1781
+ }
1693
1782
 
1783
+ static __inline__ vector bool long long __ATTRS_o_ai
1784
+ vec_cmpeq(vector bool long long __a, vector bool long long __b) {
1785
+ return vec_cmpeq((vector signed long long)__a, (vector signed long long)__b);
1786
+ }
1694
1787
  #endif
1695
1788
 
1696
1789
  static __inline__ vector bool int __ATTRS_o_ai vec_cmpeq(vector float __a,
@@ -1709,7 +1802,7 @@ vec_cmpeq(vector double __a, vector double __b) {
1709
1802
  }
1710
1803
  #endif
1711
1804
 
1712
- #ifdef __POWER10_VECTOR__
1805
+ #if defined(__POWER10_VECTOR__) && defined(__SIZEOF_INT128__)
1713
1806
  static __inline__ vector bool __int128 __ATTRS_o_ai
1714
1807
  vec_cmpeq(vector signed __int128 __a, vector signed __int128 __b) {
1715
1808
  return (vector bool __int128)__builtin_altivec_vcmpequq(
@@ -1721,6 +1814,11 @@ vec_cmpeq(vector unsigned __int128 __a, vector unsigned __int128 __b) {
1721
1814
  return (vector bool __int128)__builtin_altivec_vcmpequq(
1722
1815
  (vector bool __int128)__a, (vector bool __int128)__b);
1723
1816
  }
1817
+
1818
+ static __inline__ vector bool __int128 __ATTRS_o_ai
1819
+ vec_cmpeq(vector bool __int128 __a, vector bool __int128 __b) {
1820
+ return (vector bool __int128)__builtin_altivec_vcmpequq(__a, __b);
1821
+ }
1724
1822
  #endif
1725
1823
 
1726
1824
  #ifdef __POWER9_VECTOR__
@@ -1786,7 +1884,7 @@ vec_cmpne(vector float __a, vector float __b) {
1786
1884
  (vector int)__b);
1787
1885
  }
1788
1886
 
1789
- #ifdef __POWER10_VECTOR__
1887
+ #if defined(__POWER10_VECTOR__) && defined(__SIZEOF_INT128__)
1790
1888
  static __inline__ vector bool __int128 __ATTRS_o_ai
1791
1889
  vec_cmpne(vector unsigned __int128 __a, vector unsigned __int128 __b) {
1792
1890
  return (vector bool __int128) ~(__builtin_altivec_vcmpequq(
@@ -1798,6 +1896,11 @@ vec_cmpne(vector signed __int128 __a, vector signed __int128 __b) {
1798
1896
  return (vector bool __int128) ~(__builtin_altivec_vcmpequq(
1799
1897
  (vector bool __int128)__a, (vector bool __int128)__b));
1800
1898
  }
1899
+
1900
+ static __inline__ vector bool __int128 __ATTRS_o_ai
1901
+ vec_cmpne(vector bool __int128 __a, vector bool __int128 __b) {
1902
+ return (vector bool __int128) ~(__builtin_altivec_vcmpequq(__a, __b));
1903
+ }
1801
1904
  #endif
1802
1905
 
1803
1906
  /* vec_cmpnez */
@@ -1884,6 +1987,7 @@ vec_parity_lsbb(vector signed int __a) {
1884
1987
  return __builtin_altivec_vprtybw(__a);
1885
1988
  }
1886
1989
 
1990
+ #ifdef __SIZEOF_INT128__
1887
1991
  static __inline__ vector unsigned __int128 __ATTRS_o_ai
1888
1992
  vec_parity_lsbb(vector unsigned __int128 __a) {
1889
1993
  return __builtin_altivec_vprtybq(__a);
@@ -1893,6 +1997,7 @@ static __inline__ vector unsigned __int128 __ATTRS_o_ai
1893
1997
  vec_parity_lsbb(vector signed __int128 __a) {
1894
1998
  return __builtin_altivec_vprtybq(__a);
1895
1999
  }
2000
+ #endif
1896
2001
 
1897
2002
  static __inline__ vector unsigned long long __ATTRS_o_ai
1898
2003
  vec_parity_lsbb(vector unsigned long long __a) {
@@ -1976,6 +2081,24 @@ vec_cmpne(vector unsigned long long __a, vector unsigned long long __b) {
1976
2081
  return (vector bool long long)
1977
2082
  ~(__builtin_altivec_vcmpequd((vector long long)__a, (vector long long)__b));
1978
2083
  }
2084
+ #elif defined(__VSX__)
2085
+ static __inline__ vector bool long long __ATTRS_o_ai
2086
+ vec_cmpne(vector bool long long __a, vector bool long long __b) {
2087
+ return (vector bool long long)~(
2088
+ vec_cmpeq((vector signed long long)__a, (vector signed long long)__b));
2089
+ }
2090
+
2091
+ static __inline__ vector bool long long __ATTRS_o_ai
2092
+ vec_cmpne(vector signed long long __a, vector signed long long __b) {
2093
+ return (vector bool long long)~(
2094
+ vec_cmpeq((vector signed long long)__a, (vector signed long long)__b));
2095
+ }
2096
+
2097
+ static __inline__ vector bool long long __ATTRS_o_ai
2098
+ vec_cmpne(vector unsigned long long __a, vector unsigned long long __b) {
2099
+ return (vector bool long long)~(
2100
+ vec_cmpeq((vector signed long long)__a, (vector signed long long)__b));
2101
+ }
1979
2102
  #endif
1980
2103
 
1981
2104
  #ifdef __VSX__
@@ -2028,6 +2151,46 @@ static __inline__ vector bool long long __ATTRS_o_ai
2028
2151
  vec_cmpgt(vector unsigned long long __a, vector unsigned long long __b) {
2029
2152
  return (vector bool long long)__builtin_altivec_vcmpgtud(__a, __b);
2030
2153
  }
2154
+ #elif defined(__VSX__)
2155
+ static __inline__ vector bool long long __ATTRS_o_ai
2156
+ vec_cmpgt(vector signed long long __a, vector signed long long __b) {
2157
+ vector signed int __sgtw = (vector signed int)vec_cmpgt(
2158
+ (vector signed int)__a, (vector signed int)__b);
2159
+ vector unsigned int __ugtw = (vector unsigned int)vec_cmpgt(
2160
+ (vector unsigned int)__a, (vector unsigned int)__b);
2161
+ vector unsigned int __eqw = (vector unsigned int)vec_cmpeq(
2162
+ (vector signed int)__a, (vector signed int)__b);
2163
+ #ifdef __LITTLE_ENDIAN__
2164
+ __ugtw = __builtin_shufflevector(__ugtw, __ugtw, 3, 0, 1, 2) & __eqw;
2165
+ __sgtw |= (vector signed int)__ugtw;
2166
+ return (vector bool long long)__builtin_shufflevector(__sgtw, __sgtw, 1, 1, 3,
2167
+ 3);
2168
+ #else
2169
+ __ugtw = __builtin_shufflevector(__ugtw, __ugtw, 1, 2, 3, 0) & __eqw;
2170
+ __sgtw |= (vector signed int)__ugtw;
2171
+ return (vector bool long long)__builtin_shufflevector(__sgtw, __sgtw, 0, 0, 2,
2172
+ 2);
2173
+ #endif
2174
+ }
2175
+
2176
+ static __inline__ vector bool long long __ATTRS_o_ai
2177
+ vec_cmpgt(vector unsigned long long __a, vector unsigned long long __b) {
2178
+ vector unsigned int __ugtw = (vector unsigned int)vec_cmpgt(
2179
+ (vector unsigned int)__a, (vector unsigned int)__b);
2180
+ vector unsigned int __eqw = (vector unsigned int)vec_cmpeq(
2181
+ (vector signed int)__a, (vector signed int)__b);
2182
+ #ifdef __LITTLE_ENDIAN__
2183
+ __eqw = __builtin_shufflevector(__ugtw, __ugtw, 3, 0, 1, 2) & __eqw;
2184
+ __ugtw |= __eqw;
2185
+ return (vector bool long long)__builtin_shufflevector(__ugtw, __ugtw, 1, 1, 3,
2186
+ 3);
2187
+ #else
2188
+ __eqw = __builtin_shufflevector(__ugtw, __ugtw, 1, 2, 3, 0) & __eqw;
2189
+ __ugtw |= __eqw;
2190
+ return (vector bool long long)__builtin_shufflevector(__ugtw, __ugtw, 0, 0, 2,
2191
+ 2);
2192
+ #endif
2193
+ }
2031
2194
  #endif
2032
2195
 
2033
2196
  static __inline__ vector bool int __ATTRS_o_ai vec_cmpgt(vector float __a,
@@ -2046,7 +2209,7 @@ vec_cmpgt(vector double __a, vector double __b) {
2046
2209
  }
2047
2210
  #endif
2048
2211
 
2049
- #ifdef __POWER10_VECTOR__
2212
+ #if defined(__POWER10_VECTOR__) && defined(__SIZEOF_INT128__)
2050
2213
  static __inline__ vector bool __int128 __ATTRS_o_ai
2051
2214
  vec_cmpgt(vector signed __int128 __a, vector signed __int128 __b) {
2052
2215
  return (vector bool __int128)__builtin_altivec_vcmpgtsq(
@@ -2106,9 +2269,7 @@ static __inline__ vector bool long long __ATTRS_o_ai
2106
2269
  vec_cmpge(vector double __a, vector double __b) {
2107
2270
  return (vector bool long long)__builtin_vsx_xvcmpgedp(__a, __b);
2108
2271
  }
2109
- #endif
2110
2272
 
2111
- #ifdef __POWER8_VECTOR__
2112
2273
  static __inline__ vector bool long long __ATTRS_o_ai
2113
2274
  vec_cmpge(vector signed long long __a, vector signed long long __b) {
2114
2275
  return ~(vec_cmpgt(__b, __a));
@@ -2120,7 +2281,7 @@ vec_cmpge(vector unsigned long long __a, vector unsigned long long __b) {
2120
2281
  }
2121
2282
  #endif
2122
2283
 
2123
- #ifdef __POWER10_VECTOR__
2284
+ #if defined(__POWER10_VECTOR__) && defined(__SIZEOF_INT128__)
2124
2285
  static __inline__ vector bool __int128 __ATTRS_o_ai
2125
2286
  vec_cmpge(vector signed __int128 __a, vector signed __int128 __b) {
2126
2287
  return ~(vec_cmpgt(__b, __a));
@@ -2230,9 +2391,7 @@ static __inline__ vector bool long long __ATTRS_o_ai
2230
2391
  vec_cmple(vector double __a, vector double __b) {
2231
2392
  return vec_cmpge(__b, __a);
2232
2393
  }
2233
- #endif
2234
2394
 
2235
- #ifdef __POWER8_VECTOR__
2236
2395
  static __inline__ vector bool long long __ATTRS_o_ai
2237
2396
  vec_cmple(vector signed long long __a, vector signed long long __b) {
2238
2397
  return vec_cmpge(__b, __a);
@@ -2244,7 +2403,7 @@ vec_cmple(vector unsigned long long __a, vector unsigned long long __b) {
2244
2403
  }
2245
2404
  #endif
2246
2405
 
2247
- #ifdef __POWER10_VECTOR__
2406
+ #if defined(__POWER10_VECTOR__) && defined(__SIZEOF_INT128__)
2248
2407
  static __inline__ vector bool __int128 __ATTRS_o_ai
2249
2408
  vec_cmple(vector signed __int128 __a, vector signed __int128 __b) {
2250
2409
  return vec_cmpge(__b, __a);
@@ -2300,7 +2459,7 @@ vec_cmplt(vector double __a, vector double __b) {
2300
2459
  }
2301
2460
  #endif
2302
2461
 
2303
- #ifdef __POWER10_VECTOR__
2462
+ #if defined(__POWER10_VECTOR__) && defined(__SIZEOF_INT128__)
2304
2463
  static __inline__ vector bool __int128 __ATTRS_o_ai
2305
2464
  vec_cmplt(vector signed __int128 __a, vector signed __int128 __b) {
2306
2465
  return vec_cmpgt(__b, __a);
@@ -2312,7 +2471,7 @@ vec_cmplt(vector unsigned __int128 __a, vector unsigned __int128 __b) {
2312
2471
  }
2313
2472
  #endif
2314
2473
 
2315
- #ifdef __POWER8_VECTOR__
2474
+ #ifdef __VSX__
2316
2475
  static __inline__ vector bool long long __ATTRS_o_ai
2317
2476
  vec_cmplt(vector signed long long __a, vector signed long long __b) {
2318
2477
  return vec_cmpgt(__b, __a);
@@ -2322,10 +2481,12 @@ static __inline__ vector bool long long __ATTRS_o_ai
2322
2481
  vec_cmplt(vector unsigned long long __a, vector unsigned long long __b) {
2323
2482
  return vec_cmpgt(__b, __a);
2324
2483
  }
2484
+ #endif
2325
2485
 
2486
+ #ifdef __POWER8_VECTOR__
2326
2487
  /* vec_popcnt */
2327
2488
 
2328
- static __inline__ vector signed char __ATTRS_o_ai
2489
+ static __inline__ vector unsigned char __ATTRS_o_ai
2329
2490
  vec_popcnt(vector signed char __a) {
2330
2491
  return __builtin_altivec_vpopcntb(__a);
2331
2492
  }
@@ -2333,7 +2494,7 @@ static __inline__ vector unsigned char __ATTRS_o_ai
2333
2494
  vec_popcnt(vector unsigned char __a) {
2334
2495
  return __builtin_altivec_vpopcntb(__a);
2335
2496
  }
2336
- static __inline__ vector signed short __ATTRS_o_ai
2497
+ static __inline__ vector unsigned short __ATTRS_o_ai
2337
2498
  vec_popcnt(vector signed short __a) {
2338
2499
  return __builtin_altivec_vpopcnth(__a);
2339
2500
  }
@@ -2341,7 +2502,7 @@ static __inline__ vector unsigned short __ATTRS_o_ai
2341
2502
  vec_popcnt(vector unsigned short __a) {
2342
2503
  return __builtin_altivec_vpopcnth(__a);
2343
2504
  }
2344
- static __inline__ vector signed int __ATTRS_o_ai
2505
+ static __inline__ vector unsigned int __ATTRS_o_ai
2345
2506
  vec_popcnt(vector signed int __a) {
2346
2507
  return __builtin_altivec_vpopcntw(__a);
2347
2508
  }
@@ -2349,7 +2510,7 @@ static __inline__ vector unsigned int __ATTRS_o_ai
2349
2510
  vec_popcnt(vector unsigned int __a) {
2350
2511
  return __builtin_altivec_vpopcntw(__a);
2351
2512
  }
2352
- static __inline__ vector signed long long __ATTRS_o_ai
2513
+ static __inline__ vector unsigned long long __ATTRS_o_ai
2353
2514
  vec_popcnt(vector signed long long __a) {
2354
2515
  return __builtin_altivec_vpopcntd(__a);
2355
2516
  }
@@ -2358,6 +2519,7 @@ vec_popcnt(vector unsigned long long __a) {
2358
2519
  return __builtin_altivec_vpopcntd(__a);
2359
2520
  }
2360
2521
 
2522
+ #define vec_vclz vec_cntlz
2361
2523
  /* vec_cntlz */
2362
2524
 
2363
2525
  static __inline__ vector signed char __ATTRS_o_ai
@@ -2870,6 +3032,7 @@ static __inline__ vector float __ATTRS_o_ai vec_xl_len(const float *__a, size_t
2870
3032
  return (vector float)__builtin_vsx_lxvl(__a, (__b << 56));
2871
3033
  }
2872
3034
 
3035
+ #ifdef __SIZEOF_INT128__
2873
3036
  static __inline__ vector signed __int128 __ATTRS_o_ai
2874
3037
  vec_xl_len(const signed __int128 *__a, size_t __b) {
2875
3038
  return (vector signed __int128)__builtin_vsx_lxvl(__a, (__b << 56));
@@ -2879,6 +3042,7 @@ static __inline__ vector unsigned __int128 __ATTRS_o_ai
2879
3042
  vec_xl_len(const unsigned __int128 *__a, size_t __b) {
2880
3043
  return (vector unsigned __int128)__builtin_vsx_lxvl(__a, (__b << 56));
2881
3044
  }
3045
+ #endif
2882
3046
 
2883
3047
  static __inline__ vector signed long long __ATTRS_o_ai
2884
3048
  vec_xl_len(const signed long long *__a, size_t __b) {
@@ -2899,13 +3063,10 @@ static __inline__ vector unsigned char __ATTRS_o_ai
2899
3063
  vec_xl_len_r(const unsigned char *__a, size_t __b) {
2900
3064
  vector unsigned char __res =
2901
3065
  (vector unsigned char)__builtin_vsx_lxvll(__a, (__b << 56));
2902
- #ifdef __LITTLE_ENDIAN__
2903
3066
  vector unsigned char __mask =
2904
3067
  (vector unsigned char)__builtin_altivec_lvsr(16 - __b, (int *)NULL);
2905
- __res = (vector unsigned char)__builtin_altivec_vperm_4si(
3068
+ return (vector unsigned char)__builtin_altivec_vperm_4si(
2906
3069
  (vector int)__res, (vector int)__res, __mask);
2907
- #endif
2908
- return __res;
2909
3070
  }
2910
3071
 
2911
3072
  // vec_xst_len
@@ -2946,6 +3107,7 @@ static __inline__ void __ATTRS_o_ai vec_xst_len(vector float __a, float *__b,
2946
3107
  return __builtin_vsx_stxvl((vector int)__a, __b, (__c << 56));
2947
3108
  }
2948
3109
 
3110
+ #ifdef __SIZEOF_INT128__
2949
3111
  static __inline__ void __ATTRS_o_ai vec_xst_len(vector signed __int128 __a,
2950
3112
  signed __int128 *__b,
2951
3113
  size_t __c) {
@@ -2957,6 +3119,7 @@ static __inline__ void __ATTRS_o_ai vec_xst_len(vector unsigned __int128 __a,
2957
3119
  size_t __c) {
2958
3120
  return __builtin_vsx_stxvl((vector int)__a, __b, (__c << 56));
2959
3121
  }
3122
+ #endif
2960
3123
 
2961
3124
  static __inline__ void __ATTRS_o_ai vec_xst_len(vector signed long long __a,
2962
3125
  signed long long *__b,
@@ -2978,19 +3141,24 @@ static __inline__ void __ATTRS_o_ai vec_xst_len(vector double __a, double *__b,
2978
3141
  static __inline__ void __ATTRS_o_ai vec_xst_len_r(vector unsigned char __a,
2979
3142
  unsigned char *__b,
2980
3143
  size_t __c) {
2981
- #ifdef __LITTLE_ENDIAN__
2982
3144
  vector unsigned char __mask =
2983
3145
  (vector unsigned char)__builtin_altivec_lvsl(16 - __c, (int *)NULL);
2984
3146
  vector unsigned char __res =
2985
3147
  __builtin_altivec_vperm_4si((vector int)__a, (vector int)__a, __mask);
2986
3148
  return __builtin_vsx_stxvll((vector int)__res, __b, (__c << 56));
2987
- #else
2988
- return __builtin_vsx_stxvll((vector int)__a, __b, (__c << 56));
2989
- #endif
2990
3149
  }
2991
3150
  #endif
2992
3151
  #endif
2993
3152
 
3153
+ #if defined(__POWER9_VECTOR__) && defined(__powerpc64__)
3154
+ #define __vec_ldrmb(PTR, CNT) vec_xl_len_r((const unsigned char *)(PTR), (CNT))
3155
+ #define __vec_strmb(PTR, CNT, VAL) \
3156
+ vec_xst_len_r((VAL), (unsigned char *)(PTR), (CNT))
3157
+ #else
3158
+ #define __vec_ldrmb __builtin_vsx_ldrmb
3159
+ #define __vec_strmb __builtin_vsx_strmb
3160
+ #endif
3161
+
2994
3162
  /* vec_cpsgn */
2995
3163
 
2996
3164
  #ifdef __VSX__
@@ -3008,6 +3176,23 @@ static __inline__ vector double __ATTRS_o_ai vec_cpsgn(vector double __a,
3008
3176
  /* vec_ctf */
3009
3177
 
3010
3178
  #ifdef __VSX__
3179
+ // There are some functions that have different signatures with the XL compiler
3180
+ // from those in Clang/GCC and documented in the PVIPR. This macro ensures that
3181
+ // the XL-compatible signatures are used for those functions.
3182
+ #ifdef __XL_COMPAT_ALTIVEC__
3183
+ #define vec_ctf(__a, __b) \
3184
+ _Generic((__a), vector int \
3185
+ : (vector float)__builtin_altivec_vcfsx((vector int)(__a), (__b)), \
3186
+ vector unsigned int \
3187
+ : (vector float)__builtin_altivec_vcfux((vector unsigned int)(__a), \
3188
+ (__b)), \
3189
+ vector unsigned long long \
3190
+ : (__builtin_vsx_xvcvuxdsp((vector unsigned long long)(__a)) * \
3191
+ (vector float)(vector unsigned)((0x7f - (__b)) << 23)), \
3192
+ vector signed long long \
3193
+ : (__builtin_vsx_xvcvsxdsp((vector signed long long)(__a)) * \
3194
+ (vector float)(vector unsigned)((0x7f - (__b)) << 23)))
3195
+ #else // __XL_COMPAT_ALTIVEC__
3011
3196
  #define vec_ctf(__a, __b) \
3012
3197
  _Generic((__a), vector int \
3013
3198
  : (vector float)__builtin_altivec_vcfsx((vector int)(__a), (__b)), \
@@ -3024,6 +3209,7 @@ static __inline__ vector double __ATTRS_o_ai vec_cpsgn(vector double __a,
3024
3209
  vector double) * \
3025
3210
  (vector double)(vector unsigned long long)((0x3ffULL - (__b)) \
3026
3211
  << 52)))
3212
+ #endif // __XL_COMPAT_ALTIVEC__
3027
3213
  #else
3028
3214
  #define vec_ctf(__a, __b) \
3029
3215
  _Generic((__a), vector int \
@@ -3033,10 +3219,32 @@ static __inline__ vector double __ATTRS_o_ai vec_cpsgn(vector double __a,
3033
3219
  (__b)))
3034
3220
  #endif
3035
3221
 
3222
+ /* vec_ctd */
3223
+ #ifdef __VSX__
3224
+ #define vec_ctd(__a, __b) \
3225
+ _Generic((__a), vector signed int \
3226
+ : (vec_doublee((vector signed int)(__a)) * \
3227
+ (vector double)(vector unsigned long long)((0x3ffULL - (__b)) \
3228
+ << 52)), \
3229
+ vector unsigned int \
3230
+ : (vec_doublee((vector unsigned int)(__a)) * \
3231
+ (vector double)(vector unsigned long long)((0x3ffULL - (__b)) \
3232
+ << 52)), \
3233
+ vector unsigned long long \
3234
+ : (__builtin_convertvector((vector unsigned long long)(__a), \
3235
+ vector double) * \
3236
+ (vector double)(vector unsigned long long)((0x3ffULL - (__b)) \
3237
+ << 52)), \
3238
+ vector signed long long \
3239
+ : (__builtin_convertvector((vector signed long long)(__a), \
3240
+ vector double) * \
3241
+ (vector double)(vector unsigned long long)((0x3ffULL - (__b)) \
3242
+ << 52)))
3243
+ #endif // __VSX__
3244
+
3036
3245
  /* vec_vcfsx */
3037
3246
 
3038
3247
  #define vec_vcfux __builtin_altivec_vcfux
3039
-
3040
3248
  /* vec_vcfux */
3041
3249
 
3042
3250
  #define vec_vcfsx(__a, __b) __builtin_altivec_vcfsx((vector int)(__a), (__b))
@@ -3044,6 +3252,19 @@ static __inline__ vector double __ATTRS_o_ai vec_cpsgn(vector double __a,
3044
3252
  /* vec_cts */
3045
3253
 
3046
3254
  #ifdef __VSX__
3255
+ #ifdef __XL_COMPAT_ALTIVEC__
3256
+ #define vec_cts(__a, __b) \
3257
+ _Generic((__a), vector float \
3258
+ : __builtin_altivec_vctsxs((vector float)(__a), (__b)), \
3259
+ vector double \
3260
+ : __extension__({ \
3261
+ vector double __ret = \
3262
+ (vector double)(__a) * \
3263
+ (vector double)(vector unsigned long long)((0x3ffULL + (__b)) \
3264
+ << 52); \
3265
+ __builtin_vsx_xvcvdpsxws(__ret); \
3266
+ }))
3267
+ #else // __XL_COMPAT_ALTIVEC__
3047
3268
  #define vec_cts(__a, __b) \
3048
3269
  _Generic((__a), vector float \
3049
3270
  : __builtin_altivec_vctsxs((vector float)(__a), (__b)), \
@@ -3055,6 +3276,7 @@ static __inline__ vector double __ATTRS_o_ai vec_cpsgn(vector double __a,
3055
3276
  << 52); \
3056
3277
  __builtin_convertvector(__ret, vector signed long long); \
3057
3278
  }))
3279
+ #endif // __XL_COMPAT_ALTIVEC__
3058
3280
  #else
3059
3281
  #define vec_cts __builtin_altivec_vctsxs
3060
3282
  #endif
@@ -3066,6 +3288,19 @@ static __inline__ vector double __ATTRS_o_ai vec_cpsgn(vector double __a,
3066
3288
  /* vec_ctu */
3067
3289
 
3068
3290
  #ifdef __VSX__
3291
+ #ifdef __XL_COMPAT_ALTIVEC__
3292
+ #define vec_ctu(__a, __b) \
3293
+ _Generic((__a), vector float \
3294
+ : __builtin_altivec_vctuxs((vector float)(__a), (__b)), \
3295
+ vector double \
3296
+ : __extension__({ \
3297
+ vector double __ret = \
3298
+ (vector double)(__a) * \
3299
+ (vector double)(vector unsigned long long)((0x3ffULL + __b) \
3300
+ << 52); \
3301
+ __builtin_vsx_xvcvdpuxws(__ret); \
3302
+ }))
3303
+ #else // __XL_COMPAT_ALTIVEC__
3069
3304
  #define vec_ctu(__a, __b) \
3070
3305
  _Generic((__a), vector float \
3071
3306
  : __builtin_altivec_vctuxs((vector float)(__a), (__b)), \
@@ -3077,10 +3312,95 @@ static __inline__ vector double __ATTRS_o_ai vec_cpsgn(vector double __a,
3077
3312
  << 52); \
3078
3313
  __builtin_convertvector(__ret, vector unsigned long long); \
3079
3314
  }))
3315
+ #endif // __XL_COMPAT_ALTIVEC__
3080
3316
  #else
3081
3317
  #define vec_ctu __builtin_altivec_vctuxs
3082
3318
  #endif
3083
3319
 
3320
+ #ifdef __LITTLE_ENDIAN__
3321
+ /* vec_ctsl */
3322
+
3323
+ #ifdef __VSX__
3324
+ #define vec_ctsl(__a, __b) \
3325
+ _Generic((__a), vector float \
3326
+ : __extension__({ \
3327
+ vector float __ret = \
3328
+ (vector float)(__a) * \
3329
+ (vector float)(vector unsigned)((0x7f + (__b)) << 23); \
3330
+ __builtin_vsx_xvcvspsxds( \
3331
+ __builtin_vsx_xxsldwi(__ret, __ret, 1)); \
3332
+ }), \
3333
+ vector double \
3334
+ : __extension__({ \
3335
+ vector double __ret = \
3336
+ (vector double)(__a) * \
3337
+ (vector double)(vector unsigned long long)((0x3ffULL + __b) \
3338
+ << 52); \
3339
+ __builtin_convertvector(__ret, vector signed long long); \
3340
+ }))
3341
+
3342
+ /* vec_ctul */
3343
+
3344
+ #define vec_ctul(__a, __b) \
3345
+ _Generic((__a), vector float \
3346
+ : __extension__({ \
3347
+ vector float __ret = \
3348
+ (vector float)(__a) * \
3349
+ (vector float)(vector unsigned)((0x7f + (__b)) << 23); \
3350
+ __builtin_vsx_xvcvspuxds( \
3351
+ __builtin_vsx_xxsldwi(__ret, __ret, 1)); \
3352
+ }), \
3353
+ vector double \
3354
+ : __extension__({ \
3355
+ vector double __ret = \
3356
+ (vector double)(__a) * \
3357
+ (vector double)(vector unsigned long long)((0x3ffULL + __b) \
3358
+ << 52); \
3359
+ __builtin_convertvector(__ret, vector unsigned long long); \
3360
+ }))
3361
+ #endif
3362
+ #else // __LITTLE_ENDIAN__
3363
+ /* vec_ctsl */
3364
+
3365
+ #ifdef __VSX__
3366
+ #define vec_ctsl(__a, __b) \
3367
+ _Generic((__a), vector float \
3368
+ : __extension__({ \
3369
+ vector float __ret = \
3370
+ (vector float)(__a) * \
3371
+ (vector float)(vector unsigned)((0x7f + (__b)) << 23); \
3372
+ __builtin_vsx_xvcvspsxds(__ret); \
3373
+ }), \
3374
+ vector double \
3375
+ : __extension__({ \
3376
+ vector double __ret = \
3377
+ (vector double)(__a) * \
3378
+ (vector double)(vector unsigned long long)((0x3ffULL + __b) \
3379
+ << 52); \
3380
+ __builtin_convertvector(__ret, vector signed long long); \
3381
+ }))
3382
+
3383
+ /* vec_ctul */
3384
+
3385
+ #define vec_ctul(__a, __b) \
3386
+ _Generic((__a), vector float \
3387
+ : __extension__({ \
3388
+ vector float __ret = \
3389
+ (vector float)(__a) * \
3390
+ (vector float)(vector unsigned)((0x7f + (__b)) << 23); \
3391
+ __builtin_vsx_xvcvspuxds(__ret); \
3392
+ }), \
3393
+ vector double \
3394
+ : __extension__({ \
3395
+ vector double __ret = \
3396
+ (vector double)(__a) * \
3397
+ (vector double)(vector unsigned long long)((0x3ffULL + __b) \
3398
+ << 52); \
3399
+ __builtin_convertvector(__ret, vector unsigned long long); \
3400
+ }))
3401
+ #endif
3402
+ #endif // __LITTLE_ENDIAN__
3403
+
3084
3404
  /* vec_vctuxs */
3085
3405
 
3086
3406
  #define vec_vctuxs __builtin_altivec_vctuxs
@@ -3114,7 +3434,7 @@ vec_signextll(vector signed int __a) {
3114
3434
  }
3115
3435
  #endif
3116
3436
 
3117
- #ifdef __POWER10_VECTOR__
3437
+ #if defined(__POWER10_VECTOR__) && defined(__SIZEOF_INT128__)
3118
3438
  static __inline__ vector signed __int128 __ATTRS_o_ai
3119
3439
  vec_signextq(vector signed long long __a) {
3120
3440
  return __builtin_altivec_vextsd2q(__a);
@@ -3399,6 +3719,15 @@ vec_doubleo(vector float __a) {
3399
3719
  return __builtin_vsx_xvcvspdp(vec_sld(__a, __a, 4));
3400
3720
  #endif
3401
3721
  }
3722
+
3723
+ /* vec_cvf */
3724
+ static __inline__ vector double __ATTRS_o_ai vec_cvf(vector float __a) {
3725
+ return vec_doublee(__a);
3726
+ }
3727
+
3728
+ static __inline__ vector float __ATTRS_o_ai vec_cvf(vector double __a) {
3729
+ return vec_floate(__a);
3730
+ }
3402
3731
  #endif
3403
3732
 
3404
3733
  /* vec_div */
@@ -3481,6 +3810,7 @@ vec_dive(vector unsigned long long __a, vector unsigned long long __b) {
3481
3810
  return __builtin_altivec_vdiveud(__a, __b);
3482
3811
  }
3483
3812
 
3813
+ #ifdef __SIZEOF_INT128__
3484
3814
  static __inline__ vector unsigned __int128 __ATTRS_o_ai
3485
3815
  vec_dive(vector unsigned __int128 __a, vector unsigned __int128 __b) {
3486
3816
  return __builtin_altivec_vdiveuq(__a, __b);
@@ -3491,8 +3821,9 @@ vec_dive(vector signed __int128 __a, vector signed __int128 __b) {
3491
3821
  return __builtin_altivec_vdivesq(__a, __b);
3492
3822
  }
3493
3823
  #endif
3824
+ #endif
3494
3825
 
3495
- #ifdef __POWER10_VECTOR__
3826
+ #if defined(__POWER10_VECTOR__) && defined(__SIZEOF_INT128__)
3496
3827
  static __inline__ vector unsigned __int128 __ATTRS_o_ai
3497
3828
  vec_div(vector unsigned __int128 __a, vector unsigned __int128 __b) {
3498
3829
  return __a / __b;
@@ -3661,6 +3992,17 @@ static __inline__ vector double __ATTRS_o_ai vec_floor(vector double __a) {
3661
3992
  }
3662
3993
  #endif
3663
3994
 
3995
+ /* vec_roundm */
3996
+ static __inline__ vector float __ATTRS_o_ai vec_roundm(vector float __a) {
3997
+ return vec_floor(__a);
3998
+ }
3999
+
4000
+ #ifdef __VSX__
4001
+ static __inline__ vector double __ATTRS_o_ai vec_roundm(vector double __a) {
4002
+ return vec_floor(__a);
4003
+ }
4004
+ #endif
4005
+
3664
4006
  /* vec_vrfim */
3665
4007
 
3666
4008
  static __inline__ vector float __attribute__((__always_inline__))
@@ -3671,251 +4013,251 @@ vec_vrfim(vector float __a) {
3671
4013
  /* vec_ld */
3672
4014
 
3673
4015
  static __inline__ vector signed char __ATTRS_o_ai
3674
- vec_ld(int __a, const vector signed char *__b) {
4016
+ vec_ld(long __a, const vector signed char *__b) {
3675
4017
  return (vector signed char)__builtin_altivec_lvx(__a, __b);
3676
4018
  }
3677
4019
 
3678
4020
  static __inline__ vector signed char __ATTRS_o_ai
3679
- vec_ld(int __a, const signed char *__b) {
4021
+ vec_ld(long __a, const signed char *__b) {
3680
4022
  return (vector signed char)__builtin_altivec_lvx(__a, __b);
3681
4023
  }
3682
4024
 
3683
4025
  static __inline__ vector unsigned char __ATTRS_o_ai
3684
- vec_ld(int __a, const vector unsigned char *__b) {
4026
+ vec_ld(long __a, const vector unsigned char *__b) {
3685
4027
  return (vector unsigned char)__builtin_altivec_lvx(__a, __b);
3686
4028
  }
3687
4029
 
3688
4030
  static __inline__ vector unsigned char __ATTRS_o_ai
3689
- vec_ld(int __a, const unsigned char *__b) {
4031
+ vec_ld(long __a, const unsigned char *__b) {
3690
4032
  return (vector unsigned char)__builtin_altivec_lvx(__a, __b);
3691
4033
  }
3692
4034
 
3693
4035
  static __inline__ vector bool char __ATTRS_o_ai
3694
- vec_ld(int __a, const vector bool char *__b) {
4036
+ vec_ld(long __a, const vector bool char *__b) {
3695
4037
  return (vector bool char)__builtin_altivec_lvx(__a, __b);
3696
4038
  }
3697
4039
 
3698
- static __inline__ vector short __ATTRS_o_ai vec_ld(int __a,
4040
+ static __inline__ vector short __ATTRS_o_ai vec_ld(long __a,
3699
4041
  const vector short *__b) {
3700
4042
  return (vector short)__builtin_altivec_lvx(__a, __b);
3701
4043
  }
3702
4044
 
3703
- static __inline__ vector short __ATTRS_o_ai vec_ld(int __a, const short *__b) {
4045
+ static __inline__ vector short __ATTRS_o_ai vec_ld(long __a, const short *__b) {
3704
4046
  return (vector short)__builtin_altivec_lvx(__a, __b);
3705
4047
  }
3706
4048
 
3707
4049
  static __inline__ vector unsigned short __ATTRS_o_ai
3708
- vec_ld(int __a, const vector unsigned short *__b) {
4050
+ vec_ld(long __a, const vector unsigned short *__b) {
3709
4051
  return (vector unsigned short)__builtin_altivec_lvx(__a, __b);
3710
4052
  }
3711
4053
 
3712
4054
  static __inline__ vector unsigned short __ATTRS_o_ai
3713
- vec_ld(int __a, const unsigned short *__b) {
4055
+ vec_ld(long __a, const unsigned short *__b) {
3714
4056
  return (vector unsigned short)__builtin_altivec_lvx(__a, __b);
3715
4057
  }
3716
4058
 
3717
4059
  static __inline__ vector bool short __ATTRS_o_ai
3718
- vec_ld(int __a, const vector bool short *__b) {
4060
+ vec_ld(long __a, const vector bool short *__b) {
3719
4061
  return (vector bool short)__builtin_altivec_lvx(__a, __b);
3720
4062
  }
3721
4063
 
3722
- static __inline__ vector pixel __ATTRS_o_ai vec_ld(int __a,
4064
+ static __inline__ vector pixel __ATTRS_o_ai vec_ld(long __a,
3723
4065
  const vector pixel *__b) {
3724
4066
  return (vector pixel)__builtin_altivec_lvx(__a, __b);
3725
4067
  }
3726
4068
 
3727
- static __inline__ vector int __ATTRS_o_ai vec_ld(int __a,
4069
+ static __inline__ vector int __ATTRS_o_ai vec_ld(long __a,
3728
4070
  const vector int *__b) {
3729
4071
  return (vector int)__builtin_altivec_lvx(__a, __b);
3730
4072
  }
3731
4073
 
3732
- static __inline__ vector int __ATTRS_o_ai vec_ld(int __a, const int *__b) {
4074
+ static __inline__ vector int __ATTRS_o_ai vec_ld(long __a, const int *__b) {
3733
4075
  return (vector int)__builtin_altivec_lvx(__a, __b);
3734
4076
  }
3735
4077
 
3736
4078
  static __inline__ vector unsigned int __ATTRS_o_ai
3737
- vec_ld(int __a, const vector unsigned int *__b) {
4079
+ vec_ld(long __a, const vector unsigned int *__b) {
3738
4080
  return (vector unsigned int)__builtin_altivec_lvx(__a, __b);
3739
4081
  }
3740
4082
 
3741
4083
  static __inline__ vector unsigned int __ATTRS_o_ai
3742
- vec_ld(int __a, const unsigned int *__b) {
4084
+ vec_ld(long __a, const unsigned int *__b) {
3743
4085
  return (vector unsigned int)__builtin_altivec_lvx(__a, __b);
3744
4086
  }
3745
4087
 
3746
4088
  static __inline__ vector bool int __ATTRS_o_ai
3747
- vec_ld(int __a, const vector bool int *__b) {
4089
+ vec_ld(long __a, const vector bool int *__b) {
3748
4090
  return (vector bool int)__builtin_altivec_lvx(__a, __b);
3749
4091
  }
3750
4092
 
3751
- static __inline__ vector float __ATTRS_o_ai vec_ld(int __a,
4093
+ static __inline__ vector float __ATTRS_o_ai vec_ld(long __a,
3752
4094
  const vector float *__b) {
3753
4095
  return (vector float)__builtin_altivec_lvx(__a, __b);
3754
4096
  }
3755
4097
 
3756
- static __inline__ vector float __ATTRS_o_ai vec_ld(int __a, const float *__b) {
4098
+ static __inline__ vector float __ATTRS_o_ai vec_ld(long __a, const float *__b) {
3757
4099
  return (vector float)__builtin_altivec_lvx(__a, __b);
3758
4100
  }
3759
4101
 
3760
4102
  /* vec_lvx */
3761
4103
 
3762
4104
  static __inline__ vector signed char __ATTRS_o_ai
3763
- vec_lvx(int __a, const vector signed char *__b) {
4105
+ vec_lvx(long __a, const vector signed char *__b) {
3764
4106
  return (vector signed char)__builtin_altivec_lvx(__a, __b);
3765
4107
  }
3766
4108
 
3767
4109
  static __inline__ vector signed char __ATTRS_o_ai
3768
- vec_lvx(int __a, const signed char *__b) {
4110
+ vec_lvx(long __a, const signed char *__b) {
3769
4111
  return (vector signed char)__builtin_altivec_lvx(__a, __b);
3770
4112
  }
3771
4113
 
3772
4114
  static __inline__ vector unsigned char __ATTRS_o_ai
3773
- vec_lvx(int __a, const vector unsigned char *__b) {
4115
+ vec_lvx(long __a, const vector unsigned char *__b) {
3774
4116
  return (vector unsigned char)__builtin_altivec_lvx(__a, __b);
3775
4117
  }
3776
4118
 
3777
4119
  static __inline__ vector unsigned char __ATTRS_o_ai
3778
- vec_lvx(int __a, const unsigned char *__b) {
4120
+ vec_lvx(long __a, const unsigned char *__b) {
3779
4121
  return (vector unsigned char)__builtin_altivec_lvx(__a, __b);
3780
4122
  }
3781
4123
 
3782
4124
  static __inline__ vector bool char __ATTRS_o_ai
3783
- vec_lvx(int __a, const vector bool char *__b) {
4125
+ vec_lvx(long __a, const vector bool char *__b) {
3784
4126
  return (vector bool char)__builtin_altivec_lvx(__a, __b);
3785
4127
  }
3786
4128
 
3787
- static __inline__ vector short __ATTRS_o_ai vec_lvx(int __a,
4129
+ static __inline__ vector short __ATTRS_o_ai vec_lvx(long __a,
3788
4130
  const vector short *__b) {
3789
4131
  return (vector short)__builtin_altivec_lvx(__a, __b);
3790
4132
  }
3791
4133
 
3792
- static __inline__ vector short __ATTRS_o_ai vec_lvx(int __a, const short *__b) {
4134
+ static __inline__ vector short __ATTRS_o_ai vec_lvx(long __a, const short *__b) {
3793
4135
  return (vector short)__builtin_altivec_lvx(__a, __b);
3794
4136
  }
3795
4137
 
3796
4138
  static __inline__ vector unsigned short __ATTRS_o_ai
3797
- vec_lvx(int __a, const vector unsigned short *__b) {
4139
+ vec_lvx(long __a, const vector unsigned short *__b) {
3798
4140
  return (vector unsigned short)__builtin_altivec_lvx(__a, __b);
3799
4141
  }
3800
4142
 
3801
4143
  static __inline__ vector unsigned short __ATTRS_o_ai
3802
- vec_lvx(int __a, const unsigned short *__b) {
4144
+ vec_lvx(long __a, const unsigned short *__b) {
3803
4145
  return (vector unsigned short)__builtin_altivec_lvx(__a, __b);
3804
4146
  }
3805
4147
 
3806
4148
  static __inline__ vector bool short __ATTRS_o_ai
3807
- vec_lvx(int __a, const vector bool short *__b) {
4149
+ vec_lvx(long __a, const vector bool short *__b) {
3808
4150
  return (vector bool short)__builtin_altivec_lvx(__a, __b);
3809
4151
  }
3810
4152
 
3811
- static __inline__ vector pixel __ATTRS_o_ai vec_lvx(int __a,
4153
+ static __inline__ vector pixel __ATTRS_o_ai vec_lvx(long __a,
3812
4154
  const vector pixel *__b) {
3813
4155
  return (vector pixel)__builtin_altivec_lvx(__a, __b);
3814
4156
  }
3815
4157
 
3816
- static __inline__ vector int __ATTRS_o_ai vec_lvx(int __a,
4158
+ static __inline__ vector int __ATTRS_o_ai vec_lvx(long __a,
3817
4159
  const vector int *__b) {
3818
4160
  return (vector int)__builtin_altivec_lvx(__a, __b);
3819
4161
  }
3820
4162
 
3821
- static __inline__ vector int __ATTRS_o_ai vec_lvx(int __a, const int *__b) {
4163
+ static __inline__ vector int __ATTRS_o_ai vec_lvx(long __a, const int *__b) {
3822
4164
  return (vector int)__builtin_altivec_lvx(__a, __b);
3823
4165
  }
3824
4166
 
3825
4167
  static __inline__ vector unsigned int __ATTRS_o_ai
3826
- vec_lvx(int __a, const vector unsigned int *__b) {
4168
+ vec_lvx(long __a, const vector unsigned int *__b) {
3827
4169
  return (vector unsigned int)__builtin_altivec_lvx(__a, __b);
3828
4170
  }
3829
4171
 
3830
4172
  static __inline__ vector unsigned int __ATTRS_o_ai
3831
- vec_lvx(int __a, const unsigned int *__b) {
4173
+ vec_lvx(long __a, const unsigned int *__b) {
3832
4174
  return (vector unsigned int)__builtin_altivec_lvx(__a, __b);
3833
4175
  }
3834
4176
 
3835
4177
  static __inline__ vector bool int __ATTRS_o_ai
3836
- vec_lvx(int __a, const vector bool int *__b) {
4178
+ vec_lvx(long __a, const vector bool int *__b) {
3837
4179
  return (vector bool int)__builtin_altivec_lvx(__a, __b);
3838
4180
  }
3839
4181
 
3840
- static __inline__ vector float __ATTRS_o_ai vec_lvx(int __a,
4182
+ static __inline__ vector float __ATTRS_o_ai vec_lvx(long __a,
3841
4183
  const vector float *__b) {
3842
4184
  return (vector float)__builtin_altivec_lvx(__a, __b);
3843
4185
  }
3844
4186
 
3845
- static __inline__ vector float __ATTRS_o_ai vec_lvx(int __a, const float *__b) {
4187
+ static __inline__ vector float __ATTRS_o_ai vec_lvx(long __a, const float *__b) {
3846
4188
  return (vector float)__builtin_altivec_lvx(__a, __b);
3847
4189
  }
3848
4190
 
3849
4191
  /* vec_lde */
3850
4192
 
3851
4193
  static __inline__ vector signed char __ATTRS_o_ai
3852
- vec_lde(int __a, const signed char *__b) {
4194
+ vec_lde(long __a, const signed char *__b) {
3853
4195
  return (vector signed char)__builtin_altivec_lvebx(__a, __b);
3854
4196
  }
3855
4197
 
3856
4198
  static __inline__ vector unsigned char __ATTRS_o_ai
3857
- vec_lde(int __a, const unsigned char *__b) {
4199
+ vec_lde(long __a, const unsigned char *__b) {
3858
4200
  return (vector unsigned char)__builtin_altivec_lvebx(__a, __b);
3859
4201
  }
3860
4202
 
3861
- static __inline__ vector short __ATTRS_o_ai vec_lde(int __a, const short *__b) {
4203
+ static __inline__ vector short __ATTRS_o_ai vec_lde(long __a, const short *__b) {
3862
4204
  return (vector short)__builtin_altivec_lvehx(__a, __b);
3863
4205
  }
3864
4206
 
3865
4207
  static __inline__ vector unsigned short __ATTRS_o_ai
3866
- vec_lde(int __a, const unsigned short *__b) {
4208
+ vec_lde(long __a, const unsigned short *__b) {
3867
4209
  return (vector unsigned short)__builtin_altivec_lvehx(__a, __b);
3868
4210
  }
3869
4211
 
3870
- static __inline__ vector int __ATTRS_o_ai vec_lde(int __a, const int *__b) {
4212
+ static __inline__ vector int __ATTRS_o_ai vec_lde(long __a, const int *__b) {
3871
4213
  return (vector int)__builtin_altivec_lvewx(__a, __b);
3872
4214
  }
3873
4215
 
3874
4216
  static __inline__ vector unsigned int __ATTRS_o_ai
3875
- vec_lde(int __a, const unsigned int *__b) {
4217
+ vec_lde(long __a, const unsigned int *__b) {
3876
4218
  return (vector unsigned int)__builtin_altivec_lvewx(__a, __b);
3877
4219
  }
3878
4220
 
3879
- static __inline__ vector float __ATTRS_o_ai vec_lde(int __a, const float *__b) {
4221
+ static __inline__ vector float __ATTRS_o_ai vec_lde(long __a, const float *__b) {
3880
4222
  return (vector float)__builtin_altivec_lvewx(__a, __b);
3881
4223
  }
3882
4224
 
3883
4225
  /* vec_lvebx */
3884
4226
 
3885
4227
  static __inline__ vector signed char __ATTRS_o_ai
3886
- vec_lvebx(int __a, const signed char *__b) {
4228
+ vec_lvebx(long __a, const signed char *__b) {
3887
4229
  return (vector signed char)__builtin_altivec_lvebx(__a, __b);
3888
4230
  }
3889
4231
 
3890
4232
  static __inline__ vector unsigned char __ATTRS_o_ai
3891
- vec_lvebx(int __a, const unsigned char *__b) {
4233
+ vec_lvebx(long __a, const unsigned char *__b) {
3892
4234
  return (vector unsigned char)__builtin_altivec_lvebx(__a, __b);
3893
4235
  }
3894
4236
 
3895
4237
  /* vec_lvehx */
3896
4238
 
3897
- static __inline__ vector short __ATTRS_o_ai vec_lvehx(int __a,
4239
+ static __inline__ vector short __ATTRS_o_ai vec_lvehx(long __a,
3898
4240
  const short *__b) {
3899
4241
  return (vector short)__builtin_altivec_lvehx(__a, __b);
3900
4242
  }
3901
4243
 
3902
4244
  static __inline__ vector unsigned short __ATTRS_o_ai
3903
- vec_lvehx(int __a, const unsigned short *__b) {
4245
+ vec_lvehx(long __a, const unsigned short *__b) {
3904
4246
  return (vector unsigned short)__builtin_altivec_lvehx(__a, __b);
3905
4247
  }
3906
4248
 
3907
4249
  /* vec_lvewx */
3908
4250
 
3909
- static __inline__ vector int __ATTRS_o_ai vec_lvewx(int __a, const int *__b) {
4251
+ static __inline__ vector int __ATTRS_o_ai vec_lvewx(long __a, const int *__b) {
3910
4252
  return (vector int)__builtin_altivec_lvewx(__a, __b);
3911
4253
  }
3912
4254
 
3913
4255
  static __inline__ vector unsigned int __ATTRS_o_ai
3914
- vec_lvewx(int __a, const unsigned int *__b) {
4256
+ vec_lvewx(long __a, const unsigned int *__b) {
3915
4257
  return (vector unsigned int)__builtin_altivec_lvewx(__a, __b);
3916
4258
  }
3917
4259
 
3918
- static __inline__ vector float __ATTRS_o_ai vec_lvewx(int __a,
4260
+ static __inline__ vector float __ATTRS_o_ai vec_lvewx(long __a,
3919
4261
  const float *__b) {
3920
4262
  return (vector float)__builtin_altivec_lvewx(__a, __b);
3921
4263
  }
@@ -3923,179 +4265,179 @@ static __inline__ vector float __ATTRS_o_ai vec_lvewx(int __a,
3923
4265
  /* vec_ldl */
3924
4266
 
3925
4267
  static __inline__ vector signed char __ATTRS_o_ai
3926
- vec_ldl(int __a, const vector signed char *__b) {
4268
+ vec_ldl(long __a, const vector signed char *__b) {
3927
4269
  return (vector signed char)__builtin_altivec_lvxl(__a, __b);
3928
4270
  }
3929
4271
 
3930
4272
  static __inline__ vector signed char __ATTRS_o_ai
3931
- vec_ldl(int __a, const signed char *__b) {
4273
+ vec_ldl(long __a, const signed char *__b) {
3932
4274
  return (vector signed char)__builtin_altivec_lvxl(__a, __b);
3933
4275
  }
3934
4276
 
3935
4277
  static __inline__ vector unsigned char __ATTRS_o_ai
3936
- vec_ldl(int __a, const vector unsigned char *__b) {
4278
+ vec_ldl(long __a, const vector unsigned char *__b) {
3937
4279
  return (vector unsigned char)__builtin_altivec_lvxl(__a, __b);
3938
4280
  }
3939
4281
 
3940
4282
  static __inline__ vector unsigned char __ATTRS_o_ai
3941
- vec_ldl(int __a, const unsigned char *__b) {
4283
+ vec_ldl(long __a, const unsigned char *__b) {
3942
4284
  return (vector unsigned char)__builtin_altivec_lvxl(__a, __b);
3943
4285
  }
3944
4286
 
3945
4287
  static __inline__ vector bool char __ATTRS_o_ai
3946
- vec_ldl(int __a, const vector bool char *__b) {
4288
+ vec_ldl(long __a, const vector bool char *__b) {
3947
4289
  return (vector bool char)__builtin_altivec_lvxl(__a, __b);
3948
4290
  }
3949
4291
 
3950
- static __inline__ vector short __ATTRS_o_ai vec_ldl(int __a,
4292
+ static __inline__ vector short __ATTRS_o_ai vec_ldl(long __a,
3951
4293
  const vector short *__b) {
3952
4294
  return (vector short)__builtin_altivec_lvxl(__a, __b);
3953
4295
  }
3954
4296
 
3955
- static __inline__ vector short __ATTRS_o_ai vec_ldl(int __a, const short *__b) {
4297
+ static __inline__ vector short __ATTRS_o_ai vec_ldl(long __a, const short *__b) {
3956
4298
  return (vector short)__builtin_altivec_lvxl(__a, __b);
3957
4299
  }
3958
4300
 
3959
4301
  static __inline__ vector unsigned short __ATTRS_o_ai
3960
- vec_ldl(int __a, const vector unsigned short *__b) {
4302
+ vec_ldl(long __a, const vector unsigned short *__b) {
3961
4303
  return (vector unsigned short)__builtin_altivec_lvxl(__a, __b);
3962
4304
  }
3963
4305
 
3964
4306
  static __inline__ vector unsigned short __ATTRS_o_ai
3965
- vec_ldl(int __a, const unsigned short *__b) {
4307
+ vec_ldl(long __a, const unsigned short *__b) {
3966
4308
  return (vector unsigned short)__builtin_altivec_lvxl(__a, __b);
3967
4309
  }
3968
4310
 
3969
4311
  static __inline__ vector bool short __ATTRS_o_ai
3970
- vec_ldl(int __a, const vector bool short *__b) {
4312
+ vec_ldl(long __a, const vector bool short *__b) {
3971
4313
  return (vector bool short)__builtin_altivec_lvxl(__a, __b);
3972
4314
  }
3973
4315
 
3974
- static __inline__ vector pixel __ATTRS_o_ai vec_ldl(int __a,
4316
+ static __inline__ vector pixel __ATTRS_o_ai vec_ldl(long __a,
3975
4317
  const vector pixel *__b) {
3976
4318
  return (vector pixel short)__builtin_altivec_lvxl(__a, __b);
3977
4319
  }
3978
4320
 
3979
- static __inline__ vector int __ATTRS_o_ai vec_ldl(int __a,
4321
+ static __inline__ vector int __ATTRS_o_ai vec_ldl(long __a,
3980
4322
  const vector int *__b) {
3981
4323
  return (vector int)__builtin_altivec_lvxl(__a, __b);
3982
4324
  }
3983
4325
 
3984
- static __inline__ vector int __ATTRS_o_ai vec_ldl(int __a, const int *__b) {
4326
+ static __inline__ vector int __ATTRS_o_ai vec_ldl(long __a, const int *__b) {
3985
4327
  return (vector int)__builtin_altivec_lvxl(__a, __b);
3986
4328
  }
3987
4329
 
3988
4330
  static __inline__ vector unsigned int __ATTRS_o_ai
3989
- vec_ldl(int __a, const vector unsigned int *__b) {
4331
+ vec_ldl(long __a, const vector unsigned int *__b) {
3990
4332
  return (vector unsigned int)__builtin_altivec_lvxl(__a, __b);
3991
4333
  }
3992
4334
 
3993
4335
  static __inline__ vector unsigned int __ATTRS_o_ai
3994
- vec_ldl(int __a, const unsigned int *__b) {
4336
+ vec_ldl(long __a, const unsigned int *__b) {
3995
4337
  return (vector unsigned int)__builtin_altivec_lvxl(__a, __b);
3996
4338
  }
3997
4339
 
3998
4340
  static __inline__ vector bool int __ATTRS_o_ai
3999
- vec_ldl(int __a, const vector bool int *__b) {
4341
+ vec_ldl(long __a, const vector bool int *__b) {
4000
4342
  return (vector bool int)__builtin_altivec_lvxl(__a, __b);
4001
4343
  }
4002
4344
 
4003
- static __inline__ vector float __ATTRS_o_ai vec_ldl(int __a,
4345
+ static __inline__ vector float __ATTRS_o_ai vec_ldl(long __a,
4004
4346
  const vector float *__b) {
4005
4347
  return (vector float)__builtin_altivec_lvxl(__a, __b);
4006
4348
  }
4007
4349
 
4008
- static __inline__ vector float __ATTRS_o_ai vec_ldl(int __a, const float *__b) {
4350
+ static __inline__ vector float __ATTRS_o_ai vec_ldl(long __a, const float *__b) {
4009
4351
  return (vector float)__builtin_altivec_lvxl(__a, __b);
4010
4352
  }
4011
4353
 
4012
4354
  /* vec_lvxl */
4013
4355
 
4014
4356
  static __inline__ vector signed char __ATTRS_o_ai
4015
- vec_lvxl(int __a, const vector signed char *__b) {
4357
+ vec_lvxl(long __a, const vector signed char *__b) {
4016
4358
  return (vector signed char)__builtin_altivec_lvxl(__a, __b);
4017
4359
  }
4018
4360
 
4019
4361
  static __inline__ vector signed char __ATTRS_o_ai
4020
- vec_lvxl(int __a, const signed char *__b) {
4362
+ vec_lvxl(long __a, const signed char *__b) {
4021
4363
  return (vector signed char)__builtin_altivec_lvxl(__a, __b);
4022
4364
  }
4023
4365
 
4024
4366
  static __inline__ vector unsigned char __ATTRS_o_ai
4025
- vec_lvxl(int __a, const vector unsigned char *__b) {
4367
+ vec_lvxl(long __a, const vector unsigned char *__b) {
4026
4368
  return (vector unsigned char)__builtin_altivec_lvxl(__a, __b);
4027
4369
  }
4028
4370
 
4029
4371
  static __inline__ vector unsigned char __ATTRS_o_ai
4030
- vec_lvxl(int __a, const unsigned char *__b) {
4372
+ vec_lvxl(long __a, const unsigned char *__b) {
4031
4373
  return (vector unsigned char)__builtin_altivec_lvxl(__a, __b);
4032
4374
  }
4033
4375
 
4034
4376
  static __inline__ vector bool char __ATTRS_o_ai
4035
- vec_lvxl(int __a, const vector bool char *__b) {
4377
+ vec_lvxl(long __a, const vector bool char *__b) {
4036
4378
  return (vector bool char)__builtin_altivec_lvxl(__a, __b);
4037
4379
  }
4038
4380
 
4039
- static __inline__ vector short __ATTRS_o_ai vec_lvxl(int __a,
4381
+ static __inline__ vector short __ATTRS_o_ai vec_lvxl(long __a,
4040
4382
  const vector short *__b) {
4041
4383
  return (vector short)__builtin_altivec_lvxl(__a, __b);
4042
4384
  }
4043
4385
 
4044
- static __inline__ vector short __ATTRS_o_ai vec_lvxl(int __a,
4386
+ static __inline__ vector short __ATTRS_o_ai vec_lvxl(long __a,
4045
4387
  const short *__b) {
4046
4388
  return (vector short)__builtin_altivec_lvxl(__a, __b);
4047
4389
  }
4048
4390
 
4049
4391
  static __inline__ vector unsigned short __ATTRS_o_ai
4050
- vec_lvxl(int __a, const vector unsigned short *__b) {
4392
+ vec_lvxl(long __a, const vector unsigned short *__b) {
4051
4393
  return (vector unsigned short)__builtin_altivec_lvxl(__a, __b);
4052
4394
  }
4053
4395
 
4054
4396
  static __inline__ vector unsigned short __ATTRS_o_ai
4055
- vec_lvxl(int __a, const unsigned short *__b) {
4397
+ vec_lvxl(long __a, const unsigned short *__b) {
4056
4398
  return (vector unsigned short)__builtin_altivec_lvxl(__a, __b);
4057
4399
  }
4058
4400
 
4059
4401
  static __inline__ vector bool short __ATTRS_o_ai
4060
- vec_lvxl(int __a, const vector bool short *__b) {
4402
+ vec_lvxl(long __a, const vector bool short *__b) {
4061
4403
  return (vector bool short)__builtin_altivec_lvxl(__a, __b);
4062
4404
  }
4063
4405
 
4064
- static __inline__ vector pixel __ATTRS_o_ai vec_lvxl(int __a,
4406
+ static __inline__ vector pixel __ATTRS_o_ai vec_lvxl(long __a,
4065
4407
  const vector pixel *__b) {
4066
4408
  return (vector pixel)__builtin_altivec_lvxl(__a, __b);
4067
4409
  }
4068
4410
 
4069
- static __inline__ vector int __ATTRS_o_ai vec_lvxl(int __a,
4411
+ static __inline__ vector int __ATTRS_o_ai vec_lvxl(long __a,
4070
4412
  const vector int *__b) {
4071
4413
  return (vector int)__builtin_altivec_lvxl(__a, __b);
4072
4414
  }
4073
4415
 
4074
- static __inline__ vector int __ATTRS_o_ai vec_lvxl(int __a, const int *__b) {
4416
+ static __inline__ vector int __ATTRS_o_ai vec_lvxl(long __a, const int *__b) {
4075
4417
  return (vector int)__builtin_altivec_lvxl(__a, __b);
4076
4418
  }
4077
4419
 
4078
4420
  static __inline__ vector unsigned int __ATTRS_o_ai
4079
- vec_lvxl(int __a, const vector unsigned int *__b) {
4421
+ vec_lvxl(long __a, const vector unsigned int *__b) {
4080
4422
  return (vector unsigned int)__builtin_altivec_lvxl(__a, __b);
4081
4423
  }
4082
4424
 
4083
4425
  static __inline__ vector unsigned int __ATTRS_o_ai
4084
- vec_lvxl(int __a, const unsigned int *__b) {
4426
+ vec_lvxl(long __a, const unsigned int *__b) {
4085
4427
  return (vector unsigned int)__builtin_altivec_lvxl(__a, __b);
4086
4428
  }
4087
4429
 
4088
4430
  static __inline__ vector bool int __ATTRS_o_ai
4089
- vec_lvxl(int __a, const vector bool int *__b) {
4431
+ vec_lvxl(long __a, const vector bool int *__b) {
4090
4432
  return (vector bool int)__builtin_altivec_lvxl(__a, __b);
4091
4433
  }
4092
4434
 
4093
- static __inline__ vector float __ATTRS_o_ai vec_lvxl(int __a,
4435
+ static __inline__ vector float __ATTRS_o_ai vec_lvxl(long __a,
4094
4436
  const vector float *__b) {
4095
4437
  return (vector float)__builtin_altivec_lvxl(__a, __b);
4096
4438
  }
4097
4439
 
4098
- static __inline__ vector float __ATTRS_o_ai vec_lvxl(int __a,
4440
+ static __inline__ vector float __ATTRS_o_ai vec_lvxl(long __a,
4099
4441
  const float *__b) {
4100
4442
  return (vector float)__builtin_altivec_lvxl(__a, __b);
4101
4443
  }
@@ -5695,7 +6037,7 @@ vec_msum(vector unsigned short __a, vector unsigned short __b,
5695
6037
 
5696
6038
  /* vec_msumc */
5697
6039
 
5698
- #ifdef __POWER10_VECTOR__
6040
+ #if defined(__POWER10_VECTOR__) && defined(__SIZEOF_INT128__)
5699
6041
  static __inline__ vector unsigned __int128 __ATTRS_o_ai
5700
6042
  vec_msumc(vector unsigned long long __a, vector unsigned long long __b,
5701
6043
  vector unsigned __int128 __c) {
@@ -5929,7 +6271,7 @@ vec_mule(vector unsigned int __a, vector unsigned int __b) {
5929
6271
  }
5930
6272
  #endif
5931
6273
 
5932
- #ifdef __POWER10_VECTOR__
6274
+ #if defined(__POWER10_VECTOR__) && defined(__SIZEOF_INT128__)
5933
6275
  static __inline__ vector signed __int128 __ATTRS_o_ai
5934
6276
  vec_mule(vector signed long long __a, vector signed long long __b) {
5935
6277
  #ifdef __LITTLE_ENDIAN__
@@ -6075,7 +6417,7 @@ vec_mulo(vector unsigned int __a, vector unsigned int __b) {
6075
6417
  }
6076
6418
  #endif
6077
6419
 
6078
- #ifdef __POWER10_VECTOR__
6420
+ #if defined(__POWER10_VECTOR__) && defined(__SIZEOF_INT128__)
6079
6421
  static __inline__ vector signed __int128 __ATTRS_o_ai
6080
6422
  vec_mulo(vector signed long long __a, vector signed long long __b) {
6081
6423
  #ifdef __LITTLE_ENDIAN__
@@ -6771,6 +7113,11 @@ vec_orc(vector float __a, vector bool int __b) {
6771
7113
  return (vector float)((vector unsigned int)__a | ~__b);
6772
7114
  }
6773
7115
 
7116
+ static __inline__ vector float __ATTRS_o_ai vec_orc(vector float __a,
7117
+ vector float __b) {
7118
+ return (vector float)((vector unsigned int)__a | ~(vector unsigned int)__b);
7119
+ }
7120
+
6774
7121
  static __inline__ vector signed long long __ATTRS_o_ai
6775
7122
  vec_orc(vector signed long long __a, vector signed long long __b) {
6776
7123
  return __a | ~__b;
@@ -6815,6 +7162,12 @@ static __inline__ vector double __ATTRS_o_ai
6815
7162
  vec_orc(vector bool long long __a, vector double __b) {
6816
7163
  return (vector double)(__a | ~(vector unsigned long long)__b);
6817
7164
  }
7165
+
7166
+ static __inline__ vector double __ATTRS_o_ai vec_orc(vector double __a,
7167
+ vector double __b) {
7168
+ return (vector double)((vector bool long long)__a |
7169
+ ~(vector unsigned long long)__b);
7170
+ }
6818
7171
  #endif
6819
7172
 
6820
7173
  /* vec_vor */
@@ -7927,7 +8280,7 @@ vec_rl(vector unsigned long long __a, vector unsigned long long __b) {
7927
8280
  }
7928
8281
  #endif
7929
8282
 
7930
- #ifdef __POWER10_VECTOR__
8283
+ #if defined(__POWER10_VECTOR__) && defined(__SIZEOF_INT128__)
7931
8284
  static __inline__ vector signed __int128 __ATTRS_o_ai
7932
8285
  vec_rl(vector signed __int128 __a, vector unsigned __int128 __b) {
7933
8286
  return (__b << __a)|(__b >> ((__CHAR_BIT__ * sizeof(vector signed __int128)) - __a));
@@ -7954,7 +8307,7 @@ vec_rlmi(vector unsigned long long __a, vector unsigned long long __b,
7954
8307
  }
7955
8308
  #endif
7956
8309
 
7957
- #ifdef __POWER10_VECTOR__
8310
+ #if defined(__POWER10_VECTOR__) && defined(__SIZEOF_INT128__)
7958
8311
  static __inline__ vector unsigned __int128 __ATTRS_o_ai
7959
8312
  vec_rlmi(vector unsigned __int128 __a, vector unsigned __int128 __b,
7960
8313
  vector unsigned __int128 __c) {
@@ -7985,7 +8338,7 @@ vec_rlnm(vector unsigned long long __a, vector unsigned long long __b,
7985
8338
  }
7986
8339
  #endif
7987
8340
 
7988
- #ifdef __POWER10_VECTOR__
8341
+ #if defined(__POWER10_VECTOR__) && defined(__SIZEOF_INT128__)
7989
8342
  static __inline__ vector unsigned __int128 __ATTRS_o_ai
7990
8343
  vec_rlnm(vector unsigned __int128 __a, vector unsigned __int128 __b,
7991
8344
  vector unsigned __int128 __c) {
@@ -8060,18 +8413,25 @@ vec_vrlw(vector unsigned int __a, vector unsigned int __b) {
8060
8413
  /* vec_round */
8061
8414
 
8062
8415
  static __inline__ vector float __ATTRS_o_ai vec_round(vector float __a) {
8063
- #ifdef __VSX__
8064
- return __builtin_vsx_xvrspi(__a);
8065
- #else
8066
8416
  return __builtin_altivec_vrfin(__a);
8067
- #endif
8068
8417
  }
8069
8418
 
8070
8419
  #ifdef __VSX__
8420
+ #ifdef __XL_COMPAT_ALTIVEC__
8421
+ static __inline__ vector double __ATTRS_o_ai vec_rint(vector double __a);
8071
8422
  static __inline__ vector double __ATTRS_o_ai vec_round(vector double __a) {
8072
- return __builtin_vsx_xvrdpi(__a);
8423
+ double __fpscr = __builtin_readflm();
8424
+ __builtin_setrnd(0);
8425
+ vector double __rounded = vec_rint(__a);
8426
+ __builtin_setflm(__fpscr);
8427
+ return __rounded;
8073
8428
  }
8074
-
8429
+ #else
8430
+ static __inline__ vector double __ATTRS_o_ai vec_round(vector double __a) {
8431
+ return __builtin_vsx_xvrdpi(__a);
8432
+ }
8433
+ #endif
8434
+
8075
8435
  /* vec_rint */
8076
8436
 
8077
8437
  static __inline__ vector float __ATTRS_o_ai vec_rint(vector float __a) {
@@ -8082,6 +8442,16 @@ static __inline__ vector double __ATTRS_o_ai vec_rint(vector double __a) {
8082
8442
  return __builtin_vsx_xvrdpic(__a);
8083
8443
  }
8084
8444
 
8445
+ /* vec_roundc */
8446
+
8447
+ static __inline__ vector float __ATTRS_o_ai vec_roundc(vector float __a) {
8448
+ return __builtin_vsx_xvrspic(__a);
8449
+ }
8450
+
8451
+ static __inline__ vector double __ATTRS_o_ai vec_roundc(vector double __a) {
8452
+ return __builtin_vsx_xvrdpic(__a);
8453
+ }
8454
+
8085
8455
  /* vec_nearbyint */
8086
8456
 
8087
8457
  static __inline__ vector float __ATTRS_o_ai vec_nearbyint(vector float __a) {
@@ -8128,6 +8498,16 @@ static __inline__ vector double __ATTRS_o_ai vec_rsqrte(vector double __a) {
8128
8498
  }
8129
8499
  #endif
8130
8500
 
8501
+ static vector float __ATTRS_o_ai vec_rsqrt(vector float __a) {
8502
+ return __builtin_ppc_rsqrtf(__a);
8503
+ }
8504
+
8505
+ #ifdef __VSX__
8506
+ static vector double __ATTRS_o_ai vec_rsqrt(vector double __a) {
8507
+ return __builtin_ppc_rsqrtd(__a);
8508
+ }
8509
+ #endif
8510
+
8131
8511
  /* vec_vrsqrtefp */
8132
8512
 
8133
8513
  static __inline__ __vector float __attribute__((__always_inline__))
@@ -8488,7 +8868,53 @@ static __inline__ vector long long __ATTRS_o_ai
8488
8868
  vec_sl(vector long long __a, vector unsigned long long __b) {
8489
8869
  return (vector long long)vec_sl((vector unsigned long long)__a, __b);
8490
8870
  }
8871
+ #elif defined(__VSX__)
8872
+ static __inline__ vector unsigned char __ATTRS_o_ai
8873
+ vec_vspltb(vector unsigned char __a, unsigned char __b);
8874
+ static __inline__ vector unsigned long long __ATTRS_o_ai
8875
+ vec_sl(vector unsigned long long __a, vector unsigned long long __b) {
8876
+ __b %= (vector unsigned long long)(sizeof(unsigned long long) * __CHAR_BIT__);
8877
+
8878
+ // Big endian element one (the right doubleword) can be left shifted as-is.
8879
+ // The other element needs to be swapped into the right doubleword and
8880
+ // shifted. Then the right doublewords of the two result vectors are merged.
8881
+ vector signed long long __rightelt =
8882
+ (vector signed long long)__builtin_altivec_vslo((vector signed int)__a,
8883
+ (vector signed int)__b);
8884
+ #ifdef __LITTLE_ENDIAN__
8885
+ __rightelt = (vector signed long long)__builtin_altivec_vsl(
8886
+ (vector signed int)__rightelt,
8887
+ (vector signed int)vec_vspltb((vector unsigned char)__b, 0));
8888
+ #else
8889
+ __rightelt = (vector signed long long)__builtin_altivec_vsl(
8890
+ (vector signed int)__rightelt,
8891
+ (vector signed int)vec_vspltb((vector unsigned char)__b, 15));
8892
+ #endif
8893
+ __a = __builtin_shufflevector(__a, __a, 1, 0);
8894
+ __b = __builtin_shufflevector(__b, __b, 1, 0);
8895
+ vector signed long long __leftelt =
8896
+ (vector signed long long)__builtin_altivec_vslo((vector signed int)__a,
8897
+ (vector signed int)__b);
8898
+ #ifdef __LITTLE_ENDIAN__
8899
+ __leftelt = (vector signed long long)__builtin_altivec_vsl(
8900
+ (vector signed int)__leftelt,
8901
+ (vector signed int)vec_vspltb((vector unsigned char)__b, 0));
8902
+ return (vector unsigned long long)__builtin_shufflevector(__rightelt,
8903
+ __leftelt, 0, 2);
8904
+ #else
8905
+ __leftelt = (vector signed long long)__builtin_altivec_vsl(
8906
+ (vector signed int)__leftelt,
8907
+ (vector signed int)vec_vspltb((vector unsigned char)__b, 15));
8908
+ return (vector unsigned long long)__builtin_shufflevector(__leftelt,
8909
+ __rightelt, 1, 3);
8491
8910
  #endif
8911
+ }
8912
+
8913
+ static __inline__ vector long long __ATTRS_o_ai
8914
+ vec_sl(vector long long __a, vector unsigned long long __b) {
8915
+ return (vector long long)vec_sl((vector unsigned long long)__a, __b);
8916
+ }
8917
+ #endif /* __VSX__ */
8492
8918
 
8493
8919
  /* vec_vslb */
8494
8920
 
@@ -8850,6 +9276,11 @@ static __inline__ vector unsigned int __ATTRS_o_ai vec_sldw(
8850
9276
  return vec_sld(__a, __b, ((__c << 2) & 0x0F));
8851
9277
  }
8852
9278
 
9279
+ static __inline__ vector float __ATTRS_o_ai vec_sldw(
9280
+ vector float __a, vector float __b, unsigned const int __c) {
9281
+ return vec_sld(__a, __b, ((__c << 2) & 0x0F));
9282
+ }
9283
+
8853
9284
  #ifdef __VSX__
8854
9285
  static __inline__ vector signed long long __ATTRS_o_ai
8855
9286
  vec_sldw(vector signed long long __a, vector signed long long __b,
@@ -8862,6 +9293,11 @@ vec_sldw(vector unsigned long long __a, vector unsigned long long __b,
8862
9293
  unsigned const int __c) {
8863
9294
  return vec_sld(__a, __b, ((__c << 2) & 0x0F));
8864
9295
  }
9296
+
9297
+ static __inline__ vector double __ATTRS_o_ai vec_sldw(
9298
+ vector double __a, vector double __b, unsigned const int __c) {
9299
+ return vec_sld(__a, __b, ((__c << 2) & 0x0F));
9300
+ }
8865
9301
  #endif
8866
9302
 
8867
9303
  #ifdef __POWER9_VECTOR__
@@ -9943,7 +10379,51 @@ static __inline__ vector long long __ATTRS_o_ai
9943
10379
  vec_sr(vector long long __a, vector unsigned long long __b) {
9944
10380
  return (vector long long)vec_sr((vector unsigned long long)__a, __b);
9945
10381
  }
10382
+ #elif defined(__VSX__)
10383
+ static __inline__ vector unsigned long long __ATTRS_o_ai
10384
+ vec_sr(vector unsigned long long __a, vector unsigned long long __b) {
10385
+ __b %= (vector unsigned long long)(sizeof(unsigned long long) * __CHAR_BIT__);
10386
+
10387
+ // Big endian element zero (the left doubleword) can be right shifted as-is.
10388
+ // However the shift amount must be in the right doubleword.
10389
+ // The other element needs to be swapped into the left doubleword and
10390
+ // shifted. Then the left doublewords of the two result vectors are merged.
10391
+ vector unsigned long long __swapshift =
10392
+ __builtin_shufflevector(__b, __b, 1, 0);
10393
+ vector unsigned long long __leftelt =
10394
+ (vector unsigned long long)__builtin_altivec_vsro(
10395
+ (vector signed int)__a, (vector signed int)__swapshift);
10396
+ #ifdef __LITTLE_ENDIAN__
10397
+ __leftelt = (vector unsigned long long)__builtin_altivec_vsr(
10398
+ (vector signed int)__leftelt,
10399
+ (vector signed int)vec_vspltb((vector unsigned char)__swapshift, 0));
10400
+ #else
10401
+ __leftelt = (vector unsigned long long)__builtin_altivec_vsr(
10402
+ (vector signed int)__leftelt,
10403
+ (vector signed int)vec_vspltb((vector unsigned char)__swapshift, 15));
10404
+ #endif
10405
+ __a = __builtin_shufflevector(__a, __a, 1, 0);
10406
+ vector unsigned long long __rightelt =
10407
+ (vector unsigned long long)__builtin_altivec_vsro((vector signed int)__a,
10408
+ (vector signed int)__b);
10409
+ #ifdef __LITTLE_ENDIAN__
10410
+ __rightelt = (vector unsigned long long)__builtin_altivec_vsr(
10411
+ (vector signed int)__rightelt,
10412
+ (vector signed int)vec_vspltb((vector unsigned char)__b, 0));
10413
+ return __builtin_shufflevector(__rightelt, __leftelt, 1, 3);
10414
+ #else
10415
+ __rightelt = (vector unsigned long long)__builtin_altivec_vsr(
10416
+ (vector signed int)__rightelt,
10417
+ (vector signed int)vec_vspltb((vector unsigned char)__b, 15));
10418
+ return __builtin_shufflevector(__leftelt, __rightelt, 0, 2);
9946
10419
  #endif
10420
+ }
10421
+
10422
+ static __inline__ vector long long __ATTRS_o_ai
10423
+ vec_sr(vector long long __a, vector unsigned long long __b) {
10424
+ return (vector long long)vec_sr((vector unsigned long long)__a, __b);
10425
+ }
10426
+ #endif /* __VSX__ */
9947
10427
 
9948
10428
  /* vec_vsrb */
9949
10429
 
@@ -10029,7 +10509,19 @@ static __inline__ vector unsigned long long __ATTRS_o_ai
10029
10509
  vec_sra(vector unsigned long long __a, vector unsigned long long __b) {
10030
10510
  return (vector unsigned long long)((vector signed long long)__a >> __b);
10031
10511
  }
10032
- #endif
10512
+ #elif defined(__VSX__)
10513
+ static __inline__ vector signed long long __ATTRS_o_ai
10514
+ vec_sra(vector signed long long __a, vector unsigned long long __b) {
10515
+ __b %= (vector unsigned long long)(sizeof(unsigned long long) * __CHAR_BIT__);
10516
+ return __a >> __b;
10517
+ }
10518
+
10519
+ static __inline__ vector unsigned long long __ATTRS_o_ai
10520
+ vec_sra(vector unsigned long long __a, vector unsigned long long __b) {
10521
+ __b %= (vector unsigned long long)(sizeof(unsigned long long) * __CHAR_BIT__);
10522
+ return (vector unsigned long long)((vector signed long long)__a >> __b);
10523
+ }
10524
+ #endif /* __VSX__ */
10033
10525
 
10034
10526
  /* vec_vsrab */
10035
10527
 
@@ -10635,420 +11127,420 @@ static __inline__ vector float __ATTRS_o_ai vec_vsro(vector float __a,
10635
11127
 
10636
11128
  /* vec_st */
10637
11129
 
10638
- static __inline__ void __ATTRS_o_ai vec_st(vector signed char __a, int __b,
11130
+ static __inline__ void __ATTRS_o_ai vec_st(vector signed char __a, long __b,
10639
11131
  vector signed char *__c) {
10640
11132
  __builtin_altivec_stvx((vector int)__a, __b, __c);
10641
11133
  }
10642
11134
 
10643
- static __inline__ void __ATTRS_o_ai vec_st(vector signed char __a, int __b,
11135
+ static __inline__ void __ATTRS_o_ai vec_st(vector signed char __a, long __b,
10644
11136
  signed char *__c) {
10645
11137
  __builtin_altivec_stvx((vector int)__a, __b, __c);
10646
11138
  }
10647
11139
 
10648
- static __inline__ void __ATTRS_o_ai vec_st(vector unsigned char __a, int __b,
11140
+ static __inline__ void __ATTRS_o_ai vec_st(vector unsigned char __a, long __b,
10649
11141
  vector unsigned char *__c) {
10650
11142
  __builtin_altivec_stvx((vector int)__a, __b, __c);
10651
11143
  }
10652
11144
 
10653
- static __inline__ void __ATTRS_o_ai vec_st(vector unsigned char __a, int __b,
11145
+ static __inline__ void __ATTRS_o_ai vec_st(vector unsigned char __a, long __b,
10654
11146
  unsigned char *__c) {
10655
11147
  __builtin_altivec_stvx((vector int)__a, __b, __c);
10656
11148
  }
10657
11149
 
10658
- static __inline__ void __ATTRS_o_ai vec_st(vector bool char __a, int __b,
11150
+ static __inline__ void __ATTRS_o_ai vec_st(vector bool char __a, long __b,
10659
11151
  signed char *__c) {
10660
11152
  __builtin_altivec_stvx((vector int)__a, __b, __c);
10661
11153
  }
10662
11154
 
10663
- static __inline__ void __ATTRS_o_ai vec_st(vector bool char __a, int __b,
11155
+ static __inline__ void __ATTRS_o_ai vec_st(vector bool char __a, long __b,
10664
11156
  unsigned char *__c) {
10665
11157
  __builtin_altivec_stvx((vector int)__a, __b, __c);
10666
11158
  }
10667
11159
 
10668
- static __inline__ void __ATTRS_o_ai vec_st(vector bool char __a, int __b,
11160
+ static __inline__ void __ATTRS_o_ai vec_st(vector bool char __a, long __b,
10669
11161
  vector bool char *__c) {
10670
11162
  __builtin_altivec_stvx((vector int)__a, __b, __c);
10671
11163
  }
10672
11164
 
10673
- static __inline__ void __ATTRS_o_ai vec_st(vector short __a, int __b,
11165
+ static __inline__ void __ATTRS_o_ai vec_st(vector short __a, long __b,
10674
11166
  vector short *__c) {
10675
11167
  __builtin_altivec_stvx((vector int)__a, __b, __c);
10676
11168
  }
10677
11169
 
10678
- static __inline__ void __ATTRS_o_ai vec_st(vector short __a, int __b,
11170
+ static __inline__ void __ATTRS_o_ai vec_st(vector short __a, long __b,
10679
11171
  short *__c) {
10680
11172
  __builtin_altivec_stvx((vector int)__a, __b, __c);
10681
11173
  }
10682
11174
 
10683
- static __inline__ void __ATTRS_o_ai vec_st(vector unsigned short __a, int __b,
11175
+ static __inline__ void __ATTRS_o_ai vec_st(vector unsigned short __a, long __b,
10684
11176
  vector unsigned short *__c) {
10685
11177
  __builtin_altivec_stvx((vector int)__a, __b, __c);
10686
11178
  }
10687
11179
 
10688
- static __inline__ void __ATTRS_o_ai vec_st(vector unsigned short __a, int __b,
11180
+ static __inline__ void __ATTRS_o_ai vec_st(vector unsigned short __a, long __b,
10689
11181
  unsigned short *__c) {
10690
11182
  __builtin_altivec_stvx((vector int)__a, __b, __c);
10691
11183
  }
10692
11184
 
10693
- static __inline__ void __ATTRS_o_ai vec_st(vector bool short __a, int __b,
11185
+ static __inline__ void __ATTRS_o_ai vec_st(vector bool short __a, long __b,
10694
11186
  short *__c) {
10695
11187
  __builtin_altivec_stvx((vector int)__a, __b, __c);
10696
11188
  }
10697
11189
 
10698
- static __inline__ void __ATTRS_o_ai vec_st(vector bool short __a, int __b,
11190
+ static __inline__ void __ATTRS_o_ai vec_st(vector bool short __a, long __b,
10699
11191
  unsigned short *__c) {
10700
11192
  __builtin_altivec_stvx((vector int)__a, __b, __c);
10701
11193
  }
10702
11194
 
10703
- static __inline__ void __ATTRS_o_ai vec_st(vector bool short __a, int __b,
11195
+ static __inline__ void __ATTRS_o_ai vec_st(vector bool short __a, long __b,
10704
11196
  vector bool short *__c) {
10705
11197
  __builtin_altivec_stvx((vector int)__a, __b, __c);
10706
11198
  }
10707
11199
 
10708
- static __inline__ void __ATTRS_o_ai vec_st(vector pixel __a, int __b,
11200
+ static __inline__ void __ATTRS_o_ai vec_st(vector pixel __a, long __b,
10709
11201
  short *__c) {
10710
11202
  __builtin_altivec_stvx((vector int)__a, __b, __c);
10711
11203
  }
10712
11204
 
10713
- static __inline__ void __ATTRS_o_ai vec_st(vector pixel __a, int __b,
11205
+ static __inline__ void __ATTRS_o_ai vec_st(vector pixel __a, long __b,
10714
11206
  unsigned short *__c) {
10715
11207
  __builtin_altivec_stvx((vector int)__a, __b, __c);
10716
11208
  }
10717
11209
 
10718
- static __inline__ void __ATTRS_o_ai vec_st(vector pixel __a, int __b,
11210
+ static __inline__ void __ATTRS_o_ai vec_st(vector pixel __a, long __b,
10719
11211
  vector pixel *__c) {
10720
11212
  __builtin_altivec_stvx((vector int)__a, __b, __c);
10721
11213
  }
10722
11214
 
10723
- static __inline__ void __ATTRS_o_ai vec_st(vector int __a, int __b,
11215
+ static __inline__ void __ATTRS_o_ai vec_st(vector int __a, long __b,
10724
11216
  vector int *__c) {
10725
11217
  __builtin_altivec_stvx(__a, __b, __c);
10726
11218
  }
10727
11219
 
10728
- static __inline__ void __ATTRS_o_ai vec_st(vector int __a, int __b, int *__c) {
11220
+ static __inline__ void __ATTRS_o_ai vec_st(vector int __a, long __b, int *__c) {
10729
11221
  __builtin_altivec_stvx(__a, __b, __c);
10730
11222
  }
10731
11223
 
10732
- static __inline__ void __ATTRS_o_ai vec_st(vector unsigned int __a, int __b,
11224
+ static __inline__ void __ATTRS_o_ai vec_st(vector unsigned int __a, long __b,
10733
11225
  vector unsigned int *__c) {
10734
11226
  __builtin_altivec_stvx((vector int)__a, __b, __c);
10735
11227
  }
10736
11228
 
10737
- static __inline__ void __ATTRS_o_ai vec_st(vector unsigned int __a, int __b,
11229
+ static __inline__ void __ATTRS_o_ai vec_st(vector unsigned int __a, long __b,
10738
11230
  unsigned int *__c) {
10739
11231
  __builtin_altivec_stvx((vector int)__a, __b, __c);
10740
11232
  }
10741
11233
 
10742
- static __inline__ void __ATTRS_o_ai vec_st(vector bool int __a, int __b,
11234
+ static __inline__ void __ATTRS_o_ai vec_st(vector bool int __a, long __b,
10743
11235
  int *__c) {
10744
11236
  __builtin_altivec_stvx((vector int)__a, __b, __c);
10745
11237
  }
10746
11238
 
10747
- static __inline__ void __ATTRS_o_ai vec_st(vector bool int __a, int __b,
11239
+ static __inline__ void __ATTRS_o_ai vec_st(vector bool int __a, long __b,
10748
11240
  unsigned int *__c) {
10749
11241
  __builtin_altivec_stvx((vector int)__a, __b, __c);
10750
11242
  }
10751
11243
 
10752
- static __inline__ void __ATTRS_o_ai vec_st(vector bool int __a, int __b,
11244
+ static __inline__ void __ATTRS_o_ai vec_st(vector bool int __a, long __b,
10753
11245
  vector bool int *__c) {
10754
11246
  __builtin_altivec_stvx((vector int)__a, __b, __c);
10755
11247
  }
10756
11248
 
10757
- static __inline__ void __ATTRS_o_ai vec_st(vector float __a, int __b,
11249
+ static __inline__ void __ATTRS_o_ai vec_st(vector float __a, long __b,
10758
11250
  vector float *__c) {
10759
11251
  __builtin_altivec_stvx((vector int)__a, __b, __c);
10760
11252
  }
10761
11253
 
10762
- static __inline__ void __ATTRS_o_ai vec_st(vector float __a, int __b,
11254
+ static __inline__ void __ATTRS_o_ai vec_st(vector float __a, long __b,
10763
11255
  float *__c) {
10764
11256
  __builtin_altivec_stvx((vector int)__a, __b, __c);
10765
11257
  }
10766
11258
 
10767
11259
  /* vec_stvx */
10768
11260
 
10769
- static __inline__ void __ATTRS_o_ai vec_stvx(vector signed char __a, int __b,
11261
+ static __inline__ void __ATTRS_o_ai vec_stvx(vector signed char __a, long __b,
10770
11262
  vector signed char *__c) {
10771
11263
  __builtin_altivec_stvx((vector int)__a, __b, __c);
10772
11264
  }
10773
11265
 
10774
- static __inline__ void __ATTRS_o_ai vec_stvx(vector signed char __a, int __b,
11266
+ static __inline__ void __ATTRS_o_ai vec_stvx(vector signed char __a, long __b,
10775
11267
  signed char *__c) {
10776
11268
  __builtin_altivec_stvx((vector int)__a, __b, __c);
10777
11269
  }
10778
11270
 
10779
- static __inline__ void __ATTRS_o_ai vec_stvx(vector unsigned char __a, int __b,
11271
+ static __inline__ void __ATTRS_o_ai vec_stvx(vector unsigned char __a, long __b,
10780
11272
  vector unsigned char *__c) {
10781
11273
  __builtin_altivec_stvx((vector int)__a, __b, __c);
10782
11274
  }
10783
11275
 
10784
- static __inline__ void __ATTRS_o_ai vec_stvx(vector unsigned char __a, int __b,
11276
+ static __inline__ void __ATTRS_o_ai vec_stvx(vector unsigned char __a, long __b,
10785
11277
  unsigned char *__c) {
10786
11278
  __builtin_altivec_stvx((vector int)__a, __b, __c);
10787
11279
  }
10788
11280
 
10789
- static __inline__ void __ATTRS_o_ai vec_stvx(vector bool char __a, int __b,
11281
+ static __inline__ void __ATTRS_o_ai vec_stvx(vector bool char __a, long __b,
10790
11282
  signed char *__c) {
10791
11283
  __builtin_altivec_stvx((vector int)__a, __b, __c);
10792
11284
  }
10793
11285
 
10794
- static __inline__ void __ATTRS_o_ai vec_stvx(vector bool char __a, int __b,
11286
+ static __inline__ void __ATTRS_o_ai vec_stvx(vector bool char __a, long __b,
10795
11287
  unsigned char *__c) {
10796
11288
  __builtin_altivec_stvx((vector int)__a, __b, __c);
10797
11289
  }
10798
11290
 
10799
- static __inline__ void __ATTRS_o_ai vec_stvx(vector bool char __a, int __b,
11291
+ static __inline__ void __ATTRS_o_ai vec_stvx(vector bool char __a, long __b,
10800
11292
  vector bool char *__c) {
10801
11293
  __builtin_altivec_stvx((vector int)__a, __b, __c);
10802
11294
  }
10803
11295
 
10804
- static __inline__ void __ATTRS_o_ai vec_stvx(vector short __a, int __b,
11296
+ static __inline__ void __ATTRS_o_ai vec_stvx(vector short __a, long __b,
10805
11297
  vector short *__c) {
10806
11298
  __builtin_altivec_stvx((vector int)__a, __b, __c);
10807
11299
  }
10808
11300
 
10809
- static __inline__ void __ATTRS_o_ai vec_stvx(vector short __a, int __b,
11301
+ static __inline__ void __ATTRS_o_ai vec_stvx(vector short __a, long __b,
10810
11302
  short *__c) {
10811
11303
  __builtin_altivec_stvx((vector int)__a, __b, __c);
10812
11304
  }
10813
11305
 
10814
- static __inline__ void __ATTRS_o_ai vec_stvx(vector unsigned short __a, int __b,
11306
+ static __inline__ void __ATTRS_o_ai vec_stvx(vector unsigned short __a, long __b,
10815
11307
  vector unsigned short *__c) {
10816
11308
  __builtin_altivec_stvx((vector int)__a, __b, __c);
10817
11309
  }
10818
11310
 
10819
- static __inline__ void __ATTRS_o_ai vec_stvx(vector unsigned short __a, int __b,
11311
+ static __inline__ void __ATTRS_o_ai vec_stvx(vector unsigned short __a, long __b,
10820
11312
  unsigned short *__c) {
10821
11313
  __builtin_altivec_stvx((vector int)__a, __b, __c);
10822
11314
  }
10823
11315
 
10824
- static __inline__ void __ATTRS_o_ai vec_stvx(vector bool short __a, int __b,
11316
+ static __inline__ void __ATTRS_o_ai vec_stvx(vector bool short __a, long __b,
10825
11317
  short *__c) {
10826
11318
  __builtin_altivec_stvx((vector int)__a, __b, __c);
10827
11319
  }
10828
11320
 
10829
- static __inline__ void __ATTRS_o_ai vec_stvx(vector bool short __a, int __b,
11321
+ static __inline__ void __ATTRS_o_ai vec_stvx(vector bool short __a, long __b,
10830
11322
  unsigned short *__c) {
10831
11323
  __builtin_altivec_stvx((vector int)__a, __b, __c);
10832
11324
  }
10833
11325
 
10834
- static __inline__ void __ATTRS_o_ai vec_stvx(vector bool short __a, int __b,
11326
+ static __inline__ void __ATTRS_o_ai vec_stvx(vector bool short __a, long __b,
10835
11327
  vector bool short *__c) {
10836
11328
  __builtin_altivec_stvx((vector int)__a, __b, __c);
10837
11329
  }
10838
11330
 
10839
- static __inline__ void __ATTRS_o_ai vec_stvx(vector pixel __a, int __b,
11331
+ static __inline__ void __ATTRS_o_ai vec_stvx(vector pixel __a, long __b,
10840
11332
  short *__c) {
10841
11333
  __builtin_altivec_stvx((vector int)__a, __b, __c);
10842
11334
  }
10843
11335
 
10844
- static __inline__ void __ATTRS_o_ai vec_stvx(vector pixel __a, int __b,
11336
+ static __inline__ void __ATTRS_o_ai vec_stvx(vector pixel __a, long __b,
10845
11337
  unsigned short *__c) {
10846
11338
  __builtin_altivec_stvx((vector int)__a, __b, __c);
10847
11339
  }
10848
11340
 
10849
- static __inline__ void __ATTRS_o_ai vec_stvx(vector pixel __a, int __b,
11341
+ static __inline__ void __ATTRS_o_ai vec_stvx(vector pixel __a, long __b,
10850
11342
  vector pixel *__c) {
10851
11343
  __builtin_altivec_stvx((vector int)__a, __b, __c);
10852
11344
  }
10853
11345
 
10854
- static __inline__ void __ATTRS_o_ai vec_stvx(vector int __a, int __b,
11346
+ static __inline__ void __ATTRS_o_ai vec_stvx(vector int __a, long __b,
10855
11347
  vector int *__c) {
10856
11348
  __builtin_altivec_stvx(__a, __b, __c);
10857
11349
  }
10858
11350
 
10859
- static __inline__ void __ATTRS_o_ai vec_stvx(vector int __a, int __b,
11351
+ static __inline__ void __ATTRS_o_ai vec_stvx(vector int __a, long __b,
10860
11352
  int *__c) {
10861
11353
  __builtin_altivec_stvx(__a, __b, __c);
10862
11354
  }
10863
11355
 
10864
- static __inline__ void __ATTRS_o_ai vec_stvx(vector unsigned int __a, int __b,
11356
+ static __inline__ void __ATTRS_o_ai vec_stvx(vector unsigned int __a, long __b,
10865
11357
  vector unsigned int *__c) {
10866
11358
  __builtin_altivec_stvx((vector int)__a, __b, __c);
10867
11359
  }
10868
11360
 
10869
- static __inline__ void __ATTRS_o_ai vec_stvx(vector unsigned int __a, int __b,
11361
+ static __inline__ void __ATTRS_o_ai vec_stvx(vector unsigned int __a, long __b,
10870
11362
  unsigned int *__c) {
10871
11363
  __builtin_altivec_stvx((vector int)__a, __b, __c);
10872
11364
  }
10873
11365
 
10874
- static __inline__ void __ATTRS_o_ai vec_stvx(vector bool int __a, int __b,
11366
+ static __inline__ void __ATTRS_o_ai vec_stvx(vector bool int __a, long __b,
10875
11367
  int *__c) {
10876
11368
  __builtin_altivec_stvx((vector int)__a, __b, __c);
10877
11369
  }
10878
11370
 
10879
- static __inline__ void __ATTRS_o_ai vec_stvx(vector bool int __a, int __b,
11371
+ static __inline__ void __ATTRS_o_ai vec_stvx(vector bool int __a, long __b,
10880
11372
  unsigned int *__c) {
10881
11373
  __builtin_altivec_stvx((vector int)__a, __b, __c);
10882
11374
  }
10883
11375
 
10884
- static __inline__ void __ATTRS_o_ai vec_stvx(vector bool int __a, int __b,
11376
+ static __inline__ void __ATTRS_o_ai vec_stvx(vector bool int __a, long __b,
10885
11377
  vector bool int *__c) {
10886
11378
  __builtin_altivec_stvx((vector int)__a, __b, __c);
10887
11379
  }
10888
11380
 
10889
- static __inline__ void __ATTRS_o_ai vec_stvx(vector float __a, int __b,
11381
+ static __inline__ void __ATTRS_o_ai vec_stvx(vector float __a, long __b,
10890
11382
  vector float *__c) {
10891
11383
  __builtin_altivec_stvx((vector int)__a, __b, __c);
10892
11384
  }
10893
11385
 
10894
- static __inline__ void __ATTRS_o_ai vec_stvx(vector float __a, int __b,
11386
+ static __inline__ void __ATTRS_o_ai vec_stvx(vector float __a, long __b,
10895
11387
  float *__c) {
10896
11388
  __builtin_altivec_stvx((vector int)__a, __b, __c);
10897
11389
  }
10898
11390
 
10899
11391
  /* vec_ste */
10900
11392
 
10901
- static __inline__ void __ATTRS_o_ai vec_ste(vector signed char __a, int __b,
11393
+ static __inline__ void __ATTRS_o_ai vec_ste(vector signed char __a, long __b,
10902
11394
  signed char *__c) {
10903
11395
  __builtin_altivec_stvebx((vector char)__a, __b, __c);
10904
11396
  }
10905
11397
 
10906
- static __inline__ void __ATTRS_o_ai vec_ste(vector unsigned char __a, int __b,
11398
+ static __inline__ void __ATTRS_o_ai vec_ste(vector unsigned char __a, long __b,
10907
11399
  unsigned char *__c) {
10908
11400
  __builtin_altivec_stvebx((vector char)__a, __b, __c);
10909
11401
  }
10910
11402
 
10911
- static __inline__ void __ATTRS_o_ai vec_ste(vector bool char __a, int __b,
11403
+ static __inline__ void __ATTRS_o_ai vec_ste(vector bool char __a, long __b,
10912
11404
  signed char *__c) {
10913
11405
  __builtin_altivec_stvebx((vector char)__a, __b, __c);
10914
11406
  }
10915
11407
 
10916
- static __inline__ void __ATTRS_o_ai vec_ste(vector bool char __a, int __b,
11408
+ static __inline__ void __ATTRS_o_ai vec_ste(vector bool char __a, long __b,
10917
11409
  unsigned char *__c) {
10918
11410
  __builtin_altivec_stvebx((vector char)__a, __b, __c);
10919
11411
  }
10920
11412
 
10921
- static __inline__ void __ATTRS_o_ai vec_ste(vector short __a, int __b,
11413
+ static __inline__ void __ATTRS_o_ai vec_ste(vector short __a, long __b,
10922
11414
  short *__c) {
10923
11415
  __builtin_altivec_stvehx(__a, __b, __c);
10924
11416
  }
10925
11417
 
10926
- static __inline__ void __ATTRS_o_ai vec_ste(vector unsigned short __a, int __b,
11418
+ static __inline__ void __ATTRS_o_ai vec_ste(vector unsigned short __a, long __b,
10927
11419
  unsigned short *__c) {
10928
11420
  __builtin_altivec_stvehx((vector short)__a, __b, __c);
10929
11421
  }
10930
11422
 
10931
- static __inline__ void __ATTRS_o_ai vec_ste(vector bool short __a, int __b,
11423
+ static __inline__ void __ATTRS_o_ai vec_ste(vector bool short __a, long __b,
10932
11424
  short *__c) {
10933
11425
  __builtin_altivec_stvehx((vector short)__a, __b, __c);
10934
11426
  }
10935
11427
 
10936
- static __inline__ void __ATTRS_o_ai vec_ste(vector bool short __a, int __b,
11428
+ static __inline__ void __ATTRS_o_ai vec_ste(vector bool short __a, long __b,
10937
11429
  unsigned short *__c) {
10938
11430
  __builtin_altivec_stvehx((vector short)__a, __b, __c);
10939
11431
  }
10940
11432
 
10941
- static __inline__ void __ATTRS_o_ai vec_ste(vector pixel __a, int __b,
11433
+ static __inline__ void __ATTRS_o_ai vec_ste(vector pixel __a, long __b,
10942
11434
  short *__c) {
10943
11435
  __builtin_altivec_stvehx((vector short)__a, __b, __c);
10944
11436
  }
10945
11437
 
10946
- static __inline__ void __ATTRS_o_ai vec_ste(vector pixel __a, int __b,
11438
+ static __inline__ void __ATTRS_o_ai vec_ste(vector pixel __a, long __b,
10947
11439
  unsigned short *__c) {
10948
11440
  __builtin_altivec_stvehx((vector short)__a, __b, __c);
10949
11441
  }
10950
11442
 
10951
- static __inline__ void __ATTRS_o_ai vec_ste(vector int __a, int __b, int *__c) {
11443
+ static __inline__ void __ATTRS_o_ai vec_ste(vector int __a, long __b, int *__c) {
10952
11444
  __builtin_altivec_stvewx(__a, __b, __c);
10953
11445
  }
10954
11446
 
10955
- static __inline__ void __ATTRS_o_ai vec_ste(vector unsigned int __a, int __b,
11447
+ static __inline__ void __ATTRS_o_ai vec_ste(vector unsigned int __a, long __b,
10956
11448
  unsigned int *__c) {
10957
11449
  __builtin_altivec_stvewx((vector int)__a, __b, __c);
10958
11450
  }
10959
11451
 
10960
- static __inline__ void __ATTRS_o_ai vec_ste(vector bool int __a, int __b,
11452
+ static __inline__ void __ATTRS_o_ai vec_ste(vector bool int __a, long __b,
10961
11453
  int *__c) {
10962
11454
  __builtin_altivec_stvewx((vector int)__a, __b, __c);
10963
11455
  }
10964
11456
 
10965
- static __inline__ void __ATTRS_o_ai vec_ste(vector bool int __a, int __b,
11457
+ static __inline__ void __ATTRS_o_ai vec_ste(vector bool int __a, long __b,
10966
11458
  unsigned int *__c) {
10967
11459
  __builtin_altivec_stvewx((vector int)__a, __b, __c);
10968
11460
  }
10969
11461
 
10970
- static __inline__ void __ATTRS_o_ai vec_ste(vector float __a, int __b,
11462
+ static __inline__ void __ATTRS_o_ai vec_ste(vector float __a, long __b,
10971
11463
  float *__c) {
10972
11464
  __builtin_altivec_stvewx((vector int)__a, __b, __c);
10973
11465
  }
10974
11466
 
10975
11467
  /* vec_stvebx */
10976
11468
 
10977
- static __inline__ void __ATTRS_o_ai vec_stvebx(vector signed char __a, int __b,
11469
+ static __inline__ void __ATTRS_o_ai vec_stvebx(vector signed char __a, long __b,
10978
11470
  signed char *__c) {
10979
11471
  __builtin_altivec_stvebx((vector char)__a, __b, __c);
10980
11472
  }
10981
11473
 
10982
11474
  static __inline__ void __ATTRS_o_ai vec_stvebx(vector unsigned char __a,
10983
- int __b, unsigned char *__c) {
11475
+ long __b, unsigned char *__c) {
10984
11476
  __builtin_altivec_stvebx((vector char)__a, __b, __c);
10985
11477
  }
10986
11478
 
10987
- static __inline__ void __ATTRS_o_ai vec_stvebx(vector bool char __a, int __b,
11479
+ static __inline__ void __ATTRS_o_ai vec_stvebx(vector bool char __a, long __b,
10988
11480
  signed char *__c) {
10989
11481
  __builtin_altivec_stvebx((vector char)__a, __b, __c);
10990
11482
  }
10991
11483
 
10992
- static __inline__ void __ATTRS_o_ai vec_stvebx(vector bool char __a, int __b,
11484
+ static __inline__ void __ATTRS_o_ai vec_stvebx(vector bool char __a, long __b,
10993
11485
  unsigned char *__c) {
10994
11486
  __builtin_altivec_stvebx((vector char)__a, __b, __c);
10995
11487
  }
10996
11488
 
10997
11489
  /* vec_stvehx */
10998
11490
 
10999
- static __inline__ void __ATTRS_o_ai vec_stvehx(vector short __a, int __b,
11491
+ static __inline__ void __ATTRS_o_ai vec_stvehx(vector short __a, long __b,
11000
11492
  short *__c) {
11001
11493
  __builtin_altivec_stvehx(__a, __b, __c);
11002
11494
  }
11003
11495
 
11004
11496
  static __inline__ void __ATTRS_o_ai vec_stvehx(vector unsigned short __a,
11005
- int __b, unsigned short *__c) {
11497
+ long __b, unsigned short *__c) {
11006
11498
  __builtin_altivec_stvehx((vector short)__a, __b, __c);
11007
11499
  }
11008
11500
 
11009
- static __inline__ void __ATTRS_o_ai vec_stvehx(vector bool short __a, int __b,
11501
+ static __inline__ void __ATTRS_o_ai vec_stvehx(vector bool short __a, long __b,
11010
11502
  short *__c) {
11011
11503
  __builtin_altivec_stvehx((vector short)__a, __b, __c);
11012
11504
  }
11013
11505
 
11014
- static __inline__ void __ATTRS_o_ai vec_stvehx(vector bool short __a, int __b,
11506
+ static __inline__ void __ATTRS_o_ai vec_stvehx(vector bool short __a, long __b,
11015
11507
  unsigned short *__c) {
11016
11508
  __builtin_altivec_stvehx((vector short)__a, __b, __c);
11017
11509
  }
11018
11510
 
11019
- static __inline__ void __ATTRS_o_ai vec_stvehx(vector pixel __a, int __b,
11511
+ static __inline__ void __ATTRS_o_ai vec_stvehx(vector pixel __a, long __b,
11020
11512
  short *__c) {
11021
11513
  __builtin_altivec_stvehx((vector short)__a, __b, __c);
11022
11514
  }
11023
11515
 
11024
- static __inline__ void __ATTRS_o_ai vec_stvehx(vector pixel __a, int __b,
11516
+ static __inline__ void __ATTRS_o_ai vec_stvehx(vector pixel __a, long __b,
11025
11517
  unsigned short *__c) {
11026
11518
  __builtin_altivec_stvehx((vector short)__a, __b, __c);
11027
11519
  }
11028
11520
 
11029
11521
  /* vec_stvewx */
11030
11522
 
11031
- static __inline__ void __ATTRS_o_ai vec_stvewx(vector int __a, int __b,
11523
+ static __inline__ void __ATTRS_o_ai vec_stvewx(vector int __a, long __b,
11032
11524
  int *__c) {
11033
11525
  __builtin_altivec_stvewx(__a, __b, __c);
11034
11526
  }
11035
11527
 
11036
- static __inline__ void __ATTRS_o_ai vec_stvewx(vector unsigned int __a, int __b,
11528
+ static __inline__ void __ATTRS_o_ai vec_stvewx(vector unsigned int __a, long __b,
11037
11529
  unsigned int *__c) {
11038
11530
  __builtin_altivec_stvewx((vector int)__a, __b, __c);
11039
11531
  }
11040
11532
 
11041
- static __inline__ void __ATTRS_o_ai vec_stvewx(vector bool int __a, int __b,
11533
+ static __inline__ void __ATTRS_o_ai vec_stvewx(vector bool int __a, long __b,
11042
11534
  int *__c) {
11043
11535
  __builtin_altivec_stvewx((vector int)__a, __b, __c);
11044
11536
  }
11045
11537
 
11046
- static __inline__ void __ATTRS_o_ai vec_stvewx(vector bool int __a, int __b,
11538
+ static __inline__ void __ATTRS_o_ai vec_stvewx(vector bool int __a, long __b,
11047
11539
  unsigned int *__c) {
11048
11540
  __builtin_altivec_stvewx((vector int)__a, __b, __c);
11049
11541
  }
11050
11542
 
11051
- static __inline__ void __ATTRS_o_ai vec_stvewx(vector float __a, int __b,
11543
+ static __inline__ void __ATTRS_o_ai vec_stvewx(vector float __a, long __b,
11052
11544
  float *__c) {
11053
11545
  __builtin_altivec_stvewx((vector int)__a, __b, __c);
11054
11546
  }
@@ -11409,7 +11901,8 @@ vec_sub(vector unsigned int __a, vector bool int __b) {
11409
11901
  return __a - (vector unsigned int)__b;
11410
11902
  }
11411
11903
 
11412
- #if defined(__POWER8_VECTOR__) && defined(__powerpc64__)
11904
+ #if defined(__POWER8_VECTOR__) && defined(__powerpc64__) && \
11905
+ defined(__SIZEOF_INT128__)
11413
11906
  static __inline__ vector signed __int128 __ATTRS_o_ai
11414
11907
  vec_sub(vector signed __int128 __a, vector signed __int128 __b) {
11415
11908
  return __a - __b;
@@ -11419,7 +11912,8 @@ static __inline__ vector unsigned __int128 __ATTRS_o_ai
11419
11912
  vec_sub(vector unsigned __int128 __a, vector unsigned __int128 __b) {
11420
11913
  return __a - __b;
11421
11914
  }
11422
- #endif // defined(__POWER8_VECTOR__) && defined(__powerpc64__)
11915
+ #endif // defined(__POWER8_VECTOR__) && defined(__powerpc64__) &&
11916
+ // defined(__SIZEOF_INT128__)
11423
11917
 
11424
11918
  #ifdef __VSX__
11425
11919
  static __inline__ vector signed long long __ATTRS_o_ai
@@ -11567,7 +12061,8 @@ vec_subc(vector unsigned int __a, vector unsigned int __b) {
11567
12061
  return __builtin_altivec_vsubcuw(__a, __b);
11568
12062
  }
11569
12063
 
11570
- #if defined(__POWER8_VECTOR__) && defined(__powerpc64__)
12064
+ #ifdef __POWER8_VECTOR__
12065
+ #ifdef __SIZEOF_INT128__
11571
12066
  static __inline__ vector unsigned __int128 __ATTRS_o_ai
11572
12067
  vec_subc(vector unsigned __int128 __a, vector unsigned __int128 __b) {
11573
12068
  return __builtin_altivec_vsubcuq(__a, __b);
@@ -11577,7 +12072,13 @@ static __inline__ vector signed __int128 __ATTRS_o_ai
11577
12072
  vec_subc(vector signed __int128 __a, vector signed __int128 __b) {
11578
12073
  return __builtin_altivec_vsubcuq(__a, __b);
11579
12074
  }
11580
- #endif // defined(__POWER8_VECTOR__) && defined(__powerpc64__)
12075
+ #endif
12076
+
12077
+ static __inline__ vector unsigned char __attribute__((__always_inline__))
12078
+ vec_subc_u128(vector unsigned char __a, vector unsigned char __b) {
12079
+ return (vector unsigned char)__builtin_altivec_vsubcuq(__a, __b);
12080
+ }
12081
+ #endif // __POWER8_VECTOR__
11581
12082
 
11582
12083
  /* vec_vsubcuw */
11583
12084
 
@@ -11780,9 +12281,10 @@ vec_vsubuws(vector unsigned int __a, vector bool int __b) {
11780
12281
  return __builtin_altivec_vsubuws(__a, (vector unsigned int)__b);
11781
12282
  }
11782
12283
 
11783
- #if defined(__POWER8_VECTOR__) && defined(__powerpc64__)
12284
+ #ifdef __POWER8_VECTOR__
11784
12285
  /* vec_vsubuqm */
11785
12286
 
12287
+ #ifdef __SIZEOF_INT128__
11786
12288
  static __inline__ vector signed __int128 __ATTRS_o_ai
11787
12289
  vec_vsubuqm(vector signed __int128 __a, vector signed __int128 __b) {
11788
12290
  return __a - __b;
@@ -11792,10 +12294,16 @@ static __inline__ vector unsigned __int128 __ATTRS_o_ai
11792
12294
  vec_vsubuqm(vector unsigned __int128 __a, vector unsigned __int128 __b) {
11793
12295
  return __a - __b;
11794
12296
  }
12297
+ #endif
11795
12298
 
11796
- /* vec_vsubeuqm */
12299
+ static __inline__ vector unsigned char __attribute__((__always_inline__))
12300
+ vec_sub_u128(vector unsigned char __a, vector unsigned char __b) {
12301
+ return __builtin_altivec_vsubuqm(__a, __b);
12302
+ }
11797
12303
 
12304
+ /* vec_vsubeuqm */
11798
12305
 
12306
+ #ifdef __SIZEOF_INT128__
11799
12307
  static __inline__ vector signed __int128 __ATTRS_o_ai
11800
12308
  vec_vsubeuqm(vector signed __int128 __a, vector signed __int128 __b,
11801
12309
  vector signed __int128 __c) {
@@ -11819,9 +12327,17 @@ vec_sube(vector unsigned __int128 __a, vector unsigned __int128 __b,
11819
12327
  vector unsigned __int128 __c) {
11820
12328
  return __builtin_altivec_vsubeuqm(__a, __b, __c);
11821
12329
  }
12330
+ #endif
12331
+
12332
+ static __inline__ vector unsigned char __attribute__((__always_inline__))
12333
+ vec_sube_u128(vector unsigned char __a, vector unsigned char __b,
12334
+ vector unsigned char __c) {
12335
+ return (vector unsigned char)__builtin_altivec_vsubeuqm(__a, __b, __c);
12336
+ }
11822
12337
 
11823
12338
  /* vec_vsubcuq */
11824
12339
 
12340
+ #ifdef __SIZEOF_INT128__
11825
12341
  static __inline__ vector signed __int128 __ATTRS_o_ai
11826
12342
  vec_vsubcuq(vector signed __int128 __a, vector signed __int128 __b) {
11827
12343
  return __builtin_altivec_vsubcuq(__a, __b);
@@ -11845,7 +12361,9 @@ vec_vsubecuq(vector unsigned __int128 __a, vector unsigned __int128 __b,
11845
12361
  vector unsigned __int128 __c) {
11846
12362
  return __builtin_altivec_vsubecuq(__a, __b, __c);
11847
12363
  }
12364
+ #endif
11848
12365
 
12366
+ #ifdef __powerpc64__
11849
12367
  static __inline__ vector signed int __ATTRS_o_ai
11850
12368
  vec_subec(vector signed int __a, vector signed int __b,
11851
12369
  vector signed int __c) {
@@ -11857,7 +12375,9 @@ vec_subec(vector unsigned int __a, vector unsigned int __b,
11857
12375
  vector unsigned int __c) {
11858
12376
  return vec_addec(__a, ~__b, __c);
11859
12377
  }
12378
+ #endif
11860
12379
 
12380
+ #ifdef __SIZEOF_INT128__
11861
12381
  static __inline__ vector signed __int128 __ATTRS_o_ai
11862
12382
  vec_subec(vector signed __int128 __a, vector signed __int128 __b,
11863
12383
  vector signed __int128 __c) {
@@ -11869,7 +12389,14 @@ vec_subec(vector unsigned __int128 __a, vector unsigned __int128 __b,
11869
12389
  vector unsigned __int128 __c) {
11870
12390
  return __builtin_altivec_vsubecuq(__a, __b, __c);
11871
12391
  }
11872
- #endif // defined(__POWER8_VECTOR__) && defined(__powerpc64__)
12392
+ #endif
12393
+
12394
+ static __inline__ vector unsigned char __attribute__((__always_inline__))
12395
+ vec_subec_u128(vector unsigned char __a, vector unsigned char __b,
12396
+ vector unsigned char __c) {
12397
+ return (vector unsigned char)__builtin_altivec_vsubecuq(__a, __b, __c);
12398
+ }
12399
+ #endif // __POWER8_VECTOR__
11873
12400
 
11874
12401
  static __inline__ vector signed int __ATTRS_o_ai
11875
12402
  vec_sube(vector signed int __a, vector signed int __b,
@@ -12012,6 +12539,17 @@ static __inline__ vector double __ATTRS_o_ai vec_trunc(vector double __a) {
12012
12539
  }
12013
12540
  #endif
12014
12541
 
12542
+ /* vec_roundz */
12543
+ static __inline__ vector float __ATTRS_o_ai vec_roundz(vector float __a) {
12544
+ return vec_trunc(__a);
12545
+ }
12546
+
12547
+ #ifdef __VSX__
12548
+ static __inline__ vector double __ATTRS_o_ai vec_roundz(vector double __a) {
12549
+ return vec_trunc(__a);
12550
+ }
12551
+ #endif
12552
+
12015
12553
  /* vec_vrfiz */
12016
12554
 
12017
12555
  static __inline__ vector float __attribute__((__always_inline__))
@@ -12023,6 +12561,13 @@ vec_vrfiz(vector float __a) {
12023
12561
 
12024
12562
  /* The vector unpack instructions all have a big-endian bias, so for
12025
12563
  little endian we must reverse the meanings of "high" and "low." */
12564
+ #ifdef __LITTLE_ENDIAN__
12565
+ #define vec_vupkhpx(__a) __builtin_altivec_vupklpx((vector short)(__a))
12566
+ #define vec_vupklpx(__a) __builtin_altivec_vupkhpx((vector short)(__a))
12567
+ #else
12568
+ #define vec_vupkhpx(__a) __builtin_altivec_vupkhpx((vector short)(__a))
12569
+ #define vec_vupklpx(__a) __builtin_altivec_vupklpx((vector short)(__a))
12570
+ #endif
12026
12571
 
12027
12572
  static __inline__ vector short __ATTRS_o_ai
12028
12573
  vec_unpackh(vector signed char __a) {
@@ -12558,6 +13103,16 @@ static __inline__ void __ATTRS_o_ai vec_vsx_st(vector unsigned char __a,
12558
13103
  #ifdef __VSX__
12559
13104
  #define vec_xxpermdi __builtin_vsx_xxpermdi
12560
13105
  #define vec_xxsldwi __builtin_vsx_xxsldwi
13106
+ #define vec_permi(__a, __b, __c) \
13107
+ _Generic((__a), vector signed long long \
13108
+ : __builtin_shufflevector((__a), (__b), (((__c) >> 1) & 0x1), \
13109
+ (((__c)&0x1) + 2)), \
13110
+ vector unsigned long long \
13111
+ : __builtin_shufflevector((__a), (__b), (((__c) >> 1) & 0x1), \
13112
+ (((__c)&0x1) + 2)), \
13113
+ vector double \
13114
+ : __builtin_shufflevector((__a), (__b), (((__c) >> 1) & 0x1), \
13115
+ (((__c)&0x1) + 2)))
12561
13116
  #endif
12562
13117
 
12563
13118
  /* vec_xor */
@@ -12915,73 +13470,75 @@ vec_vxor(vector bool long long __a, vector bool long long __b) {
12915
13470
  /* vec_extract */
12916
13471
 
12917
13472
  static __inline__ signed char __ATTRS_o_ai vec_extract(vector signed char __a,
12918
- int __b) {
12919
- return __a[__b];
13473
+ signed int __b) {
13474
+ return __a[__b & 0xf];
12920
13475
  }
12921
13476
 
12922
13477
  static __inline__ unsigned char __ATTRS_o_ai
12923
- vec_extract(vector unsigned char __a, int __b) {
12924
- return __a[__b];
13478
+ vec_extract(vector unsigned char __a, signed int __b) {
13479
+ return __a[__b & 0xf];
12925
13480
  }
12926
13481
 
12927
13482
  static __inline__ unsigned char __ATTRS_o_ai vec_extract(vector bool char __a,
12928
- int __b) {
12929
- return __a[__b];
13483
+ signed int __b) {
13484
+ return __a[__b & 0xf];
12930
13485
  }
12931
13486
 
12932
13487
  static __inline__ signed short __ATTRS_o_ai vec_extract(vector signed short __a,
12933
- int __b) {
12934
- return __a[__b];
13488
+ signed int __b) {
13489
+ return __a[__b & 0x7];
12935
13490
  }
12936
13491
 
12937
13492
  static __inline__ unsigned short __ATTRS_o_ai
12938
- vec_extract(vector unsigned short __a, int __b) {
12939
- return __a[__b];
13493
+ vec_extract(vector unsigned short __a, signed int __b) {
13494
+ return __a[__b & 0x7];
12940
13495
  }
12941
13496
 
12942
13497
  static __inline__ unsigned short __ATTRS_o_ai vec_extract(vector bool short __a,
12943
- int __b) {
12944
- return __a[__b];
13498
+ signed int __b) {
13499
+ return __a[__b & 0x7];
12945
13500
  }
12946
13501
 
12947
13502
  static __inline__ signed int __ATTRS_o_ai vec_extract(vector signed int __a,
12948
- int __b) {
12949
- return __a[__b];
13503
+ signed int __b) {
13504
+ return __a[__b & 0x3];
12950
13505
  }
12951
13506
 
12952
13507
  static __inline__ unsigned int __ATTRS_o_ai vec_extract(vector unsigned int __a,
12953
- int __b) {
12954
- return __a[__b];
13508
+ signed int __b) {
13509
+ return __a[__b & 0x3];
12955
13510
  }
12956
13511
 
12957
13512
  static __inline__ unsigned int __ATTRS_o_ai vec_extract(vector bool int __a,
12958
- int __b) {
12959
- return __a[__b];
13513
+ signed int __b) {
13514
+ return __a[__b & 0x3];
12960
13515
  }
12961
13516
 
12962
13517
  #ifdef __VSX__
12963
13518
  static __inline__ signed long long __ATTRS_o_ai
12964
- vec_extract(vector signed long long __a, int __b) {
12965
- return __a[__b];
13519
+ vec_extract(vector signed long long __a, signed int __b) {
13520
+ return __a[__b & 0x1];
12966
13521
  }
12967
13522
 
12968
13523
  static __inline__ unsigned long long __ATTRS_o_ai
12969
- vec_extract(vector unsigned long long __a, int __b) {
12970
- return __a[__b];
13524
+ vec_extract(vector unsigned long long __a, signed int __b) {
13525
+ return __a[__b & 0x1];
12971
13526
  }
12972
13527
 
12973
13528
  static __inline__ unsigned long long __ATTRS_o_ai
12974
- vec_extract(vector bool long long __a, int __b) {
12975
- return __a[__b];
13529
+ vec_extract(vector bool long long __a, signed int __b) {
13530
+ return __a[__b & 0x1];
12976
13531
  }
12977
13532
 
12978
- static __inline__ double __ATTRS_o_ai vec_extract(vector double __a, int __b) {
12979
- return __a[__b];
13533
+ static __inline__ double __ATTRS_o_ai vec_extract(vector double __a,
13534
+ signed int __b) {
13535
+ return __a[__b & 0x1];
12980
13536
  }
12981
13537
  #endif
12982
13538
 
12983
- static __inline__ float __ATTRS_o_ai vec_extract(vector float __a, int __b) {
12984
- return __a[__b];
13539
+ static __inline__ float __ATTRS_o_ai vec_extract(vector float __a,
13540
+ signed int __b) {
13541
+ return __a[__b & 0x3];
12985
13542
  }
12986
13543
 
12987
13544
  #ifdef __POWER9_VECTOR__
@@ -13040,82 +13597,82 @@ vec_extract_fp32_from_shortl(vector unsigned short __a) {
13040
13597
 
13041
13598
  static __inline__ vector signed char __ATTRS_o_ai
13042
13599
  vec_insert(signed char __a, vector signed char __b, int __c) {
13043
- __b[__c] = __a;
13600
+ __b[__c & 0xF] = __a;
13044
13601
  return __b;
13045
13602
  }
13046
13603
 
13047
13604
  static __inline__ vector unsigned char __ATTRS_o_ai
13048
13605
  vec_insert(unsigned char __a, vector unsigned char __b, int __c) {
13049
- __b[__c] = __a;
13606
+ __b[__c & 0xF] = __a;
13050
13607
  return __b;
13051
13608
  }
13052
13609
 
13053
13610
  static __inline__ vector bool char __ATTRS_o_ai vec_insert(unsigned char __a,
13054
13611
  vector bool char __b,
13055
13612
  int __c) {
13056
- __b[__c] = __a;
13613
+ __b[__c & 0xF] = __a;
13057
13614
  return __b;
13058
13615
  }
13059
13616
 
13060
13617
  static __inline__ vector signed short __ATTRS_o_ai
13061
13618
  vec_insert(signed short __a, vector signed short __b, int __c) {
13062
- __b[__c] = __a;
13619
+ __b[__c & 0x7] = __a;
13063
13620
  return __b;
13064
13621
  }
13065
13622
 
13066
13623
  static __inline__ vector unsigned short __ATTRS_o_ai
13067
13624
  vec_insert(unsigned short __a, vector unsigned short __b, int __c) {
13068
- __b[__c] = __a;
13625
+ __b[__c & 0x7] = __a;
13069
13626
  return __b;
13070
13627
  }
13071
13628
 
13072
13629
  static __inline__ vector bool short __ATTRS_o_ai
13073
13630
  vec_insert(unsigned short __a, vector bool short __b, int __c) {
13074
- __b[__c] = __a;
13631
+ __b[__c & 0x7] = __a;
13075
13632
  return __b;
13076
13633
  }
13077
13634
 
13078
13635
  static __inline__ vector signed int __ATTRS_o_ai
13079
13636
  vec_insert(signed int __a, vector signed int __b, int __c) {
13080
- __b[__c] = __a;
13637
+ __b[__c & 0x3] = __a;
13081
13638
  return __b;
13082
13639
  }
13083
13640
 
13084
13641
  static __inline__ vector unsigned int __ATTRS_o_ai
13085
13642
  vec_insert(unsigned int __a, vector unsigned int __b, int __c) {
13086
- __b[__c] = __a;
13643
+ __b[__c & 0x3] = __a;
13087
13644
  return __b;
13088
13645
  }
13089
13646
 
13090
13647
  static __inline__ vector bool int __ATTRS_o_ai vec_insert(unsigned int __a,
13091
13648
  vector bool int __b,
13092
13649
  int __c) {
13093
- __b[__c] = __a;
13650
+ __b[__c & 0x3] = __a;
13094
13651
  return __b;
13095
13652
  }
13096
13653
 
13097
13654
  #ifdef __VSX__
13098
13655
  static __inline__ vector signed long long __ATTRS_o_ai
13099
13656
  vec_insert(signed long long __a, vector signed long long __b, int __c) {
13100
- __b[__c] = __a;
13657
+ __b[__c & 0x1] = __a;
13101
13658
  return __b;
13102
13659
  }
13103
13660
 
13104
13661
  static __inline__ vector unsigned long long __ATTRS_o_ai
13105
13662
  vec_insert(unsigned long long __a, vector unsigned long long __b, int __c) {
13106
- __b[__c] = __a;
13663
+ __b[__c & 0x1] = __a;
13107
13664
  return __b;
13108
13665
  }
13109
13666
 
13110
13667
  static __inline__ vector bool long long __ATTRS_o_ai
13111
13668
  vec_insert(unsigned long long __a, vector bool long long __b, int __c) {
13112
- __b[__c] = __a;
13669
+ __b[__c & 0x1] = __a;
13113
13670
  return __b;
13114
13671
  }
13115
13672
  static __inline__ vector double __ATTRS_o_ai vec_insert(double __a,
13116
13673
  vector double __b,
13117
13674
  int __c) {
13118
- __b[__c] = __a;
13675
+ __b[__c & 0x1] = __a;
13119
13676
  return __b;
13120
13677
  }
13121
13678
  #endif
@@ -13123,7 +13680,7 @@ static __inline__ vector double __ATTRS_o_ai vec_insert(double __a,
13123
13680
  static __inline__ vector float __ATTRS_o_ai vec_insert(float __a,
13124
13681
  vector float __b,
13125
13682
  int __c) {
13126
- __b[__c] = __a;
13683
+ __b[__c & 0x3] = __a;
13127
13684
  return __b;
13128
13685
  }
13129
13686
 
@@ -14022,48 +14579,70 @@ static __inline__ void __ATTRS_o_ai vec_stvrxl(vector float __a, int __b,
14022
14579
  static __inline__ vector signed char __ATTRS_o_ai vec_promote(signed char __a,
14023
14580
  int __b) {
14024
14581
  vector signed char __res = (vector signed char)(0);
14025
- __res[__b] = __a;
14582
+ __res[__b & 0x7] = __a;
14026
14583
  return __res;
14027
14584
  }
14028
14585
 
14029
14586
  static __inline__ vector unsigned char __ATTRS_o_ai
14030
14587
  vec_promote(unsigned char __a, int __b) {
14031
14588
  vector unsigned char __res = (vector unsigned char)(0);
14032
- __res[__b] = __a;
14589
+ __res[__b & 0x7] = __a;
14033
14590
  return __res;
14034
14591
  }
14035
14592
 
14036
14593
  static __inline__ vector short __ATTRS_o_ai vec_promote(short __a, int __b) {
14037
14594
  vector short __res = (vector short)(0);
14038
- __res[__b] = __a;
14595
+ __res[__b & 0x7] = __a;
14039
14596
  return __res;
14040
14597
  }
14041
14598
 
14042
14599
  static __inline__ vector unsigned short __ATTRS_o_ai
14043
14600
  vec_promote(unsigned short __a, int __b) {
14044
14601
  vector unsigned short __res = (vector unsigned short)(0);
14045
- __res[__b] = __a;
14602
+ __res[__b & 0x7] = __a;
14046
14603
  return __res;
14047
14604
  }
14048
14605
 
14049
14606
  static __inline__ vector int __ATTRS_o_ai vec_promote(int __a, int __b) {
14050
14607
  vector int __res = (vector int)(0);
14051
- __res[__b] = __a;
14608
+ __res[__b & 0x3] = __a;
14052
14609
  return __res;
14053
14610
  }
14054
14611
 
14055
14612
  static __inline__ vector unsigned int __ATTRS_o_ai vec_promote(unsigned int __a,
14056
14613
  int __b) {
14057
14614
  vector unsigned int __res = (vector unsigned int)(0);
14058
- __res[__b] = __a;
14615
+ __res[__b & 0x3] = __a;
14059
14616
  return __res;
14060
14617
  }
14061
14618
 
14062
14619
  static __inline__ vector float __ATTRS_o_ai vec_promote(float __a, int __b) {
14063
14620
  vector float __res = (vector float)(0);
14064
- __res[__b] = __a;
14621
+ __res[__b & 0x3] = __a;
14622
+ return __res;
14623
+ }
14624
+
14625
+ #ifdef __VSX__
14626
+ static __inline__ vector double __ATTRS_o_ai vec_promote(double __a, int __b) {
14627
+ vector double __res = (vector double)(0);
14628
+ __res[__b & 0x1] = __a;
14629
+ return __res;
14630
+ }
14631
+
14632
+ static __inline__ vector signed long long __ATTRS_o_ai
14633
+ vec_promote(signed long long __a, int __b) {
14634
+ vector signed long long __res = (vector signed long long)(0);
14635
+ __res[__b & 0x1] = __a;
14636
+ return __res;
14637
+ }
14638
+
14639
+ static __inline__ vector unsigned long long __ATTRS_o_ai
14640
+ vec_promote(unsigned long long __a, int __b) {
14641
+ vector unsigned long long __res = (vector unsigned long long)(0);
14642
+ __res[__b & 0x1] = __a;
14065
14643
  return __res;
14066
14644
  }
14645
+ #endif
14067
14646
 
14068
14647
  /* vec_splats */
14069
14648
 
@@ -14105,7 +14684,8 @@ vec_splats(unsigned long long __a) {
14105
14684
  return (vector unsigned long long)(__a);
14106
14685
  }
14107
14686
 
14108
- #if defined(__POWER8_VECTOR__) && defined(__powerpc64__)
14687
+ #if defined(__POWER8_VECTOR__) && defined(__powerpc64__) && \
14688
+ defined(__SIZEOF_INT128__)
14109
14689
  static __inline__ vector signed __int128 __ATTRS_o_ai
14110
14690
  vec_splats(signed __int128 __a) {
14111
14691
  return (vector signed __int128)(__a);
@@ -14258,45 +14838,46 @@ static __inline__ int __ATTRS_o_ai vec_all_eq(vector bool int __a,
14258
14838
  (vector int)__b);
14259
14839
  }
14260
14840
 
14261
- #ifdef __POWER8_VECTOR__
14841
+ #ifdef __VSX__
14262
14842
  static __inline__ int __ATTRS_o_ai vec_all_eq(vector signed long long __a,
14263
14843
  vector signed long long __b) {
14844
+ #ifdef __POWER8_VECTOR__
14264
14845
  return __builtin_altivec_vcmpequd_p(__CR6_LT, __a, __b);
14846
+ #else
14847
+ // No vcmpequd on Power7 so we xor the two vectors and compare against zero as
14848
+ // 32-bit elements.
14849
+ return vec_all_eq((vector signed int)vec_xor(__a, __b), (vector signed int)0);
14850
+ #endif
14265
14851
  }
14266
14852
 
14267
14853
  static __inline__ int __ATTRS_o_ai vec_all_eq(vector long long __a,
14268
14854
  vector bool long long __b) {
14269
- return __builtin_altivec_vcmpequd_p(__CR6_LT, __a, (vector long long)__b);
14855
+ return vec_all_eq((vector signed long long)__a, (vector signed long long)__b);
14270
14856
  }
14271
14857
 
14272
14858
  static __inline__ int __ATTRS_o_ai vec_all_eq(vector unsigned long long __a,
14273
14859
  vector unsigned long long __b) {
14274
- return __builtin_altivec_vcmpequd_p(__CR6_LT, (vector long long)__a,
14275
- (vector long long)__b);
14860
+ return vec_all_eq((vector signed long long)__a, (vector signed long long)__b);
14276
14861
  }
14277
14862
 
14278
14863
  static __inline__ int __ATTRS_o_ai vec_all_eq(vector unsigned long long __a,
14279
14864
  vector bool long long __b) {
14280
- return __builtin_altivec_vcmpequd_p(__CR6_LT, (vector long long)__a,
14281
- (vector long long)__b);
14865
+ return vec_all_eq((vector signed long long)__a, (vector signed long long)__b);
14282
14866
  }
14283
14867
 
14284
14868
  static __inline__ int __ATTRS_o_ai vec_all_eq(vector bool long long __a,
14285
14869
  vector long long __b) {
14286
- return __builtin_altivec_vcmpequd_p(__CR6_LT, (vector long long)__a,
14287
- (vector long long)__b);
14870
+ return vec_all_eq((vector signed long long)__a, (vector signed long long)__b);
14288
14871
  }
14289
14872
 
14290
14873
  static __inline__ int __ATTRS_o_ai vec_all_eq(vector bool long long __a,
14291
14874
  vector unsigned long long __b) {
14292
- return __builtin_altivec_vcmpequd_p(__CR6_LT, (vector long long)__a,
14293
- (vector long long)__b);
14875
+ return vec_all_eq((vector signed long long)__a, (vector signed long long)__b);
14294
14876
  }
14295
14877
 
14296
14878
  static __inline__ int __ATTRS_o_ai vec_all_eq(vector bool long long __a,
14297
14879
  vector bool long long __b) {
14298
- return __builtin_altivec_vcmpequd_p(__CR6_LT, (vector long long)__a,
14299
- (vector long long)__b);
14880
+ return vec_all_eq((vector signed long long)__a, (vector signed long long)__b);
14300
14881
  }
14301
14882
  #endif
14302
14883
 
@@ -14316,7 +14897,7 @@ static __inline__ int __ATTRS_o_ai vec_all_eq(vector double __a,
14316
14897
  }
14317
14898
  #endif
14318
14899
 
14319
- #ifdef __POWER10_VECTOR__
14900
+ #if defined(__POWER10_VECTOR__) && defined(__SIZEOF_INT128__)
14320
14901
  static __inline__ int __ATTRS_o_ai vec_all_eq(vector signed __int128 __a,
14321
14902
  vector signed __int128 __b) {
14322
14903
  return __builtin_altivec_vcmpequq_p(__CR6_LT, __a, __b);
@@ -14326,6 +14907,11 @@ static __inline__ int __ATTRS_o_ai vec_all_eq(vector unsigned __int128 __a,
14326
14907
  vector unsigned __int128 __b) {
14327
14908
  return __builtin_altivec_vcmpequq_p(__CR6_LT, __a, __b);
14328
14909
  }
14910
+
14911
+ static __inline__ int __ATTRS_o_ai vec_all_eq(vector bool __int128 __a,
14912
+ vector bool __int128 __b) {
14913
+ return __builtin_altivec_vcmpequq_p(__CR6_LT, __a, __b);
14914
+ }
14329
14915
  #endif
14330
14916
 
14331
14917
  /* vec_all_ge */
@@ -14352,8 +14938,7 @@ static __inline__ int __ATTRS_o_ai vec_all_ge(vector unsigned char __a,
14352
14938
 
14353
14939
  static __inline__ int __ATTRS_o_ai vec_all_ge(vector bool char __a,
14354
14940
  vector signed char __b) {
14355
- return __builtin_altivec_vcmpgtub_p(__CR6_EQ, (vector unsigned char)__b,
14356
- (vector unsigned char)__a);
14941
+ return __builtin_altivec_vcmpgtsb_p(__CR6_EQ, __b, (vector signed char)__a);
14357
14942
  }
14358
14943
 
14359
14944
  static __inline__ int __ATTRS_o_ai vec_all_ge(vector bool char __a,
@@ -14390,8 +14975,7 @@ static __inline__ int __ATTRS_o_ai vec_all_ge(vector unsigned short __a,
14390
14975
 
14391
14976
  static __inline__ int __ATTRS_o_ai vec_all_ge(vector bool short __a,
14392
14977
  vector short __b) {
14393
- return __builtin_altivec_vcmpgtuh_p(__CR6_EQ, (vector unsigned short)__b,
14394
- (vector unsigned short)__a);
14978
+ return __builtin_altivec_vcmpgtsh_p(__CR6_EQ, __b, (vector signed short)__a);
14395
14979
  }
14396
14980
 
14397
14981
  static __inline__ int __ATTRS_o_ai vec_all_ge(vector bool short __a,
@@ -14427,8 +15011,7 @@ static __inline__ int __ATTRS_o_ai vec_all_ge(vector unsigned int __a,
14427
15011
 
14428
15012
  static __inline__ int __ATTRS_o_ai vec_all_ge(vector bool int __a,
14429
15013
  vector int __b) {
14430
- return __builtin_altivec_vcmpgtuw_p(__CR6_EQ, (vector unsigned int)__b,
14431
- (vector unsigned int)__a);
15014
+ return __builtin_altivec_vcmpgtsw_p(__CR6_EQ, __b, (vector signed int)__a);
14432
15015
  }
14433
15016
 
14434
15017
  static __inline__ int __ATTRS_o_ai vec_all_ge(vector bool int __a,
@@ -14442,7 +15025,7 @@ static __inline__ int __ATTRS_o_ai vec_all_ge(vector bool int __a,
14442
15025
  (vector unsigned int)__a);
14443
15026
  }
14444
15027
 
14445
- #ifdef __POWER8_VECTOR__
15028
+ #ifdef __VSX__
14446
15029
  static __inline__ int __ATTRS_o_ai vec_all_ge(vector signed long long __a,
14447
15030
  vector signed long long __b) {
14448
15031
  return __builtin_altivec_vcmpgtsd_p(__CR6_EQ, __b, __a);
@@ -14466,8 +15049,8 @@ static __inline__ int __ATTRS_o_ai vec_all_ge(vector unsigned long long __a,
14466
15049
 
14467
15050
  static __inline__ int __ATTRS_o_ai vec_all_ge(vector bool long long __a,
14468
15051
  vector signed long long __b) {
14469
- return __builtin_altivec_vcmpgtud_p(__CR6_EQ, (vector unsigned long long)__b,
14470
- (vector unsigned long long)__a);
15052
+ return __builtin_altivec_vcmpgtsd_p(__CR6_EQ, __b,
15053
+ (vector signed long long)__a);
14471
15054
  }
14472
15055
 
14473
15056
  static __inline__ int __ATTRS_o_ai vec_all_ge(vector bool long long __a,
@@ -14499,7 +15082,7 @@ static __inline__ int __ATTRS_o_ai vec_all_ge(vector double __a,
14499
15082
  }
14500
15083
  #endif
14501
15084
 
14502
- #ifdef __POWER10_VECTOR__
15085
+ #if defined(__POWER10_VECTOR__) && defined(__SIZEOF_INT128__)
14503
15086
  static __inline__ int __ATTRS_o_ai vec_all_ge(vector signed __int128 __a,
14504
15087
  vector signed __int128 __b) {
14505
15088
  return __builtin_altivec_vcmpgtsq_p(__CR6_EQ, __b, __a);
@@ -14535,8 +15118,7 @@ static __inline__ int __ATTRS_o_ai vec_all_gt(vector unsigned char __a,
14535
15118
 
14536
15119
  static __inline__ int __ATTRS_o_ai vec_all_gt(vector bool char __a,
14537
15120
  vector signed char __b) {
14538
- return __builtin_altivec_vcmpgtub_p(__CR6_LT, (vector unsigned char)__a,
14539
- (vector unsigned char)__b);
15121
+ return __builtin_altivec_vcmpgtsb_p(__CR6_LT, (vector signed char)__a, __b);
14540
15122
  }
14541
15123
 
14542
15124
  static __inline__ int __ATTRS_o_ai vec_all_gt(vector bool char __a,
@@ -14573,8 +15155,7 @@ static __inline__ int __ATTRS_o_ai vec_all_gt(vector unsigned short __a,
14573
15155
 
14574
15156
  static __inline__ int __ATTRS_o_ai vec_all_gt(vector bool short __a,
14575
15157
  vector short __b) {
14576
- return __builtin_altivec_vcmpgtuh_p(__CR6_LT, (vector unsigned short)__a,
14577
- (vector unsigned short)__b);
15158
+ return __builtin_altivec_vcmpgtsh_p(__CR6_LT, (vector signed short)__a, __b);
14578
15159
  }
14579
15160
 
14580
15161
  static __inline__ int __ATTRS_o_ai vec_all_gt(vector bool short __a,
@@ -14610,8 +15191,7 @@ static __inline__ int __ATTRS_o_ai vec_all_gt(vector unsigned int __a,
14610
15191
 
14611
15192
  static __inline__ int __ATTRS_o_ai vec_all_gt(vector bool int __a,
14612
15193
  vector int __b) {
14613
- return __builtin_altivec_vcmpgtuw_p(__CR6_LT, (vector unsigned int)__a,
14614
- (vector unsigned int)__b);
15194
+ return __builtin_altivec_vcmpgtsw_p(__CR6_LT, (vector signed int)__a, __b);
14615
15195
  }
14616
15196
 
14617
15197
  static __inline__ int __ATTRS_o_ai vec_all_gt(vector bool int __a,
@@ -14625,7 +15205,7 @@ static __inline__ int __ATTRS_o_ai vec_all_gt(vector bool int __a,
14625
15205
  (vector unsigned int)__b);
14626
15206
  }
14627
15207
 
14628
- #ifdef __POWER8_VECTOR__
15208
+ #ifdef __VSX__
14629
15209
  static __inline__ int __ATTRS_o_ai vec_all_gt(vector signed long long __a,
14630
15210
  vector signed long long __b) {
14631
15211
  return __builtin_altivec_vcmpgtsd_p(__CR6_LT, __a, __b);
@@ -14649,8 +15229,8 @@ static __inline__ int __ATTRS_o_ai vec_all_gt(vector unsigned long long __a,
14649
15229
 
14650
15230
  static __inline__ int __ATTRS_o_ai vec_all_gt(vector bool long long __a,
14651
15231
  vector signed long long __b) {
14652
- return __builtin_altivec_vcmpgtud_p(__CR6_LT, (vector unsigned long long)__a,
14653
- (vector unsigned long long)__b);
15232
+ return __builtin_altivec_vcmpgtsd_p(__CR6_LT, (vector signed long long)__a,
15233
+ __b);
14654
15234
  }
14655
15235
 
14656
15236
  static __inline__ int __ATTRS_o_ai vec_all_gt(vector bool long long __a,
@@ -14682,7 +15262,7 @@ static __inline__ int __ATTRS_o_ai vec_all_gt(vector double __a,
14682
15262
  }
14683
15263
  #endif
14684
15264
 
14685
- #ifdef __POWER10_VECTOR__
15265
+ #if defined(__POWER10_VECTOR__) && defined(__SIZEOF_INT128__)
14686
15266
  static __inline__ int __ATTRS_o_ai vec_all_gt(vector signed __int128 __a,
14687
15267
  vector signed __int128 __b) {
14688
15268
  return __builtin_altivec_vcmpgtsq_p(__CR6_LT, __a, __b);
@@ -14725,8 +15305,7 @@ static __inline__ int __ATTRS_o_ai vec_all_le(vector unsigned char __a,
14725
15305
 
14726
15306
  static __inline__ int __ATTRS_o_ai vec_all_le(vector bool char __a,
14727
15307
  vector signed char __b) {
14728
- return __builtin_altivec_vcmpgtub_p(__CR6_EQ, (vector unsigned char)__a,
14729
- (vector unsigned char)__b);
15308
+ return __builtin_altivec_vcmpgtsb_p(__CR6_EQ, (vector signed char)__a, __b);
14730
15309
  }
14731
15310
 
14732
15311
  static __inline__ int __ATTRS_o_ai vec_all_le(vector bool char __a,
@@ -14763,8 +15342,7 @@ static __inline__ int __ATTRS_o_ai vec_all_le(vector unsigned short __a,
14763
15342
 
14764
15343
  static __inline__ int __ATTRS_o_ai vec_all_le(vector bool short __a,
14765
15344
  vector short __b) {
14766
- return __builtin_altivec_vcmpgtuh_p(__CR6_EQ, (vector unsigned short)__a,
14767
- (vector unsigned short)__b);
15345
+ return __builtin_altivec_vcmpgtsh_p(__CR6_EQ, (vector signed short)__a, __b);
14768
15346
  }
14769
15347
 
14770
15348
  static __inline__ int __ATTRS_o_ai vec_all_le(vector bool short __a,
@@ -14800,8 +15378,7 @@ static __inline__ int __ATTRS_o_ai vec_all_le(vector unsigned int __a,
14800
15378
 
14801
15379
  static __inline__ int __ATTRS_o_ai vec_all_le(vector bool int __a,
14802
15380
  vector int __b) {
14803
- return __builtin_altivec_vcmpgtuw_p(__CR6_EQ, (vector unsigned int)__a,
14804
- (vector unsigned int)__b);
15381
+ return __builtin_altivec_vcmpgtsw_p(__CR6_EQ, (vector signed int)__a, __b);
14805
15382
  }
14806
15383
 
14807
15384
  static __inline__ int __ATTRS_o_ai vec_all_le(vector bool int __a,
@@ -14815,7 +15392,7 @@ static __inline__ int __ATTRS_o_ai vec_all_le(vector bool int __a,
14815
15392
  (vector unsigned int)__b);
14816
15393
  }
14817
15394
 
14818
- #ifdef __POWER8_VECTOR__
15395
+ #ifdef __VSX__
14819
15396
  static __inline__ int __ATTRS_o_ai vec_all_le(vector signed long long __a,
14820
15397
  vector signed long long __b) {
14821
15398
  return __builtin_altivec_vcmpgtsd_p(__CR6_EQ, __a, __b);
@@ -14840,8 +15417,8 @@ static __inline__ int __ATTRS_o_ai vec_all_le(vector unsigned long long __a,
14840
15417
 
14841
15418
  static __inline__ int __ATTRS_o_ai vec_all_le(vector bool long long __a,
14842
15419
  vector signed long long __b) {
14843
- return __builtin_altivec_vcmpgtud_p(__CR6_EQ, (vector unsigned long long)__a,
14844
- (vector unsigned long long)__b);
15420
+ return __builtin_altivec_vcmpgtsd_p(__CR6_EQ, (vector signed long long)__a,
15421
+ __b);
14845
15422
  }
14846
15423
 
14847
15424
  static __inline__ int __ATTRS_o_ai vec_all_le(vector bool long long __a,
@@ -14873,7 +15450,7 @@ static __inline__ int __ATTRS_o_ai vec_all_le(vector double __a,
14873
15450
  }
14874
15451
  #endif
14875
15452
 
14876
- #ifdef __POWER10_VECTOR__
15453
+ #if defined(__POWER10_VECTOR__) && defined(__SIZEOF_INT128__)
14877
15454
  static __inline__ int __ATTRS_o_ai vec_all_le(vector signed __int128 __a,
14878
15455
  vector signed __int128 __b) {
14879
15456
  return __builtin_altivec_vcmpgtsq_p(__CR6_EQ, __a, __b);
@@ -14909,8 +15486,7 @@ static __inline__ int __ATTRS_o_ai vec_all_lt(vector unsigned char __a,
14909
15486
 
14910
15487
  static __inline__ int __ATTRS_o_ai vec_all_lt(vector bool char __a,
14911
15488
  vector signed char __b) {
14912
- return __builtin_altivec_vcmpgtub_p(__CR6_LT, (vector unsigned char)__b,
14913
- (vector unsigned char)__a);
15489
+ return __builtin_altivec_vcmpgtsb_p(__CR6_LT, __b, (vector signed char)__a);
14914
15490
  }
14915
15491
 
14916
15492
  static __inline__ int __ATTRS_o_ai vec_all_lt(vector bool char __a,
@@ -14947,8 +15523,7 @@ static __inline__ int __ATTRS_o_ai vec_all_lt(vector unsigned short __a,
14947
15523
 
14948
15524
  static __inline__ int __ATTRS_o_ai vec_all_lt(vector bool short __a,
14949
15525
  vector short __b) {
14950
- return __builtin_altivec_vcmpgtuh_p(__CR6_LT, (vector unsigned short)__b,
14951
- (vector unsigned short)__a);
15526
+ return __builtin_altivec_vcmpgtsh_p(__CR6_LT, __b, (vector signed short)__a);
14952
15527
  }
14953
15528
 
14954
15529
  static __inline__ int __ATTRS_o_ai vec_all_lt(vector bool short __a,
@@ -14984,8 +15559,7 @@ static __inline__ int __ATTRS_o_ai vec_all_lt(vector unsigned int __a,
14984
15559
 
14985
15560
  static __inline__ int __ATTRS_o_ai vec_all_lt(vector bool int __a,
14986
15561
  vector int __b) {
14987
- return __builtin_altivec_vcmpgtuw_p(__CR6_LT, (vector unsigned int)__b,
14988
- (vector unsigned int)__a);
15562
+ return __builtin_altivec_vcmpgtsw_p(__CR6_LT, __b, (vector signed int)__a);
14989
15563
  }
14990
15564
 
14991
15565
  static __inline__ int __ATTRS_o_ai vec_all_lt(vector bool int __a,
@@ -14999,7 +15573,7 @@ static __inline__ int __ATTRS_o_ai vec_all_lt(vector bool int __a,
14999
15573
  (vector unsigned int)__a);
15000
15574
  }
15001
15575
 
15002
- #ifdef __POWER8_VECTOR__
15576
+ #ifdef __VSX__
15003
15577
  static __inline__ int __ATTRS_o_ai vec_all_lt(vector signed long long __a,
15004
15578
  vector signed long long __b) {
15005
15579
  return __builtin_altivec_vcmpgtsd_p(__CR6_LT, __b, __a);
@@ -15024,8 +15598,8 @@ static __inline__ int __ATTRS_o_ai vec_all_lt(vector unsigned long long __a,
15024
15598
 
15025
15599
  static __inline__ int __ATTRS_o_ai vec_all_lt(vector bool long long __a,
15026
15600
  vector signed long long __b) {
15027
- return __builtin_altivec_vcmpgtud_p(__CR6_LT, (vector unsigned long long)__b,
15028
- (vector unsigned long long)__a);
15601
+ return __builtin_altivec_vcmpgtsd_p(__CR6_LT, __b,
15602
+ (vector signed long long)__a);
15029
15603
  }
15030
15604
 
15031
15605
  static __inline__ int __ATTRS_o_ai vec_all_lt(vector bool long long __a,
@@ -15057,7 +15631,7 @@ static __inline__ int __ATTRS_o_ai vec_all_lt(vector double __a,
15057
15631
  }
15058
15632
  #endif
15059
15633
 
15060
- #ifdef __POWER10_VECTOR__
15634
+ #if defined(__POWER10_VECTOR__) && defined(__SIZEOF_INT128__)
15061
15635
  static __inline__ int __ATTRS_o_ai vec_all_lt(vector signed __int128 __a,
15062
15636
  vector signed __int128 __b) {
15063
15637
  return __builtin_altivec_vcmpgtsq_p(__CR6_LT, __b, __a);
@@ -15214,7 +15788,7 @@ static __inline__ int __ATTRS_o_ai vec_all_ne(vector bool int __a,
15214
15788
  (vector int)__b);
15215
15789
  }
15216
15790
 
15217
- #ifdef __POWER8_VECTOR__
15791
+ #ifdef __VSX__
15218
15792
  static __inline__ int __ATTRS_o_ai vec_all_ne(vector signed long long __a,
15219
15793
  vector signed long long __b) {
15220
15794
  return __builtin_altivec_vcmpequd_p(__CR6_EQ, __a, __b);
@@ -15273,7 +15847,7 @@ static __inline__ int __ATTRS_o_ai vec_all_ne(vector double __a,
15273
15847
  }
15274
15848
  #endif
15275
15849
 
15276
- #ifdef __POWER10_VECTOR__
15850
+ #if defined(__POWER10_VECTOR__) && defined(__SIZEOF_INT128__)
15277
15851
  static __inline__ int __ATTRS_o_ai vec_all_ne(vector signed __int128 __a,
15278
15852
  vector signed __int128 __b) {
15279
15853
  return __builtin_altivec_vcmpequq_p(__CR6_EQ, __a, __b);
@@ -15283,6 +15857,11 @@ static __inline__ int __ATTRS_o_ai vec_all_ne(vector unsigned __int128 __a,
15283
15857
  vector unsigned __int128 __b) {
15284
15858
  return __builtin_altivec_vcmpequq_p(__CR6_EQ, __a, __b);
15285
15859
  }
15860
+
15861
+ static __inline__ int __ATTRS_o_ai vec_all_ne(vector bool __int128 __a,
15862
+ vector bool __int128 __b) {
15863
+ return __builtin_altivec_vcmpequq_p(__CR6_EQ, __a, __b);
15864
+ }
15286
15865
  #endif
15287
15866
 
15288
15867
  /* vec_all_nge */
@@ -15323,25 +15902,57 @@ static __inline__ int __ATTRS_o_ai vec_all_ngt(vector double __a,
15323
15902
 
15324
15903
  /* vec_all_nle */
15325
15904
 
15326
- static __inline__ int __attribute__((__always_inline__))
15905
+ static __inline__ int __ATTRS_o_ai
15327
15906
  vec_all_nle(vector float __a, vector float __b) {
15907
+ #ifdef __VSX__
15908
+ return __builtin_vsx_xvcmpgesp_p(__CR6_EQ, __b, __a);
15909
+ #else
15328
15910
  return __builtin_altivec_vcmpgefp_p(__CR6_EQ, __b, __a);
15911
+ #endif
15912
+ }
15913
+
15914
+ #ifdef __VSX__
15915
+ static __inline__ int __ATTRS_o_ai vec_all_nle(vector double __a,
15916
+ vector double __b) {
15917
+ return __builtin_vsx_xvcmpgedp_p(__CR6_EQ, __b, __a);
15329
15918
  }
15919
+ #endif
15330
15920
 
15331
15921
  /* vec_all_nlt */
15332
15922
 
15333
- static __inline__ int __attribute__((__always_inline__))
15923
+ static __inline__ int __ATTRS_o_ai
15334
15924
  vec_all_nlt(vector float __a, vector float __b) {
15925
+ #ifdef __VSX__
15926
+ return __builtin_vsx_xvcmpgtsp_p(__CR6_EQ, __b, __a);
15927
+ #else
15335
15928
  return __builtin_altivec_vcmpgtfp_p(__CR6_EQ, __b, __a);
15929
+ #endif
15336
15930
  }
15337
15931
 
15932
+ #ifdef __VSX__
15933
+ static __inline__ int __ATTRS_o_ai vec_all_nlt(vector double __a,
15934
+ vector double __b) {
15935
+ return __builtin_vsx_xvcmpgtdp_p(__CR6_EQ, __b, __a);
15936
+ }
15937
+ #endif
15938
+
15338
15939
  /* vec_all_numeric */
15339
15940
 
15340
- static __inline__ int __attribute__((__always_inline__))
15941
+ static __inline__ int __ATTRS_o_ai
15341
15942
  vec_all_numeric(vector float __a) {
15943
+ #ifdef __VSX__
15944
+ return __builtin_vsx_xvcmpeqsp_p(__CR6_LT, __a, __a);
15945
+ #else
15342
15946
  return __builtin_altivec_vcmpeqfp_p(__CR6_LT, __a, __a);
15947
+ #endif
15343
15948
  }
15344
15949
 
15950
+ #ifdef __VSX__
15951
+ static __inline__ int __ATTRS_o_ai vec_all_numeric(vector double __a) {
15952
+ return __builtin_vsx_xvcmpeqdp_p(__CR6_LT, __a, __a);
15953
+ }
15954
+ #endif
15955
+
15345
15956
  /* vec_any_eq */
15346
15957
 
15347
15958
  static __inline__ int __ATTRS_o_ai vec_any_eq(vector signed char __a,
@@ -15471,7 +16082,7 @@ static __inline__ int __ATTRS_o_ai vec_any_eq(vector bool int __a,
15471
16082
  (vector int)__b);
15472
16083
  }
15473
16084
 
15474
- #ifdef __POWER8_VECTOR__
16085
+ #ifdef __VSX__
15475
16086
  static __inline__ int __ATTRS_o_ai vec_any_eq(vector signed long long __a,
15476
16087
  vector signed long long __b) {
15477
16088
  return __builtin_altivec_vcmpequd_p(__CR6_EQ_REV, __a, __b);
@@ -15530,7 +16141,7 @@ static __inline__ int __ATTRS_o_ai vec_any_eq(vector double __a,
15530
16141
  }
15531
16142
  #endif
15532
16143
 
15533
- #ifdef __POWER10_VECTOR__
16144
+ #if defined(__POWER10_VECTOR__) && defined(__SIZEOF_INT128__)
15534
16145
  static __inline__ int __ATTRS_o_ai vec_any_eq(vector signed __int128 __a,
15535
16146
  vector signed __int128 __b) {
15536
16147
  return __builtin_altivec_vcmpequq_p(__CR6_EQ_REV, __a, __b);
@@ -15540,6 +16151,11 @@ static __inline__ int __ATTRS_o_ai vec_any_eq(vector unsigned __int128 __a,
15540
16151
  vector unsigned __int128 __b) {
15541
16152
  return __builtin_altivec_vcmpequq_p(__CR6_EQ_REV, __a, __b);
15542
16153
  }
16154
+
16155
+ static __inline__ int __ATTRS_o_ai vec_any_eq(vector bool __int128 __a,
16156
+ vector bool __int128 __b) {
16157
+ return __builtin_altivec_vcmpequq_p(__CR6_EQ_REV, __a, __b);
16158
+ }
15543
16159
  #endif
15544
16160
 
15545
16161
  /* vec_any_ge */
@@ -15568,8 +16184,8 @@ static __inline__ int __ATTRS_o_ai vec_any_ge(vector unsigned char __a,
15568
16184
 
15569
16185
  static __inline__ int __ATTRS_o_ai vec_any_ge(vector bool char __a,
15570
16186
  vector signed char __b) {
15571
- return __builtin_altivec_vcmpgtub_p(__CR6_LT_REV, (vector unsigned char)__b,
15572
- (vector unsigned char)__a);
16187
+ return __builtin_altivec_vcmpgtsb_p(__CR6_LT_REV, __b,
16188
+ (vector signed char)__a);
15573
16189
  }
15574
16190
 
15575
16191
  static __inline__ int __ATTRS_o_ai vec_any_ge(vector bool char __a,
@@ -15607,8 +16223,8 @@ static __inline__ int __ATTRS_o_ai vec_any_ge(vector unsigned short __a,
15607
16223
 
15608
16224
  static __inline__ int __ATTRS_o_ai vec_any_ge(vector bool short __a,
15609
16225
  vector short __b) {
15610
- return __builtin_altivec_vcmpgtuh_p(__CR6_LT_REV, (vector unsigned short)__b,
15611
- (vector unsigned short)__a);
16226
+ return __builtin_altivec_vcmpgtsh_p(__CR6_LT_REV, __b,
16227
+ (vector signed short)__a);
15612
16228
  }
15613
16229
 
15614
16230
  static __inline__ int __ATTRS_o_ai vec_any_ge(vector bool short __a,
@@ -15645,8 +16261,8 @@ static __inline__ int __ATTRS_o_ai vec_any_ge(vector unsigned int __a,
15645
16261
 
15646
16262
  static __inline__ int __ATTRS_o_ai vec_any_ge(vector bool int __a,
15647
16263
  vector int __b) {
15648
- return __builtin_altivec_vcmpgtuw_p(__CR6_LT_REV, (vector unsigned int)__b,
15649
- (vector unsigned int)__a);
16264
+ return __builtin_altivec_vcmpgtsw_p(__CR6_LT_REV, __b,
16265
+ (vector signed int)__a);
15650
16266
  }
15651
16267
 
15652
16268
  static __inline__ int __ATTRS_o_ai vec_any_ge(vector bool int __a,
@@ -15661,7 +16277,7 @@ static __inline__ int __ATTRS_o_ai vec_any_ge(vector bool int __a,
15661
16277
  (vector unsigned int)__a);
15662
16278
  }
15663
16279
 
15664
- #ifdef __POWER8_VECTOR__
16280
+ #ifdef __VSX__
15665
16281
  static __inline__ int __ATTRS_o_ai vec_any_ge(vector signed long long __a,
15666
16282
  vector signed long long __b) {
15667
16283
  return __builtin_altivec_vcmpgtsd_p(__CR6_LT_REV, __b, __a);
@@ -15686,9 +16302,8 @@ static __inline__ int __ATTRS_o_ai vec_any_ge(vector unsigned long long __a,
15686
16302
 
15687
16303
  static __inline__ int __ATTRS_o_ai vec_any_ge(vector bool long long __a,
15688
16304
  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);
16305
+ return __builtin_altivec_vcmpgtsd_p(__CR6_LT_REV, __b,
16306
+ (vector signed long long)__a);
15692
16307
  }
15693
16308
 
15694
16309
  static __inline__ int __ATTRS_o_ai vec_any_ge(vector bool long long __a,
@@ -15721,7 +16336,7 @@ static __inline__ int __ATTRS_o_ai vec_any_ge(vector double __a,
15721
16336
  }
15722
16337
  #endif
15723
16338
 
15724
- #ifdef __POWER10_VECTOR__
16339
+ #if defined(__POWER10_VECTOR__) && defined(__SIZEOF_INT128__)
15725
16340
  static __inline__ int __ATTRS_o_ai vec_any_ge(vector signed __int128 __a,
15726
16341
  vector signed __int128 __b) {
15727
16342
  return __builtin_altivec_vcmpgtsq_p(__CR6_LT_REV, __b, __a);
@@ -15759,8 +16374,8 @@ static __inline__ int __ATTRS_o_ai vec_any_gt(vector unsigned char __a,
15759
16374
 
15760
16375
  static __inline__ int __ATTRS_o_ai vec_any_gt(vector bool char __a,
15761
16376
  vector signed char __b) {
15762
- return __builtin_altivec_vcmpgtub_p(__CR6_EQ_REV, (vector unsigned char)__a,
15763
- (vector unsigned char)__b);
16377
+ return __builtin_altivec_vcmpgtsb_p(__CR6_EQ_REV, (vector signed char)__a,
16378
+ __b);
15764
16379
  }
15765
16380
 
15766
16381
  static __inline__ int __ATTRS_o_ai vec_any_gt(vector bool char __a,
@@ -15798,8 +16413,8 @@ static __inline__ int __ATTRS_o_ai vec_any_gt(vector unsigned short __a,
15798
16413
 
15799
16414
  static __inline__ int __ATTRS_o_ai vec_any_gt(vector bool short __a,
15800
16415
  vector short __b) {
15801
- return __builtin_altivec_vcmpgtuh_p(__CR6_EQ_REV, (vector unsigned short)__a,
15802
- (vector unsigned short)__b);
16416
+ return __builtin_altivec_vcmpgtsh_p(__CR6_EQ_REV, (vector signed short)__a,
16417
+ __b);
15803
16418
  }
15804
16419
 
15805
16420
  static __inline__ int __ATTRS_o_ai vec_any_gt(vector bool short __a,
@@ -15836,8 +16451,8 @@ static __inline__ int __ATTRS_o_ai vec_any_gt(vector unsigned int __a,
15836
16451
 
15837
16452
  static __inline__ int __ATTRS_o_ai vec_any_gt(vector bool int __a,
15838
16453
  vector int __b) {
15839
- return __builtin_altivec_vcmpgtuw_p(__CR6_EQ_REV, (vector unsigned int)__a,
15840
- (vector unsigned int)__b);
16454
+ return __builtin_altivec_vcmpgtsw_p(__CR6_EQ_REV, (vector signed int)__a,
16455
+ __b);
15841
16456
  }
15842
16457
 
15843
16458
  static __inline__ int __ATTRS_o_ai vec_any_gt(vector bool int __a,
@@ -15852,7 +16467,7 @@ static __inline__ int __ATTRS_o_ai vec_any_gt(vector bool int __a,
15852
16467
  (vector unsigned int)__b);
15853
16468
  }
15854
16469
 
15855
- #ifdef __POWER8_VECTOR__
16470
+ #ifdef __VSX__
15856
16471
  static __inline__ int __ATTRS_o_ai vec_any_gt(vector signed long long __a,
15857
16472
  vector signed long long __b) {
15858
16473
  return __builtin_altivec_vcmpgtsd_p(__CR6_EQ_REV, __a, __b);
@@ -15877,9 +16492,8 @@ static __inline__ int __ATTRS_o_ai vec_any_gt(vector unsigned long long __a,
15877
16492
 
15878
16493
  static __inline__ int __ATTRS_o_ai vec_any_gt(vector bool long long __a,
15879
16494
  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);
16495
+ return __builtin_altivec_vcmpgtsd_p(__CR6_EQ_REV,
16496
+ (vector signed long long)__a, __b);
15883
16497
  }
15884
16498
 
15885
16499
  static __inline__ int __ATTRS_o_ai vec_any_gt(vector bool long long __a,
@@ -15912,7 +16526,7 @@ static __inline__ int __ATTRS_o_ai vec_any_gt(vector double __a,
15912
16526
  }
15913
16527
  #endif
15914
16528
 
15915
- #ifdef __POWER10_VECTOR__
16529
+ #if defined(__POWER10_VECTOR__) && defined(__SIZEOF_INT128__)
15916
16530
  static __inline__ int __ATTRS_o_ai vec_any_gt(vector signed __int128 __a,
15917
16531
  vector signed __int128 __b) {
15918
16532
  return __builtin_altivec_vcmpgtsq_p(__CR6_EQ_REV, __a, __b);
@@ -15950,8 +16564,8 @@ static __inline__ int __ATTRS_o_ai vec_any_le(vector unsigned char __a,
15950
16564
 
15951
16565
  static __inline__ int __ATTRS_o_ai vec_any_le(vector bool char __a,
15952
16566
  vector signed char __b) {
15953
- return __builtin_altivec_vcmpgtub_p(__CR6_LT_REV, (vector unsigned char)__a,
15954
- (vector unsigned char)__b);
16567
+ return __builtin_altivec_vcmpgtsb_p(__CR6_LT_REV, (vector signed char)__a,
16568
+ __b);
15955
16569
  }
15956
16570
 
15957
16571
  static __inline__ int __ATTRS_o_ai vec_any_le(vector bool char __a,
@@ -15989,8 +16603,8 @@ static __inline__ int __ATTRS_o_ai vec_any_le(vector unsigned short __a,
15989
16603
 
15990
16604
  static __inline__ int __ATTRS_o_ai vec_any_le(vector bool short __a,
15991
16605
  vector short __b) {
15992
- return __builtin_altivec_vcmpgtuh_p(__CR6_LT_REV, (vector unsigned short)__a,
15993
- (vector unsigned short)__b);
16606
+ return __builtin_altivec_vcmpgtsh_p(__CR6_LT_REV, (vector signed short)__a,
16607
+ __b);
15994
16608
  }
15995
16609
 
15996
16610
  static __inline__ int __ATTRS_o_ai vec_any_le(vector bool short __a,
@@ -16027,8 +16641,8 @@ static __inline__ int __ATTRS_o_ai vec_any_le(vector unsigned int __a,
16027
16641
 
16028
16642
  static __inline__ int __ATTRS_o_ai vec_any_le(vector bool int __a,
16029
16643
  vector int __b) {
16030
- return __builtin_altivec_vcmpgtuw_p(__CR6_LT_REV, (vector unsigned int)__a,
16031
- (vector unsigned int)__b);
16644
+ return __builtin_altivec_vcmpgtsw_p(__CR6_LT_REV, (vector signed int)__a,
16645
+ __b);
16032
16646
  }
16033
16647
 
16034
16648
  static __inline__ int __ATTRS_o_ai vec_any_le(vector bool int __a,
@@ -16043,7 +16657,7 @@ static __inline__ int __ATTRS_o_ai vec_any_le(vector bool int __a,
16043
16657
  (vector unsigned int)__b);
16044
16658
  }
16045
16659
 
16046
- #ifdef __POWER8_VECTOR__
16660
+ #ifdef __VSX__
16047
16661
  static __inline__ int __ATTRS_o_ai vec_any_le(vector signed long long __a,
16048
16662
  vector signed long long __b) {
16049
16663
  return __builtin_altivec_vcmpgtsd_p(__CR6_LT_REV, __a, __b);
@@ -16068,9 +16682,8 @@ static __inline__ int __ATTRS_o_ai vec_any_le(vector unsigned long long __a,
16068
16682
 
16069
16683
  static __inline__ int __ATTRS_o_ai vec_any_le(vector bool long long __a,
16070
16684
  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);
16685
+ return __builtin_altivec_vcmpgtsd_p(__CR6_LT_REV,
16686
+ (vector signed long long)__a, __b);
16074
16687
  }
16075
16688
 
16076
16689
  static __inline__ int __ATTRS_o_ai vec_any_le(vector bool long long __a,
@@ -16103,7 +16716,7 @@ static __inline__ int __ATTRS_o_ai vec_any_le(vector double __a,
16103
16716
  }
16104
16717
  #endif
16105
16718
 
16106
- #ifdef __POWER10_VECTOR__
16719
+ #if defined(__POWER10_VECTOR__) && defined(__SIZEOF_INT128__)
16107
16720
  static __inline__ int __ATTRS_o_ai vec_any_le(vector signed __int128 __a,
16108
16721
  vector signed __int128 __b) {
16109
16722
  return __builtin_altivec_vcmpgtsq_p(__CR6_LT_REV, __a, __b);
@@ -16141,8 +16754,8 @@ static __inline__ int __ATTRS_o_ai vec_any_lt(vector unsigned char __a,
16141
16754
 
16142
16755
  static __inline__ int __ATTRS_o_ai vec_any_lt(vector bool char __a,
16143
16756
  vector signed char __b) {
16144
- return __builtin_altivec_vcmpgtub_p(__CR6_EQ_REV, (vector unsigned char)__b,
16145
- (vector unsigned char)__a);
16757
+ return __builtin_altivec_vcmpgtsb_p(__CR6_EQ_REV, __b,
16758
+ (vector signed char)__a);
16146
16759
  }
16147
16760
 
16148
16761
  static __inline__ int __ATTRS_o_ai vec_any_lt(vector bool char __a,
@@ -16180,8 +16793,8 @@ static __inline__ int __ATTRS_o_ai vec_any_lt(vector unsigned short __a,
16180
16793
 
16181
16794
  static __inline__ int __ATTRS_o_ai vec_any_lt(vector bool short __a,
16182
16795
  vector short __b) {
16183
- return __builtin_altivec_vcmpgtuh_p(__CR6_EQ_REV, (vector unsigned short)__b,
16184
- (vector unsigned short)__a);
16796
+ return __builtin_altivec_vcmpgtsh_p(__CR6_EQ_REV, __b,
16797
+ (vector signed short)__a);
16185
16798
  }
16186
16799
 
16187
16800
  static __inline__ int __ATTRS_o_ai vec_any_lt(vector bool short __a,
@@ -16218,8 +16831,8 @@ static __inline__ int __ATTRS_o_ai vec_any_lt(vector unsigned int __a,
16218
16831
 
16219
16832
  static __inline__ int __ATTRS_o_ai vec_any_lt(vector bool int __a,
16220
16833
  vector int __b) {
16221
- return __builtin_altivec_vcmpgtuw_p(__CR6_EQ_REV, (vector unsigned int)__b,
16222
- (vector unsigned int)__a);
16834
+ return __builtin_altivec_vcmpgtsw_p(__CR6_EQ_REV, __b,
16835
+ (vector signed int)__a);
16223
16836
  }
16224
16837
 
16225
16838
  static __inline__ int __ATTRS_o_ai vec_any_lt(vector bool int __a,
@@ -16234,7 +16847,7 @@ static __inline__ int __ATTRS_o_ai vec_any_lt(vector bool int __a,
16234
16847
  (vector unsigned int)__a);
16235
16848
  }
16236
16849
 
16237
- #ifdef __POWER8_VECTOR__
16850
+ #ifdef __VSX__
16238
16851
  static __inline__ int __ATTRS_o_ai vec_any_lt(vector signed long long __a,
16239
16852
  vector signed long long __b) {
16240
16853
  return __builtin_altivec_vcmpgtsd_p(__CR6_EQ_REV, __b, __a);
@@ -16259,9 +16872,8 @@ static __inline__ int __ATTRS_o_ai vec_any_lt(vector unsigned long long __a,
16259
16872
 
16260
16873
  static __inline__ int __ATTRS_o_ai vec_any_lt(vector bool long long __a,
16261
16874
  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);
16875
+ return __builtin_altivec_vcmpgtsd_p(__CR6_EQ_REV, __b,
16876
+ (vector signed long long)__a);
16265
16877
  }
16266
16878
 
16267
16879
  static __inline__ int __ATTRS_o_ai vec_any_lt(vector bool long long __a,
@@ -16294,7 +16906,7 @@ static __inline__ int __ATTRS_o_ai vec_any_lt(vector double __a,
16294
16906
  }
16295
16907
  #endif
16296
16908
 
16297
- #ifdef __POWER10_VECTOR__
16909
+ #if defined(__POWER10_VECTOR__) && defined(__SIZEOF_INT128__)
16298
16910
  static __inline__ int __ATTRS_o_ai vec_any_lt(vector signed __int128 __a,
16299
16911
  vector signed __int128 __b) {
16300
16912
  return __builtin_altivec_vcmpgtsq_p(__CR6_EQ_REV, __b, __a);
@@ -16308,10 +16920,18 @@ static __inline__ int __ATTRS_o_ai vec_any_lt(vector unsigned __int128 __a,
16308
16920
 
16309
16921
  /* vec_any_nan */
16310
16922
 
16311
- static __inline__ int __attribute__((__always_inline__))
16312
- vec_any_nan(vector float __a) {
16923
+ static __inline__ int __ATTRS_o_ai vec_any_nan(vector float __a) {
16924
+ #ifdef __VSX__
16925
+ return __builtin_vsx_xvcmpeqsp_p(__CR6_LT_REV, __a, __a);
16926
+ #else
16313
16927
  return __builtin_altivec_vcmpeqfp_p(__CR6_LT_REV, __a, __a);
16928
+ #endif
16929
+ }
16930
+ #ifdef __VSX__
16931
+ static __inline__ int __ATTRS_o_ai vec_any_nan(vector double __a) {
16932
+ return __builtin_vsx_xvcmpeqdp_p(__CR6_LT_REV, __a, __a);
16314
16933
  }
16934
+ #endif
16315
16935
 
16316
16936
  /* vec_any_ne */
16317
16937
 
@@ -16442,46 +17062,46 @@ static __inline__ int __ATTRS_o_ai vec_any_ne(vector bool int __a,
16442
17062
  (vector int)__b);
16443
17063
  }
16444
17064
 
16445
- #ifdef __POWER8_VECTOR__
17065
+ #ifdef __VSX__
16446
17066
  static __inline__ int __ATTRS_o_ai vec_any_ne(vector signed long long __a,
16447
17067
  vector signed long long __b) {
17068
+ #ifdef __POWER8_VECTOR__
16448
17069
  return __builtin_altivec_vcmpequd_p(__CR6_LT_REV, __a, __b);
17070
+ #else
17071
+ // Take advantage of the optimized sequence for vec_all_eq when vcmpequd is
17072
+ // not available.
17073
+ return !vec_all_eq(__a, __b);
17074
+ #endif
16449
17075
  }
16450
17076
 
16451
17077
  static __inline__ int __ATTRS_o_ai vec_any_ne(vector unsigned long long __a,
16452
17078
  vector unsigned long long __b) {
16453
- return __builtin_altivec_vcmpequd_p(__CR6_LT_REV, (vector long long)__a,
16454
- (vector long long)__b);
17079
+ return vec_any_ne((vector signed long long)__a, (vector signed long long)__b);
16455
17080
  }
16456
17081
 
16457
17082
  static __inline__ int __ATTRS_o_ai vec_any_ne(vector signed long long __a,
16458
17083
  vector bool long long __b) {
16459
- return __builtin_altivec_vcmpequd_p(__CR6_LT_REV, __a,
16460
- (vector signed long long)__b);
17084
+ return vec_any_ne((vector signed long long)__a, (vector signed long long)__b);
16461
17085
  }
16462
17086
 
16463
17087
  static __inline__ int __ATTRS_o_ai vec_any_ne(vector unsigned long long __a,
16464
17088
  vector bool long long __b) {
16465
- return __builtin_altivec_vcmpequd_p(
16466
- __CR6_LT_REV, (vector signed long long)__a, (vector signed long long)__b);
17089
+ return vec_any_ne((vector signed long long)__a, (vector signed long long)__b);
16467
17090
  }
16468
17091
 
16469
17092
  static __inline__ int __ATTRS_o_ai vec_any_ne(vector bool long long __a,
16470
17093
  vector signed long long __b) {
16471
- return __builtin_altivec_vcmpequd_p(
16472
- __CR6_LT_REV, (vector signed long long)__a, (vector signed long long)__b);
17094
+ return vec_any_ne((vector signed long long)__a, (vector signed long long)__b);
16473
17095
  }
16474
17096
 
16475
17097
  static __inline__ int __ATTRS_o_ai vec_any_ne(vector bool long long __a,
16476
17098
  vector unsigned long long __b) {
16477
- return __builtin_altivec_vcmpequd_p(
16478
- __CR6_LT_REV, (vector signed long long)__a, (vector signed long long)__b);
17099
+ return vec_any_ne((vector signed long long)__a, (vector signed long long)__b);
16479
17100
  }
16480
17101
 
16481
17102
  static __inline__ int __ATTRS_o_ai vec_any_ne(vector bool long long __a,
16482
17103
  vector bool long long __b) {
16483
- return __builtin_altivec_vcmpequd_p(
16484
- __CR6_LT_REV, (vector signed long long)__a, (vector signed long long)__b);
17104
+ return vec_any_ne((vector signed long long)__a, (vector signed long long)__b);
16485
17105
  }
16486
17106
  #endif
16487
17107
 
@@ -16501,7 +17121,7 @@ static __inline__ int __ATTRS_o_ai vec_any_ne(vector double __a,
16501
17121
  }
16502
17122
  #endif
16503
17123
 
16504
- #ifdef __POWER10_VECTOR__
17124
+ #if defined(__POWER10_VECTOR__) && defined(__SIZEOF_INT128__)
16505
17125
  static __inline__ int __ATTRS_o_ai vec_any_ne(vector signed __int128 __a,
16506
17126
  vector signed __int128 __b) {
16507
17127
  return __builtin_altivec_vcmpequq_p(__CR6_LT_REV, __a, __b);
@@ -16511,42 +17131,100 @@ static __inline__ int __ATTRS_o_ai vec_any_ne(vector unsigned __int128 __a,
16511
17131
  vector unsigned __int128 __b) {
16512
17132
  return __builtin_altivec_vcmpequq_p(__CR6_LT_REV, __a, __b);
16513
17133
  }
17134
+
17135
+ static __inline__ int __ATTRS_o_ai vec_any_ne(vector bool __int128 __a,
17136
+ vector bool __int128 __b) {
17137
+ return __builtin_altivec_vcmpequq_p(__CR6_LT_REV, __a, __b);
17138
+ }
16514
17139
  #endif
16515
17140
 
16516
17141
  /* vec_any_nge */
16517
17142
 
16518
- static __inline__ int __attribute__((__always_inline__))
16519
- vec_any_nge(vector float __a, vector float __b) {
17143
+ static __inline__ int __ATTRS_o_ai vec_any_nge(vector float __a,
17144
+ vector float __b) {
17145
+ #ifdef __VSX__
17146
+ return __builtin_vsx_xvcmpgesp_p(__CR6_LT_REV, __a, __b);
17147
+ #else
16520
17148
  return __builtin_altivec_vcmpgefp_p(__CR6_LT_REV, __a, __b);
17149
+ #endif
16521
17150
  }
16522
17151
 
17152
+ #ifdef __VSX__
17153
+ static __inline__ int __ATTRS_o_ai vec_any_nge(vector double __a,
17154
+ vector double __b) {
17155
+ return __builtin_vsx_xvcmpgedp_p(__CR6_LT_REV, __a, __b);
17156
+ }
17157
+ #endif
17158
+
16523
17159
  /* vec_any_ngt */
16524
17160
 
16525
- static __inline__ int __attribute__((__always_inline__))
16526
- vec_any_ngt(vector float __a, vector float __b) {
17161
+ static __inline__ int __ATTRS_o_ai vec_any_ngt(vector float __a,
17162
+ vector float __b) {
17163
+ #ifdef __VSX__
17164
+ return __builtin_vsx_xvcmpgtsp_p(__CR6_LT_REV, __a, __b);
17165
+ #else
16527
17166
  return __builtin_altivec_vcmpgtfp_p(__CR6_LT_REV, __a, __b);
17167
+ #endif
17168
+ }
17169
+
17170
+ #ifdef __VSX__
17171
+ static __inline__ int __ATTRS_o_ai vec_any_ngt(vector double __a,
17172
+ vector double __b) {
17173
+ return __builtin_vsx_xvcmpgtdp_p(__CR6_LT_REV, __a, __b);
16528
17174
  }
17175
+ #endif
16529
17176
 
16530
17177
  /* vec_any_nle */
16531
17178
 
16532
- static __inline__ int __attribute__((__always_inline__))
16533
- vec_any_nle(vector float __a, vector float __b) {
17179
+ static __inline__ int __ATTRS_o_ai vec_any_nle(vector float __a,
17180
+ vector float __b) {
17181
+ #ifdef __VSX__
17182
+ return __builtin_vsx_xvcmpgesp_p(__CR6_LT_REV, __b, __a);
17183
+ #else
16534
17184
  return __builtin_altivec_vcmpgefp_p(__CR6_LT_REV, __b, __a);
17185
+ #endif
16535
17186
  }
16536
17187
 
17188
+ #ifdef __VSX__
17189
+ static __inline__ int __ATTRS_o_ai vec_any_nle(vector double __a,
17190
+ vector double __b) {
17191
+ return __builtin_vsx_xvcmpgedp_p(__CR6_LT_REV, __b, __a);
17192
+ }
17193
+ #endif
17194
+
16537
17195
  /* vec_any_nlt */
16538
17196
 
16539
- static __inline__ int __attribute__((__always_inline__))
16540
- vec_any_nlt(vector float __a, vector float __b) {
17197
+ static __inline__ int __ATTRS_o_ai vec_any_nlt(vector float __a,
17198
+ vector float __b) {
17199
+ #ifdef __VSX__
17200
+ return __builtin_vsx_xvcmpgtsp_p(__CR6_LT_REV, __b, __a);
17201
+ #else
16541
17202
  return __builtin_altivec_vcmpgtfp_p(__CR6_LT_REV, __b, __a);
17203
+ #endif
17204
+ }
17205
+
17206
+ #ifdef __VSX__
17207
+ static __inline__ int __ATTRS_o_ai vec_any_nlt(vector double __a,
17208
+ vector double __b) {
17209
+ return __builtin_vsx_xvcmpgtdp_p(__CR6_LT_REV, __b, __a);
16542
17210
  }
17211
+ #endif
16543
17212
 
16544
17213
  /* vec_any_numeric */
16545
17214
 
16546
- static __inline__ int __attribute__((__always_inline__))
16547
- vec_any_numeric(vector float __a) {
17215
+ static __inline__ int __ATTRS_o_ai vec_any_numeric(vector float __a) {
17216
+ #ifdef __VSX__
17217
+ return __builtin_vsx_xvcmpeqsp_p(__CR6_EQ_REV, __a, __a);
17218
+ #else
16548
17219
  return __builtin_altivec_vcmpeqfp_p(__CR6_EQ_REV, __a, __a);
17220
+ #endif
17221
+ }
17222
+
17223
+ #ifdef __VSX__
17224
+ static __inline__ int __ATTRS_o_ai vec_any_numeric(vector double __a) {
17225
+ return __builtin_vsx_xvcmpeqdp_p(__CR6_EQ_REV, __a, __a);
16549
17226
  }
17227
+ #endif
16550
17228
 
16551
17229
  /* vec_any_out */
16552
17230
 
@@ -16575,6 +17253,7 @@ provided.
16575
17253
  #define vec_ncipher_be __builtin_altivec_crypto_vncipher
16576
17254
  #define vec_ncipherlast_be __builtin_altivec_crypto_vncipherlast
16577
17255
 
17256
+ #ifdef __VSX__
16578
17257
  static __inline__ vector unsigned long long __attribute__((__always_inline__))
16579
17258
  __builtin_crypto_vsbox(vector unsigned long long __a) {
16580
17259
  return __builtin_altivec_crypto_vsbox(__a);
@@ -16603,6 +17282,7 @@ __builtin_crypto_vncipherlast(vector unsigned long long __a,
16603
17282
  vector unsigned long long __b) {
16604
17283
  return __builtin_altivec_crypto_vncipherlast(__a, __b);
16605
17284
  }
17285
+ #endif /* __VSX__ */
16606
17286
 
16607
17287
  #define __builtin_crypto_vshasigmad __builtin_altivec_crypto_vshasigmad
16608
17288
  #define __builtin_crypto_vshasigmaw __builtin_altivec_crypto_vshasigmaw
@@ -16696,6 +17376,16 @@ vec_vgbbd(vector unsigned char __a) {
16696
17376
  return __builtin_altivec_vgbbd(__a);
16697
17377
  }
16698
17378
 
17379
+ static __inline__ vector signed long long __ATTRS_o_ai
17380
+ vec_gbb(vector signed long long __a) {
17381
+ return __builtin_altivec_vgbbd((vector unsigned char)__a);
17382
+ }
17383
+
17384
+ static __inline__ vector unsigned long long __ATTRS_o_ai
17385
+ vec_gbb(vector unsigned long long __a) {
17386
+ return __builtin_altivec_vgbbd((vector unsigned char)__a);
17387
+ }
17388
+
16699
17389
  static __inline__ vector long long __ATTRS_o_ai
16700
17390
  vec_vbpermq(vector signed char __a, vector signed char __b) {
16701
17391
  return __builtin_altivec_vbpermq((vector unsigned char)__a,
@@ -16707,13 +17397,23 @@ vec_vbpermq(vector unsigned char __a, vector unsigned char __b) {
16707
17397
  return __builtin_altivec_vbpermq(__a, __b);
16708
17398
  }
16709
17399
 
16710
- #ifdef __powerpc64__
16711
- static __inline__ vector unsigned long long __attribute__((__always_inline__))
17400
+ #if defined(__powerpc64__) && defined(__SIZEOF_INT128__)
17401
+ static __inline__ vector unsigned long long __ATTRS_o_ai
16712
17402
  vec_bperm(vector unsigned __int128 __a, vector unsigned char __b) {
16713
17403
  return __builtin_altivec_vbpermq((vector unsigned char)__a,
16714
17404
  (vector unsigned char)__b);
16715
17405
  }
16716
17406
  #endif
17407
+ static __inline__ vector unsigned char __ATTRS_o_ai
17408
+ vec_bperm(vector unsigned char __a, vector unsigned char __b) {
17409
+ return __builtin_altivec_vbpermq(__a, __b);
17410
+ }
17411
+ #endif // __POWER8_VECTOR__
17412
+ #ifdef __POWER9_VECTOR__
17413
+ static __inline__ vector unsigned long long __ATTRS_o_ai
17414
+ vec_bperm(vector unsigned long long __a, vector unsigned char __b) {
17415
+ return __builtin_altivec_vbpermd(__a, __b);
17416
+ }
16717
17417
  #endif
16718
17418
 
16719
17419
 
@@ -16882,7 +17582,8 @@ vec_revb(vector double __a) {
16882
17582
  }
16883
17583
  #endif /* End __VSX__ */
16884
17584
 
16885
- #if defined(__POWER8_VECTOR__) && defined(__powerpc64__)
17585
+ #if defined(__POWER8_VECTOR__) && defined(__powerpc64__) && \
17586
+ defined(__SIZEOF_INT128__)
16886
17587
  static __inline__ vector signed __int128 __ATTRS_o_ai
16887
17588
  vec_revb(vector signed __int128 __a) {
16888
17589
  vector unsigned char __indices =
@@ -16904,6 +17605,8 @@ vec_revb(vector unsigned __int128 __a) {
16904
17605
 
16905
17606
  /* vec_xl */
16906
17607
 
17608
+ #define vec_xld2 vec_xl
17609
+ #define vec_xlw4 vec_xl
16907
17610
  typedef vector signed char unaligned_vec_schar __attribute__((aligned(1)));
16908
17611
  typedef vector unsigned char unaligned_vec_uchar __attribute__((aligned(1)));
16909
17612
  typedef vector signed short unaligned_vec_sshort __attribute__((aligned(1)));
@@ -16912,41 +17615,41 @@ typedef vector signed int unaligned_vec_sint __attribute__((aligned(1)));
16912
17615
  typedef vector unsigned int unaligned_vec_uint __attribute__((aligned(1)));
16913
17616
  typedef vector float unaligned_vec_float __attribute__((aligned(1)));
16914
17617
 
16915
- static inline __ATTRS_o_ai vector signed char vec_xl(signed long long __offset,
17618
+ static inline __ATTRS_o_ai vector signed char vec_xl(ptrdiff_t __offset,
16916
17619
  const signed char *__ptr) {
16917
17620
  return *(unaligned_vec_schar *)(__ptr + __offset);
16918
17621
  }
16919
17622
 
16920
17623
  static inline __ATTRS_o_ai vector unsigned char
16921
- vec_xl(signed long long __offset, const unsigned char *__ptr) {
17624
+ vec_xl(ptrdiff_t __offset, const unsigned char *__ptr) {
16922
17625
  return *(unaligned_vec_uchar*)(__ptr + __offset);
16923
17626
  }
16924
17627
 
16925
- static inline __ATTRS_o_ai vector signed short vec_xl(signed long long __offset,
16926
- const signed short *__ptr) {
17628
+ static inline __ATTRS_o_ai vector signed short
17629
+ vec_xl(ptrdiff_t __offset, const signed short *__ptr) {
16927
17630
  signed char *__addr = (signed char *)__ptr + __offset;
16928
17631
  return *(unaligned_vec_sshort *)__addr;
16929
17632
  }
16930
17633
 
16931
17634
  static inline __ATTRS_o_ai vector unsigned short
16932
- vec_xl(signed long long __offset, const unsigned short *__ptr) {
17635
+ vec_xl(ptrdiff_t __offset, const unsigned short *__ptr) {
16933
17636
  signed char *__addr = (signed char *)__ptr + __offset;
16934
17637
  return *(unaligned_vec_ushort *)__addr;
16935
17638
  }
16936
17639
 
16937
- static inline __ATTRS_o_ai vector signed int vec_xl(signed long long __offset,
17640
+ static inline __ATTRS_o_ai vector signed int vec_xl(ptrdiff_t __offset,
16938
17641
  const signed int *__ptr) {
16939
17642
  signed char *__addr = (signed char *)__ptr + __offset;
16940
17643
  return *(unaligned_vec_sint *)__addr;
16941
17644
  }
16942
17645
 
16943
- static inline __ATTRS_o_ai vector unsigned int vec_xl(signed long long __offset,
16944
- const unsigned int *__ptr) {
17646
+ static inline __ATTRS_o_ai vector unsigned int
17647
+ vec_xl(ptrdiff_t __offset, const unsigned int *__ptr) {
16945
17648
  signed char *__addr = (signed char *)__ptr + __offset;
16946
17649
  return *(unaligned_vec_uint *)__addr;
16947
17650
  }
16948
17651
 
16949
- static inline __ATTRS_o_ai vector float vec_xl(signed long long __offset,
17652
+ static inline __ATTRS_o_ai vector float vec_xl(ptrdiff_t __offset,
16950
17653
  const float *__ptr) {
16951
17654
  signed char *__addr = (signed char *)__ptr + __offset;
16952
17655
  return *(unaligned_vec_float *)__addr;
@@ -16958,36 +17661,37 @@ typedef vector unsigned long long unaligned_vec_ull __attribute__((aligned(1)));
16958
17661
  typedef vector double unaligned_vec_double __attribute__((aligned(1)));
16959
17662
 
16960
17663
  static inline __ATTRS_o_ai vector signed long long
16961
- vec_xl(signed long long __offset, const signed long long *__ptr) {
17664
+ vec_xl(ptrdiff_t __offset, const signed long long *__ptr) {
16962
17665
  signed char *__addr = (signed char *)__ptr + __offset;
16963
17666
  return *(unaligned_vec_sll *)__addr;
16964
17667
  }
16965
17668
 
16966
17669
  static inline __ATTRS_o_ai vector unsigned long long
16967
- vec_xl(signed long long __offset, const unsigned long long *__ptr) {
17670
+ vec_xl(ptrdiff_t __offset, const unsigned long long *__ptr) {
16968
17671
  signed char *__addr = (signed char *)__ptr + __offset;
16969
17672
  return *(unaligned_vec_ull *)__addr;
16970
17673
  }
16971
17674
 
16972
- static inline __ATTRS_o_ai vector double vec_xl(signed long long __offset,
17675
+ static inline __ATTRS_o_ai vector double vec_xl(ptrdiff_t __offset,
16973
17676
  const double *__ptr) {
16974
17677
  signed char *__addr = (signed char *)__ptr + __offset;
16975
17678
  return *(unaligned_vec_double *)__addr;
16976
17679
  }
16977
17680
  #endif
16978
17681
 
16979
- #if defined(__POWER8_VECTOR__) && defined(__powerpc64__)
17682
+ #if defined(__POWER8_VECTOR__) && defined(__powerpc64__) && \
17683
+ defined(__SIZEOF_INT128__)
16980
17684
  typedef vector signed __int128 unaligned_vec_si128 __attribute__((aligned(1)));
16981
17685
  typedef vector unsigned __int128 unaligned_vec_ui128
16982
17686
  __attribute__((aligned(1)));
16983
17687
  static inline __ATTRS_o_ai vector signed __int128
16984
- vec_xl(signed long long __offset, const signed __int128 *__ptr) {
17688
+ vec_xl(ptrdiff_t __offset, const signed __int128 *__ptr) {
16985
17689
  signed char *__addr = (signed char *)__ptr + __offset;
16986
17690
  return *(unaligned_vec_si128 *)__addr;
16987
17691
  }
16988
17692
 
16989
17693
  static inline __ATTRS_o_ai vector unsigned __int128
16990
- vec_xl(signed long long __offset, const unsigned __int128 *__ptr) {
17694
+ vec_xl(ptrdiff_t __offset, const unsigned __int128 *__ptr) {
16991
17695
  signed char *__addr = (signed char *)__ptr + __offset;
16992
17696
  return *(unaligned_vec_ui128 *)__addr;
16993
17697
  }
@@ -16997,27 +17701,27 @@ vec_xl(signed long long __offset, const unsigned __int128 *__ptr) {
16997
17701
 
16998
17702
  #ifdef __LITTLE_ENDIAN__
16999
17703
  static __inline__ vector signed char __ATTRS_o_ai
17000
- vec_xl_be(signed long long __offset, const signed char *__ptr) {
17704
+ vec_xl_be(ptrdiff_t __offset, const signed char *__ptr) {
17001
17705
  vector signed char __vec = (vector signed char)__builtin_vsx_lxvd2x_be(__offset, __ptr);
17002
17706
  return __builtin_shufflevector(__vec, __vec, 7, 6, 5, 4, 3, 2, 1, 0, 15, 14,
17003
17707
  13, 12, 11, 10, 9, 8);
17004
17708
  }
17005
17709
 
17006
17710
  static __inline__ vector unsigned char __ATTRS_o_ai
17007
- vec_xl_be(signed long long __offset, const unsigned char *__ptr) {
17711
+ vec_xl_be(ptrdiff_t __offset, const unsigned char *__ptr) {
17008
17712
  vector unsigned char __vec = (vector unsigned char)__builtin_vsx_lxvd2x_be(__offset, __ptr);
17009
17713
  return __builtin_shufflevector(__vec, __vec, 7, 6, 5, 4, 3, 2, 1, 0, 15, 14,
17010
17714
  13, 12, 11, 10, 9, 8);
17011
17715
  }
17012
17716
 
17013
- static __inline__ vector signed short __ATTRS_o_ai
17014
- vec_xl_be(signed long long __offset, const signed short *__ptr) {
17717
+ static __inline__ vector signed short __ATTRS_o_ai
17718
+ vec_xl_be(ptrdiff_t __offset, const signed short *__ptr) {
17015
17719
  vector signed short __vec = (vector signed short)__builtin_vsx_lxvd2x_be(__offset, __ptr);
17016
17720
  return __builtin_shufflevector(__vec, __vec, 3, 2, 1, 0, 7, 6, 5, 4);
17017
17721
  }
17018
17722
 
17019
17723
  static __inline__ vector unsigned short __ATTRS_o_ai
17020
- vec_xl_be(signed long long __offset, const unsigned short *__ptr) {
17724
+ vec_xl_be(ptrdiff_t __offset, const unsigned short *__ptr) {
17021
17725
  vector unsigned short __vec = (vector unsigned short)__builtin_vsx_lxvd2x_be(__offset, __ptr);
17022
17726
  return __builtin_shufflevector(__vec, __vec, 3, 2, 1, 0, 7, 6, 5, 4);
17023
17727
  }
@@ -17054,7 +17758,8 @@ vec_xl_be(signed long long __offset, const double *__ptr) {
17054
17758
  }
17055
17759
  #endif
17056
17760
 
17057
- #if defined(__POWER8_VECTOR__) && defined(__powerpc64__)
17761
+ #if defined(__POWER8_VECTOR__) && defined(__powerpc64__) && \
17762
+ defined(__SIZEOF_INT128__)
17058
17763
  static __inline__ vector signed __int128 __ATTRS_o_ai
17059
17764
  vec_xl_be(signed long long __offset, const signed __int128 *__ptr) {
17060
17765
  return vec_xl(__offset, __ptr);
@@ -17069,98 +17774,153 @@ vec_xl_be(signed long long __offset, const unsigned __int128 *__ptr) {
17069
17774
  #define vec_xl_be vec_xl
17070
17775
  #endif
17071
17776
 
17072
- #if defined(__POWER10_VECTOR__) && defined(__VSX__)
17777
+ #if defined(__POWER10_VECTOR__) && defined(__VSX__) && \
17778
+ defined(__SIZEOF_INT128__)
17073
17779
 
17074
17780
  /* vect_xl_sext */
17075
17781
 
17076
17782
  static __inline__ vector unsigned __int128 __ATTRS_o_ai
17077
- vec_xl_sext(signed long long __offset, const signed char *__pointer) {
17783
+ vec_xl_sext(ptrdiff_t __offset, const signed char *__pointer) {
17078
17784
  return (vector unsigned __int128)*(__pointer + __offset);
17079
17785
  }
17080
17786
 
17081
17787
  static __inline__ vector unsigned __int128 __ATTRS_o_ai
17082
- vec_xl_sext(signed long long __offset, const signed short *__pointer) {
17788
+ vec_xl_sext(ptrdiff_t __offset, const signed short *__pointer) {
17083
17789
  return (vector unsigned __int128)*(__pointer + __offset);
17084
17790
  }
17085
17791
 
17086
17792
  static __inline__ vector unsigned __int128 __ATTRS_o_ai
17087
- vec_xl_sext(signed long long __offset, const signed int *__pointer) {
17793
+ vec_xl_sext(ptrdiff_t __offset, const signed int *__pointer) {
17088
17794
  return (vector unsigned __int128)*(__pointer + __offset);
17089
17795
  }
17090
17796
 
17091
17797
  static __inline__ vector unsigned __int128 __ATTRS_o_ai
17092
- vec_xl_sext(signed long long __offset, const signed long long *__pointer) {
17798
+ vec_xl_sext(ptrdiff_t __offset, const signed long long *__pointer) {
17093
17799
  return (vector unsigned __int128)*(__pointer + __offset);
17094
17800
  }
17095
17801
 
17096
17802
  /* vec_xl_zext */
17097
17803
 
17098
17804
  static __inline__ vector unsigned __int128 __ATTRS_o_ai
17099
- vec_xl_zext(signed long long __offset, const unsigned char *__pointer) {
17805
+ vec_xl_zext(ptrdiff_t __offset, const unsigned char *__pointer) {
17100
17806
  return (vector unsigned __int128)*(__pointer + __offset);
17101
17807
  }
17102
17808
 
17103
17809
  static __inline__ vector unsigned __int128 __ATTRS_o_ai
17104
- vec_xl_zext(signed long long __offset, const unsigned short *__pointer) {
17810
+ vec_xl_zext(ptrdiff_t __offset, const unsigned short *__pointer) {
17105
17811
  return (vector unsigned __int128)*(__pointer + __offset);
17106
17812
  }
17107
17813
 
17108
17814
  static __inline__ vector unsigned __int128 __ATTRS_o_ai
17109
- vec_xl_zext(signed long long __offset, const unsigned int *__pointer) {
17815
+ vec_xl_zext(ptrdiff_t __offset, const unsigned int *__pointer) {
17110
17816
  return (vector unsigned __int128)*(__pointer + __offset);
17111
17817
  }
17112
17818
 
17113
17819
  static __inline__ vector unsigned __int128 __ATTRS_o_ai
17114
- vec_xl_zext(signed long long __offset, const unsigned long long *__pointer) {
17820
+ vec_xl_zext(ptrdiff_t __offset, const unsigned long long *__pointer) {
17115
17821
  return (vector unsigned __int128)*(__pointer + __offset);
17116
17822
  }
17117
17823
 
17118
17824
  #endif
17119
17825
 
17826
+ /* vec_xlds */
17827
+ #ifdef __VSX__
17828
+ static __inline__ vector signed long long __ATTRS_o_ai
17829
+ vec_xlds(ptrdiff_t __offset, const signed long long *__ptr) {
17830
+ signed long long *__addr = (signed long long*)((signed char *)__ptr + __offset);
17831
+ return (vector signed long long) *__addr;
17832
+ }
17833
+
17834
+ static __inline__ vector unsigned long long __ATTRS_o_ai
17835
+ vec_xlds(ptrdiff_t __offset, const unsigned long long *__ptr) {
17836
+ unsigned long long *__addr = (unsigned long long *)((signed char *)__ptr + __offset);
17837
+ return (unaligned_vec_ull) *__addr;
17838
+ }
17839
+
17840
+ static __inline__ vector double __ATTRS_o_ai vec_xlds(ptrdiff_t __offset,
17841
+ const double *__ptr) {
17842
+ double *__addr = (double*)((signed char *)__ptr + __offset);
17843
+ return (unaligned_vec_double) *__addr;
17844
+ }
17845
+
17846
+ /* vec_load_splats */
17847
+ static __inline__ vector signed int __ATTRS_o_ai
17848
+ vec_load_splats(signed long long __offset, const signed int *__ptr) {
17849
+ signed int *__addr = (signed int*)((signed char *)__ptr + __offset);
17850
+ return (vector signed int)*__addr;
17851
+ }
17852
+
17853
+ static __inline__ vector signed int __ATTRS_o_ai
17854
+ vec_load_splats(unsigned long long __offset, const signed int *__ptr) {
17855
+ signed int *__addr = (signed int*)((signed char *)__ptr + __offset);
17856
+ return (vector signed int)*__addr;
17857
+ }
17858
+
17859
+ static __inline__ vector unsigned int __ATTRS_o_ai
17860
+ vec_load_splats(signed long long __offset, const unsigned int *__ptr) {
17861
+ unsigned int *__addr = (unsigned int*)((signed char *)__ptr + __offset);
17862
+ return (vector unsigned int)*__addr;
17863
+ }
17864
+
17865
+ static __inline__ vector unsigned int __ATTRS_o_ai
17866
+ vec_load_splats(unsigned long long __offset, const unsigned int *__ptr) {
17867
+ unsigned int *__addr = (unsigned int*)((signed char *)__ptr + __offset);
17868
+ return (vector unsigned int)*__addr;
17869
+ }
17870
+
17871
+ static __inline__ vector float __ATTRS_o_ai
17872
+ vec_load_splats(signed long long __offset, const float *__ptr) {
17873
+ float *__addr = (float*)((signed char *)__ptr + __offset);
17874
+ return (vector float)*__addr;
17875
+ }
17876
+
17877
+ static __inline__ vector float __ATTRS_o_ai
17878
+ vec_load_splats(unsigned long long __offset, const float *__ptr) {
17879
+ float *__addr = (float*)((signed char *)__ptr + __offset);
17880
+ return (vector float)*__addr;
17881
+ }
17882
+ #endif
17883
+
17120
17884
  /* vec_xst */
17121
17885
 
17122
- static inline __ATTRS_o_ai void vec_xst(vector signed char __vec,
17123
- signed long long __offset,
17124
- signed char *__ptr) {
17886
+ #define vec_xstd2 vec_xst
17887
+ #define vec_xstw4 vec_xst
17888
+ static inline __ATTRS_o_ai void
17889
+ vec_xst(vector signed char __vec, ptrdiff_t __offset, signed char *__ptr) {
17125
17890
  *(unaligned_vec_schar *)(__ptr + __offset) = __vec;
17126
17891
  }
17127
17892
 
17128
- static inline __ATTRS_o_ai void vec_xst(vector unsigned char __vec,
17129
- signed long long __offset,
17130
- unsigned char *__ptr) {
17893
+ static inline __ATTRS_o_ai void
17894
+ vec_xst(vector unsigned char __vec, ptrdiff_t __offset, unsigned char *__ptr) {
17131
17895
  *(unaligned_vec_uchar *)(__ptr + __offset) = __vec;
17132
17896
  }
17133
17897
 
17134
- static inline __ATTRS_o_ai void vec_xst(vector signed short __vec,
17135
- signed long long __offset,
17136
- signed short *__ptr) {
17898
+ static inline __ATTRS_o_ai void
17899
+ vec_xst(vector signed short __vec, ptrdiff_t __offset, signed short *__ptr) {
17137
17900
  signed char *__addr = (signed char *)__ptr + __offset;
17138
17901
  *(unaligned_vec_sshort *)__addr = __vec;
17139
17902
  }
17140
17903
 
17141
17904
  static inline __ATTRS_o_ai void vec_xst(vector unsigned short __vec,
17142
- signed long long __offset,
17905
+ ptrdiff_t __offset,
17143
17906
  unsigned short *__ptr) {
17144
17907
  signed char *__addr = (signed char *)__ptr + __offset;
17145
17908
  *(unaligned_vec_ushort *)__addr = __vec;
17146
17909
  }
17147
17910
 
17148
17911
  static inline __ATTRS_o_ai void vec_xst(vector signed int __vec,
17149
- signed long long __offset,
17150
- signed int *__ptr) {
17912
+ ptrdiff_t __offset, signed int *__ptr) {
17151
17913
  signed char *__addr = (signed char *)__ptr + __offset;
17152
17914
  *(unaligned_vec_sint *)__addr = __vec;
17153
17915
  }
17154
17916
 
17155
- static inline __ATTRS_o_ai void vec_xst(vector unsigned int __vec,
17156
- signed long long __offset,
17157
- unsigned int *__ptr) {
17917
+ static inline __ATTRS_o_ai void
17918
+ vec_xst(vector unsigned int __vec, ptrdiff_t __offset, unsigned int *__ptr) {
17158
17919
  signed char *__addr = (signed char *)__ptr + __offset;
17159
17920
  *(unaligned_vec_uint *)__addr = __vec;
17160
17921
  }
17161
17922
 
17162
- static inline __ATTRS_o_ai void vec_xst(vector float __vec,
17163
- signed long long __offset,
17923
+ static inline __ATTRS_o_ai void vec_xst(vector float __vec, ptrdiff_t __offset,
17164
17924
  float *__ptr) {
17165
17925
  signed char *__addr = (signed char *)__ptr + __offset;
17166
17926
  *(unaligned_vec_float *)__addr = __vec;
@@ -17168,37 +17928,37 @@ static inline __ATTRS_o_ai void vec_xst(vector float __vec,
17168
17928
 
17169
17929
  #ifdef __VSX__
17170
17930
  static inline __ATTRS_o_ai void vec_xst(vector signed long long __vec,
17171
- signed long long __offset,
17931
+ ptrdiff_t __offset,
17172
17932
  signed long long *__ptr) {
17173
17933
  signed char *__addr = (signed char *)__ptr + __offset;
17174
17934
  *(unaligned_vec_sll *)__addr = __vec;
17175
17935
  }
17176
17936
 
17177
17937
  static inline __ATTRS_o_ai void vec_xst(vector unsigned long long __vec,
17178
- signed long long __offset,
17938
+ ptrdiff_t __offset,
17179
17939
  unsigned long long *__ptr) {
17180
17940
  signed char *__addr = (signed char *)__ptr + __offset;
17181
17941
  *(unaligned_vec_ull *)__addr = __vec;
17182
17942
  }
17183
17943
 
17184
- static inline __ATTRS_o_ai void vec_xst(vector double __vec,
17185
- signed long long __offset,
17944
+ static inline __ATTRS_o_ai void vec_xst(vector double __vec, ptrdiff_t __offset,
17186
17945
  double *__ptr) {
17187
17946
  signed char *__addr = (signed char *)__ptr + __offset;
17188
17947
  *(unaligned_vec_double *)__addr = __vec;
17189
17948
  }
17190
17949
  #endif
17191
17950
 
17192
- #if defined(__POWER8_VECTOR__) && defined(__powerpc64__)
17951
+ #if defined(__POWER8_VECTOR__) && defined(__powerpc64__) && \
17952
+ defined(__SIZEOF_INT128__)
17193
17953
  static inline __ATTRS_o_ai void vec_xst(vector signed __int128 __vec,
17194
- signed long long __offset,
17954
+ ptrdiff_t __offset,
17195
17955
  signed __int128 *__ptr) {
17196
17956
  signed char *__addr = (signed char *)__ptr + __offset;
17197
17957
  *(unaligned_vec_si128 *)__addr = __vec;
17198
17958
  }
17199
17959
 
17200
17960
  static inline __ATTRS_o_ai void vec_xst(vector unsigned __int128 __vec,
17201
- signed long long __offset,
17961
+ ptrdiff_t __offset,
17202
17962
  unsigned __int128 *__ptr) {
17203
17963
  signed char *__addr = (signed char *)__ptr + __offset;
17204
17964
  *(unaligned_vec_ui128 *)__addr = __vec;
@@ -17207,51 +17967,52 @@ static inline __ATTRS_o_ai void vec_xst(vector unsigned __int128 __vec,
17207
17967
 
17208
17968
  /* vec_xst_trunc */
17209
17969
 
17210
- #if defined(__POWER10_VECTOR__) && defined(__VSX__)
17970
+ #if defined(__POWER10_VECTOR__) && defined(__VSX__) && \
17971
+ defined(__SIZEOF_INT128__)
17211
17972
  static inline __ATTRS_o_ai void vec_xst_trunc(vector signed __int128 __vec,
17212
- signed long long __offset,
17973
+ ptrdiff_t __offset,
17213
17974
  signed char *__ptr) {
17214
17975
  *(__ptr + __offset) = (signed char)__vec[0];
17215
17976
  }
17216
17977
 
17217
17978
  static inline __ATTRS_o_ai void vec_xst_trunc(vector unsigned __int128 __vec,
17218
- signed long long __offset,
17979
+ ptrdiff_t __offset,
17219
17980
  unsigned char *__ptr) {
17220
17981
  *(__ptr + __offset) = (unsigned char)__vec[0];
17221
17982
  }
17222
17983
 
17223
17984
  static inline __ATTRS_o_ai void vec_xst_trunc(vector signed __int128 __vec,
17224
- signed long long __offset,
17985
+ ptrdiff_t __offset,
17225
17986
  signed short *__ptr) {
17226
17987
  *(__ptr + __offset) = (signed short)__vec[0];
17227
17988
  }
17228
17989
 
17229
17990
  static inline __ATTRS_o_ai void vec_xst_trunc(vector unsigned __int128 __vec,
17230
- signed long long __offset,
17991
+ ptrdiff_t __offset,
17231
17992
  unsigned short *__ptr) {
17232
17993
  *(__ptr + __offset) = (unsigned short)__vec[0];
17233
17994
  }
17234
17995
 
17235
17996
  static inline __ATTRS_o_ai void vec_xst_trunc(vector signed __int128 __vec,
17236
- signed long long __offset,
17997
+ ptrdiff_t __offset,
17237
17998
  signed int *__ptr) {
17238
17999
  *(__ptr + __offset) = (signed int)__vec[0];
17239
18000
  }
17240
18001
 
17241
18002
  static inline __ATTRS_o_ai void vec_xst_trunc(vector unsigned __int128 __vec,
17242
- signed long long __offset,
18003
+ ptrdiff_t __offset,
17243
18004
  unsigned int *__ptr) {
17244
18005
  *(__ptr + __offset) = (unsigned int)__vec[0];
17245
18006
  }
17246
18007
 
17247
18008
  static inline __ATTRS_o_ai void vec_xst_trunc(vector signed __int128 __vec,
17248
- signed long long __offset,
18009
+ ptrdiff_t __offset,
17249
18010
  signed long long *__ptr) {
17250
18011
  *(__ptr + __offset) = (signed long long)__vec[0];
17251
18012
  }
17252
18013
 
17253
18014
  static inline __ATTRS_o_ai void vec_xst_trunc(vector unsigned __int128 __vec,
17254
- signed long long __offset,
18015
+ ptrdiff_t __offset,
17255
18016
  unsigned long long *__ptr) {
17256
18017
  *(__ptr + __offset) = (unsigned long long)__vec[0];
17257
18018
  }
@@ -17336,7 +18097,8 @@ static __inline__ void __ATTRS_o_ai vec_xst_be(vector double __vec,
17336
18097
  }
17337
18098
  #endif
17338
18099
 
17339
- #if defined(__POWER8_VECTOR__) && defined(__powerpc64__)
18100
+ #if defined(__POWER8_VECTOR__) && defined(__powerpc64__) && \
18101
+ defined(__SIZEOF_INT128__)
17340
18102
  static __inline__ void __ATTRS_o_ai vec_xst_be(vector signed __int128 __vec,
17341
18103
  signed long long __offset,
17342
18104
  signed __int128 *__ptr) {
@@ -17375,7 +18137,7 @@ static vector double __ATTRS_o_ai vec_neg(vector double __a) {
17375
18137
 
17376
18138
  #endif
17377
18139
 
17378
- #if defined(__POWER8_VECTOR__) && defined(__powerpc64__)
18140
+ #ifdef __VSX__
17379
18141
  static vector long long __ATTRS_o_ai vec_neg(vector long long __a) {
17380
18142
  return -__a;
17381
18143
  }
@@ -17404,7 +18166,7 @@ static vector double __ATTRS_o_ai vec_nabs(vector double __a) {
17404
18166
 
17405
18167
  #endif
17406
18168
 
17407
- #if defined(__POWER8_VECTOR__) && defined(__powerpc64__)
18169
+ #ifdef __POWER8_VECTOR__
17408
18170
  static vector long long __ATTRS_o_ai vec_nabs(vector long long __a) {
17409
18171
  return __builtin_altivec_vminsd(__a, -__a);
17410
18172
  }
@@ -17422,6 +18184,18 @@ static vector signed char __ATTRS_o_ai vec_nabs(vector signed char __a) {
17422
18184
  return __builtin_altivec_vminsb(__a, -__a);
17423
18185
  }
17424
18186
 
18187
+ static vector float __ATTRS_o_ai vec_recipdiv(vector float __a,
18188
+ vector float __b) {
18189
+ return __builtin_ppc_recipdivf(__a, __b);
18190
+ }
18191
+
18192
+ #ifdef __VSX__
18193
+ static vector double __ATTRS_o_ai vec_recipdiv(vector double __a,
18194
+ vector double __b) {
18195
+ return __builtin_ppc_recipdivd(__a, __b);
18196
+ }
18197
+ #endif
18198
+
17425
18199
  #ifdef __POWER10_VECTOR__
17426
18200
 
17427
18201
  /* vec_extractm */
@@ -17446,10 +18220,12 @@ vec_extractm(vector unsigned long long __a) {
17446
18220
  return __builtin_altivec_vextractdm(__a);
17447
18221
  }
17448
18222
 
18223
+ #ifdef __SIZEOF_INT128__
17449
18224
  static __inline__ unsigned int __ATTRS_o_ai
17450
18225
  vec_extractm(vector unsigned __int128 __a) {
17451
18226
  return __builtin_altivec_vextractqm(__a);
17452
18227
  }
18228
+ #endif
17453
18229
 
17454
18230
  /* vec_expandm */
17455
18231
 
@@ -17473,22 +18249,24 @@ vec_expandm(vector unsigned long long __a) {
17473
18249
  return __builtin_altivec_vexpanddm(__a);
17474
18250
  }
17475
18251
 
18252
+ #ifdef __SIZEOF_INT128__
17476
18253
  static __inline__ vector unsigned __int128 __ATTRS_o_ai
17477
18254
  vec_expandm(vector unsigned __int128 __a) {
17478
18255
  return __builtin_altivec_vexpandqm(__a);
17479
18256
  }
18257
+ #endif
17480
18258
 
17481
18259
  /* vec_cntm */
17482
18260
 
17483
18261
  #define vec_cntm(__a, __mp) \
17484
18262
  _Generic((__a), vector unsigned char \
17485
- : __builtin_altivec_vcntmbb((__a), (unsigned int)(__mp)), \
18263
+ : __builtin_altivec_vcntmbb((__a), (unsigned char)(__mp)), \
17486
18264
  vector unsigned short \
17487
- : __builtin_altivec_vcntmbh((__a), (unsigned int)(__mp)), \
18265
+ : __builtin_altivec_vcntmbh((__a), (unsigned char)(__mp)), \
17488
18266
  vector unsigned int \
17489
- : __builtin_altivec_vcntmbw((__a), (unsigned int)(__mp)), \
18267
+ : __builtin_altivec_vcntmbw((__a), (unsigned char)(__mp)), \
17490
18268
  vector unsigned long long \
17491
- : __builtin_altivec_vcntmbd((__a), (unsigned int)(__mp)))
18269
+ : __builtin_altivec_vcntmbd((__a), (unsigned char)(__mp)))
17492
18270
 
17493
18271
  /* vec_gen[b|h|w|d|q]m */
17494
18272
 
@@ -17512,10 +18290,12 @@ vec_gendm(unsigned long long __bm) {
17512
18290
  return __builtin_altivec_mtvsrdm(__bm);
17513
18291
  }
17514
18292
 
18293
+ #ifdef __SIZEOF_INT128__
17515
18294
  static __inline__ vector unsigned __int128 __ATTRS_o_ai
17516
18295
  vec_genqm(unsigned long long __bm) {
17517
18296
  return __builtin_altivec_mtvsrqm(__bm);
17518
18297
  }
18298
+ #endif
17519
18299
 
17520
18300
  /* vec_pdep */
17521
18301
 
@@ -17544,6 +18324,7 @@ vec_cfuge(vector unsigned long long __a, vector unsigned long long __b) {
17544
18324
 
17545
18325
  /* vec_ternarylogic */
17546
18326
  #ifdef __VSX__
18327
+ #ifdef __SIZEOF_INT128__
17547
18328
  #define vec_ternarylogic(__a, __b, __c, __imm) \
17548
18329
  _Generic((__a), vector unsigned char \
17549
18330
  : __builtin_vsx_xxeval((vector unsigned long long)(__a), \
@@ -17565,6 +18346,25 @@ vec_cfuge(vector unsigned long long __a, vector unsigned long long __b) {
17565
18346
  : __builtin_vsx_xxeval((vector unsigned long long)(__a), \
17566
18347
  (vector unsigned long long)(__b), \
17567
18348
  (vector unsigned long long)(__c), (__imm)))
18349
+ #else
18350
+ #define vec_ternarylogic(__a, __b, __c, __imm) \
18351
+ _Generic((__a), vector unsigned char \
18352
+ : __builtin_vsx_xxeval((vector unsigned long long)(__a), \
18353
+ (vector unsigned long long)(__b), \
18354
+ (vector unsigned long long)(__c), (__imm)), \
18355
+ vector unsigned short \
18356
+ : __builtin_vsx_xxeval((vector unsigned long long)(__a), \
18357
+ (vector unsigned long long)(__b), \
18358
+ (vector unsigned long long)(__c), (__imm)), \
18359
+ vector unsigned int \
18360
+ : __builtin_vsx_xxeval((vector unsigned long long)(__a), \
18361
+ (vector unsigned long long)(__b), \
18362
+ (vector unsigned long long)(__c), (__imm)), \
18363
+ vector unsigned long long \
18364
+ : __builtin_vsx_xxeval((vector unsigned long long)(__a), \
18365
+ (vector unsigned long long)(__b), \
18366
+ (vector unsigned long long)(__c), (__imm)))
18367
+ #endif /* __SIZEOF_INT128__ */
17568
18368
  #endif /* __VSX__ */
17569
18369
 
17570
18370
  /* vec_genpcvm */
@@ -17581,10 +18381,10 @@ vec_cfuge(vector unsigned long long __a, vector unsigned long long __b) {
17581
18381
  : __builtin_vsx_xxgenpcvdm((__a), (int)(__imm)))
17582
18382
  #endif /* __VSX__ */
17583
18383
 
17584
- /* vec_clrl */
18384
+ /* vec_clr_first */
17585
18385
 
17586
18386
  static __inline__ vector signed char __ATTRS_o_ai
17587
- vec_clrl(vector signed char __a, unsigned int __n) {
18387
+ vec_clr_first(vector signed char __a, unsigned int __n) {
17588
18388
  #ifdef __LITTLE_ENDIAN__
17589
18389
  return __builtin_altivec_vclrrb(__a, __n);
17590
18390
  #else
@@ -17593,7 +18393,7 @@ vec_clrl(vector signed char __a, unsigned int __n) {
17593
18393
  }
17594
18394
 
17595
18395
  static __inline__ vector unsigned char __ATTRS_o_ai
17596
- vec_clrl(vector unsigned char __a, unsigned int __n) {
18396
+ vec_clr_first(vector unsigned char __a, unsigned int __n) {
17597
18397
  #ifdef __LITTLE_ENDIAN__
17598
18398
  return __builtin_altivec_vclrrb((vector signed char)__a, __n);
17599
18399
  #else
@@ -17601,10 +18401,10 @@ vec_clrl(vector unsigned char __a, unsigned int __n) {
17601
18401
  #endif
17602
18402
  }
17603
18403
 
17604
- /* vec_clrr */
18404
+ /* vec_clr_last */
17605
18405
 
17606
18406
  static __inline__ vector signed char __ATTRS_o_ai
17607
- vec_clrr(vector signed char __a, unsigned int __n) {
18407
+ vec_clr_last(vector signed char __a, unsigned int __n) {
17608
18408
  #ifdef __LITTLE_ENDIAN__
17609
18409
  return __builtin_altivec_vclrlb(__a, __n);
17610
18410
  #else
@@ -17613,7 +18413,7 @@ vec_clrr(vector signed char __a, unsigned int __n) {
17613
18413
  }
17614
18414
 
17615
18415
  static __inline__ vector unsigned char __ATTRS_o_ai
17616
- vec_clrr(vector unsigned char __a, unsigned int __n) {
18416
+ vec_clr_last(vector unsigned char __a, unsigned int __n) {
17617
18417
  #ifdef __LITTLE_ENDIAN__
17618
18418
  return __builtin_altivec_vclrlb((vector signed char)__a, __n);
17619
18419
  #else
@@ -17657,6 +18457,7 @@ vec_mod(vector unsigned long long __a, vector unsigned long long __b) {
17657
18457
  return __a % __b;
17658
18458
  }
17659
18459
 
18460
+ #ifdef __SIZEOF_INT128__
17660
18461
  static __inline__ vector signed __int128 __ATTRS_o_ai
17661
18462
  vec_mod(vector signed __int128 __a, vector signed __int128 __b) {
17662
18463
  return __a % __b;
@@ -17666,6 +18467,7 @@ static __inline__ vector unsigned __int128 __ATTRS_o_ai
17666
18467
  vec_mod(vector unsigned __int128 __a, vector unsigned __int128 __b) {
17667
18468
  return __a % __b;
17668
18469
  }
18470
+ #endif
17669
18471
 
17670
18472
  /* vec_sldbi */
17671
18473
 
@@ -17993,36 +18795,39 @@ static __inline__ vector double __ATTRS_o_ai vec_splatid(const float __a) {
17993
18795
 
17994
18796
  static __inline__ vector signed int __ATTRS_o_ai vec_splati_ins(
17995
18797
  vector signed int __a, const unsigned int __b, const signed int __c) {
18798
+ const unsigned int __d = __b & 0x01;
17996
18799
  #ifdef __LITTLE_ENDIAN__
17997
- __a[1 - __b] = __c;
17998
- __a[3 - __b] = __c;
18800
+ __a[1 - __d] = __c;
18801
+ __a[3 - __d] = __c;
17999
18802
  #else
18000
- __a[__b] = __c;
18001
- __a[2 + __b] = __c;
18803
+ __a[__d] = __c;
18804
+ __a[2 + __d] = __c;
18002
18805
  #endif
18003
18806
  return __a;
18004
18807
  }
18005
18808
 
18006
18809
  static __inline__ vector unsigned int __ATTRS_o_ai vec_splati_ins(
18007
18810
  vector unsigned int __a, const unsigned int __b, const unsigned int __c) {
18811
+ const unsigned int __d = __b & 0x01;
18008
18812
  #ifdef __LITTLE_ENDIAN__
18009
- __a[1 - __b] = __c;
18010
- __a[3 - __b] = __c;
18813
+ __a[1 - __d] = __c;
18814
+ __a[3 - __d] = __c;
18011
18815
  #else
18012
- __a[__b] = __c;
18013
- __a[2 + __b] = __c;
18816
+ __a[__d] = __c;
18817
+ __a[2 + __d] = __c;
18014
18818
  #endif
18015
18819
  return __a;
18016
18820
  }
18017
18821
 
18018
18822
  static __inline__ vector float __ATTRS_o_ai
18019
18823
  vec_splati_ins(vector float __a, const unsigned int __b, const float __c) {
18824
+ const unsigned int __d = __b & 0x01;
18020
18825
  #ifdef __LITTLE_ENDIAN__
18021
- __a[1 - __b] = __c;
18022
- __a[3 - __b] = __c;
18826
+ __a[1 - __d] = __c;
18827
+ __a[3 - __d] = __c;
18023
18828
  #else
18024
- __a[__b] = __c;
18025
- __a[2 + __b] = __c;
18829
+ __a[__d] = __c;
18830
+ __a[2 + __d] = __c;
18026
18831
  #endif
18027
18832
  return __a;
18028
18833
  }
@@ -18188,6 +18993,7 @@ static __inline__ int __ATTRS_o_ai vec_strir_p(vector signed short __a) {
18188
18993
 
18189
18994
  /* vs[l | r | ra] */
18190
18995
 
18996
+ #ifdef __SIZEOF_INT128__
18191
18997
  static __inline__ vector unsigned __int128 __ATTRS_o_ai
18192
18998
  vec_sl(vector unsigned __int128 __a, vector unsigned __int128 __b) {
18193
18999
  return __a << (__b % (vector unsigned __int128)(sizeof(unsigned __int128) *
@@ -18232,8 +19038,54 @@ vec_sra(vector signed __int128 __a, vector unsigned __int128 __b) {
18232
19038
  __CHAR_BIT__));
18233
19039
  }
18234
19040
 
19041
+ #endif /* __SIZEOF_INT128__ */
18235
19042
  #endif /* __POWER10_VECTOR__ */
18236
19043
 
19044
+ #ifdef __POWER8_VECTOR__
19045
+ #define __bcdadd(__a, __b, __ps) __builtin_ppc_bcdadd((__a), (__b), (__ps))
19046
+ #define __bcdsub(__a, __b, __ps) __builtin_ppc_bcdsub((__a), (__b), (__ps))
19047
+
19048
+ static __inline__ long __bcdadd_ofl(vector unsigned char __a,
19049
+ vector unsigned char __b) {
19050
+ return __builtin_ppc_bcdadd_p(__CR6_SO, __a, __b);
19051
+ }
19052
+
19053
+ static __inline__ long __bcdsub_ofl(vector unsigned char __a,
19054
+ vector unsigned char __b) {
19055
+ return __builtin_ppc_bcdsub_p(__CR6_SO, __a, __b);
19056
+ }
19057
+
19058
+ static __inline__ long __bcd_invalid(vector unsigned char __a) {
19059
+ return __builtin_ppc_bcdsub_p(__CR6_SO, __a, __a);
19060
+ }
19061
+
19062
+ static __inline__ long __bcdcmpeq(vector unsigned char __a,
19063
+ vector unsigned char __b) {
19064
+ return __builtin_ppc_bcdsub_p(__CR6_EQ, __a, __b);
19065
+ }
19066
+
19067
+ static __inline__ long __bcdcmplt(vector unsigned char __a,
19068
+ vector unsigned char __b) {
19069
+ return __builtin_ppc_bcdsub_p(__CR6_LT, __a, __b);
19070
+ }
19071
+
19072
+ static __inline__ long __bcdcmpgt(vector unsigned char __a,
19073
+ vector unsigned char __b) {
19074
+ return __builtin_ppc_bcdsub_p(__CR6_GT, __a, __b);
19075
+ }
19076
+
19077
+ static __inline__ long __bcdcmple(vector unsigned char __a,
19078
+ vector unsigned char __b) {
19079
+ return __builtin_ppc_bcdsub_p(__CR6_GT_REV, __a, __b);
19080
+ }
19081
+
19082
+ static __inline__ long __bcdcmpge(vector unsigned char __a,
19083
+ vector unsigned char __b) {
19084
+ return __builtin_ppc_bcdsub_p(__CR6_LT_REV, __a, __b);
19085
+ }
19086
+
19087
+ #endif // __POWER8_VECTOR__
19088
+
18237
19089
  #undef __ATTRS_o_ai
18238
19090
 
18239
19091
  #endif /* __ALTIVEC_H */