authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2017-09-30 18:20:12-04:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2017-09-30 18:20:55-04:00
logcd58b400110586bb0d0632dce0f667efbc3dbd88
treefa0b6571c6c8fbfb8337e1fce54e63fad93f25b3
parentba3d21ca67af0ce47841bc2d0258903ccaf89a75

update C headers to clang 5.0.0


37 files changed, 5707 insertions(+), 1837 deletions(-)

CMakeLists.txt+3
......@@ -410,10 +410,12 @@ install(FILES "${CMAKE_SOURCE_DIR}/c_headers/avx512vlbwintrin.h" DESTINATION "${
410410install(FILES "${CMAKE_SOURCE_DIR}/c_headers/avx512vlcdintrin.h" DESTINATION "${C_HEADERS_DEST}")
411411install(FILES "${CMAKE_SOURCE_DIR}/c_headers/avx512vldqintrin.h" DESTINATION "${C_HEADERS_DEST}")
412412install(FILES "${CMAKE_SOURCE_DIR}/c_headers/avx512vlintrin.h" DESTINATION "${C_HEADERS_DEST}")
413install(FILES "${CMAKE_SOURCE_DIR}/c_headers/avx512vpopcntdqintrin.h" DESTINATION "${C_HEADERS_DEST}")
413414install(FILES "${CMAKE_SOURCE_DIR}/c_headers/avxintrin.h" DESTINATION "${C_HEADERS_DEST}")
414415install(FILES "${CMAKE_SOURCE_DIR}/c_headers/bmi2intrin.h" DESTINATION "${C_HEADERS_DEST}")
415416install(FILES "${CMAKE_SOURCE_DIR}/c_headers/bmiintrin.h" DESTINATION "${C_HEADERS_DEST}")
416417install(FILES "${CMAKE_SOURCE_DIR}/c_headers/clflushoptintrin.h" DESTINATION "${C_HEADERS_DEST}")
418install(FILES "${CMAKE_SOURCE_DIR}/c_headers/clzerointrin.h" DESTINATION "${C_HEADERS_DEST}")
417419install(FILES "${CMAKE_SOURCE_DIR}/c_headers/cpuid.h" DESTINATION "${C_HEADERS_DEST}")
418420install(FILES "${CMAKE_SOURCE_DIR}/c_headers/cuda_wrappers/algorithm" DESTINATION "${C_HEADERS_DEST}/cuda_wrappers")
419421install(FILES "${CMAKE_SOURCE_DIR}/c_headers/cuda_wrappers/complex" DESTINATION "${C_HEADERS_DEST}/cuda_wrappers")
......@@ -432,6 +434,7 @@ install(FILES "${CMAKE_SOURCE_DIR}/c_headers/intrin.h" DESTINATION "${C_HEADERS_
432434install(FILES "${CMAKE_SOURCE_DIR}/c_headers/inttypes.h" DESTINATION "${C_HEADERS_DEST}")
433435install(FILES "${CMAKE_SOURCE_DIR}/c_headers/iso646.h" DESTINATION "${C_HEADERS_DEST}")
434436install(FILES "${CMAKE_SOURCE_DIR}/c_headers/limits.h" DESTINATION "${C_HEADERS_DEST}")
437install(FILES "${CMAKE_SOURCE_DIR}/c_headers/lwpintrin.h" DESTINATION "${C_HEADERS_DEST}")
435438install(FILES "${CMAKE_SOURCE_DIR}/c_headers/lzcntintrin.h" DESTINATION "${C_HEADERS_DEST}")
436439install(FILES "${CMAKE_SOURCE_DIR}/c_headers/mm3dnow.h" DESTINATION "${C_HEADERS_DEST}")
437440install(FILES "${CMAKE_SOURCE_DIR}/c_headers/mm_malloc.h" DESTINATION "${C_HEADERS_DEST}")
c_headers/altivec.h+79-76
......@@ -2887,87 +2887,79 @@ static __inline__ vector double __ATTRS_o_ai vec_cpsgn(vector double __a,
28872887
28882888/* vec_ctf */
28892889
2890static __inline__ vector float __ATTRS_o_ai vec_ctf(vector int __a, int __b) {
2891 return __builtin_altivec_vcfsx(__a, __b);
2892}
2893
2894static __inline__ vector float __ATTRS_o_ai vec_ctf(vector unsigned int __a,
2895 int __b) {
2896 return __builtin_altivec_vcfux((vector int)__a, __b);
2897}
2898
28992890#ifdef __VSX__
2900static __inline__ vector double __ATTRS_o_ai
2901vec_ctf(vector unsigned long long __a, int __b) {
2902 vector double __ret = __builtin_convertvector(__a, vector double);
2903 __ret *= (vector double)(vector unsigned long long)((0x3ffULL - __b) << 52);
2904 return __ret;
2905}
2906
2907static __inline__ vector double __ATTRS_o_ai
2908vec_ctf(vector signed long long __a, int __b) {
2909 vector double __ret = __builtin_convertvector(__a, vector double);
2910 __ret *= (vector double)(vector unsigned long long)((0x3ffULL - __b) << 52);
2911 return __ret;
2912}
2891#define vec_ctf(__a, __b) \
2892 _Generic((__a), vector int \
2893 : (vector float)__builtin_altivec_vcfsx((__a), (__b)), \
2894 vector unsigned int \
2895 : (vector float)__builtin_altivec_vcfux((vector int)(__a), (__b)), \
2896 vector unsigned long long \
2897 : (__builtin_convertvector((vector unsigned long long)(__a), \
2898 vector double) * \
2899 (vector double)(vector unsigned long long)((0x3ffULL - (__b)) \
2900 << 52)), \
2901 vector signed long long \
2902 : (__builtin_convertvector((vector signed long long)(__a), \
2903 vector double) * \
2904 (vector double)(vector unsigned long long)((0x3ffULL - (__b)) \
2905 << 52)))
2906#else
2907#define vec_ctf(__a, __b) \
2908 _Generic((__a), vector int \
2909 : (vector float)__builtin_altivec_vcfsx((__a), (__b)), \
2910 vector unsigned int \
2911 : (vector float)__builtin_altivec_vcfux((vector int)(__a), (__b)))
29132912#endif
29142913
29152914/* vec_vcfsx */
29162915
2917static __inline__ vector float __attribute__((__always_inline__))
2918vec_vcfsx(vector int __a, int __b) {
2919 return __builtin_altivec_vcfsx(__a, __b);
2920}
2916#define vec_vcfux __builtin_altivec_vcfux
29212917
29222918/* vec_vcfux */
29232919
2924static __inline__ vector float __attribute__((__always_inline__))
2925vec_vcfux(vector unsigned int __a, int __b) {
2926 return __builtin_altivec_vcfux((vector int)__a, __b);
2927}
2920#define vec_vcfsx(__a, __b) __builtin_altivec_vcfsx((vector int)(__a), (__b))
29282921
29292922/* vec_cts */
29302923
2931static __inline__ vector int __ATTRS_o_ai vec_cts(vector float __a, int __b) {
2932 return __builtin_altivec_vctsxs(__a, __b);
2933}
2934
29352924#ifdef __VSX__
2936static __inline__ vector signed long long __ATTRS_o_ai
2937vec_cts(vector double __a, int __b) {
2938 __a *= (vector double)(vector unsigned long long)((0x3ffULL + __b) << 52);
2939 return __builtin_convertvector(__a, vector signed long long);
2940}
2925#define vec_cts(__a, __b) \
2926 _Generic((__a), vector float \
2927 : __builtin_altivec_vctsxs((__a), (__b)), vector double \
2928 : __extension__({ \
2929 vector double __ret = \
2930 (__a) * \
2931 (vector double)(vector unsigned long long)((0x3ffULL + (__b)) \
2932 << 52); \
2933 __builtin_convertvector(__ret, vector signed long long); \
2934 }))
2935#else
2936#define vec_cts __builtin_altivec_vctsxs
29412937#endif
29422938
29432939/* vec_vctsxs */
29442940
2945static __inline__ vector int __attribute__((__always_inline__))
2946vec_vctsxs(vector float __a, int __b) {
2947 return __builtin_altivec_vctsxs(__a, __b);
2948}
2941#define vec_vctsxs __builtin_altivec_vctsxs
29492942
29502943/* vec_ctu */
29512944
2952static __inline__ vector unsigned int __ATTRS_o_ai vec_ctu(vector float __a,
2953 int __b) {
2954 return __builtin_altivec_vctuxs(__a, __b);
2955}
2956
29572945#ifdef __VSX__
2958static __inline__ vector unsigned long long __ATTRS_o_ai
2959vec_ctu(vector double __a, int __b) {
2960 __a *= (vector double)(vector unsigned long long)((0x3ffULL + __b) << 52);
2961 return __builtin_convertvector(__a, vector unsigned long long);
2962}
2946#define vec_ctu(__a, __b) \
2947 _Generic((__a), vector float \
2948 : __builtin_altivec_vctuxs((__a), (__b)), vector double \
2949 : __extension__({ \
2950 vector double __ret = \
2951 (__a) * \
2952 (vector double)(vector unsigned long long)((0x3ffULL + __b) \
2953 << 52); \
2954 __builtin_convertvector(__ret, vector unsigned long long); \
2955 }))
2956#else
2957#define vec_ctu __builtin_altivec_vctuxs
29632958#endif
29642959
29652960/* vec_vctuxs */
29662961
2967static __inline__ vector unsigned int __attribute__((__always_inline__))
2968vec_vctuxs(vector float __a, int __b) {
2969 return __builtin_altivec_vctuxs(__a, __b);
2970}
2962#define vec_vctuxs __builtin_altivec_vctuxs
29712963
29722964/* vec_signed */
29732965
......@@ -8045,45 +8037,51 @@ static __inline__ vector float __ATTRS_o_ai vec_vsel(vector float __a,
80458037
80468038/* vec_sl */
80478039
8048static __inline__ vector signed char __ATTRS_o_ai
8049vec_sl(vector signed char __a, vector unsigned char __b) {
8050 return __a << (vector signed char)__b;
8051}
8052
8040// vec_sl does modulo arithmetic on __b first, so __b is allowed to be more
8041// than the length of __a.
80538042static __inline__ vector unsigned char __ATTRS_o_ai
80548043vec_sl(vector unsigned char __a, vector unsigned char __b) {
8055 return __a << __b;
8044 return __a << (__b %
8045 (vector unsigned char)(sizeof(unsigned char) * __CHAR_BIT__));
80568046}
80578047
8058static __inline__ vector short __ATTRS_o_ai vec_sl(vector short __a,
8059 vector unsigned short __b) {
8060 return __a << (vector short)__b;
8048static __inline__ vector signed char __ATTRS_o_ai
8049vec_sl(vector signed char __a, vector unsigned char __b) {
8050 return (vector signed char)vec_sl((vector unsigned char)__a, __b);
80618051}
80628052
80638053static __inline__ vector unsigned short __ATTRS_o_ai
80648054vec_sl(vector unsigned short __a, vector unsigned short __b) {
8065 return __a << __b;
8055 return __a << (__b % (vector unsigned short)(sizeof(unsigned short) *
8056 __CHAR_BIT__));
80668057}
80678058
8068static __inline__ vector int __ATTRS_o_ai vec_sl(vector int __a,
8069 vector unsigned int __b) {
8070 return __a << (vector int)__b;
8059static __inline__ vector short __ATTRS_o_ai vec_sl(vector short __a,
8060 vector unsigned short __b) {
8061 return (vector short)vec_sl((vector unsigned short)__a, __b);
80718062}
80728063
80738064static __inline__ vector unsigned int __ATTRS_o_ai
80748065vec_sl(vector unsigned int __a, vector unsigned int __b) {
8075 return __a << __b;
8066 return __a << (__b %
8067 (vector unsigned int)(sizeof(unsigned int) * __CHAR_BIT__));
80768068}
80778069
8078#ifdef __POWER8_VECTOR__
8079static __inline__ vector signed long long __ATTRS_o_ai
8080vec_sl(vector signed long long __a, vector unsigned long long __b) {
8081 return __a << (vector long long)__b;
8070static __inline__ vector int __ATTRS_o_ai vec_sl(vector int __a,
8071 vector unsigned int __b) {
8072 return (vector int)vec_sl((vector unsigned int)__a, __b);
80828073}
80838074
8075#ifdef __POWER8_VECTOR__
80848076static __inline__ vector unsigned long long __ATTRS_o_ai
80858077vec_sl(vector unsigned long long __a, vector unsigned long long __b) {
8086 return __a << __b;
8078 return __a << (__b % (vector unsigned long long)(sizeof(unsigned long long) *
8079 __CHAR_BIT__));
8080}
8081
8082static __inline__ vector long long __ATTRS_o_ai
8083vec_sl(vector long long __a, vector unsigned long long __b) {
8084 return (vector long long)vec_sl((vector unsigned long long)__a, __b);
80878085}
80888086#endif
80898087
......@@ -12150,6 +12148,11 @@ static __inline__ void __ATTRS_o_ai vec_vsx_st(vector unsigned char __a,
1215012148
1215112149#endif
1215212150
12151#ifdef __VSX__
12152#define vec_xxpermdi __builtin_vsx_xxpermdi
12153#define vec_xxsldwi __builtin_vsx_xxsldwi
12154#endif
12155
1215312156/* vec_xor */
1215412157
1215512158#define __builtin_altivec_vxor vec_xor
c_headers/arm_acle.h+316-2
......@@ -224,6 +224,36 @@ __rbitl(unsigned long __t) {
224224#endif
225225}
226226
227/*
228 * 9.3 16-bit multiplications
229 */
230#if __ARM_FEATURE_DSP
231static __inline__ int32_t __attribute__((__always_inline__,__nodebug__))
232__smulbb(int32_t __a, int32_t __b) {
233 return __builtin_arm_smulbb(__a, __b);
234}
235static __inline__ int32_t __attribute__((__always_inline__,__nodebug__))
236__smulbt(int32_t __a, int32_t __b) {
237 return __builtin_arm_smulbt(__a, __b);
238}
239static __inline__ int32_t __attribute__((__always_inline__,__nodebug__))
240__smultb(int32_t __a, int32_t __b) {
241 return __builtin_arm_smultb(__a, __b);
242}
243static __inline__ int32_t __attribute__((__always_inline__,__nodebug__))
244__smultt(int32_t __a, int32_t __b) {
245 return __builtin_arm_smultt(__a, __b);
246}
247static __inline__ int32_t __attribute__((__always_inline__,__nodebug__))
248__smulwb(int32_t __a, int32_t __b) {
249 return __builtin_arm_smulwb(__a, __b);
250}
251static __inline__ int32_t __attribute__((__always_inline__,__nodebug__))
252__smulwt(int32_t __a, int32_t __b) {
253 return __builtin_arm_smulwt(__a, __b);
254}
255#endif
256
227257/*
228258 * 9.4 Saturating intrinsics
229259 *
......@@ -231,13 +261,13 @@ __rbitl(unsigned long __t) {
231261 * intrinsics are implemented and the flag is enabled.
232262 */
233263/* 9.4.1 Width-specified saturation intrinsics */
234#if __ARM_32BIT_STATE
264#if __ARM_FEATURE_SAT
235265#define __ssat(x, y) __builtin_arm_ssat(x, y)
236266#define __usat(x, y) __builtin_arm_usat(x, y)
237267#endif
238268
239269/* 9.4.2 Saturating addition and subtraction intrinsics */
240#if __ARM_32BIT_STATE
270#if __ARM_FEATURE_DSP
241271static __inline__ int32_t __attribute__((__always_inline__, __nodebug__))
242272__qadd(int32_t __t, int32_t __v) {
243273 return __builtin_arm_qadd(__t, __v);
......@@ -254,6 +284,290 @@ __qdbl(int32_t __t) {
254284}
255285#endif
256286
287/* 9.4.3 Accumultating multiplications */
288#if __ARM_FEATURE_DSP
289static __inline__ int32_t __attribute__((__always_inline__, __nodebug__))
290__smlabb(int32_t __a, int32_t __b, int32_t __c) {
291 return __builtin_arm_smlabb(__a, __b, __c);
292}
293static __inline__ int32_t __attribute__((__always_inline__, __nodebug__))
294__smlabt(int32_t __a, int32_t __b, int32_t __c) {
295 return __builtin_arm_smlabt(__a, __b, __c);
296}
297static __inline__ int32_t __attribute__((__always_inline__, __nodebug__))
298__smlatb(int32_t __a, int32_t __b, int32_t __c) {
299 return __builtin_arm_smlatb(__a, __b, __c);
300}
301static __inline__ int32_t __attribute__((__always_inline__, __nodebug__))
302__smlatt(int32_t __a, int32_t __b, int32_t __c) {
303 return __builtin_arm_smlatt(__a, __b, __c);
304}
305static __inline__ int32_t __attribute__((__always_inline__, __nodebug__))
306__smlawb(int32_t __a, int32_t __b, int32_t __c) {
307 return __builtin_arm_smlawb(__a, __b, __c);
308}
309static __inline__ int32_t __attribute__((__always_inline__, __nodebug__))
310__smlawt(int32_t __a, int32_t __b, int32_t __c) {
311 return __builtin_arm_smlawt(__a, __b, __c);
312}
313#endif
314
315
316/* 9.5.4 Parallel 16-bit saturation */
317#if __ARM_FEATURE_SIMD32
318#define __ssat16(x, y) __builtin_arm_ssat16(x, y)
319#define __usat16(x, y) __builtin_arm_usat16(x, y)
320#endif
321
322/* 9.5.5 Packing and unpacking */
323#if __ARM_FEATURE_SIMD32
324typedef int32_t int8x4_t;
325typedef int32_t int16x2_t;
326typedef uint32_t uint8x4_t;
327typedef uint32_t uint16x2_t;
328
329static __inline__ int16x2_t __attribute__((__always_inline__, __nodebug__))
330__sxtab16(int16x2_t __a, int8x4_t __b) {
331 return __builtin_arm_sxtab16(__a, __b);
332}
333static __inline__ int16x2_t __attribute__((__always_inline__, __nodebug__))
334__sxtb16(int8x4_t __a) {
335 return __builtin_arm_sxtb16(__a);
336}
337static __inline__ int16x2_t __attribute__((__always_inline__, __nodebug__))
338__uxtab16(int16x2_t __a, int8x4_t __b) {
339 return __builtin_arm_uxtab16(__a, __b);
340}
341static __inline__ int16x2_t __attribute__((__always_inline__, __nodebug__))
342__uxtb16(int8x4_t __a) {
343 return __builtin_arm_uxtb16(__a);
344}
345#endif
346
347/* 9.5.6 Parallel selection */
348#if __ARM_FEATURE_SIMD32
349static __inline__ uint8x4_t __attribute__((__always_inline__, __nodebug__))
350__sel(uint8x4_t __a, uint8x4_t __b) {
351 return __builtin_arm_sel(__a, __b);
352}
353#endif
354
355/* 9.5.7 Parallel 8-bit addition and subtraction */
356#if __ARM_FEATURE_SIMD32
357static __inline__ int8x4_t __attribute__((__always_inline__, __nodebug__))
358__qadd8(int8x4_t __a, int8x4_t __b) {
359 return __builtin_arm_qadd8(__a, __b);
360}
361static __inline__ int8x4_t __attribute__((__always_inline__, __nodebug__))
362__qsub8(int8x4_t __a, int8x4_t __b) {
363 return __builtin_arm_qsub8(__a, __b);
364}
365static __inline__ int8x4_t __attribute__((__always_inline__, __nodebug__))
366__sadd8(int8x4_t __a, int8x4_t __b) {
367 return __builtin_arm_sadd8(__a, __b);
368}
369static __inline__ int8x4_t __attribute__((__always_inline__, __nodebug__))
370__shadd8(int8x4_t __a, int8x4_t __b) {
371 return __builtin_arm_shadd8(__a, __b);
372}
373static __inline__ int8x4_t __attribute__((__always_inline__, __nodebug__))
374__shsub8(int8x4_t __a, int8x4_t __b) {
375 return __builtin_arm_shsub8(__a, __b);
376}
377static __inline__ int8x4_t __attribute__((__always_inline__, __nodebug__))
378__ssub8(int8x4_t __a, int8x4_t __b) {
379 return __builtin_arm_ssub8(__a, __b);
380}
381static __inline__ uint8x4_t __attribute__((__always_inline__, __nodebug__))
382__uadd8(uint8x4_t __a, uint8x4_t __b) {
383 return __builtin_arm_uadd8(__a, __b);
384}
385static __inline__ uint8x4_t __attribute__((__always_inline__, __nodebug__))
386__uhadd8(uint8x4_t __a, uint8x4_t __b) {
387 return __builtin_arm_uhadd8(__a, __b);
388}
389static __inline__ uint8x4_t __attribute__((__always_inline__, __nodebug__))
390__uhsub8(uint8x4_t __a, uint8x4_t __b) {
391 return __builtin_arm_uhsub8(__a, __b);
392}
393static __inline__ uint8x4_t __attribute__((__always_inline__, __nodebug__))
394__uqadd8(uint8x4_t __a, uint8x4_t __b) {
395 return __builtin_arm_uqadd8(__a, __b);
396}
397static __inline__ uint8x4_t __attribute__((__always_inline__, __nodebug__))
398__uqsub8(uint8x4_t __a, uint8x4_t __b) {
399 return __builtin_arm_uqsub8(__a, __b);
400}
401static __inline__ uint8x4_t __attribute__((__always_inline__, __nodebug__))
402__usub8(uint8x4_t __a, uint8x4_t __b) {
403 return __builtin_arm_usub8(__a, __b);
404}
405#endif
406
407/* 9.5.8 Sum of 8-bit absolute differences */
408#if __ARM_FEATURE_SIMD32
409static __inline__ uint32_t __attribute__((__always_inline__, __nodebug__))
410__usad8(uint8x4_t __a, uint8x4_t __b) {
411 return __builtin_arm_usad8(__a, __b);
412}
413static __inline__ uint32_t __attribute__((__always_inline__, __nodebug__))
414__usada8(uint8x4_t __a, uint8x4_t __b, uint32_t __c) {
415 return __builtin_arm_usada8(__a, __b, __c);
416}
417#endif
418
419/* 9.5.9 Parallel 16-bit addition and subtraction */
420#if __ARM_FEATURE_SIMD32
421static __inline__ int16x2_t __attribute__((__always_inline__, __nodebug__))
422__qadd16(int16x2_t __a, int16x2_t __b) {
423 return __builtin_arm_qadd16(__a, __b);
424}
425static __inline__ int16x2_t __attribute__((__always_inline__, __nodebug__))
426__qasx(int16x2_t __a, int16x2_t __b) {
427 return __builtin_arm_qasx(__a, __b);
428}
429static __inline__ int16x2_t __attribute__((__always_inline__, __nodebug__))
430__qsax(int16x2_t __a, int16x2_t __b) {
431 return __builtin_arm_qsax(__a, __b);
432}
433static __inline__ int16x2_t __attribute__((__always_inline__, __nodebug__))
434__qsub16(int16x2_t __a, int16x2_t __b) {
435 return __builtin_arm_qsub16(__a, __b);
436}
437static __inline__ int16x2_t __attribute__((__always_inline__, __nodebug__))
438__sadd16(int16x2_t __a, int16x2_t __b) {
439 return __builtin_arm_sadd16(__a, __b);
440}
441static __inline__ int16x2_t __attribute__((__always_inline__, __nodebug__))
442__sasx(int16x2_t __a, int16x2_t __b) {
443 return __builtin_arm_sasx(__a, __b);
444}
445static __inline__ int16x2_t __attribute__((__always_inline__, __nodebug__))
446__shadd16(int16x2_t __a, int16x2_t __b) {
447 return __builtin_arm_shadd16(__a, __b);
448}
449static __inline__ int16x2_t __attribute__((__always_inline__, __nodebug__))
450__shasx(int16x2_t __a, int16x2_t __b) {
451 return __builtin_arm_shasx(__a, __b);
452}
453static __inline__ int16x2_t __attribute__((__always_inline__, __nodebug__))
454__shsax(int16x2_t __a, int16x2_t __b) {
455 return __builtin_arm_shsax(__a, __b);
456}
457static __inline__ int16x2_t __attribute__((__always_inline__, __nodebug__))
458__shsub16(int16x2_t __a, int16x2_t __b) {
459 return __builtin_arm_shsub16(__a, __b);
460}
461static __inline__ int16x2_t __attribute__((__always_inline__, __nodebug__))
462__ssax(int16x2_t __a, int16x2_t __b) {
463 return __builtin_arm_ssax(__a, __b);
464}
465static __inline__ int16x2_t __attribute__((__always_inline__, __nodebug__))
466__ssub16(int16x2_t __a, int16x2_t __b) {
467 return __builtin_arm_ssub16(__a, __b);
468}
469static __inline__ uint16x2_t __attribute__((__always_inline__, __nodebug__))
470__uadd16(uint16x2_t __a, uint16x2_t __b) {
471 return __builtin_arm_uadd16(__a, __b);
472}
473static __inline__ uint16x2_t __attribute__((__always_inline__, __nodebug__))
474__uasx(uint16x2_t __a, uint16x2_t __b) {
475 return __builtin_arm_uasx(__a, __b);
476}
477static __inline__ uint16x2_t __attribute__((__always_inline__, __nodebug__))
478__uhadd16(uint16x2_t __a, uint16x2_t __b) {
479 return __builtin_arm_uhadd16(__a, __b);
480}
481static __inline__ uint16x2_t __attribute__((__always_inline__, __nodebug__))
482__uhasx(uint16x2_t __a, uint16x2_t __b) {
483 return __builtin_arm_uhasx(__a, __b);
484}
485static __inline__ uint16x2_t __attribute__((__always_inline__, __nodebug__))
486__uhsax(uint16x2_t __a, uint16x2_t __b) {
487 return __builtin_arm_uhsax(__a, __b);
488}
489static __inline__ uint16x2_t __attribute__((__always_inline__, __nodebug__))
490__uhsub16(uint16x2_t __a, uint16x2_t __b) {
491 return __builtin_arm_uhsub16(__a, __b);
492}
493static __inline__ uint16x2_t __attribute__((__always_inline__, __nodebug__))
494__uqadd16(uint16x2_t __a, uint16x2_t __b) {
495 return __builtin_arm_uqadd16(__a, __b);
496}
497static __inline__ uint16x2_t __attribute__((__always_inline__, __nodebug__))
498__uqasx(uint16x2_t __a, uint16x2_t __b) {
499 return __builtin_arm_uqasx(__a, __b);
500}
501static __inline__ uint16x2_t __attribute__((__always_inline__, __nodebug__))
502__uqsax(uint16x2_t __a, uint16x2_t __b) {
503 return __builtin_arm_uqsax(__a, __b);
504}
505static __inline__ uint16x2_t __attribute__((__always_inline__, __nodebug__))
506__uqsub16(uint16x2_t __a, uint16x2_t __b) {
507 return __builtin_arm_uqsub16(__a, __b);
508}
509static __inline__ uint16x2_t __attribute__((__always_inline__, __nodebug__))
510__usax(uint16x2_t __a, uint16x2_t __b) {
511 return __builtin_arm_usax(__a, __b);
512}
513static __inline__ uint16x2_t __attribute__((__always_inline__, __nodebug__))
514__usub16(uint16x2_t __a, uint16x2_t __b) {
515 return __builtin_arm_usub16(__a, __b);
516}
517#endif
518
519/* 9.5.10 Parallel 16-bit multiplications */
520#if __ARM_FEATURE_SIMD32
521static __inline__ int32_t __attribute__((__always_inline__, __nodebug__))
522__smlad(int16x2_t __a, int16x2_t __b, int32_t __c) {
523 return __builtin_arm_smlad(__a, __b, __c);
524}
525static __inline__ int32_t __attribute__((__always_inline__, __nodebug__))
526__smladx(int16x2_t __a, int16x2_t __b, int32_t __c) {
527 return __builtin_arm_smladx(__a, __b, __c);
528}
529static __inline__ int64_t __attribute__((__always_inline__, __nodebug__))
530__smlald(int16x2_t __a, int16x2_t __b, int64_t __c) {
531 return __builtin_arm_smlald(__a, __b, __c);
532}
533static __inline__ int64_t __attribute__((__always_inline__, __nodebug__))
534__smlaldx(int16x2_t __a, int16x2_t __b, int64_t __c) {
535 return __builtin_arm_smlaldx(__a, __b, __c);
536}
537static __inline__ int32_t __attribute__((__always_inline__, __nodebug__))
538__smlsd(int16x2_t __a, int16x2_t __b, int32_t __c) {
539 return __builtin_arm_smlsd(__a, __b, __c);
540}
541static __inline__ int32_t __attribute__((__always_inline__, __nodebug__))
542__smlsdx(int16x2_t __a, int16x2_t __b, int32_t __c) {
543 return __builtin_arm_smlsdx(__a, __b, __c);
544}
545static __inline__ int64_t __attribute__((__always_inline__, __nodebug__))
546__smlsld(int16x2_t __a, int16x2_t __b, int64_t __c) {
547 return __builtin_arm_smlsld(__a, __b, __c);
548}
549static __inline__ int64_t __attribute__((__always_inline__, __nodebug__))
550__smlsldx(int16x2_t __a, int16x2_t __b, int64_t __c) {
551 return __builtin_arm_smlsldx(__a, __b, __c);
552}
553static __inline__ int32_t __attribute__((__always_inline__, __nodebug__))
554__smuad(int16x2_t __a, int16x2_t __b) {
555 return __builtin_arm_smuad(__a, __b);
556}
557static __inline__ int32_t __attribute__((__always_inline__, __nodebug__))
558__smuadx(int16x2_t __a, int16x2_t __b) {
559 return __builtin_arm_smuadx(__a, __b);
560}
561static __inline__ int32_t __attribute__((__always_inline__, __nodebug__))
562__smusd(int16x2_t __a, int16x2_t __b) {
563 return __builtin_arm_smusd(__a, __b);
564}
565static __inline__ int32_t __attribute__((__always_inline__, __nodebug__))
566__smusdx(int16x2_t __a, int16x2_t __b) {
567 return __builtin_arm_smusdx(__a, __b);
568}
569#endif
570
257571/* 9.7 CRC32 intrinsics */
258572#if __ARM_FEATURE_CRC32
259573static __inline__ uint32_t __attribute__((__always_inline__, __nodebug__))
c_headers/avx2intrin.h+2-1
......@@ -832,7 +832,8 @@ _mm256_xor_si256(__m256i __a, __m256i __b)
832832static __inline__ __m256i __DEFAULT_FN_ATTRS
833833_mm256_stream_load_si256(__m256i const *__V)
834834{
835 return (__m256i)__builtin_ia32_movntdqa256((const __v4di *)__V);
835 typedef __v4di __v4di_aligned __attribute__((aligned(32)));
836 return (__m256i)__builtin_nontemporal_load((const __v4di_aligned *)__V);
836837}
837838
838839static __inline__ __m128 __DEFAULT_FN_ATTRS
c_headers/avx512bwintrin.h+40-64
......@@ -504,115 +504,91 @@ _mm512_maskz_abs_epi16 (__mmask32 __U, __m512i __A)
504504}
505505
506506static __inline__ __m512i __DEFAULT_FN_ATTRS
507_mm512_packs_epi32 (__m512i __A, __m512i __B)
507_mm512_packs_epi32(__m512i __A, __m512i __B)
508508{
509 return (__m512i) __builtin_ia32_packssdw512_mask ((__v16si) __A,
510 (__v16si) __B,
511 (__v32hi) _mm512_setzero_hi(),
512 (__mmask32) -1);
509 return (__m512i)__builtin_ia32_packssdw512((__v16si)__A, (__v16si)__B);
513510}
514511
515512static __inline__ __m512i __DEFAULT_FN_ATTRS
516_mm512_maskz_packs_epi32 (__mmask32 __M, __m512i __A, __m512i __B)
513_mm512_maskz_packs_epi32(__mmask32 __M, __m512i __A, __m512i __B)
517514{
518 return (__m512i) __builtin_ia32_packssdw512_mask ((__v16si) __A,
519 (__v16si) __B,
520 (__v32hi) _mm512_setzero_hi(),
521 __M);
515 return (__m512i)__builtin_ia32_selectw_512((__mmask32)__M,
516 (__v32hi)_mm512_packs_epi32(__A, __B),
517 (__v32hi)_mm512_setzero_hi());
522518}
523519
524520static __inline__ __m512i __DEFAULT_FN_ATTRS
525_mm512_mask_packs_epi32 (__m512i __W, __mmask32 __M, __m512i __A,
526 __m512i __B)
521_mm512_mask_packs_epi32(__m512i __W, __mmask32 __M, __m512i __A, __m512i __B)
527522{
528 return (__m512i) __builtin_ia32_packssdw512_mask ((__v16si) __A,
529 (__v16si) __B,
530 (__v32hi) __W,
531 __M);
523 return (__m512i)__builtin_ia32_selectw_512((__mmask32)__M,
524 (__v32hi)_mm512_packs_epi32(__A, __B),
525 (__v32hi)__W);
532526}
533527
534528static __inline__ __m512i __DEFAULT_FN_ATTRS
535_mm512_packs_epi16 (__m512i __A, __m512i __B)
529_mm512_packs_epi16(__m512i __A, __m512i __B)
536530{
537 return (__m512i) __builtin_ia32_packsswb512_mask ((__v32hi) __A,
538 (__v32hi) __B,
539 (__v64qi) _mm512_setzero_qi(),
540 (__mmask64) -1);
531 return (__m512i)__builtin_ia32_packsswb512((__v32hi)__A, (__v32hi) __B);
541532}
542533
543534static __inline__ __m512i __DEFAULT_FN_ATTRS
544_mm512_mask_packs_epi16 (__m512i __W, __mmask64 __M, __m512i __A,
545 __m512i __B)
535_mm512_mask_packs_epi16(__m512i __W, __mmask64 __M, __m512i __A, __m512i __B)
546536{
547 return (__m512i) __builtin_ia32_packsswb512_mask ((__v32hi) __A,
548 (__v32hi) __B,
549 (__v64qi) __W,
550 (__mmask64) __M);
537 return (__m512i)__builtin_ia32_selectb_512((__mmask64)__M,
538 (__v64qi)_mm512_packs_epi16(__A, __B),
539 (__v64qi)__W);
551540}
552541
553542static __inline__ __m512i __DEFAULT_FN_ATTRS
554_mm512_maskz_packs_epi16 (__mmask64 __M, __m512i __A, __m512i __B)
543_mm512_maskz_packs_epi16(__mmask64 __M, __m512i __A, __m512i __B)
555544{
556 return (__m512i) __builtin_ia32_packsswb512_mask ((__v32hi) __A,
557 (__v32hi) __B,
558 (__v64qi) _mm512_setzero_qi(),
559 __M);
545 return (__m512i)__builtin_ia32_selectb_512((__mmask64)__M,
546 (__v64qi)_mm512_packs_epi16(__A, __B),
547 (__v64qi)_mm512_setzero_qi());
560548}
561549
562550static __inline__ __m512i __DEFAULT_FN_ATTRS
563_mm512_packus_epi32 (__m512i __A, __m512i __B)
551_mm512_packus_epi32(__m512i __A, __m512i __B)
564552{
565 return (__m512i) __builtin_ia32_packusdw512_mask ((__v16si) __A,
566 (__v16si) __B,
567 (__v32hi) _mm512_setzero_hi(),
568 (__mmask32) -1);
553 return (__m512i)__builtin_ia32_packusdw512((__v16si) __A, (__v16si) __B);
569554}
570555
571556static __inline__ __m512i __DEFAULT_FN_ATTRS
572_mm512_maskz_packus_epi32 (__mmask32 __M, __m512i __A, __m512i __B)
557_mm512_maskz_packus_epi32(__mmask32 __M, __m512i __A, __m512i __B)
573558{
574 return (__m512i) __builtin_ia32_packusdw512_mask ((__v16si) __A,
575 (__v16si) __B,
576 (__v32hi) _mm512_setzero_hi(),
577 __M);
559 return (__m512i)__builtin_ia32_selectw_512((__mmask32)__M,
560 (__v32hi)_mm512_packus_epi32(__A, __B),
561 (__v32hi)_mm512_setzero_hi());
578562}
579563
580564static __inline__ __m512i __DEFAULT_FN_ATTRS
581_mm512_mask_packus_epi32 (__m512i __W, __mmask32 __M, __m512i __A,
582 __m512i __B)
565_mm512_mask_packus_epi32(__m512i __W, __mmask32 __M, __m512i __A, __m512i __B)
583566{
584 return (__m512i) __builtin_ia32_packusdw512_mask ((__v16si) __A,
585 (__v16si) __B,
586 (__v32hi) __W,
587 __M);
567 return (__m512i)__builtin_ia32_selectw_512((__mmask32)__M,
568 (__v32hi)_mm512_packus_epi32(__A, __B),
569 (__v32hi)__W);
588570}
589571
590572static __inline__ __m512i __DEFAULT_FN_ATTRS
591_mm512_packus_epi16 (__m512i __A, __m512i __B)
573_mm512_packus_epi16(__m512i __A, __m512i __B)
592574{
593 return (__m512i) __builtin_ia32_packuswb512_mask ((__v32hi) __A,
594 (__v32hi) __B,
595 (__v64qi) _mm512_setzero_qi(),
596 (__mmask64) -1);
575 return (__m512i)__builtin_ia32_packuswb512((__v32hi) __A, (__v32hi) __B);
597576}
598577
599578static __inline__ __m512i __DEFAULT_FN_ATTRS
600_mm512_mask_packus_epi16 (__m512i __W, __mmask64 __M, __m512i __A,
601 __m512i __B)
579_mm512_mask_packus_epi16(__m512i __W, __mmask64 __M, __m512i __A, __m512i __B)
602580{
603 return (__m512i) __builtin_ia32_packuswb512_mask ((__v32hi) __A,
604 (__v32hi) __B,
605 (__v64qi) __W,
606 (__mmask64) __M);
581 return (__m512i)__builtin_ia32_selectb_512((__mmask64)__M,
582 (__v64qi)_mm512_packus_epi16(__A, __B),
583 (__v64qi)__W);
607584}
608585
609586static __inline__ __m512i __DEFAULT_FN_ATTRS
610_mm512_maskz_packus_epi16 (__mmask64 __M, __m512i __A, __m512i __B)
587_mm512_maskz_packus_epi16(__mmask64 __M, __m512i __A, __m512i __B)
611588{
612 return (__m512i) __builtin_ia32_packuswb512_mask ((__v32hi) __A,
613 (__v32hi) __B,
614 (__v64qi) _mm512_setzero_qi(),
615 (__mmask64) __M);
589 return (__m512i)__builtin_ia32_selectb_512((__mmask64)__M,
590 (__v64qi)_mm512_packus_epi16(__A, __B),
591 (__v64qi)_mm512_setzero_qi());
616592}
617593
618594static __inline__ __m512i __DEFAULT_FN_ATTRS
c_headers/avx512dqintrin.h+46-49
......@@ -995,51 +995,50 @@ _mm512_maskz_broadcast_f32x2 (__mmask16 __M, __m128 __A)
995995}
996996
997997static __inline__ __m512 __DEFAULT_FN_ATTRS
998_mm512_broadcast_f32x8 (__m256 __A)
998_mm512_broadcast_f32x8(__m256 __A)
999999{
1000 return (__m512) __builtin_ia32_broadcastf32x8_512_mask ((__v8sf) __A,
1001 _mm512_undefined_ps(),
1002 (__mmask16) -1);
1000 return (__m512)__builtin_shufflevector((__v8sf)__A, (__v8sf)__A,
1001 0, 1, 2, 3, 4, 5, 6, 7,
1002 0, 1, 2, 3, 4, 5, 6, 7);
10031003}
10041004
10051005static __inline__ __m512 __DEFAULT_FN_ATTRS
1006_mm512_mask_broadcast_f32x8 (__m512 __O, __mmask16 __M, __m256 __A)
1006_mm512_mask_broadcast_f32x8(__m512 __O, __mmask16 __M, __m256 __A)
10071007{
1008 return (__m512) __builtin_ia32_broadcastf32x8_512_mask ((__v8sf) __A,
1009 (__v16sf)__O,
1010 __M);
1008 return (__m512)__builtin_ia32_selectps_512((__mmask8)__M,
1009 (__v16sf)_mm512_broadcast_f32x8(__A),
1010 (__v16sf)__O);
10111011}
10121012
10131013static __inline__ __m512 __DEFAULT_FN_ATTRS
1014_mm512_maskz_broadcast_f32x8 (__mmask16 __M, __m256 __A)
1014_mm512_maskz_broadcast_f32x8(__mmask16 __M, __m256 __A)
10151015{
1016 return (__m512) __builtin_ia32_broadcastf32x8_512_mask ((__v8sf) __A,
1017 (__v16sf)_mm512_setzero_ps (),
1018 __M);
1016 return (__m512)__builtin_ia32_selectps_512((__mmask8)__M,
1017 (__v16sf)_mm512_broadcast_f32x8(__A),
1018 (__v16sf)_mm512_setzero_ps());
10191019}
10201020
10211021static __inline__ __m512d __DEFAULT_FN_ATTRS
1022_mm512_broadcast_f64x2 (__m128d __A)
1022_mm512_broadcast_f64x2(__m128d __A)
10231023{
1024 return (__m512d) __builtin_ia32_broadcastf64x2_512_mask ((__v2df) __A,
1025 (__v8df)_mm512_undefined_pd(),
1026 (__mmask8) -1);
1024 return (__m512d)__builtin_shufflevector((__v2df)__A, (__v2df)__A,
1025 0, 1, 0, 1, 0, 1, 0, 1);
10271026}
10281027
10291028static __inline__ __m512d __DEFAULT_FN_ATTRS
1030_mm512_mask_broadcast_f64x2 (__m512d __O, __mmask8 __M, __m128d __A)
1029_mm512_mask_broadcast_f64x2(__m512d __O, __mmask8 __M, __m128d __A)
10311030{
1032 return (__m512d) __builtin_ia32_broadcastf64x2_512_mask ((__v2df) __A,
1033 (__v8df)
1034 __O, __M);
1031 return (__m512d)__builtin_ia32_selectpd_512((__mmask8)__M,
1032 (__v8df)_mm512_broadcast_f64x2(__A),
1033 (__v8df)__O);
10351034}
10361035
10371036static __inline__ __m512d __DEFAULT_FN_ATTRS
1038_mm512_maskz_broadcast_f64x2 (__mmask8 __M, __m128d __A)
1037_mm512_maskz_broadcast_f64x2(__mmask8 __M, __m128d __A)
10391038{
1040 return (__m512d) __builtin_ia32_broadcastf64x2_512_mask ((__v2df) __A,
1041 (__v8df)_mm512_setzero_ps (),
1042 __M);
1039 return (__m512d)__builtin_ia32_selectpd_512((__mmask8)__M,
1040 (__v8df)_mm512_broadcast_f64x2(__A),
1041 (__v8df)_mm512_setzero_pd());
10431042}
10441043
10451044static __inline__ __m512i __DEFAULT_FN_ATTRS
......@@ -1067,52 +1066,50 @@ _mm512_maskz_broadcast_i32x2 (__mmask16 __M, __m128i __A)
10671066}
10681067
10691068static __inline__ __m512i __DEFAULT_FN_ATTRS
1070_mm512_broadcast_i32x8 (__m256i __A)
1069_mm512_broadcast_i32x8(__m256i __A)
10711070{
1072 return (__m512i) __builtin_ia32_broadcasti32x8_512_mask ((__v8si) __A,
1073 (__v16si)_mm512_setzero_si512(),
1074 (__mmask16) -1);
1071 return (__m512i)__builtin_shufflevector((__v8si)__A, (__v8si)__A,
1072 0, 1, 2, 3, 4, 5, 6, 7,
1073 0, 1, 2, 3, 4, 5, 6, 7);
10751074}
10761075
10771076static __inline__ __m512i __DEFAULT_FN_ATTRS
1078_mm512_mask_broadcast_i32x8 (__m512i __O, __mmask16 __M, __m256i __A)
1077_mm512_mask_broadcast_i32x8(__m512i __O, __mmask16 __M, __m256i __A)
10791078{
1080 return (__m512i) __builtin_ia32_broadcasti32x8_512_mask ((__v8si) __A,
1081 (__v16si)__O,
1082 __M);
1079 return (__m512i)__builtin_ia32_selectd_512((__mmask8)__M,
1080 (__v16si)_mm512_broadcast_i32x8(__A),
1081 (__v16si)__O);
10831082}
10841083
10851084static __inline__ __m512i __DEFAULT_FN_ATTRS
1086_mm512_maskz_broadcast_i32x8 (__mmask16 __M, __m256i __A)
1085_mm512_maskz_broadcast_i32x8(__mmask16 __M, __m256i __A)
10871086{
1088 return (__m512i) __builtin_ia32_broadcasti32x8_512_mask ((__v8si) __A,
1089 (__v16si)
1090 _mm512_setzero_si512 (),
1091 __M);
1087 return (__m512i)__builtin_ia32_selectd_512((__mmask8)__M,
1088 (__v16si)_mm512_broadcast_i32x8(__A),
1089 (__v16si)_mm512_setzero_si512());
10921090}
10931091
10941092static __inline__ __m512i __DEFAULT_FN_ATTRS
1095_mm512_broadcast_i64x2 (__m128i __A)
1093_mm512_broadcast_i64x2(__m128i __A)
10961094{
1097 return (__m512i) __builtin_ia32_broadcasti64x2_512_mask ((__v2di) __A,
1098 (__v8di)_mm512_setzero_si512(),
1099 (__mmask8) -1);
1095 return (__m512i)__builtin_shufflevector((__v2di)__A, (__v2di)__A,
1096 0, 1, 0, 1, 0, 1, 0, 1);
11001097}
11011098
11021099static __inline__ __m512i __DEFAULT_FN_ATTRS
1103_mm512_mask_broadcast_i64x2 (__m512i __O, __mmask8 __M, __m128i __A)
1100_mm512_mask_broadcast_i64x2(__m512i __O, __mmask8 __M, __m128i __A)
11041101{
1105 return (__m512i) __builtin_ia32_broadcasti64x2_512_mask ((__v2di) __A,
1106 (__v8di)
1107 __O, __M);
1102 return (__m512i)__builtin_ia32_selectq_512((__mmask8)__M,
1103 (__v8di)_mm512_broadcast_i64x2(__A),
1104 (__v8di)__O);
11081105}
11091106
11101107static __inline__ __m512i __DEFAULT_FN_ATTRS
1111_mm512_maskz_broadcast_i64x2 (__mmask8 __M, __m128i __A)
1108_mm512_maskz_broadcast_i64x2(__mmask8 __M, __m128i __A)
11121109{
1113 return (__m512i) __builtin_ia32_broadcasti64x2_512_mask ((__v2di) __A,
1114 (__v8di)_mm512_setzero_si512 (),
1115 __M);
1110 return (__m512i)__builtin_ia32_selectq_512((__mmask8)__M,
1111 (__v8di)_mm512_broadcast_i64x2(__A),
1112 (__v8di)_mm512_setzero_si512());
11161113}
11171114
11181115#define _mm512_extractf32x8_ps(A, imm) __extension__ ({ \
c_headers/avx512fintrin.h+264-105
......@@ -528,6 +528,116 @@ _mm512_mask2int(__mmask16 __a)
528528 return (int)__a;
529529}
530530
531/// \brief Constructs a 512-bit floating-point vector of [8 x double] from a
532/// 128-bit floating-point vector of [2 x double]. The lower 128 bits
533/// contain the value of the source vector. The upper 384 bits are set
534/// to zero.
535///
536/// \headerfile <x86intrin.h>
537///
538/// This intrinsic has no corresponding instruction.
539///
540/// \param __a
541/// A 128-bit vector of [2 x double].
542/// \returns A 512-bit floating-point vector of [8 x double]. The lower 128 bits
543/// contain the value of the parameter. The upper 384 bits are set to zero.
544static __inline __m512d __DEFAULT_FN_ATTRS
545_mm512_zextpd128_pd512(__m128d __a)
546{
547 return __builtin_shufflevector((__v2df)__a, (__v2df)_mm_setzero_pd(), 0, 1, 2, 3, 2, 3, 2, 3);
548}
549
550/// \brief Constructs a 512-bit floating-point vector of [8 x double] from a
551/// 256-bit floating-point vector of [4 x double]. The lower 256 bits
552/// contain the value of the source vector. The upper 256 bits are set
553/// to zero.
554///
555/// \headerfile <x86intrin.h>
556///
557/// This intrinsic has no corresponding instruction.
558///
559/// \param __a
560/// A 256-bit vector of [4 x double].
561/// \returns A 512-bit floating-point vector of [8 x double]. The lower 256 bits
562/// contain the value of the parameter. The upper 256 bits are set to zero.
563static __inline __m512d __DEFAULT_FN_ATTRS
564_mm512_zextpd256_pd512(__m256d __a)
565{
566 return __builtin_shufflevector((__v4df)__a, (__v4df)_mm256_setzero_pd(), 0, 1, 2, 3, 4, 5, 6, 7);
567}
568
569/// \brief Constructs a 512-bit floating-point vector of [16 x float] from a
570/// 128-bit floating-point vector of [4 x float]. The lower 128 bits contain
571/// the value of the source vector. The upper 384 bits are set to zero.
572///
573/// \headerfile <x86intrin.h>
574///
575/// This intrinsic has no corresponding instruction.
576///
577/// \param __a
578/// A 128-bit vector of [4 x float].
579/// \returns A 512-bit floating-point vector of [16 x float]. The lower 128 bits
580/// contain the value of the parameter. The upper 384 bits are set to zero.
581static __inline __m512 __DEFAULT_FN_ATTRS
582_mm512_zextps128_ps512(__m128 __a)
583{
584 return __builtin_shufflevector((__v4sf)__a, (__v4sf)_mm_setzero_ps(), 0, 1, 2, 3, 4, 5, 6, 7, 4, 5, 6, 7, 4, 5, 6, 7);
585}
586
587/// \brief Constructs a 512-bit floating-point vector of [16 x float] from a
588/// 256-bit floating-point vector of [8 x float]. The lower 256 bits contain
589/// the value of the source vector. The upper 256 bits are set to zero.
590///
591/// \headerfile <x86intrin.h>
592///
593/// This intrinsic has no corresponding instruction.
594///
595/// \param __a
596/// A 256-bit vector of [8 x float].
597/// \returns A 512-bit floating-point vector of [16 x float]. The lower 256 bits
598/// contain the value of the parameter. The upper 256 bits are set to zero.
599static __inline __m512 __DEFAULT_FN_ATTRS
600_mm512_zextps256_ps512(__m256 __a)
601{
602 return __builtin_shufflevector((__v8sf)__a, (__v8sf)_mm256_setzero_ps(), 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
603}
604
605/// \brief Constructs a 512-bit integer vector from a 128-bit integer vector.
606/// The lower 128 bits contain the value of the source vector. The upper
607/// 384 bits are set to zero.
608///
609/// \headerfile <x86intrin.h>
610///
611/// This intrinsic has no corresponding instruction.
612///
613/// \param __a
614/// A 128-bit integer vector.
615/// \returns A 512-bit integer vector. The lower 128 bits contain the value of
616/// the parameter. The upper 384 bits are set to zero.
617static __inline __m512i __DEFAULT_FN_ATTRS
618_mm512_zextsi128_si512(__m128i __a)
619{
620 return __builtin_shufflevector((__v2di)__a, (__v2di)_mm_setzero_si128(), 0, 1, 2, 3, 2, 3, 2, 3);
621}
622
623/// \brief Constructs a 512-bit integer vector from a 256-bit integer vector.
624/// The lower 256 bits contain the value of the source vector. The upper
625/// 256 bits are set to zero.
626///
627/// \headerfile <x86intrin.h>
628///
629/// This intrinsic has no corresponding instruction.
630///
631/// \param __a
632/// A 256-bit integer vector.
633/// \returns A 512-bit integer vector. The lower 256 bits contain the value of
634/// the parameter. The upper 256 bits are set to zero.
635static __inline __m512i __DEFAULT_FN_ATTRS
636_mm512_zextsi256_si512(__m256i __a)
637{
638 return __builtin_shufflevector((__v4di)__a, (__v4di)_mm256_setzero_si256(), 0, 1, 2, 3, 4, 5, 6, 7);
639}
640
531641/* Bitwise operators */
532642static __inline__ __m512i __DEFAULT_FN_ATTRS
533643_mm512_and_epi32(__m512i __a, __m512i __b)
......@@ -4179,7 +4289,7 @@ static __inline__ __m512i __DEFAULT_FN_ATTRS
41794289_mm512_maskz_cvtps_epu32 ( __mmask16 __U, __m512 __A)
41804290{
41814291 return (__m512i) __builtin_ia32_cvtps2udq512_mask ((__v16sf) __A,
4182 (__v16si)
4292 (__v16si)
41834293 _mm512_setzero_si512 (),
41844294 (__mmask16) __U ,
41854295 _MM_FROUND_CUR_DIRECTION);
......@@ -4229,6 +4339,18 @@ _mm512_maskz_cvtpd_epu32 (__mmask8 __U, __m512d __A)
42294339 _MM_FROUND_CUR_DIRECTION);
42304340}
42314341
4342static __inline__ double __DEFAULT_FN_ATTRS
4343_mm512_cvtsd_f64(__m512d __a)
4344{
4345 return __a[0];
4346}
4347
4348static __inline__ float __DEFAULT_FN_ATTRS
4349_mm512_cvtss_f32(__m512 __a)
4350{
4351 return __a[0];
4352}
4353
42324354/* Unpack and Interleave */
42334355
42344356static __inline __m512d __DEFAULT_FN_ATTRS
......@@ -4540,7 +4662,7 @@ _mm512_maskz_loadu_pd(__mmask8 __U, void const *__P)
45404662}
45414663
45424664static __inline __m512d __DEFAULT_FN_ATTRS
4543_mm512_loadu_pd(double const *__p)
4665_mm512_loadu_pd(void const *__p)
45444666{
45454667 struct __loadu_pd {
45464668 __m512d __v;
......@@ -4549,7 +4671,7 @@ _mm512_loadu_pd(double const *__p)
45494671}
45504672
45514673static __inline __m512 __DEFAULT_FN_ATTRS
4552_mm512_loadu_ps(float const *__p)
4674_mm512_loadu_ps(void const *__p)
45534675{
45544676 struct __loadu_ps {
45554677 __m512 __v;
......@@ -4558,7 +4680,7 @@ _mm512_loadu_ps(float const *__p)
45584680}
45594681
45604682static __inline __m512 __DEFAULT_FN_ATTRS
4561_mm512_load_ps(float const *__p)
4683_mm512_load_ps(void const *__p)
45624684{
45634685 return (__m512) __builtin_ia32_loadaps512_mask ((const __v16sf *)__p,
45644686 (__v16sf)
......@@ -4584,7 +4706,7 @@ _mm512_maskz_load_ps(__mmask16 __U, void const *__P)
45844706}
45854707
45864708static __inline __m512d __DEFAULT_FN_ATTRS
4587_mm512_load_pd(double const *__p)
4709_mm512_load_pd(void const *__p)
45884710{
45894711 return (__m512d) __builtin_ia32_loadapd512_mask ((const __v8df *)__p,
45904712 (__v8df)
......@@ -7278,107 +7400,97 @@ _mm_maskz_sqrt_ss (__mmask8 __U, __m128 __A, __m128 __B)
72787400 (__mmask8)(U), (int)(R)); })
72797401
72807402static __inline__ __m512 __DEFAULT_FN_ATTRS
7281_mm512_broadcast_f32x4 (__m128 __A)
7403_mm512_broadcast_f32x4(__m128 __A)
72827404{
7283 return (__m512) __builtin_ia32_broadcastf32x4_512 ((__v4sf) __A,
7284 (__v16sf)
7285 _mm512_undefined_ps (),
7286 (__mmask16) -1);
7405 return (__m512)__builtin_shufflevector((__v4sf)__A, (__v4sf)__A,
7406 0, 1, 2, 3, 0, 1, 2, 3,
7407 0, 1, 2, 3, 0, 1, 2, 3);
72877408}
72887409
72897410static __inline__ __m512 __DEFAULT_FN_ATTRS
7290_mm512_mask_broadcast_f32x4 (__m512 __O, __mmask16 __M, __m128 __A)
7411_mm512_mask_broadcast_f32x4(__m512 __O, __mmask16 __M, __m128 __A)
72917412{
7292 return (__m512) __builtin_ia32_broadcastf32x4_512 ((__v4sf) __A,
7293 (__v16sf) __O,
7294 __M);
7413 return (__m512)__builtin_ia32_selectps_512((__mmask16)__M,
7414 (__v16sf)_mm512_broadcast_f32x4(__A),
7415 (__v16sf)__O);
72957416}
72967417
72977418static __inline__ __m512 __DEFAULT_FN_ATTRS
7298_mm512_maskz_broadcast_f32x4 (__mmask16 __M, __m128 __A)
7419_mm512_maskz_broadcast_f32x4(__mmask16 __M, __m128 __A)
72997420{
7300 return (__m512) __builtin_ia32_broadcastf32x4_512 ((__v4sf) __A,
7301 (__v16sf)
7302 _mm512_setzero_ps (),
7303 __M);
7421 return (__m512)__builtin_ia32_selectps_512((__mmask16)__M,
7422 (__v16sf)_mm512_broadcast_f32x4(__A),
7423 (__v16sf)_mm512_setzero_ps());
73047424}
73057425
73067426static __inline__ __m512d __DEFAULT_FN_ATTRS
7307_mm512_broadcast_f64x4 (__m256d __A)
7427_mm512_broadcast_f64x4(__m256d __A)
73087428{
7309 return (__m512d) __builtin_ia32_broadcastf64x4_512 ((__v4df) __A,
7310 (__v8df)
7311 _mm512_undefined_pd (),
7312 (__mmask8) -1);
7429 return (__m512d)__builtin_shufflevector((__v4df)__A, (__v4df)__A,
7430 0, 1, 2, 3, 0, 1, 2, 3);
73137431}
73147432
73157433static __inline__ __m512d __DEFAULT_FN_ATTRS
7316_mm512_mask_broadcast_f64x4 (__m512d __O, __mmask8 __M, __m256d __A)
7434_mm512_mask_broadcast_f64x4(__m512d __O, __mmask8 __M, __m256d __A)
73177435{
7318 return (__m512d) __builtin_ia32_broadcastf64x4_512 ((__v4df) __A,
7319 (__v8df) __O,
7320 __M);
7436 return (__m512d)__builtin_ia32_selectpd_512((__mmask8)__M,
7437 (__v8df)_mm512_broadcast_f64x4(__A),
7438 (__v8df)__O);
73217439}
73227440
73237441static __inline__ __m512d __DEFAULT_FN_ATTRS
7324_mm512_maskz_broadcast_f64x4 (__mmask8 __M, __m256d __A)
7442_mm512_maskz_broadcast_f64x4(__mmask8 __M, __m256d __A)
73257443{
7326 return (__m512d) __builtin_ia32_broadcastf64x4_512 ((__v4df) __A,
7327 (__v8df)
7328 _mm512_setzero_pd (),
7329 __M);
7444 return (__m512d)__builtin_ia32_selectpd_512((__mmask8)__M,
7445 (__v8df)_mm512_broadcast_f64x4(__A),
7446 (__v8df)_mm512_setzero_pd());
73307447}
73317448
73327449static __inline__ __m512i __DEFAULT_FN_ATTRS
7333_mm512_broadcast_i32x4 (__m128i __A)
7450_mm512_broadcast_i32x4(__m128i __A)
73347451{
7335 return (__m512i) __builtin_ia32_broadcasti32x4_512 ((__v4si) __A,
7336 (__v16si)
7337 _mm512_undefined_epi32 (),
7338 (__mmask16) -1);
7452 return (__m512i)__builtin_shufflevector((__v4si)__A, (__v4si)__A,
7453 0, 1, 2, 3, 0, 1, 2, 3,
7454 0, 1, 2, 3, 0, 1, 2, 3);
73397455}
73407456
73417457static __inline__ __m512i __DEFAULT_FN_ATTRS
7342_mm512_mask_broadcast_i32x4 (__m512i __O, __mmask16 __M, __m128i __A)
7458_mm512_mask_broadcast_i32x4(__m512i __O, __mmask16 __M, __m128i __A)
73437459{
7344 return (__m512i) __builtin_ia32_broadcasti32x4_512 ((__v4si) __A,
7345 (__v16si) __O,
7346 __M);
7460 return (__m512i)__builtin_ia32_selectd_512((__mmask16)__M,
7461 (__v16si)_mm512_broadcast_i32x4(__A),
7462 (__v16si)__O);
73477463}
73487464
73497465static __inline__ __m512i __DEFAULT_FN_ATTRS
7350_mm512_maskz_broadcast_i32x4 (__mmask16 __M, __m128i __A)
7466_mm512_maskz_broadcast_i32x4(__mmask16 __M, __m128i __A)
73517467{
7352 return (__m512i) __builtin_ia32_broadcasti32x4_512 ((__v4si) __A,
7353 (__v16si)
7354 _mm512_setzero_si512 (),
7355 __M);
7468 return (__m512i)__builtin_ia32_selectd_512((__mmask16)__M,
7469 (__v16si)_mm512_broadcast_i32x4(__A),
7470 (__v16si)_mm512_setzero_si512());
73567471}
73577472
73587473static __inline__ __m512i __DEFAULT_FN_ATTRS
7359_mm512_broadcast_i64x4 (__m256i __A)
7474_mm512_broadcast_i64x4(__m256i __A)
73607475{
7361 return (__m512i) __builtin_ia32_broadcasti64x4_512 ((__v4di) __A,
7362 (__v8di)
7363 _mm512_undefined_epi32 (),
7364 (__mmask8) -1);
7476 return (__m512i)__builtin_shufflevector((__v4di)__A, (__v4di)__A,
7477 0, 1, 2, 3, 0, 1, 2, 3);
73657478}
73667479
73677480static __inline__ __m512i __DEFAULT_FN_ATTRS
7368_mm512_mask_broadcast_i64x4 (__m512i __O, __mmask8 __M, __m256i __A)
7481_mm512_mask_broadcast_i64x4(__m512i __O, __mmask8 __M, __m256i __A)
73697482{
7370 return (__m512i) __builtin_ia32_broadcasti64x4_512 ((__v4di) __A,
7371 (__v8di) __O,
7372 __M);
7483 return (__m512i)__builtin_ia32_selectq_512((__mmask8)__M,
7484 (__v8di)_mm512_broadcast_i64x4(__A),
7485 (__v8di)__O);
73737486}
73747487
73757488static __inline__ __m512i __DEFAULT_FN_ATTRS
7376_mm512_maskz_broadcast_i64x4 (__mmask8 __M, __m256i __A)
7489_mm512_maskz_broadcast_i64x4(__mmask8 __M, __m256i __A)
73777490{
7378 return (__m512i) __builtin_ia32_broadcasti64x4_512 ((__v4di) __A,
7379 (__v8di)
7380 _mm512_setzero_si512 (),
7381 __M);
7491 return (__m512i)__builtin_ia32_selectq_512((__mmask8)__M,
7492 (__v8di)_mm512_broadcast_i64x4(__A),
7493 (__v8di)_mm512_setzero_si512());
73827494}
73837495
73847496static __inline__ __m512d __DEFAULT_FN_ATTRS
......@@ -7860,12 +7972,12 @@ _mm512_mask_cvtepi64_storeu_epi16 (void *__P, __mmask8 __M, __m512i __A)
78607972 3 + ((imm) & 0x3) * 4); })
78617973
78627974#define _mm512_mask_extracti32x4_epi32(W, U, A, imm) __extension__ ({ \
7863 (__m128i)__builtin_ia32_selectd_128((__mmask8)__U, \
7975 (__m128i)__builtin_ia32_selectd_128((__mmask8)(U), \
78647976 (__v4si)_mm512_extracti32x4_epi32((A), (imm)), \
7865 (__v4si)__W); })
7977 (__v4si)(W)); })
78667978
78677979#define _mm512_maskz_extracti32x4_epi32(U, A, imm) __extension__ ({ \
7868 (__m128i)__builtin_ia32_selectd_128((__mmask8)__U, \
7980 (__m128i)__builtin_ia32_selectd_128((__mmask8)(U), \
78697981 (__v4si)_mm512_extracti32x4_epi32((A), (imm)), \
78707982 (__v4si)_mm_setzero_si128()); })
78717983
......@@ -7878,12 +7990,12 @@ _mm512_mask_cvtepi64_storeu_epi16 (void *__P, __mmask8 __M, __m512i __A)
78787990 ((imm) & 1) ? 7 : 3); })
78797991
78807992#define _mm512_mask_extracti64x4_epi64(W, U, A, imm) __extension__ ({ \
7881 (__m256i)__builtin_ia32_selectq_256((__mmask8)__U, \
7993 (__m256i)__builtin_ia32_selectq_256((__mmask8)(U), \
78827994 (__v4di)_mm512_extracti64x4_epi64((A), (imm)), \
7883 (__v4di)__W); })
7995 (__v4di)(W)); })
78847996
78857997#define _mm512_maskz_extracti64x4_epi64(U, A, imm) __extension__ ({ \
7886 (__m256i)__builtin_ia32_selectq_256((__mmask8)__U, \
7998 (__m256i)__builtin_ia32_selectq_256((__mmask8)(U), \
78877999 (__v4di)_mm512_extracti64x4_epi64((A), (imm)), \
78888000 (__v4di)_mm256_setzero_si256()); })
78898001
......@@ -8159,11 +8271,11 @@ _mm512_maskz_getexp_ps (__mmask16 __U, __m512 __A)
81598271 (__v8di)(__m512i)(index), (__mmask8)-1, \
81608272 (int)(scale)); })
81618273
8162#define _mm512_mask_i64gather_ps( __v1_old, __mask, __index,\
8163 __addr, __scale) __extension__({\
8164__builtin_ia32_gatherdiv16sf ((__v8sf) __v1_old,\
8165 __addr,(__v8di) __index, __mask, __scale);\
8166})
8274#define _mm512_mask_i64gather_ps(v1_old, mask, index, addr, scale) __extension__({\
8275 (__m256)__builtin_ia32_gatherdiv16sf((__v8sf)(__m256)(v1_old),\
8276 (float const *)(addr), \
8277 (__v8di)(__m512i)(index), \
8278 (__mmask8)(mask), (int)(scale)); })
81678279
81688280#define _mm512_i64gather_epi32(index, addr, scale) __extension__ ({\
81698281 (__m256i)__builtin_ia32_gatherdiv16si((__v8si)_mm256_undefined_ps(), \
......@@ -8858,6 +8970,8 @@ _mm512_permutexvar_epi32 (__m512i __X, __m512i __Y)
88588970 (__mmask16) -1);
88598971}
88608972
8973#define _mm512_permutevar_epi32 _mm512_permutexvar_epi32
8974
88618975static __inline__ __m512i __DEFAULT_FN_ATTRS
88628976_mm512_mask_permutexvar_epi32 (__m512i __W, __mmask16 __M, __m512i __X,
88638977 __m512i __Y)
......@@ -8868,6 +8982,8 @@ _mm512_mask_permutexvar_epi32 (__m512i __W, __mmask16 __M, __m512i __X,
88688982 __M);
88698983}
88708984
8985#define _mm512_mask_permutevar_epi32 _mm512_mask_permutexvar_epi32
8986
88718987static __inline__ __mmask16 __DEFAULT_FN_ATTRS
88728988_mm512_kand (__mmask16 __A, __mmask16 __B)
88738989{
......@@ -8919,25 +9035,29 @@ _mm512_kxor (__mmask16 __A, __mmask16 __B)
89199035static __inline__ void __DEFAULT_FN_ATTRS
89209036_mm512_stream_si512 (__m512i * __P, __m512i __A)
89219037{
8922 __builtin_nontemporal_store((__v8di)__A, (__v8di*)__P);
9038 typedef __v8di __v8di_aligned __attribute__((aligned(64)));
9039 __builtin_nontemporal_store((__v8di_aligned)__A, (__v8di_aligned*)__P);
89239040}
89249041
89259042static __inline__ __m512i __DEFAULT_FN_ATTRS
89269043_mm512_stream_load_si512 (void *__P)
89279044{
8928 return __builtin_ia32_movntdqa512 ((__v8di *)__P);
9045 typedef __v8di __v8di_aligned __attribute__((aligned(64)));
9046 return (__m512i) __builtin_nontemporal_load((const __v8di_aligned *)__P);
89299047}
89309048
89319049static __inline__ void __DEFAULT_FN_ATTRS
89329050_mm512_stream_pd (double *__P, __m512d __A)
89339051{
8934 __builtin_nontemporal_store((__v8df)__A, (__v8df*)__P);
9052 typedef __v8df __v8df_aligned __attribute__((aligned(64)));
9053 __builtin_nontemporal_store((__v8df_aligned)__A, (__v8df_aligned*)__P);
89359054}
89369055
89379056static __inline__ void __DEFAULT_FN_ATTRS
89389057_mm512_stream_ps (float *__P, __m512 __A)
89399058{
8940 __builtin_nontemporal_store((__v16sf)__A, (__v16sf*)__P);
9059 typedef __v16sf __v16sf_aligned __attribute__((aligned(64)));
9060 __builtin_nontemporal_store((__v16sf_aligned)__A, (__v16sf_aligned*)__P);
89419061}
89429062
89439063static __inline__ __m512d __DEFAULT_FN_ATTRS
......@@ -9101,39 +9221,39 @@ _mm512_maskz_moveldup_ps (__mmask16 __U, __m512 __A)
91019221static __inline__ __m128 __DEFAULT_FN_ATTRS
91029222_mm_mask_move_ss (__m128 __W, __mmask8 __U, __m128 __A, __m128 __B)
91039223{
9104 __m128 res = __A;
9224 __m128 res = __A;
91059225 res[0] = (__U & 1) ? __B[0] : __W[0];
9106 return res;
9226 return res;
91079227}
91089228
91099229static __inline__ __m128 __DEFAULT_FN_ATTRS
91109230_mm_maskz_move_ss (__mmask8 __U, __m128 __A, __m128 __B)
91119231{
9112 __m128 res = __A;
9113 res[0] = (__U & 1) ? __B[0] : 0;
9114 return res;
9232 __m128 res = __A;
9233 res[0] = (__U & 1) ? __B[0] : 0;
9234 return res;
91159235}
91169236
91179237static __inline__ __m128d __DEFAULT_FN_ATTRS
91189238_mm_mask_move_sd (__m128d __W, __mmask8 __U, __m128d __A, __m128d __B)
91199239{
9120 __m128d res = __A;
9240 __m128d res = __A;
91219241 res[0] = (__U & 1) ? __B[0] : __W[0];
9122 return res;
9242 return res;
91239243}
91249244
91259245static __inline__ __m128d __DEFAULT_FN_ATTRS
91269246_mm_maskz_move_sd (__mmask8 __U, __m128d __A, __m128d __B)
91279247{
9128 __m128d res = __A;
9129 res[0] = (__U & 1) ? __B[0] : 0;
9130 return res;
9248 __m128d res = __A;
9249 res[0] = (__U & 1) ? __B[0] : 0;
9250 return res;
91319251}
91329252
91339253static __inline__ void __DEFAULT_FN_ATTRS
91349254_mm_mask_store_ss (float * __W, __mmask8 __U, __m128 __A)
91359255{
9136 __builtin_ia32_storess128_mask ((__v16sf *)__W,
9256 __builtin_ia32_storess128_mask ((__v16sf *)__W,
91379257 (__v16sf) _mm512_castps128_ps512(__A),
91389258 (__mmask16) __U & (__mmask16)1);
91399259}
......@@ -9141,7 +9261,7 @@ _mm_mask_store_ss (float * __W, __mmask8 __U, __m128 __A)
91419261static __inline__ void __DEFAULT_FN_ATTRS
91429262_mm_mask_store_sd (double * __W, __mmask8 __U, __m128d __A)
91439263{
9144 __builtin_ia32_storesd128_mask ((__v8df *)__W,
9264 __builtin_ia32_storesd128_mask ((__v8df *)__W,
91459265 (__v8df) _mm512_castpd128_pd512(__A),
91469266 (__mmask8) __U & 1);
91479267}
......@@ -9490,7 +9610,7 @@ _mm_mask_cvtsd_ss (__m128 __W, __mmask8 __U, __m128 __A, __m128d __B)
94909610{
94919611 return __builtin_ia32_cvtsd2ss_round_mask ((__v4sf)(__A),
94929612 (__v2df)(__B),
9493 (__v4sf)(__W),
9613 (__v4sf)(__W),
94949614 (__mmask8)(__U), _MM_FROUND_CUR_DIRECTION);
94959615}
94969616
......@@ -9499,7 +9619,7 @@ _mm_maskz_cvtsd_ss (__mmask8 __U, __m128 __A, __m128d __B)
94999619{
95009620 return __builtin_ia32_cvtsd2ss_round_mask ((__v4sf)(__A),
95019621 (__v2df)(__B),
9502 (__v4sf)_mm_setzero_ps(),
9622 (__v4sf)_mm_setzero_ps(),
95039623 (__mmask8)(__U), _MM_FROUND_CUR_DIRECTION);
95049624}
95059625
......@@ -9564,7 +9684,7 @@ _mm_mask_cvtss_sd (__m128d __W, __mmask8 __U, __m128d __A, __m128 __B)
95649684 return __builtin_ia32_cvtss2sd_round_mask((__v2df)(__A),
95659685 (__v4sf)(__B),
95669686 (__v2df)(__W),
9567 (__mmask8)(__U), _MM_FROUND_CUR_DIRECTION);
9687 (__mmask8)(__U), _MM_FROUND_CUR_DIRECTION);
95689688}
95699689
95709690static __inline__ __m128d __DEFAULT_FN_ATTRS
......@@ -9572,8 +9692,8 @@ _mm_maskz_cvtss_sd (__mmask8 __U, __m128d __A, __m128 __B)
95729692{
95739693 return __builtin_ia32_cvtss2sd_round_mask((__v2df)(__A),
95749694 (__v4sf)(__B),
9575 (__v2df)_mm_setzero_pd(),
9576 (__mmask8)(__U), _MM_FROUND_CUR_DIRECTION);
9695 (__v2df)_mm_setzero_pd(),
9696 (__mmask8)(__U), _MM_FROUND_CUR_DIRECTION);
95779697}
95789698
95799699static __inline__ __m128d __DEFAULT_FN_ATTRS
......@@ -9635,6 +9755,45 @@ _mm512_mask_set1_epi64 (__m512i __O, __mmask8 __M, long long __A)
96359755}
96369756#endif
96379757
9758static __inline __m512i __DEFAULT_FN_ATTRS
9759_mm512_set_epi8 (char __e63, char __e62, char __e61, char __e60, char __e59,
9760 char __e58, char __e57, char __e56, char __e55, char __e54, char __e53,
9761 char __e52, char __e51, char __e50, char __e49, char __e48, char __e47,
9762 char __e46, char __e45, char __e44, char __e43, char __e42, char __e41,
9763 char __e40, char __e39, char __e38, char __e37, char __e36, char __e35,
9764 char __e34, char __e33, char __e32, char __e31, char __e30, char __e29,
9765 char __e28, char __e27, char __e26, char __e25, char __e24, char __e23,
9766 char __e22, char __e21, char __e20, char __e19, char __e18, char __e17,
9767 char __e16, char __e15, char __e14, char __e13, char __e12, char __e11,
9768 char __e10, char __e9, char __e8, char __e7, char __e6, char __e5,
9769 char __e4, char __e3, char __e2, char __e1, char __e0) {
9770
9771 return __extension__ (__m512i)(__v64qi)
9772 {__e0, __e1, __e2, __e3, __e4, __e5, __e6, __e7,
9773 __e8, __e9, __e10, __e11, __e12, __e13, __e14, __e15,
9774 __e16, __e17, __e18, __e19, __e20, __e21, __e22, __e23,
9775 __e24, __e25, __e26, __e27, __e28, __e29, __e30, __e31,
9776 __e32, __e33, __e34, __e35, __e36, __e37, __e38, __e39,
9777 __e40, __e41, __e42, __e43, __e44, __e45, __e46, __e47,
9778 __e48, __e49, __e50, __e51, __e52, __e53, __e54, __e55,
9779 __e56, __e57, __e58, __e59, __e60, __e61, __e62, __e63};
9780}
9781
9782static __inline __m512i __DEFAULT_FN_ATTRS
9783_mm512_set_epi16(short __e31, short __e30, short __e29, short __e28,
9784 short __e27, short __e26, short __e25, short __e24, short __e23,
9785 short __e22, short __e21, short __e20, short __e19, short __e18,
9786 short __e17, short __e16, short __e15, short __e14, short __e13,
9787 short __e12, short __e11, short __e10, short __e9, short __e8,
9788 short __e7, short __e6, short __e5, short __e4, short __e3,
9789 short __e2, short __e1, short __e0) {
9790 return __extension__ (__m512i)(__v32hi)
9791 {__e0, __e1, __e2, __e3, __e4, __e5, __e6, __e7,
9792 __e8, __e9, __e10, __e11, __e12, __e13, __e14, __e15,
9793 __e16, __e17, __e18, __e19, __e20, __e21, __e22, __e23,
9794 __e24, __e25, __e26, __e27, __e28, __e29, __e30, __e31 };
9795}
9796
96389797static __inline __m512i __DEFAULT_FN_ATTRS
96399798_mm512_set_epi32 (int __A, int __B, int __C, int __D,
96409799 int __E, int __F, int __G, int __H,
......@@ -9780,7 +9939,7 @@ static __inline__ double __DEFAULT_FN_ATTRS _mm512_reduce_mul_pd(__m512d __W) {
97809939}
97819940
97829941// Vec512 - Vector with size 512.
9783// Vec512Neutral - All vector elements set to the identity element.
9942// Vec512Neutral - All vector elements set to the identity element.
97849943// Identity element: {+,0},{*,1},{&,0xFFFFFFFFFFFFFFFF},{|,0}
97859944// Operator - Can be one of following: +,*,&,|
97869945// Mask - Intrinsic Mask
......@@ -9810,19 +9969,19 @@ _mm512_mask_reduce_mul_epi64(__mmask8 __M, __m512i __W) {
98109969
98119970static __inline__ long long __DEFAULT_FN_ATTRS
98129971_mm512_mask_reduce_and_epi64(__mmask8 __M, __m512i __W) {
9813 _mm512_mask_reduce_operator_64bit(__W, _mm512_set1_epi64(0xFFFFFFFFFFFFFFFF),
9972 _mm512_mask_reduce_operator_64bit(__W, _mm512_set1_epi64(0xFFFFFFFFFFFFFFFF),
98149973 &, __M, i, i, q);
98159974}
98169975
98179976static __inline__ long long __DEFAULT_FN_ATTRS
98189977_mm512_mask_reduce_or_epi64(__mmask8 __M, __m512i __W) {
9819 _mm512_mask_reduce_operator_64bit(__W, _mm512_set1_epi64(0), |, __M,
9978 _mm512_mask_reduce_operator_64bit(__W, _mm512_set1_epi64(0), |, __M,
98209979 i, i, q);
98219980}
98229981
98239982static __inline__ double __DEFAULT_FN_ATTRS
98249983_mm512_mask_reduce_add_pd(__mmask8 __M, __m512d __W) {
9825 _mm512_mask_reduce_operator_64bit(__W, _mm512_set1_pd(0), +, __M,
9984 _mm512_mask_reduce_operator_64bit(__W, _mm512_set1_pd(0), +, __M,
98269985 f, d, pd);
98279986}
98289987
......@@ -9884,17 +10043,17 @@ _mm512_reduce_add_epi32(__m512i __W) {
988410043 _mm512_reduce_operator_32bit(__W, +, i, i);
988510044}
988610045
9887static __inline__ int __DEFAULT_FN_ATTRS
10046static __inline__ int __DEFAULT_FN_ATTRS
988810047_mm512_reduce_mul_epi32(__m512i __W) {
988910048 _mm512_reduce_operator_32bit(__W, *, i, i);
989010049}
989110050
9892static __inline__ int __DEFAULT_FN_ATTRS
10051static __inline__ int __DEFAULT_FN_ATTRS
989310052_mm512_reduce_and_epi32(__m512i __W) {
989410053 _mm512_reduce_operator_32bit(__W, &, i, i);
989510054}
989610055
9897static __inline__ int __DEFAULT_FN_ATTRS
10056static __inline__ int __DEFAULT_FN_ATTRS
989810057_mm512_reduce_or_epi32(__m512i __W) {
989910058 _mm512_reduce_operator_32bit(__W, |, i, i);
990010059}
......@@ -9910,7 +10069,7 @@ _mm512_reduce_mul_ps(__m512 __W) {
991010069}
991110070
991210071// Vec512 - Vector with size 512.
9913// Vec512Neutral - All vector elements set to the identity element.
10072// Vec512Neutral - All vector elements set to the identity element.
991410073// Identity element: {+,0},{*,1},{&,0xFFFFFFFF},{|,0}
991510074// Operator - Can be one of following: +,*,&,|
991610075// Mask - Intrinsic Mask
......@@ -9940,7 +10099,7 @@ _mm512_mask_reduce_mul_epi32( __mmask16 __M, __m512i __W) {
994010099
994110100static __inline__ int __DEFAULT_FN_ATTRS
994210101_mm512_mask_reduce_and_epi32( __mmask16 __M, __m512i __W) {
9943 _mm512_mask_reduce_operator_32bit(__W, _mm512_set1_epi32(0xFFFFFFFF), &, __M,
10102 _mm512_mask_reduce_operator_32bit(__W, _mm512_set1_epi32(0xFFFFFFFF), &, __M,
994410103 i, i, d);
994510104}
994610105
......@@ -10003,7 +10162,7 @@ _mm512_mask_reduce_mul_ps(__mmask16 __M, __m512 __W) {
1000310162 return Vec512[0]; \
1000410163 })
1000510164
10006static __inline__ long long __DEFAULT_FN_ATTRS
10165static __inline__ long long __DEFAULT_FN_ATTRS
1000710166_mm512_reduce_max_epi64(__m512i __V) {
1000810167 _mm512_reduce_maxMin_64bit(__V, max_epi64, i, i);
1000910168}
......@@ -10013,7 +10172,7 @@ _mm512_reduce_max_epu64(__m512i __V) {
1001310172 _mm512_reduce_maxMin_64bit(__V, max_epu64, i, i);
1001410173}
1001510174
10016static __inline__ double __DEFAULT_FN_ATTRS
10175static __inline__ double __DEFAULT_FN_ATTRS
1001710176_mm512_reduce_max_pd(__m512d __V) {
1001810177 _mm512_reduce_maxMin_64bit(__V, max_pd, d, f);
1001910178}
......@@ -10028,7 +10187,7 @@ _mm512_reduce_min_epu64(__m512i __V) {
1002810187 _mm512_reduce_maxMin_64bit(__V, min_epu64, i, i);
1002910188}
1003010189
10031static __inline__ double __DEFAULT_FN_ATTRS
10190static __inline__ double __DEFAULT_FN_ATTRS
1003210191_mm512_reduce_min_pd(__m512d __V) {
1003310192 _mm512_reduce_maxMin_64bit(__V, min_pd, d, f);
1003410193}
c_headers/avx512vldqintrin.h+20-22
......@@ -1000,27 +1000,26 @@ _mm256_maskz_broadcast_f32x2 (__mmask8 __M, __m128 __A)
10001000}
10011001
10021002static __inline__ __m256d __DEFAULT_FN_ATTRS
1003_mm256_broadcast_f64x2 (__m128d __A)
1003_mm256_broadcast_f64x2(__m128d __A)
10041004{
1005 return (__m256d) __builtin_ia32_broadcastf64x2_256_mask ((__v2df) __A,
1006 (__v4df)_mm256_undefined_pd(),
1007 (__mmask8) -1);
1005 return (__m256d)__builtin_shufflevector((__v2df)__A, (__v2df)__A,
1006 0, 1, 0, 1);
10081007}
10091008
10101009static __inline__ __m256d __DEFAULT_FN_ATTRS
1011_mm256_mask_broadcast_f64x2 (__m256d __O, __mmask8 __M, __m128d __A)
1010_mm256_mask_broadcast_f64x2(__m256d __O, __mmask8 __M, __m128d __A)
10121011{
1013 return (__m256d) __builtin_ia32_broadcastf64x2_256_mask ((__v2df) __A,
1014 (__v4df) __O,
1015 __M);
1012 return (__m256d)__builtin_ia32_selectpd_256((__mmask8)__M,
1013 (__v4df)_mm256_broadcast_f64x2(__A),
1014 (__v4df)__O);
10161015}
10171016
10181017static __inline__ __m256d __DEFAULT_FN_ATTRS
10191018_mm256_maskz_broadcast_f64x2 (__mmask8 __M, __m128d __A)
10201019{
1021 return (__m256d) __builtin_ia32_broadcastf64x2_256_mask ((__v2df) __A,
1022 (__v4df) _mm256_setzero_ps (),
1023 __M);
1020 return (__m256d)__builtin_ia32_selectpd_256((__mmask8)__M,
1021 (__v4df)_mm256_broadcast_f64x2(__A),
1022 (__v4df)_mm256_setzero_pd());
10241023}
10251024
10261025static __inline__ __m128i __DEFAULT_FN_ATTRS
......@@ -1072,27 +1071,26 @@ _mm256_maskz_broadcast_i32x2 (__mmask8 __M, __m128i __A)
10721071}
10731072
10741073static __inline__ __m256i __DEFAULT_FN_ATTRS
1075_mm256_broadcast_i64x2 (__m128i __A)
1074_mm256_broadcast_i64x2(__m128i __A)
10761075{
1077 return (__m256i) __builtin_ia32_broadcasti64x2_256_mask ((__v2di) __A,
1078 (__v4di)_mm256_undefined_si256(),
1079 (__mmask8) -1);
1076 return (__m256i)__builtin_shufflevector((__v2di)__A, (__v2di)__A,
1077 0, 1, 0, 1);
10801078}
10811079
10821080static __inline__ __m256i __DEFAULT_FN_ATTRS
1083_mm256_mask_broadcast_i64x2 (__m256i __O, __mmask8 __M, __m128i __A)
1081_mm256_mask_broadcast_i64x2(__m256i __O, __mmask8 __M, __m128i __A)
10841082{
1085 return (__m256i) __builtin_ia32_broadcasti64x2_256_mask ((__v2di) __A,
1086 (__v4di) __O,
1087 __M);
1083 return (__m256i)__builtin_ia32_selectq_256((__mmask8)__M,
1084 (__v4di)_mm256_broadcast_i64x2(__A),
1085 (__v4di)__O);
10881086}
10891087
10901088static __inline__ __m256i __DEFAULT_FN_ATTRS
10911089_mm256_maskz_broadcast_i64x2 (__mmask8 __M, __m128i __A)
10921090{
1093 return (__m256i) __builtin_ia32_broadcasti64x2_256_mask ((__v2di) __A,
1094 (__v4di) _mm256_setzero_si256 (),
1095 __M);
1091 return (__m256i)__builtin_ia32_selectq_256((__mmask8)__M,
1092 (__v4di)_mm256_broadcast_i64x2(__A),
1093 (__v4di)_mm256_setzero_si256());
10961094}
10971095
10981096#define _mm256_extractf64x2_pd(A, imm) __extension__ ({ \
c_headers/avx512vlintrin.h+21-24
......@@ -7189,52 +7189,49 @@ _mm256_maskz_rsqrt14_ps (__mmask8 __U, __m256 __A)
71897189}
71907190
71917191static __inline__ __m256 __DEFAULT_FN_ATTRS
7192_mm256_broadcast_f32x4 (__m128 __A)
7192_mm256_broadcast_f32x4(__m128 __A)
71937193{
7194 return (__m256) __builtin_ia32_broadcastf32x4_256_mask ((__v4sf) __A,
7195 (__v8sf)_mm256_undefined_pd (),
7196 (__mmask8) -1);
7194 return (__m256)__builtin_shufflevector((__v4sf)__A, (__v4sf)__A,
7195 0, 1, 2, 3, 0, 1, 2, 3);
71977196}
71987197
71997198static __inline__ __m256 __DEFAULT_FN_ATTRS
7200_mm256_mask_broadcast_f32x4 (__m256 __O, __mmask8 __M, __m128 __A)
7199_mm256_mask_broadcast_f32x4(__m256 __O, __mmask8 __M, __m128 __A)
72017200{
7202 return (__m256) __builtin_ia32_broadcastf32x4_256_mask ((__v4sf) __A,
7203 (__v8sf) __O,
7204 __M);
7201 return (__m256)__builtin_ia32_selectps_256((__mmask8)__M,
7202 (__v8sf)_mm256_broadcast_f32x4(__A),
7203 (__v8sf)__O);
72057204}
72067205
72077206static __inline__ __m256 __DEFAULT_FN_ATTRS
72087207_mm256_maskz_broadcast_f32x4 (__mmask8 __M, __m128 __A)
72097208{
7210 return (__m256) __builtin_ia32_broadcastf32x4_256_mask ((__v4sf) __A,
7211 (__v8sf) _mm256_setzero_ps (),
7212 __M);
7209 return (__m256)__builtin_ia32_selectps_256((__mmask8)__M,
7210 (__v8sf)_mm256_broadcast_f32x4(__A),
7211 (__v8sf)_mm256_setzero_ps());
72137212}
72147213
72157214static __inline__ __m256i __DEFAULT_FN_ATTRS
7216_mm256_broadcast_i32x4 (__m128i __A)
7215_mm256_broadcast_i32x4(__m128i __A)
72177216{
7218 return (__m256i) __builtin_ia32_broadcasti32x4_256_mask ((__v4si) __A,
7219 (__v8si)_mm256_undefined_si256 (),
7220 (__mmask8) -1);
7217 return (__m256i)__builtin_shufflevector((__v4si)__A, (__v4si)__A,
7218 0, 1, 2, 3, 0, 1, 2, 3);
72217219}
72227220
72237221static __inline__ __m256i __DEFAULT_FN_ATTRS
7224_mm256_mask_broadcast_i32x4 (__m256i __O, __mmask8 __M, __m128i __A)
7222_mm256_mask_broadcast_i32x4(__m256i __O, __mmask8 __M, __m128i __A)
72257223{
7226 return (__m256i) __builtin_ia32_broadcasti32x4_256_mask ((__v4si) __A,
7227 (__v8si)
7228 __O, __M);
7224 return (__m256i)__builtin_ia32_selectd_256((__mmask8)__M,
7225 (__v8si)_mm256_broadcast_i32x4(__A),
7226 (__v8si)__O);
72297227}
72307228
72317229static __inline__ __m256i __DEFAULT_FN_ATTRS
7232_mm256_maskz_broadcast_i32x4 (__mmask8 __M, __m128i __A)
7230_mm256_maskz_broadcast_i32x4(__mmask8 __M, __m128i __A)
72337231{
7234 return (__m256i) __builtin_ia32_broadcasti32x4_256_mask ((__v4si)
7235 __A,
7236 (__v8si) _mm256_setzero_si256 (),
7237 __M);
7232 return (__m256i)__builtin_ia32_selectd_256((__mmask8)__M,
7233 (__v8si)_mm256_broadcast_i32x4(__A),
7234 (__v8si)_mm256_setzero_si256());
72387235}
72397236
72407237static __inline__ __m256d __DEFAULT_FN_ATTRS
c_headers/avx512vpopcntdqintrin.h created+70
......@@ -0,0 +1,70 @@
1/*===------------- avx512vpopcntdqintrin.h - AVX512VPOPCNTDQ intrinsics
2 *------------------===
3 *
4 *
5 * Permission is hereby granted, free of charge, to any person obtaining a copy
6 * of this software and associated documentation files (the "Software"), to deal
7 * in the Software without restriction, including without limitation the rights
8 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 * copies of the Software, and to permit persons to whom the Software is
10 * furnished to do so, subject to the following conditions:
11 *
12 * The above copyright notice and this permission notice shall be included in
13 * all copies or substantial portions of the Software.
14 *
15 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21 * THE SOFTWARE.
22 *
23 *===-----------------------------------------------------------------------===
24 */
25#ifndef __IMMINTRIN_H
26#error \
27 "Never use <avx512vpopcntdqintrin.h> directly; include <immintrin.h> instead."
28#endif
29
30#ifndef __AVX512VPOPCNTDQINTRIN_H
31#define __AVX512VPOPCNTDQINTRIN_H
32
33/* Define the default attributes for the functions in this file. */
34#define __DEFAULT_FN_ATTRS \
35 __attribute__((__always_inline__, __nodebug__, __target__("avx512vpopcntd" \
36 "q")))
37
38static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_popcnt_epi64(__m512i __A) {
39 return (__m512i)__builtin_ia32_vpopcntq_512((__v8di)__A);
40}
41
42static __inline__ __m512i __DEFAULT_FN_ATTRS
43_mm512_mask_popcnt_epi64(__m512i __W, __mmask8 __U, __m512i __A) {
44 return (__m512i)__builtin_ia32_selectq_512(
45 (__mmask8)__U, (__v8di)_mm512_popcnt_epi64(__A), (__v8di)__W);
46}
47
48static __inline__ __m512i __DEFAULT_FN_ATTRS
49_mm512_maskz_popcnt_epi64(__mmask8 __U, __m512i __A) {
50 return _mm512_mask_popcnt_epi64((__m512i)_mm512_setzero_si512(), __U, __A);
51}
52
53static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_popcnt_epi32(__m512i __A) {
54 return (__m512i)__builtin_ia32_vpopcntd_512((__v16si)__A);
55}
56
57static __inline__ __m512i __DEFAULT_FN_ATTRS
58_mm512_mask_popcnt_epi32(__m512i __W, __mmask16 __U, __m512i __A) {
59 return (__m512i)__builtin_ia32_selectd_512(
60 (__mmask16)__U, (__v16si)_mm512_popcnt_epi32(__A), (__v16si)__W);
61}
62
63static __inline__ __m512i __DEFAULT_FN_ATTRS
64_mm512_maskz_popcnt_epi32(__mmask16 __U, __m512i __A) {
65 return _mm512_mask_popcnt_epi32((__m512i)_mm512_setzero_si512(), __U, __A);
66}
67
68#undef __DEFAULT_FN_ATTRS
69
70#endif
c_headers/avxintrin.h+407-139
......@@ -1458,12 +1458,13 @@ _mm256_blendv_ps(__m256 __a, __m256 __b, __m256 __c)
14581458/// \brief Computes two dot products in parallel, using the lower and upper
14591459/// halves of two [8 x float] vectors as input to the two computations, and
14601460/// returning the two dot products in the lower and upper halves of the
1461/// [8 x float] result. The immediate integer operand controls which input
1462/// elements will contribute to the dot product, and where the final results
1463/// are returned. In general, for each dot product, the four corresponding
1464/// elements of the input vectors are multiplied; the first two and second
1465/// two products are summed, then the two sums are added to form the final
1466/// result.
1461/// [8 x float] result.
1462///
1463/// The immediate integer operand controls which input elements will
1464/// contribute to the dot product, and where the final results are returned.
1465/// In general, for each dot product, the four corresponding elements of the
1466/// input vectors are multiplied; the first two and second two products are
1467/// summed, then the two sums are added to form the final result.
14671468///
14681469/// \headerfile <x86intrin.h>
14691470///
......@@ -1497,15 +1498,16 @@ _mm256_blendv_ps(__m256 __a, __m256 __b, __m256 __c)
14971498
14981499/* Vector shuffle */
14991500/// \brief Selects 8 float values from the 256-bit operands of [8 x float], as
1500/// specified by the immediate value operand. The four selected elements in
1501/// each operand are copied to the destination according to the bits
1502/// specified in the immediate operand. The selected elements from the first
1503/// 256-bit operand are copied to bits [63:0] and bits [191:128] of the
1504/// destination, and the selected elements from the second 256-bit operand
1505/// are copied to bits [127:64] and bits [255:192] of the destination. For
1506/// example, if bits [7:0] of the immediate operand contain a value of 0xFF,
1507/// the 256-bit destination vector would contain the following values: b[7],
1508/// b[7], a[7], a[7], b[3], b[3], a[3], a[3].
1501/// specified by the immediate value operand.
1502///
1503/// The four selected elements in each operand are copied to the destination
1504/// according to the bits specified in the immediate operand. The selected
1505/// elements from the first 256-bit operand are copied to bits [63:0] and
1506/// bits [191:128] of the destination, and the selected elements from the
1507/// second 256-bit operand are copied to bits [127:64] and bits [255:192] of
1508/// the destination. For example, if bits [7:0] of the immediate operand
1509/// contain a value of 0xFF, the 256-bit destination vector would contain the
1510/// following values: b[7], b[7], a[7], a[7], b[3], b[3], a[3], a[3].
15091511///
15101512/// \headerfile <x86intrin.h>
15111513///
......@@ -1557,13 +1559,14 @@ _mm256_blendv_ps(__m256 __a, __m256 __b, __m256 __c)
15571559 12 + (((mask) >> 6) & 0x3)); })
15581560
15591561/// \brief Selects four double-precision values from the 256-bit operands of
1560/// [4 x double], as specified by the immediate value operand. The selected
1561/// elements from the first 256-bit operand are copied to bits [63:0] and
1562/// bits [191:128] in the destination, and the selected elements from the
1563/// second 256-bit operand are copied to bits [127:64] and bits [255:192] in
1564/// the destination. For example, if bits [3:0] of the immediate operand
1565/// contain a value of 0xF, the 256-bit destination vector would contain the
1566/// following values: b[3], a[3], b[1], a[1].
1562/// [4 x double], as specified by the immediate value operand.
1563///
1564/// The selected elements from the first 256-bit operand are copied to bits
1565/// [63:0] and bits [191:128] in the destination, and the selected elements
1566/// from the second 256-bit operand are copied to bits [127:64] and bits
1567/// [255:192] in the destination. For example, if bits [3:0] of the immediate
1568/// operand contain a value of 0xF, the 256-bit destination vector would
1569/// contain the following values: b[3], a[3], b[1], a[1].
15671570///
15681571/// \headerfile <x86intrin.h>
15691572///
......@@ -1613,9 +1616,9 @@ _mm256_blendv_ps(__m256 __a, __m256 __b, __m256 __c)
16131616#define _CMP_NEQ_UQ 0x04 /* Not-equal (unordered, non-signaling) */
16141617#define _CMP_NLT_US 0x05 /* Not-less-than (unordered, signaling) */
16151618#define _CMP_NLE_US 0x06 /* Not-less-than-or-equal (unordered, signaling) */
1616#define _CMP_ORD_Q 0x07 /* Ordered (nonsignaling) */
1619#define _CMP_ORD_Q 0x07 /* Ordered (non-signaling) */
16171620#define _CMP_EQ_UQ 0x08 /* Equal (unordered, non-signaling) */
1618#define _CMP_NGE_US 0x09 /* Not-greater-than-or-equal (unord, signaling) */
1621#define _CMP_NGE_US 0x09 /* Not-greater-than-or-equal (unordered, signaling) */
16191622#define _CMP_NGT_US 0x0a /* Not-greater-than (unordered, signaling) */
16201623#define _CMP_FALSE_OQ 0x0b /* False (ordered, non-signaling) */
16211624#define _CMP_NEQ_OQ 0x0c /* Not-equal (ordered, non-signaling) */
......@@ -1628,10 +1631,10 @@ _mm256_blendv_ps(__m256 __a, __m256 __b, __m256 __c)
16281631#define _CMP_UNORD_S 0x13 /* Unordered (signaling) */
16291632#define _CMP_NEQ_US 0x14 /* Not-equal (unordered, signaling) */
16301633#define _CMP_NLT_UQ 0x15 /* Not-less-than (unordered, non-signaling) */
1631#define _CMP_NLE_UQ 0x16 /* Not-less-than-or-equal (unord, non-signaling) */
1634#define _CMP_NLE_UQ 0x16 /* Not-less-than-or-equal (unordered, non-signaling) */
16321635#define _CMP_ORD_S 0x17 /* Ordered (signaling) */
16331636#define _CMP_EQ_US 0x18 /* Equal (unordered, signaling) */
1634#define _CMP_NGE_UQ 0x19 /* Not-greater-than-or-equal (unord, non-sign) */
1637#define _CMP_NGE_UQ 0x19 /* Not-greater-than-or-equal (unordered, non-signaling) */
16351638#define _CMP_NGT_UQ 0x1a /* Not-greater-than (unordered, non-signaling) */
16361639#define _CMP_FALSE_OS 0x1b /* False (ordered, signaling) */
16371640#define _CMP_NEQ_OS 0x1c /* Not-equal (ordered, signaling) */
......@@ -1641,9 +1644,11 @@ _mm256_blendv_ps(__m256 __a, __m256 __b, __m256 __c)
16411644
16421645/// \brief Compares each of the corresponding double-precision values of two
16431646/// 128-bit vectors of [2 x double], using the operation specified by the
1644/// immediate integer operand. Returns a [2 x double] vector consisting of
1645/// two doubles corresponding to the two comparison results: zero if the
1646/// comparison is false, and all 1's if the comparison is true.
1647/// immediate integer operand.
1648///
1649/// Returns a [2 x double] vector consisting of two doubles corresponding to
1650/// the two comparison results: zero if the comparison is false, and all 1's
1651/// if the comparison is true.
16471652///
16481653/// \headerfile <x86intrin.h>
16491654///
......@@ -1660,17 +1665,38 @@ _mm256_blendv_ps(__m256 __a, __m256 __b, __m256 __c)
16601665/// \param c
16611666/// An immediate integer operand, with bits [4:0] specifying which comparison
16621667/// operation to use: \n
1663/// 00h, 08h, 10h, 18h: Equal \n
1664/// 01h, 09h, 11h, 19h: Less than \n
1665/// 02h, 0Ah, 12h, 1Ah: Less than or equal / Greater than or equal
1666/// (swapped operands) \n
1667/// 03h, 0Bh, 13h, 1Bh: Unordered \n
1668/// 04h, 0Ch, 14h, 1Ch: Not equal \n
1669/// 05h, 0Dh, 15h, 1Dh: Not less than / Not greater than
1670/// (swapped operands) \n
1671/// 06h, 0Eh, 16h, 1Eh: Not less than or equal / Not greater than or equal
1672/// (swapped operands) \n
1673/// 07h, 0Fh, 17h, 1Fh: Ordered
1668/// 0x00 : Equal (ordered, non-signaling)
1669/// 0x01 : Less-than (ordered, signaling)
1670/// 0x02 : Less-than-or-equal (ordered, signaling)
1671/// 0x03 : Unordered (non-signaling)
1672/// 0x04 : Not-equal (unordered, non-signaling)
1673/// 0x05 : Not-less-than (unordered, signaling)
1674/// 0x06 : Not-less-than-or-equal (unordered, signaling)
1675/// 0x07 : Ordered (non-signaling)
1676/// 0x08 : Equal (unordered, non-signaling)
1677/// 0x09 : Not-greater-than-or-equal (unordered, signaling)
1678/// 0x0a : Not-greater-than (unordered, signaling)
1679/// 0x0b : False (ordered, non-signaling)
1680/// 0x0c : Not-equal (ordered, non-signaling)
1681/// 0x0d : Greater-than-or-equal (ordered, signaling)
1682/// 0x0e : Greater-than (ordered, signaling)
1683/// 0x0f : True (unordered, non-signaling)
1684/// 0x10 : Equal (ordered, signaling)
1685/// 0x11 : Less-than (ordered, non-signaling)
1686/// 0x12 : Less-than-or-equal (ordered, non-signaling)
1687/// 0x13 : Unordered (signaling)
1688/// 0x14 : Not-equal (unordered, signaling)
1689/// 0x15 : Not-less-than (unordered, non-signaling)
1690/// 0x16 : Not-less-than-or-equal (unordered, non-signaling)
1691/// 0x17 : Ordered (signaling)
1692/// 0x18 : Equal (unordered, signaling)
1693/// 0x19 : Not-greater-than-or-equal (unordered, non-signaling)
1694/// 0x1a : Not-greater-than (unordered, non-signaling)
1695/// 0x1b : False (ordered, signaling)
1696/// 0x1c : Not-equal (ordered, signaling)
1697/// 0x1d : Greater-than-or-equal (ordered, non-signaling)
1698/// 0x1e : Greater-than (ordered, non-signaling)
1699/// 0x1f : True (unordered, signaling)
16741700/// \returns A 128-bit vector of [2 x double] containing the comparison results.
16751701#define _mm_cmp_pd(a, b, c) __extension__ ({ \
16761702 (__m128d)__builtin_ia32_cmppd((__v2df)(__m128d)(a), \
......@@ -1678,9 +1704,11 @@ _mm256_blendv_ps(__m256 __a, __m256 __b, __m256 __c)
16781704
16791705/// \brief Compares each of the corresponding values of two 128-bit vectors of
16801706/// [4 x float], using the operation specified by the immediate integer
1681/// operand. Returns a [4 x float] vector consisting of four floats
1682/// corresponding to the four comparison results: zero if the comparison is
1683/// false, and all 1's if the comparison is true.
1707/// operand.
1708///
1709/// Returns a [4 x float] vector consisting of four floats corresponding to
1710/// the four comparison results: zero if the comparison is false, and all 1's
1711/// if the comparison is true.
16841712///
16851713/// \headerfile <x86intrin.h>
16861714///
......@@ -1697,17 +1725,38 @@ _mm256_blendv_ps(__m256 __a, __m256 __b, __m256 __c)
16971725/// \param c
16981726/// An immediate integer operand, with bits [4:0] specifying which comparison
16991727/// operation to use: \n
1700/// 00h, 08h, 10h, 18h: Equal \n
1701/// 01h, 09h, 11h, 19h: Less than \n
1702/// 02h, 0Ah, 12h, 1Ah: Less than or equal / Greater than or equal
1703/// (swapped operands) \n
1704/// 03h, 0Bh, 13h, 1Bh: Unordered \n
1705/// 04h, 0Ch, 14h, 1Ch: Not equal \n
1706/// 05h, 0Dh, 15h, 1Dh: Not less than / Not greater than
1707/// (swapped operands) \n
1708/// 06h, 0Eh, 16h, 1Eh: Not less than or equal / Not greater than or equal
1709/// (swapped operands) \n
1710/// 07h, 0Fh, 17h, 1Fh: Ordered
1728/// 0x00 : Equal (ordered, non-signaling)
1729/// 0x01 : Less-than (ordered, signaling)
1730/// 0x02 : Less-than-or-equal (ordered, signaling)
1731/// 0x03 : Unordered (non-signaling)
1732/// 0x04 : Not-equal (unordered, non-signaling)
1733/// 0x05 : Not-less-than (unordered, signaling)
1734/// 0x06 : Not-less-than-or-equal (unordered, signaling)
1735/// 0x07 : Ordered (non-signaling)
1736/// 0x08 : Equal (unordered, non-signaling)
1737/// 0x09 : Not-greater-than-or-equal (unordered, signaling)
1738/// 0x0a : Not-greater-than (unordered, signaling)
1739/// 0x0b : False (ordered, non-signaling)
1740/// 0x0c : Not-equal (ordered, non-signaling)
1741/// 0x0d : Greater-than-or-equal (ordered, signaling)
1742/// 0x0e : Greater-than (ordered, signaling)
1743/// 0x0f : True (unordered, non-signaling)
1744/// 0x10 : Equal (ordered, signaling)
1745/// 0x11 : Less-than (ordered, non-signaling)
1746/// 0x12 : Less-than-or-equal (ordered, non-signaling)
1747/// 0x13 : Unordered (signaling)
1748/// 0x14 : Not-equal (unordered, signaling)
1749/// 0x15 : Not-less-than (unordered, non-signaling)
1750/// 0x16 : Not-less-than-or-equal (unordered, non-signaling)
1751/// 0x17 : Ordered (signaling)
1752/// 0x18 : Equal (unordered, signaling)
1753/// 0x19 : Not-greater-than-or-equal (unordered, non-signaling)
1754/// 0x1a : Not-greater-than (unordered, non-signaling)
1755/// 0x1b : False (ordered, signaling)
1756/// 0x1c : Not-equal (ordered, signaling)
1757/// 0x1d : Greater-than-or-equal (ordered, non-signaling)
1758/// 0x1e : Greater-than (ordered, non-signaling)
1759/// 0x1f : True (unordered, signaling)
17111760/// \returns A 128-bit vector of [4 x float] containing the comparison results.
17121761#define _mm_cmp_ps(a, b, c) __extension__ ({ \
17131762 (__m128)__builtin_ia32_cmpps((__v4sf)(__m128)(a), \
......@@ -1715,9 +1764,11 @@ _mm256_blendv_ps(__m256 __a, __m256 __b, __m256 __c)
17151764
17161765/// \brief Compares each of the corresponding double-precision values of two
17171766/// 256-bit vectors of [4 x double], using the operation specified by the
1718/// immediate integer operand. Returns a [4 x double] vector consisting of
1719/// four doubles corresponding to the four comparison results: zero if the
1720/// comparison is false, and all 1's if the comparison is true.
1767/// immediate integer operand.
1768///
1769/// Returns a [4 x double] vector consisting of four doubles corresponding to
1770/// the four comparison results: zero if the comparison is false, and all 1's
1771/// if the comparison is true.
17211772///
17221773/// \headerfile <x86intrin.h>
17231774///
......@@ -1734,17 +1785,38 @@ _mm256_blendv_ps(__m256 __a, __m256 __b, __m256 __c)
17341785/// \param c
17351786/// An immediate integer operand, with bits [4:0] specifying which comparison
17361787/// operation to use: \n
1737/// 00h, 08h, 10h, 18h: Equal \n
1738/// 01h, 09h, 11h, 19h: Less than \n
1739/// 02h, 0Ah, 12h, 1Ah: Less than or equal / Greater than or equal
1740/// (swapped operands) \n
1741/// 03h, 0Bh, 13h, 1Bh: Unordered \n
1742/// 04h, 0Ch, 14h, 1Ch: Not equal \n
1743/// 05h, 0Dh, 15h, 1Dh: Not less than / Not greater than
1744/// (swapped operands) \n
1745/// 06h, 0Eh, 16h, 1Eh: Not less than or equal / Not greater than or equal
1746/// (swapped operands) \n
1747/// 07h, 0Fh, 17h, 1Fh: Ordered
1788/// 0x00 : Equal (ordered, non-signaling)
1789/// 0x01 : Less-than (ordered, signaling)
1790/// 0x02 : Less-than-or-equal (ordered, signaling)
1791/// 0x03 : Unordered (non-signaling)
1792/// 0x04 : Not-equal (unordered, non-signaling)
1793/// 0x05 : Not-less-than (unordered, signaling)
1794/// 0x06 : Not-less-than-or-equal (unordered, signaling)
1795/// 0x07 : Ordered (non-signaling)
1796/// 0x08 : Equal (unordered, non-signaling)
1797/// 0x09 : Not-greater-than-or-equal (unordered, signaling)
1798/// 0x0a : Not-greater-than (unordered, signaling)
1799/// 0x0b : False (ordered, non-signaling)
1800/// 0x0c : Not-equal (ordered, non-signaling)
1801/// 0x0d : Greater-than-or-equal (ordered, signaling)
1802/// 0x0e : Greater-than (ordered, signaling)
1803/// 0x0f : True (unordered, non-signaling)
1804/// 0x10 : Equal (ordered, signaling)
1805/// 0x11 : Less-than (ordered, non-signaling)
1806/// 0x12 : Less-than-or-equal (ordered, non-signaling)
1807/// 0x13 : Unordered (signaling)
1808/// 0x14 : Not-equal (unordered, signaling)
1809/// 0x15 : Not-less-than (unordered, non-signaling)
1810/// 0x16 : Not-less-than-or-equal (unordered, non-signaling)
1811/// 0x17 : Ordered (signaling)
1812/// 0x18 : Equal (unordered, signaling)
1813/// 0x19 : Not-greater-than-or-equal (unordered, non-signaling)
1814/// 0x1a : Not-greater-than (unordered, non-signaling)
1815/// 0x1b : False (ordered, signaling)
1816/// 0x1c : Not-equal (ordered, signaling)
1817/// 0x1d : Greater-than-or-equal (ordered, non-signaling)
1818/// 0x1e : Greater-than (ordered, non-signaling)
1819/// 0x1f : True (unordered, signaling)
17481820/// \returns A 256-bit vector of [4 x double] containing the comparison results.
17491821#define _mm256_cmp_pd(a, b, c) __extension__ ({ \
17501822 (__m256d)__builtin_ia32_cmppd256((__v4df)(__m256d)(a), \
......@@ -1752,9 +1824,11 @@ _mm256_blendv_ps(__m256 __a, __m256 __b, __m256 __c)
17521824
17531825/// \brief Compares each of the corresponding values of two 256-bit vectors of
17541826/// [8 x float], using the operation specified by the immediate integer
1755/// operand. Returns a [8 x float] vector consisting of eight floats
1756/// corresponding to the eight comparison results: zero if the comparison is
1757/// false, and all 1's if the comparison is true.
1827/// operand.
1828///
1829/// Returns a [8 x float] vector consisting of eight floats corresponding to
1830/// the eight comparison results: zero if the comparison is false, and all
1831/// 1's if the comparison is true.
17581832///
17591833/// \headerfile <x86intrin.h>
17601834///
......@@ -1771,17 +1845,38 @@ _mm256_blendv_ps(__m256 __a, __m256 __b, __m256 __c)
17711845/// \param c
17721846/// An immediate integer operand, with bits [4:0] specifying which comparison
17731847/// operation to use: \n
1774/// 00h, 08h, 10h, 18h: Equal \n
1775/// 01h, 09h, 11h, 19h: Less than \n
1776/// 02h, 0Ah, 12h, 1Ah: Less than or equal / Greater than or equal
1777/// (swapped operands) \n
1778/// 03h, 0Bh, 13h, 1Bh: Unordered \n
1779/// 04h, 0Ch, 14h, 1Ch: Not equal \n
1780/// 05h, 0Dh, 15h, 1Dh: Not less than / Not greater than
1781/// (swapped operands) \n
1782/// 06h, 0Eh, 16h, 1Eh: Not less than or equal / Not greater than or equal
1783/// (swapped operands) \n
1784/// 07h, 0Fh, 17h, 1Fh: Ordered
1848/// 0x00 : Equal (ordered, non-signaling)
1849/// 0x01 : Less-than (ordered, signaling)
1850/// 0x02 : Less-than-or-equal (ordered, signaling)
1851/// 0x03 : Unordered (non-signaling)
1852/// 0x04 : Not-equal (unordered, non-signaling)
1853/// 0x05 : Not-less-than (unordered, signaling)
1854/// 0x06 : Not-less-than-or-equal (unordered, signaling)
1855/// 0x07 : Ordered (non-signaling)
1856/// 0x08 : Equal (unordered, non-signaling)
1857/// 0x09 : Not-greater-than-or-equal (unordered, signaling)
1858/// 0x0a : Not-greater-than (unordered, signaling)
1859/// 0x0b : False (ordered, non-signaling)
1860/// 0x0c : Not-equal (ordered, non-signaling)
1861/// 0x0d : Greater-than-or-equal (ordered, signaling)
1862/// 0x0e : Greater-than (ordered, signaling)
1863/// 0x0f : True (unordered, non-signaling)
1864/// 0x10 : Equal (ordered, signaling)
1865/// 0x11 : Less-than (ordered, non-signaling)
1866/// 0x12 : Less-than-or-equal (ordered, non-signaling)
1867/// 0x13 : Unordered (signaling)
1868/// 0x14 : Not-equal (unordered, signaling)
1869/// 0x15 : Not-less-than (unordered, non-signaling)
1870/// 0x16 : Not-less-than-or-equal (unordered, non-signaling)
1871/// 0x17 : Ordered (signaling)
1872/// 0x18 : Equal (unordered, signaling)
1873/// 0x19 : Not-greater-than-or-equal (unordered, non-signaling)
1874/// 0x1a : Not-greater-than (unordered, non-signaling)
1875/// 0x1b : False (ordered, signaling)
1876/// 0x1c : Not-equal (ordered, signaling)
1877/// 0x1d : Greater-than-or-equal (ordered, non-signaling)
1878/// 0x1e : Greater-than (ordered, non-signaling)
1879/// 0x1f : True (unordered, signaling)
17851880/// \returns A 256-bit vector of [8 x float] containing the comparison results.
17861881#define _mm256_cmp_ps(a, b, c) __extension__ ({ \
17871882 (__m256)__builtin_ia32_cmpps256((__v8sf)(__m256)(a), \
......@@ -1789,8 +1884,10 @@ _mm256_blendv_ps(__m256 __a, __m256 __b, __m256 __c)
17891884
17901885/// \brief Compares each of the corresponding scalar double-precision values of
17911886/// two 128-bit vectors of [2 x double], using the operation specified by the
1792/// immediate integer operand. If the result is true, all 64 bits of the
1793/// destination vector are set; otherwise they are cleared.
1887/// immediate integer operand.
1888///
1889/// If the result is true, all 64 bits of the destination vector are set;
1890/// otherwise they are cleared.
17941891///
17951892/// \headerfile <x86intrin.h>
17961893///
......@@ -1807,17 +1904,38 @@ _mm256_blendv_ps(__m256 __a, __m256 __b, __m256 __c)
18071904/// \param c
18081905/// An immediate integer operand, with bits [4:0] specifying which comparison
18091906/// operation to use: \n
1810/// 00h, 08h, 10h, 18h: Equal \n
1811/// 01h, 09h, 11h, 19h: Less than \n
1812/// 02h, 0Ah, 12h, 1Ah: Less than or equal / Greater than or equal
1813/// (swapped operands) \n
1814/// 03h, 0Bh, 13h, 1Bh: Unordered \n
1815/// 04h, 0Ch, 14h, 1Ch: Not equal \n
1816/// 05h, 0Dh, 15h, 1Dh: Not less than / Not greater than
1817/// (swapped operands) \n
1818/// 06h, 0Eh, 16h, 1Eh: Not less than or equal / Not greater than or equal
1819/// (swapped operands) \n
1820/// 07h, 0Fh, 17h, 1Fh: Ordered
1907/// 0x00 : Equal (ordered, non-signaling)
1908/// 0x01 : Less-than (ordered, signaling)
1909/// 0x02 : Less-than-or-equal (ordered, signaling)
1910/// 0x03 : Unordered (non-signaling)
1911/// 0x04 : Not-equal (unordered, non-signaling)
1912/// 0x05 : Not-less-than (unordered, signaling)
1913/// 0x06 : Not-less-than-or-equal (unordered, signaling)
1914/// 0x07 : Ordered (non-signaling)
1915/// 0x08 : Equal (unordered, non-signaling)
1916/// 0x09 : Not-greater-than-or-equal (unordered, signaling)
1917/// 0x0a : Not-greater-than (unordered, signaling)
1918/// 0x0b : False (ordered, non-signaling)
1919/// 0x0c : Not-equal (ordered, non-signaling)
1920/// 0x0d : Greater-than-or-equal (ordered, signaling)
1921/// 0x0e : Greater-than (ordered, signaling)
1922/// 0x0f : True (unordered, non-signaling)
1923/// 0x10 : Equal (ordered, signaling)
1924/// 0x11 : Less-than (ordered, non-signaling)
1925/// 0x12 : Less-than-or-equal (ordered, non-signaling)
1926/// 0x13 : Unordered (signaling)
1927/// 0x14 : Not-equal (unordered, signaling)
1928/// 0x15 : Not-less-than (unordered, non-signaling)
1929/// 0x16 : Not-less-than-or-equal (unordered, non-signaling)
1930/// 0x17 : Ordered (signaling)
1931/// 0x18 : Equal (unordered, signaling)
1932/// 0x19 : Not-greater-than-or-equal (unordered, non-signaling)
1933/// 0x1a : Not-greater-than (unordered, non-signaling)
1934/// 0x1b : False (ordered, signaling)
1935/// 0x1c : Not-equal (ordered, signaling)
1936/// 0x1d : Greater-than-or-equal (ordered, non-signaling)
1937/// 0x1e : Greater-than (ordered, non-signaling)
1938/// 0x1f : True (unordered, signaling)
18211939/// \returns A 128-bit vector of [2 x double] containing the comparison results.
18221940#define _mm_cmp_sd(a, b, c) __extension__ ({ \
18231941 (__m128d)__builtin_ia32_cmpsd((__v2df)(__m128d)(a), \
......@@ -1825,8 +1943,10 @@ _mm256_blendv_ps(__m256 __a, __m256 __b, __m256 __c)
18251943
18261944/// \brief Compares each of the corresponding scalar values of two 128-bit
18271945/// vectors of [4 x float], using the operation specified by the immediate
1828/// integer operand. If the result is true, all 32 bits of the destination
1829/// vector are set; otherwise they are cleared.
1946/// integer operand.
1947///
1948/// If the result is true, all 32 bits of the destination vector are set;
1949/// otherwise they are cleared.
18301950///
18311951/// \headerfile <x86intrin.h>
18321952///
......@@ -1843,17 +1963,38 @@ _mm256_blendv_ps(__m256 __a, __m256 __b, __m256 __c)
18431963/// \param c
18441964/// An immediate integer operand, with bits [4:0] specifying which comparison
18451965/// operation to use: \n
1846/// 00h, 08h, 10h, 18h: Equal \n
1847/// 01h, 09h, 11h, 19h: Less than \n
1848/// 02h, 0Ah, 12h, 1Ah: Less than or equal / Greater than or equal
1849/// (swapped operands) \n
1850/// 03h, 0Bh, 13h, 1Bh: Unordered \n
1851/// 04h, 0Ch, 14h, 1Ch: Not equal \n
1852/// 05h, 0Dh, 15h, 1Dh: Not less than / Not greater than
1853/// (swapped operands) \n
1854/// 06h, 0Eh, 16h, 1Eh: Not less than or equal / Not greater than or equal
1855/// (swapped operands) \n
1856/// 07h, 0Fh, 17h, 1Fh: Ordered
1966/// 0x00 : Equal (ordered, non-signaling)
1967/// 0x01 : Less-than (ordered, signaling)
1968/// 0x02 : Less-than-or-equal (ordered, signaling)
1969/// 0x03 : Unordered (non-signaling)
1970/// 0x04 : Not-equal (unordered, non-signaling)
1971/// 0x05 : Not-less-than (unordered, signaling)
1972/// 0x06 : Not-less-than-or-equal (unordered, signaling)
1973/// 0x07 : Ordered (non-signaling)
1974/// 0x08 : Equal (unordered, non-signaling)
1975/// 0x09 : Not-greater-than-or-equal (unordered, signaling)
1976/// 0x0a : Not-greater-than (unordered, signaling)
1977/// 0x0b : False (ordered, non-signaling)
1978/// 0x0c : Not-equal (ordered, non-signaling)
1979/// 0x0d : Greater-than-or-equal (ordered, signaling)
1980/// 0x0e : Greater-than (ordered, signaling)
1981/// 0x0f : True (unordered, non-signaling)
1982/// 0x10 : Equal (ordered, signaling)
1983/// 0x11 : Less-than (ordered, non-signaling)
1984/// 0x12 : Less-than-or-equal (ordered, non-signaling)
1985/// 0x13 : Unordered (signaling)
1986/// 0x14 : Not-equal (unordered, signaling)
1987/// 0x15 : Not-less-than (unordered, non-signaling)
1988/// 0x16 : Not-less-than-or-equal (unordered, non-signaling)
1989/// 0x17 : Ordered (signaling)
1990/// 0x18 : Equal (unordered, signaling)
1991/// 0x19 : Not-greater-than-or-equal (unordered, non-signaling)
1992/// 0x1a : Not-greater-than (unordered, non-signaling)
1993/// 0x1b : False (ordered, signaling)
1994/// 0x1c : Not-equal (ordered, signaling)
1995/// 0x1d : Greater-than-or-equal (ordered, non-signaling)
1996/// 0x1e : Greater-than (ordered, non-signaling)
1997/// 0x1f : True (unordered, signaling)
18571998/// \returns A 128-bit vector of [4 x float] containing the comparison results.
18581999#define _mm_cmp_ss(a, b, c) __extension__ ({ \
18592000 (__m128)__builtin_ia32_cmpss((__v4sf)(__m128)(a), \
......@@ -2184,12 +2325,32 @@ _mm256_cvttps_epi32(__m256 __a)
21842325 return (__m256i)__builtin_ia32_cvttps2dq256((__v8sf) __a);
21852326}
21862327
2328/// \brief Returns the first element of the input vector of [4 x double].
2329///
2330/// \headerfile <avxintrin.h>
2331///
2332/// This intrinsic is a utility function and does not correspond to a specific
2333/// instruction.
2334///
2335/// \param __a
2336/// A 256-bit vector of [4 x double].
2337/// \returns A 64 bit double containing the first element of the input vector.
21872338static __inline double __DEFAULT_FN_ATTRS
21882339_mm256_cvtsd_f64(__m256d __a)
21892340{
21902341 return __a[0];
21912342}
21922343
2344/// \brief Returns the first element of the input vector of [8 x i32].
2345///
2346/// \headerfile <avxintrin.h>
2347///
2348/// This intrinsic is a utility function and does not correspond to a specific
2349/// instruction.
2350///
2351/// \param __a
2352/// A 256-bit vector of [8 x i32].
2353/// \returns A 32 bit integer containing the first element of the input vector.
21932354static __inline int __DEFAULT_FN_ATTRS
21942355_mm256_cvtsi256_si32(__m256i __a)
21952356{
......@@ -2197,6 +2358,16 @@ _mm256_cvtsi256_si32(__m256i __a)
21972358 return __b[0];
21982359}
21992360
2361/// \brief Returns the first element of the input vector of [8 x float].
2362///
2363/// \headerfile <avxintrin.h>
2364///
2365/// This intrinsic is a utility function and does not correspond to a specific
2366/// instruction.
2367///
2368/// \param __a
2369/// A 256-bit vector of [8 x float].
2370/// \returns A 32 bit float containing the first element of the input vector.
22002371static __inline float __DEFAULT_FN_ATTRS
22012372_mm256_cvtss_f32(__m256 __a)
22022373{
......@@ -2380,7 +2551,9 @@ _mm256_unpacklo_ps(__m256 __a, __m256 __b)
23802551/// \brief Given two 128-bit floating-point vectors of [2 x double], perform an
23812552/// element-by-element comparison of the double-precision element in the
23822553/// first source vector and the corresponding element in the second source
2383/// vector. The EFLAGS register is updated as follows: \n
2554/// vector.
2555///
2556/// The EFLAGS register is updated as follows: \n
23842557/// If there is at least one pair of double-precision elements where the
23852558/// sign-bits of both elements are 1, the ZF flag is set to 0. Otherwise the
23862559/// ZF flag is set to 1. \n
......@@ -2407,7 +2580,9 @@ _mm_testz_pd(__m128d __a, __m128d __b)
24072580/// \brief Given two 128-bit floating-point vectors of [2 x double], perform an
24082581/// element-by-element comparison of the double-precision element in the
24092582/// first source vector and the corresponding element in the second source
2410/// vector. The EFLAGS register is updated as follows: \n
2583/// vector.
2584///
2585/// The EFLAGS register is updated as follows: \n
24112586/// If there is at least one pair of double-precision elements where the
24122587/// sign-bits of both elements are 1, the ZF flag is set to 0. Otherwise the
24132588/// ZF flag is set to 1. \n
......@@ -2434,7 +2609,9 @@ _mm_testc_pd(__m128d __a, __m128d __b)
24342609/// \brief Given two 128-bit floating-point vectors of [2 x double], perform an
24352610/// element-by-element comparison of the double-precision element in the
24362611/// first source vector and the corresponding element in the second source
2437/// vector. The EFLAGS register is updated as follows: \n
2612/// vector.
2613///
2614/// The EFLAGS register is updated as follows: \n
24382615/// If there is at least one pair of double-precision elements where the
24392616/// sign-bits of both elements are 1, the ZF flag is set to 0. Otherwise the
24402617/// ZF flag is set to 1. \n
......@@ -2462,7 +2639,9 @@ _mm_testnzc_pd(__m128d __a, __m128d __b)
24622639/// \brief Given two 128-bit floating-point vectors of [4 x float], perform an
24632640/// element-by-element comparison of the single-precision element in the
24642641/// first source vector and the corresponding element in the second source
2465/// vector. The EFLAGS register is updated as follows: \n
2642/// vector.
2643///
2644/// The EFLAGS register is updated as follows: \n
24662645/// If there is at least one pair of single-precision elements where the
24672646/// sign-bits of both elements are 1, the ZF flag is set to 0. Otherwise the
24682647/// ZF flag is set to 1. \n
......@@ -2489,7 +2668,9 @@ _mm_testz_ps(__m128 __a, __m128 __b)
24892668/// \brief Given two 128-bit floating-point vectors of [4 x float], perform an
24902669/// element-by-element comparison of the single-precision element in the
24912670/// first source vector and the corresponding element in the second source
2492/// vector. The EFLAGS register is updated as follows: \n
2671/// vector.
2672///
2673/// The EFLAGS register is updated as follows: \n
24932674/// If there is at least one pair of single-precision elements where the
24942675/// sign-bits of both elements are 1, the ZF flag is set to 0. Otherwise the
24952676/// ZF flag is set to 1. \n
......@@ -2516,7 +2697,9 @@ _mm_testc_ps(__m128 __a, __m128 __b)
25162697/// \brief Given two 128-bit floating-point vectors of [4 x float], perform an
25172698/// element-by-element comparison of the single-precision element in the
25182699/// first source vector and the corresponding element in the second source
2519/// vector. The EFLAGS register is updated as follows: \n
2700/// vector.
2701///
2702/// The EFLAGS register is updated as follows: \n
25202703/// If there is at least one pair of single-precision elements where the
25212704/// sign-bits of both elements are 1, the ZF flag is set to 0. Otherwise the
25222705/// ZF flag is set to 1. \n
......@@ -2544,7 +2727,9 @@ _mm_testnzc_ps(__m128 __a, __m128 __b)
25442727/// \brief Given two 256-bit floating-point vectors of [4 x double], perform an
25452728/// element-by-element comparison of the double-precision elements in the
25462729/// first source vector and the corresponding elements in the second source
2547/// vector. The EFLAGS register is updated as follows: \n
2730/// vector.
2731///
2732/// The EFLAGS register is updated as follows: \n
25482733/// If there is at least one pair of double-precision elements where the
25492734/// sign-bits of both elements are 1, the ZF flag is set to 0. Otherwise the
25502735/// ZF flag is set to 1. \n
......@@ -2571,7 +2756,9 @@ _mm256_testz_pd(__m256d __a, __m256d __b)
25712756/// \brief Given two 256-bit floating-point vectors of [4 x double], perform an
25722757/// element-by-element comparison of the double-precision elements in the
25732758/// first source vector and the corresponding elements in the second source
2574/// vector. The EFLAGS register is updated as follows: \n
2759/// vector.
2760///
2761/// The EFLAGS register is updated as follows: \n
25752762/// If there is at least one pair of double-precision elements where the
25762763/// sign-bits of both elements are 1, the ZF flag is set to 0. Otherwise the
25772764/// ZF flag is set to 1. \n
......@@ -2598,7 +2785,9 @@ _mm256_testc_pd(__m256d __a, __m256d __b)
25982785/// \brief Given two 256-bit floating-point vectors of [4 x double], perform an
25992786/// element-by-element comparison of the double-precision elements in the
26002787/// first source vector and the corresponding elements in the second source
2601/// vector. The EFLAGS register is updated as follows: \n
2788/// vector.
2789///
2790/// The EFLAGS register is updated as follows: \n
26022791/// If there is at least one pair of double-precision elements where the
26032792/// sign-bits of both elements are 1, the ZF flag is set to 0. Otherwise the
26042793/// ZF flag is set to 1. \n
......@@ -2626,7 +2815,9 @@ _mm256_testnzc_pd(__m256d __a, __m256d __b)
26262815/// \brief Given two 256-bit floating-point vectors of [8 x float], perform an
26272816/// element-by-element comparison of the single-precision element in the
26282817/// first source vector and the corresponding element in the second source
2629/// vector. The EFLAGS register is updated as follows: \n
2818/// vector.
2819///
2820/// The EFLAGS register is updated as follows: \n
26302821/// If there is at least one pair of single-precision elements where the
26312822/// sign-bits of both elements are 1, the ZF flag is set to 0. Otherwise the
26322823/// ZF flag is set to 1. \n
......@@ -2653,7 +2844,9 @@ _mm256_testz_ps(__m256 __a, __m256 __b)
26532844/// \brief Given two 256-bit floating-point vectors of [8 x float], perform an
26542845/// element-by-element comparison of the single-precision element in the
26552846/// first source vector and the corresponding element in the second source
2656/// vector. The EFLAGS register is updated as follows: \n
2847/// vector.
2848///
2849/// The EFLAGS register is updated as follows: \n
26572850/// If there is at least one pair of single-precision elements where the
26582851/// sign-bits of both elements are 1, the ZF flag is set to 0. Otherwise the
26592852/// ZF flag is set to 1. \n
......@@ -2680,7 +2873,9 @@ _mm256_testc_ps(__m256 __a, __m256 __b)
26802873/// \brief Given two 256-bit floating-point vectors of [8 x float], perform an
26812874/// element-by-element comparison of the single-precision elements in the
26822875/// first source vector and the corresponding elements in the second source
2683/// vector. The EFLAGS register is updated as follows: \n
2876/// vector.
2877///
2878/// The EFLAGS register is updated as follows: \n
26842879/// If there is at least one pair of single-precision elements where the
26852880/// sign-bits of both elements are 1, the ZF flag is set to 0. Otherwise the
26862881/// ZF flag is set to 1. \n
......@@ -2706,7 +2901,9 @@ _mm256_testnzc_ps(__m256 __a, __m256 __b)
27062901}
27072902
27082903/// \brief Given two 256-bit integer vectors, perform a bit-by-bit comparison
2709/// of the two source vectors and update the EFLAGS register as follows: \n
2904/// of the two source vectors.
2905///
2906/// The EFLAGS register is updated as follows: \n
27102907/// If there is at least one pair of bits where both bits are 1, the ZF flag
27112908/// is set to 0. Otherwise the ZF flag is set to 1. \n
27122909/// If there is at least one pair of bits where the bit from the first source
......@@ -2730,7 +2927,9 @@ _mm256_testz_si256(__m256i __a, __m256i __b)
27302927}
27312928
27322929/// \brief Given two 256-bit integer vectors, perform a bit-by-bit comparison
2733/// of the two source vectors and update the EFLAGS register as follows: \n
2930/// of the two source vectors.
2931///
2932/// The EFLAGS register is updated as follows: \n
27342933/// If there is at least one pair of bits where both bits are 1, the ZF flag
27352934/// is set to 0. Otherwise the ZF flag is set to 1. \n
27362935/// If there is at least one pair of bits where the bit from the first source
......@@ -2754,7 +2953,9 @@ _mm256_testc_si256(__m256i __a, __m256i __b)
27542953}
27552954
27562955/// \brief Given two 256-bit integer vectors, perform a bit-by-bit comparison
2757/// of the two source vectors and update the EFLAGS register as follows: \n
2956/// of the two source vectors.
2957///
2958/// The EFLAGS register is updated as follows: \n
27582959/// If there is at least one pair of bits where both bits are 1, the ZF flag
27592960/// is set to 0. Otherwise the ZF flag is set to 1. \n
27602961/// If there is at least one pair of bits where the bit from the first source
......@@ -3389,7 +3590,8 @@ _mm_maskstore_ps(float *__p, __m128i __m, __m128 __a)
33893590static __inline void __DEFAULT_FN_ATTRS
33903591_mm256_stream_si256(__m256i *__a, __m256i __b)
33913592{
3392 __builtin_nontemporal_store((__v4di)__b, (__v4di*)__a);
3593 typedef __v4di __v4di_aligned __attribute__((aligned(32)));
3594 __builtin_nontemporal_store((__v4di_aligned)__b, (__v4di_aligned*)__a);
33933595}
33943596
33953597/// \brief Moves double-precision values from a 256-bit vector of [4 x double]
......@@ -3402,13 +3604,14 @@ _mm256_stream_si256(__m256i *__a, __m256i __b)
34023604///
34033605/// \param __a
34043606/// A pointer to a 32-byte aligned memory location that will receive the
3405/// integer values.
3607/// double-precision floating-point values.
34063608/// \param __b
34073609/// A 256-bit vector of [4 x double] containing the values to be moved.
34083610static __inline void __DEFAULT_FN_ATTRS
34093611_mm256_stream_pd(double *__a, __m256d __b)
34103612{
3411 __builtin_nontemporal_store((__v4df)__b, (__v4df*)__a);
3613 typedef __v4df __v4df_aligned __attribute__((aligned(32)));
3614 __builtin_nontemporal_store((__v4df_aligned)__b, (__v4df_aligned*)__a);
34123615}
34133616
34143617/// \brief Moves single-precision floating point values from a 256-bit vector
......@@ -3428,7 +3631,8 @@ _mm256_stream_pd(double *__a, __m256d __b)
34283631static __inline void __DEFAULT_FN_ATTRS
34293632_mm256_stream_ps(float *__p, __m256 __a)
34303633{
3431 __builtin_nontemporal_store((__v8sf)__a, (__v8sf*)__p);
3634 typedef __v8sf __v8sf_aligned __attribute__((aligned(32)));
3635 __builtin_nontemporal_store((__v8sf_aligned)__a, (__v8sf_aligned*)__p);
34323636}
34333637
34343638/* Create vectors */
......@@ -4310,9 +4514,10 @@ _mm256_castsi256_si128(__m256i __a)
43104514}
43114515
43124516/// \brief Constructs a 256-bit floating-point vector of [4 x double] from a
4313/// 128-bit floating-point vector of [2 x double]. The lower 128 bits
4314/// contain the value of the source vector. The contents of the upper 128
4315/// bits are undefined.
4517/// 128-bit floating-point vector of [2 x double].
4518///
4519/// The lower 128 bits contain the value of the source vector. The contents
4520/// of the upper 128 bits are undefined.
43164521///
43174522/// \headerfile <x86intrin.h>
43184523///
......@@ -4330,9 +4535,10 @@ _mm256_castpd128_pd256(__m128d __a)
43304535}
43314536
43324537/// \brief Constructs a 256-bit floating-point vector of [8 x float] from a
4333/// 128-bit floating-point vector of [4 x float]. The lower 128 bits contain
4334/// the value of the source vector. The contents of the upper 128 bits are
4335/// undefined.
4538/// 128-bit floating-point vector of [4 x float].
4539///
4540/// The lower 128 bits contain the value of the source vector. The contents
4541/// of the upper 128 bits are undefined.
43364542///
43374543/// \headerfile <x86intrin.h>
43384544///
......@@ -4350,6 +4556,7 @@ _mm256_castps128_ps256(__m128 __a)
43504556}
43514557
43524558/// \brief Constructs a 256-bit integer vector from a 128-bit integer vector.
4559///
43534560/// The lower 128 bits contain the value of the source vector. The contents
43544561/// of the upper 128 bits are undefined.
43554562///
......@@ -4367,6 +4574,61 @@ _mm256_castsi128_si256(__m128i __a)
43674574 return __builtin_shufflevector((__v2di)__a, (__v2di)__a, 0, 1, -1, -1);
43684575}
43694576
4577/// \brief Constructs a 256-bit floating-point vector of [4 x double] from a
4578/// 128-bit floating-point vector of [2 x double]. The lower 128 bits
4579/// contain the value of the source vector. The upper 128 bits are set
4580/// to zero.
4581///
4582/// \headerfile <x86intrin.h>
4583///
4584/// This intrinsic has no corresponding instruction.
4585///
4586/// \param __a
4587/// A 128-bit vector of [2 x double].
4588/// \returns A 256-bit floating-point vector of [4 x double]. The lower 128 bits
4589/// contain the value of the parameter. The upper 128 bits are set to zero.
4590static __inline __m256d __DEFAULT_FN_ATTRS
4591_mm256_zextpd128_pd256(__m128d __a)
4592{
4593 return __builtin_shufflevector((__v2df)__a, (__v2df)_mm_setzero_pd(), 0, 1, 2, 3);
4594}
4595
4596/// \brief Constructs a 256-bit floating-point vector of [8 x float] from a
4597/// 128-bit floating-point vector of [4 x float]. The lower 128 bits contain
4598/// the value of the source vector. The upper 128 bits are set to zero.
4599///
4600/// \headerfile <x86intrin.h>
4601///
4602/// This intrinsic has no corresponding instruction.
4603///
4604/// \param __a
4605/// A 128-bit vector of [4 x float].
4606/// \returns A 256-bit floating-point vector of [8 x float]. The lower 128 bits
4607/// contain the value of the parameter. The upper 128 bits are set to zero.
4608static __inline __m256 __DEFAULT_FN_ATTRS
4609_mm256_zextps128_ps256(__m128 __a)
4610{
4611 return __builtin_shufflevector((__v4sf)__a, (__v4sf)_mm_setzero_ps(), 0, 1, 2, 3, 4, 5, 6, 7);
4612}
4613
4614/// \brief Constructs a 256-bit integer vector from a 128-bit integer vector.
4615/// The lower 128 bits contain the value of the source vector. The upper
4616/// 128 bits are set to zero.
4617///
4618/// \headerfile <x86intrin.h>
4619///
4620/// This intrinsic has no corresponding instruction.
4621///
4622/// \param __a
4623/// A 128-bit integer vector.
4624/// \returns A 256-bit integer vector. The lower 128 bits contain the value of
4625/// the parameter. The upper 128 bits are set to zero.
4626static __inline __m256i __DEFAULT_FN_ATTRS
4627_mm256_zextsi128_si256(__m128i __a)
4628{
4629 return __builtin_shufflevector((__v2di)__a, (__v2di)_mm_setzero_si128(), 0, 1, 2, 3);
4630}
4631
43704632/*
43714633 Vector insert.
43724634 We use macros rather than inlines because we only want to accept
......@@ -4375,8 +4637,10 @@ _mm256_castsi128_si256(__m128i __a)
43754637/// \brief Constructs a new 256-bit vector of [8 x float] by first duplicating
43764638/// a 256-bit vector of [8 x float] given in the first parameter, and then
43774639/// replacing either the upper or the lower 128 bits with the contents of a
4378/// 128-bit vector of [4 x float] in the second parameter. The immediate
4379/// integer parameter determines between the upper or the lower 128 bits.
4640/// 128-bit vector of [4 x float] in the second parameter.
4641///
4642/// The immediate integer parameter determines between the upper or the lower
4643/// 128 bits.
43804644///
43814645/// \headerfile <x86intrin.h>
43824646///
......@@ -4420,8 +4684,10 @@ _mm256_castsi128_si256(__m128i __a)
44204684/// \brief Constructs a new 256-bit vector of [4 x double] by first duplicating
44214685/// a 256-bit vector of [4 x double] given in the first parameter, and then
44224686/// replacing either the upper or the lower 128 bits with the contents of a
4423/// 128-bit vector of [2 x double] in the second parameter. The immediate
4424/// integer parameter determines between the upper or the lower 128 bits.
4687/// 128-bit vector of [2 x double] in the second parameter.
4688///
4689/// The immediate integer parameter determines between the upper or the lower
4690/// 128 bits.
44254691///
44264692/// \headerfile <x86intrin.h>
44274693///
......@@ -4461,8 +4727,10 @@ _mm256_castsi128_si256(__m128i __a)
44614727/// \brief Constructs a new 256-bit integer vector by first duplicating a
44624728/// 256-bit integer vector given in the first parameter, and then replacing
44634729/// either the upper or the lower 128 bits with the contents of a 128-bit
4464/// integer vector in the second parameter. The immediate integer parameter
4465/// determines between the upper or the lower 128 bits.
4730/// integer vector in the second parameter.
4731///
4732/// The immediate integer parameter determines between the upper or the lower
4733/// 128 bits.
44664734///
44674735/// \headerfile <x86intrin.h>
44684736///
c_headers/bmiintrin.h+5-171
......@@ -28,107 +28,17 @@
2828#ifndef __BMIINTRIN_H
2929#define __BMIINTRIN_H
3030
31/// \brief Counts the number of trailing zero bits in the operand.
32///
33/// \headerfile <x86intrin.h>
34///
35/// \code
36/// unsigned short _tzcnt_u16(unsigned short a);
37/// \endcode
38///
39/// This intrinsic corresponds to the <c> TZCNT </c> instruction.
40///
41/// \param a
42/// An unsigned 16-bit integer whose trailing zeros are to be counted.
43/// \returns An unsigned 16-bit integer containing the number of trailing zero
44/// bits in the operand.
4531#define _tzcnt_u16(a) (__tzcnt_u16((a)))
4632
47/// \brief Performs a bitwise AND of the second operand with the one's
48/// complement of the first operand.
49///
50/// \headerfile <x86intrin.h>
51///
52/// \code
53/// unsigned int _andn_u32(unsigned int a, unsigned int b);
54/// \endcode
55///
56/// This intrinsic corresponds to the <c> ANDN </c> instruction.
57///
58/// \param a
59/// An unsigned integer containing one of the operands.
60/// \param b
61/// An unsigned integer containing one of the operands.
62/// \returns An unsigned integer containing the bitwise AND of the second
63/// operand with the one's complement of the first operand.
6433#define _andn_u32(a, b) (__andn_u32((a), (b)))
6534
6635/* _bextr_u32 != __bextr_u32 */
67/// \brief Clears all bits in the source except for the least significant bit
68/// containing a value of 1 and returns the result.
69///
70/// \headerfile <x86intrin.h>
71///
72/// \code
73/// unsigned int _blsi_u32(unsigned int a);
74/// \endcode
75///
76/// This intrinsic corresponds to the <c> BLSI </c> instruction.
77///
78/// \param a
79/// An unsigned integer whose bits are to be cleared.
80/// \returns An unsigned integer containing the result of clearing the bits from
81/// the source operand.
8236#define _blsi_u32(a) (__blsi_u32((a)))
8337
84/// \brief Creates a mask whose bits are set to 1, using bit 0 up to and
85/// including the least siginificant bit that is set to 1 in the source
86/// operand and returns the result.
87///
88/// \headerfile <x86intrin.h>
89///
90/// \code
91/// unsigned int _blsmsk_u32(unsigned int a);
92/// \endcode
93///
94/// This intrinsic corresponds to the <c> BLSMSK </c> instruction.
95///
96/// \param a
97/// An unsigned integer used to create the mask.
98/// \returns An unsigned integer containing the newly created mask.
9938#define _blsmsk_u32(a) (__blsmsk_u32((a)))
10039
101/// \brief Clears the least siginificant bit that is set to 1 in the source
102/// operand and returns the result.
103///
104/// \headerfile <x86intrin.h>
105///
106/// \code
107/// unsigned int _blsr_u32(unsigned int a);
108/// \endcode
109///
110/// This intrinsic corresponds to the <c> BLSR </c> instruction.
111///
112/// \param a
113/// An unsigned integer containing the operand to be cleared.
114/// \returns An unsigned integer containing the result of clearing the source
115/// operand.
11640#define _blsr_u32(a) (__blsr_u32((a)))
11741
118/// \brief Counts the number of trailing zero bits in the operand.
119///
120/// \headerfile <x86intrin.h>
121///
122/// \code
123/// unsigned int _tzcnt_u32(unsigned int a);
124/// \endcode
125///
126/// This intrinsic corresponds to the <c> TZCNT </c> instruction.
127///
128/// \param a
129/// An unsigned 32-bit integer whose trailing zeros are to be counted.
130/// \returns An unsigned 32-bit integer containing the number of trailing zero
131/// bits in the operand.
13242#define _tzcnt_u32(a) (__tzcnt_u32((a)))
13343
13444/* Define the default attributes for the functions in this file. */
......@@ -238,7 +148,7 @@ __blsi_u32(unsigned int __X)
238148}
239149
240150/// \brief Creates a mask whose bits are set to 1, using bit 0 up to and
241/// including the least siginificant bit that is set to 1 in the source
151/// including the least significant bit that is set to 1 in the source
242152/// operand and returns the result.
243153///
244154/// \headerfile <x86intrin.h>
......@@ -254,7 +164,7 @@ __blsmsk_u32(unsigned int __X)
254164 return __X ^ (__X - 1);
255165}
256166
257/// \brief Clears the least siginificant bit that is set to 1 in the source
167/// \brief Clears the least significant bit that is set to 1 in the source
258168/// operand and returns the result.
259169///
260170/// \headerfile <x86intrin.h>
......@@ -305,91 +215,15 @@ _mm_tzcnt_32(unsigned int __X)
305215
306216#ifdef __x86_64__
307217
308/// \brief Performs a bitwise AND of the second operand with the one's
309/// complement of the first operand.
310///
311/// \headerfile <x86intrin.h>
312///
313/// \code
314/// unsigned long long _andn_u64 (unsigned long long a, unsigned long long b);
315/// \endcode
316///
317/// This intrinsic corresponds to the <c> ANDN </c> instruction.
318///
319/// \param a
320/// An unsigned 64-bit integer containing one of the operands.
321/// \param b
322/// An unsigned 64-bit integer containing one of the operands.
323/// \returns An unsigned 64-bit integer containing the bitwise AND of the second
324/// operand with the one's complement of the first operand.
325218#define _andn_u64(a, b) (__andn_u64((a), (b)))
326219
327220/* _bextr_u64 != __bextr_u64 */
328/// \brief Clears all bits in the source except for the least significant bit
329/// containing a value of 1 and returns the result.
330///
331/// \headerfile <x86intrin.h>
332///
333/// \code
334/// unsigned long long _blsi_u64(unsigned long long a);
335/// \endcode
336///
337/// This intrinsic corresponds to the <c> BLSI </c> instruction.
338///
339/// \param a
340/// An unsigned 64-bit integer whose bits are to be cleared.
341/// \returns An unsigned 64-bit integer containing the result of clearing the
342/// bits from the source operand.
343221#define _blsi_u64(a) (__blsi_u64((a)))
344222
345/// \brief Creates a mask whose bits are set to 1, using bit 0 up to and
346/// including the least siginificant bit that is set to 1 in the source
347/// operand and returns the result.
348///
349/// \headerfile <x86intrin.h>
350///
351/// \code
352/// unsigned long long _blsmsk_u64(unsigned long long a);
353/// \endcode
354///
355/// This intrinsic corresponds to the <c> BLSMSK </c> instruction.
356///
357/// \param a
358/// An unsigned 64-bit integer used to create the mask.
359/// \returns A unsigned 64-bit integer containing the newly created mask.
360223#define _blsmsk_u64(a) (__blsmsk_u64((a)))
361224
362/// \brief Clears the least siginificant bit that is set to 1 in the source
363/// operand and returns the result.
364///
365/// \headerfile <x86intrin.h>
366///
367/// \code
368/// unsigned long long _blsr_u64(unsigned long long a);
369/// \endcode
370///
371/// This intrinsic corresponds to the <c> BLSR </c> instruction.
372///
373/// \param a
374/// An unsigned 64-bit integer containing the operand to be cleared.
375/// \returns An unsigned 64-bit integer containing the result of clearing the
376/// source operand.
377225#define _blsr_u64(a) (__blsr_u64((a)))
378226
379/// \brief Counts the number of trailing zero bits in the operand.
380///
381/// \headerfile <x86intrin.h>
382///
383/// \code
384/// unsigned long long _tzcnt_u64(unsigned long long a);
385/// \endcode
386///
387/// This intrinsic corresponds to the <c> TZCNT </c> instruction.
388///
389/// \param a
390/// An unsigned 64-bit integer whose trailing zeros are to be counted.
391/// \returns An unsigned 64-bit integer containing the number of trailing zero
392/// bits in the operand.
393227#define _tzcnt_u64(a) (__tzcnt_u64((a)))
394228
395229/// \brief Performs a bitwise AND of the second operand with the one's
......@@ -475,7 +309,7 @@ __blsi_u64(unsigned long long __X)
475309}
476310
477311/// \brief Creates a mask whose bits are set to 1, using bit 0 up to and
478/// including the least siginificant bit that is set to 1 in the source
312/// including the least significant bit that is set to 1 in the source
479313/// operand and returns the result.
480314///
481315/// \headerfile <x86intrin.h>
......@@ -484,14 +318,14 @@ __blsi_u64(unsigned long long __X)
484318///
485319/// \param __X
486320/// An unsigned 64-bit integer used to create the mask.
487/// \returns A unsigned 64-bit integer containing the newly created mask.
321/// \returns An unsigned 64-bit integer containing the newly created mask.
488322static __inline__ unsigned long long __DEFAULT_FN_ATTRS
489323__blsmsk_u64(unsigned long long __X)
490324{
491325 return __X ^ (__X - 1);
492326}
493327
494/// \brief Clears the least siginificant bit that is set to 1 in the source
328/// \brief Clears the least significant bit that is set to 1 in the source
495329/// operand and returns the result.
496330///
497331/// \headerfile <x86intrin.h>
c_headers/clzerointrin.h created+50
......@@ -0,0 +1,50 @@
1/*===----------------------- clzerointrin.h - CLZERO ----------------------===
2 *
3 * Permission is hereby granted, free of charge, to any person obtaining a copy
4 * of this software and associated documentation files (the "Software"), to deal
5 * in the Software without restriction, including without limitation the rights
6 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7 * copies of the Software, and to permit persons to whom the Software is
8 * furnished to do so, subject to the following conditions:
9 *
10 * The above copyright notice and this permission notice shall be included in
11 * all copies or substantial portions of the Software.
12 *
13 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19 * THE SOFTWARE.
20 *
21 *===-----------------------------------------------------------------------===
22 */
23#ifndef __X86INTRIN_H
24#error "Never use <clzerointrin.h> directly; include <x86intrin.h> instead."
25#endif
26
27#ifndef _CLZEROINTRIN_H
28#define _CLZEROINTRIN_H
29
30/* Define the default attributes for the functions in this file. */
31#define __DEFAULT_FN_ATTRS \
32 __attribute__((__always_inline__, __nodebug__, __target__("clzero")))
33
34/// \brief Loads the cache line address and zero's out the cacheline
35///
36/// \headerfile <clzerointrin.h>
37///
38/// This intrinsic corresponds to the <c> CLZERO </c> instruction.
39///
40/// \param __line
41/// A pointer to a cacheline which needs to be zeroed out.
42static __inline__ void __DEFAULT_FN_ATTRS
43_mm_clzero (void * __line)
44{
45 __builtin_ia32_clzero ((void *)__line);
46}
47
48#undef __DEFAULT_FN_ATTRS
49
50#endif /* _CLZEROINTRIN_H */
c_headers/cpuid.h+98-20
......@@ -79,7 +79,7 @@
7979#define signature_VORTEX_edx 0x36387865
8080#define signature_VORTEX_ecx 0x436f5320
8181
82/* Features in %ecx for level 1 */
82/* Features in %ecx for leaf 1 */
8383#define bit_SSE3 0x00000001
8484#define bit_PCLMULQDQ 0x00000002
8585#define bit_PCLMUL bit_PCLMULQDQ /* for gcc compat */
......@@ -114,7 +114,7 @@
114114#define bit_F16C 0x20000000
115115#define bit_RDRND 0x40000000
116116
117/* Features in %edx for level 1 */
117/* Features in %edx for leaf 1 */
118118#define bit_FPU 0x00000001
119119#define bit_VME 0x00000002
120120#define bit_DE 0x00000004
......@@ -147,44 +147,95 @@
147147#define bit_TM 0x20000000
148148#define bit_PBE 0x80000000
149149
150/* Features in %ebx for level 7 sub-leaf 0 */
150/* Features in %ebx for leaf 7 sub-leaf 0 */
151151#define bit_FSGSBASE 0x00000001
152#define bit_SGX 0x00000004
153#define bit_BMI 0x00000008
154#define bit_HLE 0x00000010
155#define bit_AVX2 0x00000020
152156#define bit_SMEP 0x00000080
157#define bit_BMI2 0x00000100
153158#define bit_ENH_MOVSB 0x00000200
159#define bit_RTM 0x00000800
160#define bit_MPX 0x00004000
161#define bit_AVX512F 0x00010000
162#define bit_AVX512DQ 0x00020000
163#define bit_RDSEED 0x00040000
164#define bit_ADX 0x00080000
165#define bit_AVX512IFMA 0x00200000
166#define bit_CLFLUSHOPT 0x00800000
167#define bit_CLWB 0x01000000
168#define bit_AVX512PF 0x04000000
169#define bit_AVX51SER 0x08000000
170#define bit_AVX512CD 0x10000000
171#define bit_SHA 0x20000000
172#define bit_AVX512BW 0x40000000
173#define bit_AVX512VL 0x80000000
174
175/* Features in %ecx for leaf 7 sub-leaf 0 */
176#define bit_PREFTCHWT1 0x00000001
177#define bit_AVX512VBMI 0x00000002
178#define bit_PKU 0x00000004
179#define bit_OSPKE 0x00000010
180#define bit_AVX512VPOPCNTDQ 0x00004000
181#define bit_RDPID 0x00400000
182
183/* Features in %edx for leaf 7 sub-leaf 0 */
184#define bit_AVX5124VNNIW 0x00000004
185#define bit_AVX5124FMAPS 0x00000008
186
187/* Features in %eax for leaf 13 sub-leaf 1 */
188#define bit_XSAVEOPT 0x00000001
189#define bit_XSAVEC 0x00000002
190#define bit_XSAVES 0x00000008
191
192/* Features in %ecx for leaf 0x80000001 */
193#define bit_LAHF_LM 0x00000001
194#define bit_ABM 0x00000020
195#define bit_SSE4a 0x00000040
196#define bit_PRFCHW 0x00000100
197#define bit_XOP 0x00000800
198#define bit_LWP 0x00008000
199#define bit_FMA4 0x00010000
200#define bit_TBM 0x00200000
201#define bit_MWAITX 0x20000000
202
203/* Features in %edx for leaf 0x80000001 */
204#define bit_MMXEXT 0x00400000
205#define bit_LM 0x20000000
206#define bit_3DNOWP 0x40000000
207#define bit_3DNOW 0x80000000
208
209/* Features in %ebx for leaf 0x80000001 */
210#define bit_CLZERO 0x00000001
211
154212
155213#if __i386__
156#define __cpuid(__level, __eax, __ebx, __ecx, __edx) \
214#define __cpuid(__leaf, __eax, __ebx, __ecx, __edx) \
157215 __asm("cpuid" : "=a"(__eax), "=b" (__ebx), "=c"(__ecx), "=d"(__edx) \
158 : "0"(__level))
216 : "0"(__leaf))
159217
160#define __cpuid_count(__level, __count, __eax, __ebx, __ecx, __edx) \
218#define __cpuid_count(__leaf, __count, __eax, __ebx, __ecx, __edx) \
161219 __asm("cpuid" : "=a"(__eax), "=b" (__ebx), "=c"(__ecx), "=d"(__edx) \
162 : "0"(__level), "2"(__count))
220 : "0"(__leaf), "2"(__count))
163221#else
164222/* x86-64 uses %rbx as the base register, so preserve it. */
165#define __cpuid(__level, __eax, __ebx, __ecx, __edx) \
223#define __cpuid(__leaf, __eax, __ebx, __ecx, __edx) \
166224 __asm(" xchgq %%rbx,%q1\n" \
167225 " cpuid\n" \
168226 " xchgq %%rbx,%q1" \
169227 : "=a"(__eax), "=r" (__ebx), "=c"(__ecx), "=d"(__edx) \
170 : "0"(__level))
228 : "0"(__leaf))
171229
172#define __cpuid_count(__level, __count, __eax, __ebx, __ecx, __edx) \
230#define __cpuid_count(__leaf, __count, __eax, __ebx, __ecx, __edx) \
173231 __asm(" xchgq %%rbx,%q1\n" \
174232 " cpuid\n" \
175233 " xchgq %%rbx,%q1" \
176234 : "=a"(__eax), "=r" (__ebx), "=c"(__ecx), "=d"(__edx) \
177 : "0"(__level), "2"(__count))
235 : "0"(__leaf), "2"(__count))
178236#endif
179237
180static __inline int __get_cpuid (unsigned int __level, unsigned int *__eax,
181 unsigned int *__ebx, unsigned int *__ecx,
182 unsigned int *__edx) {
183 __cpuid(__level, *__eax, *__ebx, *__ecx, *__edx);
184 return 1;
185}
186
187static __inline int __get_cpuid_max (unsigned int __level, unsigned int *__sig)
238static __inline int __get_cpuid_max (unsigned int __leaf, unsigned int *__sig)
188239{
189240 unsigned int __eax, __ebx, __ecx, __edx;
190241#if __i386__
......@@ -208,8 +259,35 @@ static __inline int __get_cpuid_max (unsigned int __level, unsigned int *__sig)
208259 return 0;
209260#endif
210261
211 __cpuid(__level, __eax, __ebx, __ecx, __edx);
262 __cpuid(__leaf, __eax, __ebx, __ecx, __edx);
212263 if (__sig)
213264 *__sig = __ebx;
214265 return __eax;
215266}
267
268static __inline int __get_cpuid (unsigned int __leaf, unsigned int *__eax,
269 unsigned int *__ebx, unsigned int *__ecx,
270 unsigned int *__edx)
271{
272 unsigned int __max_leaf = __get_cpuid_max(__leaf & 0x80000000, 0);
273
274 if (__max_leaf == 0 || __max_leaf < __leaf)
275 return 0;
276
277 __cpuid(__leaf, *__eax, *__ebx, *__ecx, *__edx);
278 return 1;
279}
280
281static __inline int __get_cpuid_count (unsigned int __leaf,
282 unsigned int __subleaf,
283 unsigned int *__eax, unsigned int *__ebx,
284 unsigned int *__ecx, unsigned int *__edx)
285{
286 unsigned int __max_leaf = __get_cpuid_max(__leaf & 0x80000000, 0);
287
288 if (__max_leaf == 0 || __max_leaf < __leaf)
289 return 0;
290
291 __cpuid_count(__leaf, __subleaf, *__eax, *__ebx, *__ecx, *__edx);
292 return 1;
293}
c_headers/emmintrin.h+251-114
......@@ -302,7 +302,7 @@ _mm_min_pd(__m128d __a, __m128d __b)
302302 return __builtin_ia32_minpd((__v2df)__a, (__v2df)__b);
303303}
304304
305/// \brief Compares lower 64-bits double-precision values of both operands, and
305/// \brief Compares lower 64-bit double-precision values of both operands, and
306306/// returns the greater of the pair of values in the lower 64-bits of the
307307/// result. The upper 64 bits of the result are copied from the upper double-
308308/// precision value of the first operand.
......@@ -462,8 +462,9 @@ _mm_cmplt_pd(__m128d __a, __m128d __b)
462462
463463/// \brief Compares each of the corresponding double-precision values of the
464464/// 128-bit vectors of [2 x double] to determine if the values in the first
465/// operand are less than or equal to those in the second operand. Each
466/// comparison yields 0h for false, FFFFFFFFFFFFFFFFh for true.
465/// operand are less than or equal to those in the second operand.
466///
467/// Each comparison yields 0h for false, FFFFFFFFFFFFFFFFh for true.
467468///
468469/// \headerfile <x86intrin.h>
469470///
......@@ -482,8 +483,9 @@ _mm_cmple_pd(__m128d __a, __m128d __b)
482483
483484/// \brief Compares each of the corresponding double-precision values of the
484485/// 128-bit vectors of [2 x double] to determine if the values in the first
485/// operand are greater than those in the second operand. Each comparison
486/// yields 0h for false, FFFFFFFFFFFFFFFFh for true.
486/// operand are greater than those in the second operand.
487///
488/// Each comparison yields 0h for false, FFFFFFFFFFFFFFFFh for true.
487489///
488490/// \headerfile <x86intrin.h>
489491///
......@@ -502,8 +504,9 @@ _mm_cmpgt_pd(__m128d __a, __m128d __b)
502504
503505/// \brief Compares each of the corresponding double-precision values of the
504506/// 128-bit vectors of [2 x double] to determine if the values in the first
505/// operand are greater than or equal to those in the second operand. Each
506/// comparison yields 0h for false, FFFFFFFFFFFFFFFFh for true.
507/// operand are greater than or equal to those in the second operand.
508///
509/// Each comparison yields 0h for false, FFFFFFFFFFFFFFFFh for true.
507510///
508511/// \headerfile <x86intrin.h>
509512///
......@@ -522,9 +525,10 @@ _mm_cmpge_pd(__m128d __a, __m128d __b)
522525
523526/// \brief Compares each of the corresponding double-precision values of the
524527/// 128-bit vectors of [2 x double] to determine if the values in the first
525/// operand are ordered with respect to those in the second operand. A pair
526/// of double-precision values are "ordered" with respect to each other if
527/// neither value is a NaN. Each comparison yields 0h for false,
528/// operand are ordered with respect to those in the second operand.
529///
530/// A pair of double-precision values are "ordered" with respect to each
531/// other if neither value is a NaN. Each comparison yields 0h for false,
528532/// FFFFFFFFFFFFFFFFh for true.
529533///
530534/// \headerfile <x86intrin.h>
......@@ -544,9 +548,10 @@ _mm_cmpord_pd(__m128d __a, __m128d __b)
544548
545549/// \brief Compares each of the corresponding double-precision values of the
546550/// 128-bit vectors of [2 x double] to determine if the values in the first
547/// operand are unordered with respect to those in the second operand. A pair
548/// of double-precision values are "unordered" with respect to each other if
549/// one or both values are NaN. Each comparison yields 0h for false,
551/// operand are unordered with respect to those in the second operand.
552///
553/// A pair of double-precision values are "unordered" with respect to each
554/// other if one or both values are NaN. Each comparison yields 0h for false,
550555/// FFFFFFFFFFFFFFFFh for true.
551556///
552557/// \headerfile <x86intrin.h>
......@@ -567,8 +572,9 @@ _mm_cmpunord_pd(__m128d __a, __m128d __b)
567572
568573/// \brief Compares each of the corresponding double-precision values of the
569574/// 128-bit vectors of [2 x double] to determine if the values in the first
570/// operand are unequal to those in the second operand. Each comparison
571/// yields 0h for false, FFFFFFFFFFFFFFFFh for true.
575/// operand are unequal to those in the second operand.
576///
577/// Each comparison yields 0h for false, FFFFFFFFFFFFFFFFh for true.
572578///
573579/// \headerfile <x86intrin.h>
574580///
......@@ -587,8 +593,9 @@ _mm_cmpneq_pd(__m128d __a, __m128d __b)
587593
588594/// \brief Compares each of the corresponding double-precision values of the
589595/// 128-bit vectors of [2 x double] to determine if the values in the first
590/// operand are not less than those in the second operand. Each comparison
591/// yields 0h for false, FFFFFFFFFFFFFFFFh for true.
596/// operand are not less than those in the second operand.
597///
598/// Each comparison yields 0h for false, FFFFFFFFFFFFFFFFh for true.
592599///
593600/// \headerfile <x86intrin.h>
594601///
......@@ -607,8 +614,9 @@ _mm_cmpnlt_pd(__m128d __a, __m128d __b)
607614
608615/// \brief Compares each of the corresponding double-precision values of the
609616/// 128-bit vectors of [2 x double] to determine if the values in the first
610/// operand are not less than or equal to those in the second operand. Each
611/// comparison yields 0h for false, FFFFFFFFFFFFFFFFh for true.
617/// operand are not less than or equal to those in the second operand.
618///
619/// Each comparison yields 0h for false, FFFFFFFFFFFFFFFFh for true.
612620///
613621/// \headerfile <x86intrin.h>
614622///
......@@ -627,8 +635,9 @@ _mm_cmpnle_pd(__m128d __a, __m128d __b)
627635
628636/// \brief Compares each of the corresponding double-precision values of the
629637/// 128-bit vectors of [2 x double] to determine if the values in the first
630/// operand are not greater than those in the second operand. Each
631/// comparison yields 0h for false, FFFFFFFFFFFFFFFFh for true.
638/// operand are not greater than those in the second operand.
639///
640/// Each comparison yields 0h for false, FFFFFFFFFFFFFFFFh for true.
632641///
633642/// \headerfile <x86intrin.h>
634643///
......@@ -648,6 +657,7 @@ _mm_cmpngt_pd(__m128d __a, __m128d __b)
648657/// \brief Compares each of the corresponding double-precision values of the
649658/// 128-bit vectors of [2 x double] to determine if the values in the first
650659/// operand are not greater than or equal to those in the second operand.
660///
651661/// Each comparison yields 0h for false, FFFFFFFFFFFFFFFFh for true.
652662///
653663/// \headerfile <x86intrin.h>
......@@ -666,8 +676,9 @@ _mm_cmpnge_pd(__m128d __a, __m128d __b)
666676}
667677
668678/// \brief Compares the lower double-precision floating-point values in each of
669/// the two 128-bit floating-point vectors of [2 x double] for equality. The
670/// comparison yields 0h for false, FFFFFFFFFFFFFFFFh for true.
679/// the two 128-bit floating-point vectors of [2 x double] for equality.
680///
681/// The comparison yields 0h for false, FFFFFFFFFFFFFFFFh for true.
671682///
672683/// \headerfile <x86intrin.h>
673684///
......@@ -690,8 +701,9 @@ _mm_cmpeq_sd(__m128d __a, __m128d __b)
690701/// \brief Compares the lower double-precision floating-point values in each of
691702/// the two 128-bit floating-point vectors of [2 x double] to determine if
692703/// the value in the first parameter is less than the corresponding value in
693/// the second parameter. The comparison yields 0h for false,
694/// FFFFFFFFFFFFFFFFh for true.
704/// the second parameter.
705///
706/// The comparison yields 0h for false, FFFFFFFFFFFFFFFFh for true.
695707///
696708/// \headerfile <x86intrin.h>
697709///
......@@ -714,8 +726,9 @@ _mm_cmplt_sd(__m128d __a, __m128d __b)
714726/// \brief Compares the lower double-precision floating-point values in each of
715727/// the two 128-bit floating-point vectors of [2 x double] to determine if
716728/// the value in the first parameter is less than or equal to the
717/// corresponding value in the second parameter. The comparison yields 0h for
718/// false, FFFFFFFFFFFFFFFFh for true.
729/// corresponding value in the second parameter.
730///
731/// The comparison yields 0h for false, FFFFFFFFFFFFFFFFh for true.
719732///
720733/// \headerfile <x86intrin.h>
721734///
......@@ -738,8 +751,9 @@ _mm_cmple_sd(__m128d __a, __m128d __b)
738751/// \brief Compares the lower double-precision floating-point values in each of
739752/// the two 128-bit floating-point vectors of [2 x double] to determine if
740753/// the value in the first parameter is greater than the corresponding value
741/// in the second parameter. The comparison yields 0h for false,
742/// FFFFFFFFFFFFFFFFh for true.
754/// in the second parameter.
755///
756/// The comparison yields 0h for false, FFFFFFFFFFFFFFFFh for true.
743757///
744758/// \headerfile <x86intrin.h>
745759///
......@@ -763,8 +777,9 @@ _mm_cmpgt_sd(__m128d __a, __m128d __b)
763777/// \brief Compares the lower double-precision floating-point values in each of
764778/// the two 128-bit floating-point vectors of [2 x double] to determine if
765779/// the value in the first parameter is greater than or equal to the
766/// corresponding value in the second parameter. The comparison yields 0h for
767/// false, FFFFFFFFFFFFFFFFh for true.
780/// corresponding value in the second parameter.
781///
782/// The comparison yields 0h for false, FFFFFFFFFFFFFFFFh for true.
768783///
769784/// \headerfile <x86intrin.h>
770785///
......@@ -788,9 +803,11 @@ _mm_cmpge_sd(__m128d __a, __m128d __b)
788803/// \brief Compares the lower double-precision floating-point values in each of
789804/// the two 128-bit floating-point vectors of [2 x double] to determine if
790805/// the value in the first parameter is "ordered" with respect to the
791/// corresponding value in the second parameter. The comparison yields 0h for
792/// false, FFFFFFFFFFFFFFFFh for true. A pair of double-precision values are
793/// "ordered" with respect to each other if neither value is a NaN.
806/// corresponding value in the second parameter.
807///
808/// The comparison yields 0h for false, FFFFFFFFFFFFFFFFh for true. A pair of
809/// double-precision values are "ordered" with respect to each other if
810/// neither value is a NaN.
794811///
795812/// \headerfile <x86intrin.h>
796813///
......@@ -813,9 +830,11 @@ _mm_cmpord_sd(__m128d __a, __m128d __b)
813830/// \brief Compares the lower double-precision floating-point values in each of
814831/// the two 128-bit floating-point vectors of [2 x double] to determine if
815832/// the value in the first parameter is "unordered" with respect to the
816/// corresponding value in the second parameter. The comparison yields 0h
817/// for false, FFFFFFFFFFFFFFFFh for true. A pair of double-precision values
818/// are "unordered" with respect to each other if one or both values are NaN.
833/// corresponding value in the second parameter.
834///
835/// The comparison yields 0h for false, FFFFFFFFFFFFFFFFh for true. A pair of
836/// double-precision values are "unordered" with respect to each other if one
837/// or both values are NaN.
819838///
820839/// \headerfile <x86intrin.h>
821840///
......@@ -839,8 +858,9 @@ _mm_cmpunord_sd(__m128d __a, __m128d __b)
839858/// \brief Compares the lower double-precision floating-point values in each of
840859/// the two 128-bit floating-point vectors of [2 x double] to determine if
841860/// the value in the first parameter is unequal to the corresponding value in
842/// the second parameter. The comparison yields 0h for false,
843/// FFFFFFFFFFFFFFFFh for true.
861/// the second parameter.
862///
863/// The comparison yields 0h for false, FFFFFFFFFFFFFFFFh for true.
844864///
845865/// \headerfile <x86intrin.h>
846866///
......@@ -863,8 +883,9 @@ _mm_cmpneq_sd(__m128d __a, __m128d __b)
863883/// \brief Compares the lower double-precision floating-point values in each of
864884/// the two 128-bit floating-point vectors of [2 x double] to determine if
865885/// the value in the first parameter is not less than the corresponding
866/// value in the second parameter. The comparison yields 0h for false,
867/// FFFFFFFFFFFFFFFFh for true.
886/// value in the second parameter.
887///
888/// The comparison yields 0h for false, FFFFFFFFFFFFFFFFh for true.
868889///
869890/// \headerfile <x86intrin.h>
870891///
......@@ -887,8 +908,9 @@ _mm_cmpnlt_sd(__m128d __a, __m128d __b)
887908/// \brief Compares the lower double-precision floating-point values in each of
888909/// the two 128-bit floating-point vectors of [2 x double] to determine if
889910/// the value in the first parameter is not less than or equal to the
890/// corresponding value in the second parameter. The comparison yields 0h
891/// for false, FFFFFFFFFFFFFFFFh for true.
911/// corresponding value in the second parameter.
912///
913/// The comparison yields 0h for false, FFFFFFFFFFFFFFFFh for true.
892914///
893915/// \headerfile <x86intrin.h>
894916///
......@@ -911,8 +933,9 @@ _mm_cmpnle_sd(__m128d __a, __m128d __b)
911933/// \brief Compares the lower double-precision floating-point values in each of
912934/// the two 128-bit floating-point vectors of [2 x double] to determine if
913935/// the value in the first parameter is not greater than the corresponding
914/// value in the second parameter. The comparison yields 0h for false,
915/// FFFFFFFFFFFFFFFFh for true.
936/// value in the second parameter.
937///
938/// The comparison yields 0h for false, FFFFFFFFFFFFFFFFh for true.
916939///
917940/// \headerfile <x86intrin.h>
918941///
......@@ -936,8 +959,9 @@ _mm_cmpngt_sd(__m128d __a, __m128d __b)
936959/// \brief Compares the lower double-precision floating-point values in each of
937960/// the two 128-bit floating-point vectors of [2 x double] to determine if
938961/// the value in the first parameter is not greater than or equal to the
939/// corresponding value in the second parameter. The comparison yields 0h
940/// for false, FFFFFFFFFFFFFFFFh for true.
962/// corresponding value in the second parameter.
963///
964/// The comparison yields 0h for false, FFFFFFFFFFFFFFFFh for true.
941965///
942966/// \headerfile <x86intrin.h>
943967///
......@@ -982,7 +1006,9 @@ _mm_comieq_sd(__m128d __a, __m128d __b)
9821006/// \brief Compares the lower double-precision floating-point values in each of
9831007/// the two 128-bit floating-point vectors of [2 x double] to determine if
9841008/// the value in the first parameter is less than the corresponding value in
985/// the second parameter. The comparison yields 0 for false, 1 for true.
1009/// the second parameter.
1010///
1011/// The comparison yields 0 for false, 1 for true.
9861012///
9871013/// \headerfile <x86intrin.h>
9881014///
......@@ -1004,8 +1030,9 @@ _mm_comilt_sd(__m128d __a, __m128d __b)
10041030/// \brief Compares the lower double-precision floating-point values in each of
10051031/// the two 128-bit floating-point vectors of [2 x double] to determine if
10061032/// the value in the first parameter is less than or equal to the
1007/// corresponding value in the second parameter. The comparison yields 0 for
1008/// false, 1 for true.
1033/// corresponding value in the second parameter.
1034///
1035/// The comparison yields 0 for false, 1 for true.
10091036///
10101037/// \headerfile <x86intrin.h>
10111038///
......@@ -1027,7 +1054,9 @@ _mm_comile_sd(__m128d __a, __m128d __b)
10271054/// \brief Compares the lower double-precision floating-point values in each of
10281055/// the two 128-bit floating-point vectors of [2 x double] to determine if
10291056/// the value in the first parameter is greater than the corresponding value
1030/// in the second parameter. The comparison yields 0 for false, 1 for true.
1057/// in the second parameter.
1058///
1059/// The comparison yields 0 for false, 1 for true.
10311060///
10321061/// \headerfile <x86intrin.h>
10331062///
......@@ -1049,8 +1078,9 @@ _mm_comigt_sd(__m128d __a, __m128d __b)
10491078/// \brief Compares the lower double-precision floating-point values in each of
10501079/// the two 128-bit floating-point vectors of [2 x double] to determine if
10511080/// the value in the first parameter is greater than or equal to the
1052/// corresponding value in the second parameter. The comparison yields 0 for
1053/// false, 1 for true.
1081/// corresponding value in the second parameter.
1082///
1083/// The comparison yields 0 for false, 1 for true.
10541084///
10551085/// \headerfile <x86intrin.h>
10561086///
......@@ -1072,7 +1102,9 @@ _mm_comige_sd(__m128d __a, __m128d __b)
10721102/// \brief Compares the lower double-precision floating-point values in each of
10731103/// the two 128-bit floating-point vectors of [2 x double] to determine if
10741104/// the value in the first parameter is unequal to the corresponding value in
1075/// the second parameter. The comparison yields 0 for false, 1 for true.
1105/// the second parameter.
1106///
1107/// The comparison yields 0 for false, 1 for true.
10761108///
10771109/// \headerfile <x86intrin.h>
10781110///
......@@ -1093,8 +1125,9 @@ _mm_comineq_sd(__m128d __a, __m128d __b)
10931125
10941126/// \brief Compares the lower double-precision floating-point values in each of
10951127/// the two 128-bit floating-point vectors of [2 x double] for equality. The
1096/// comparison yields 0 for false, 1 for true. If either of the two lower
1097/// double-precision values is NaN, 1 is returned.
1128/// comparison yields 0 for false, 1 for true.
1129///
1130/// If either of the two lower double-precision values is NaN, 1 is returned.
10981131///
10991132/// \headerfile <x86intrin.h>
11001133///
......@@ -1117,8 +1150,10 @@ _mm_ucomieq_sd(__m128d __a, __m128d __b)
11171150/// \brief Compares the lower double-precision floating-point values in each of
11181151/// the two 128-bit floating-point vectors of [2 x double] to determine if
11191152/// the value in the first parameter is less than the corresponding value in
1120/// the second parameter. The comparison yields 0 for false, 1 for true. If
1121/// either of the two lower double-precision values is NaN, 1 is returned.
1153/// the second parameter.
1154///
1155/// The comparison yields 0 for false, 1 for true. If either of the two lower
1156/// double-precision values is NaN, 1 is returned.
11221157///
11231158/// \headerfile <x86intrin.h>
11241159///
......@@ -1141,9 +1176,10 @@ _mm_ucomilt_sd(__m128d __a, __m128d __b)
11411176/// \brief Compares the lower double-precision floating-point values in each of
11421177/// the two 128-bit floating-point vectors of [2 x double] to determine if
11431178/// the value in the first parameter is less than or equal to the
1144/// corresponding value in the second parameter. The comparison yields 0 for
1145/// false, 1 for true. If either of the two lower double-precision values is
1146/// NaN, 1 is returned.
1179/// corresponding value in the second parameter.
1180///
1181/// The comparison yields 0 for false, 1 for true. If either of the two lower
1182/// double-precision values is NaN, 1 is returned.
11471183///
11481184/// \headerfile <x86intrin.h>
11491185///
......@@ -1166,8 +1202,10 @@ _mm_ucomile_sd(__m128d __a, __m128d __b)
11661202/// \brief Compares the lower double-precision floating-point values in each of
11671203/// the two 128-bit floating-point vectors of [2 x double] to determine if
11681204/// the value in the first parameter is greater than the corresponding value
1169/// in the second parameter. The comparison yields 0 for false, 1 for true.
1170/// If either of the two lower double-precision values is NaN, 0 is returned.
1205/// in the second parameter.
1206///
1207/// The comparison yields 0 for false, 1 for true. If either of the two lower
1208/// double-precision values is NaN, 0 is returned.
11711209///
11721210/// \headerfile <x86intrin.h>
11731211///
......@@ -1190,9 +1228,10 @@ _mm_ucomigt_sd(__m128d __a, __m128d __b)
11901228/// \brief Compares the lower double-precision floating-point values in each of
11911229/// the two 128-bit floating-point vectors of [2 x double] to determine if
11921230/// the value in the first parameter is greater than or equal to the
1193/// corresponding value in the second parameter. The comparison yields 0 for
1194/// false, 1 for true. If either of the two lower double-precision values
1195/// is NaN, 0 is returned.
1231/// corresponding value in the second parameter.
1232///
1233/// The comparison yields 0 for false, 1 for true. If either of the two
1234/// lower double-precision values is NaN, 0 is returned.
11961235///
11971236/// \headerfile <x86intrin.h>
11981237///
......@@ -1215,8 +1254,10 @@ _mm_ucomige_sd(__m128d __a, __m128d __b)
12151254/// \brief Compares the lower double-precision floating-point values in each of
12161255/// the two 128-bit floating-point vectors of [2 x double] to determine if
12171256/// the value in the first parameter is unequal to the corresponding value in
1218/// the second parameter. The comparison yields 0 for false, 1 for true. If
1219/// either of the two lower double-precision values is NaN, 0 is returned.
1257/// the second parameter.
1258///
1259/// The comparison yields 0 for false, 1 for true. If either of the two lower
1260/// double-precision values is NaN, 0 is returned.
12201261///
12211262/// \headerfile <x86intrin.h>
12221263///
......@@ -1278,8 +1319,9 @@ _mm_cvtps_pd(__m128 __a)
12781319
12791320/// \brief Converts the lower two integer elements of a 128-bit vector of
12801321/// [4 x i32] into two double-precision floating-point values, returned in a
1281/// 128-bit vector of [2 x double]. The upper two elements of the input
1282/// vector are unused.
1322/// 128-bit vector of [2 x double].
1323///
1324/// The upper two elements of the input vector are unused.
12831325///
12841326/// \headerfile <x86intrin.h>
12851327///
......@@ -1287,7 +1329,9 @@ _mm_cvtps_pd(__m128 __a)
12871329///
12881330/// \param __a
12891331/// A 128-bit integer vector of [4 x i32]. The lower two integer elements are
1290/// converted to double-precision values. The upper two elements are unused.
1332/// converted to double-precision values.
1333///
1334/// The upper two elements are unused.
12911335/// \returns A 128-bit vector of [2 x double] containing the converted values.
12921336static __inline__ __m128d __DEFAULT_FN_ATTRS
12931337_mm_cvtepi32_pd(__m128i __a)
......@@ -1409,10 +1453,11 @@ _mm_cvtss_sd(__m128d __a, __m128 __b)
14091453
14101454/// \brief Converts the two double-precision floating-point elements of a
14111455/// 128-bit vector of [2 x double] into two signed 32-bit integer values,
1412/// returned in the lower 64 bits of a 128-bit vector of [4 x i32]. If the
1413/// result of either conversion is inexact, the result is truncated (rounded
1414/// towards zero) regardless of the current MXCSR setting. The upper 64 bits
1415/// of the result vector are set to zero.
1456/// returned in the lower 64 bits of a 128-bit vector of [4 x i32].
1457///
1458/// If the result of either conversion is inexact, the result is truncated
1459/// (rounded towards zero) regardless of the current MXCSR setting. The upper
1460/// 64 bits of the result vector are set to zero.
14161461///
14171462/// \headerfile <x86intrin.h>
14181463///
......@@ -1466,9 +1511,10 @@ _mm_cvtpd_pi32(__m128d __a)
14661511
14671512/// \brief Converts the two double-precision floating-point elements of a
14681513/// 128-bit vector of [2 x double] into two signed 32-bit integer values,
1469/// returned in a 64-bit vector of [2 x i32]. If the result of either
1470/// conversion is inexact, the result is truncated (rounded towards zero)
1471/// regardless of the current MXCSR setting.
1514/// returned in a 64-bit vector of [2 x i32].
1515///
1516/// If the result of either conversion is inexact, the result is truncated
1517/// (rounded towards zero) regardless of the current MXCSR setting.
14721518///
14731519/// \headerfile <x86intrin.h>
14741520///
......@@ -1599,6 +1645,17 @@ _mm_loadu_pd(double const *__dp)
15991645 return ((struct __loadu_pd*)__dp)->__v;
16001646}
16011647
1648/// \brief Loads a 64-bit integer value to the low element of a 128-bit integer
1649/// vector and clears the upper element.
1650///
1651/// \headerfile <x86intrin.h>
1652///
1653/// This intrinsic corresponds to the <c> VMOVQ / MOVQ </c> instruction.
1654///
1655/// \param __a
1656/// A pointer to a 64-bit memory location. The address of the memory
1657/// location does not have to be aligned.
1658/// \returns A 128-bit vector of [2 x i64] containing the loaded value.
16021659static __inline__ __m128i __DEFAULT_FN_ATTRS
16031660_mm_loadu_si64(void const *__a)
16041661{
......@@ -1609,6 +1666,17 @@ _mm_loadu_si64(void const *__a)
16091666 return (__m128i){__u, 0L};
16101667}
16111668
1669/// \brief Loads a 64-bit double-precision value to the low element of a
1670/// 128-bit integer vector and clears the upper element.
1671///
1672/// \headerfile <x86intrin.h>
1673///
1674/// This intrinsic corresponds to the <c> VMOVSD / MOVSD </c> instruction.
1675///
1676/// \param __dp
1677/// A pointer to a memory location containing a double-precision value.
1678/// The address of the memory location does not have to be aligned.
1679/// \returns A 128-bit vector of [2 x double] containing the loaded value.
16121680static __inline__ __m128d __DEFAULT_FN_ATTRS
16131681_mm_load_sd(double const *__dp)
16141682{
......@@ -1728,6 +1796,24 @@ _mm_set1_pd(double __w)
17281796 return (__m128d){ __w, __w };
17291797}
17301798
1799/// \brief Constructs a 128-bit floating-point vector of [2 x double], with each
1800/// of the two double-precision floating-point vector elements set to the
1801/// specified double-precision floating-point value.
1802///
1803/// \headerfile <x86intrin.h>
1804///
1805/// This intrinsic corresponds to the <c> VMOVDDUP / MOVLHPS </c> instruction.
1806///
1807/// \param __w
1808/// A double-precision floating-point value used to initialize each vector
1809/// element of the result.
1810/// \returns An initialized 128-bit floating-point vector of [2 x double].
1811static __inline__ __m128d __DEFAULT_FN_ATTRS
1812_mm_set_pd1(double __w)
1813{
1814 return _mm_set1_pd(__w);
1815}
1816
17311817/// \brief Constructs a 128-bit floating-point vector of [2 x double]
17321818/// initialized with the specified double-precision floating-point values.
17331819///
......@@ -1787,7 +1873,7 @@ _mm_setzero_pd(void)
17871873/// \brief Constructs a 128-bit floating-point vector of [2 x double]. The lower
17881874/// 64 bits are set to the lower 64 bits of the second parameter. The upper
17891875/// 64 bits are set to the upper 64 bits of the first parameter.
1790//
1876///
17911877/// \headerfile <x86intrin.h>
17921878///
17931879/// This intrinsic corresponds to the <c> VBLENDPD / BLENDPD </c> instruction.
......@@ -1825,12 +1911,38 @@ _mm_store_sd(double *__dp, __m128d __a)
18251911 ((struct __mm_store_sd_struct*)__dp)->__u = __a[0];
18261912}
18271913
1914/// \brief Moves packed double-precision values from a 128-bit vector of
1915/// [2 x double] to a memory location.
1916///
1917/// \headerfile <x86intrin.h>
1918///
1919/// This intrinsic corresponds to the <c>VMOVAPD / MOVAPS</c> instruction.
1920///
1921/// \param __dp
1922/// A pointer to an aligned memory location that can store two
1923/// double-precision values.
1924/// \param __a
1925/// A packed 128-bit vector of [2 x double] containing the values to be
1926/// moved.
18281927static __inline__ void __DEFAULT_FN_ATTRS
18291928_mm_store_pd(double *__dp, __m128d __a)
18301929{
18311930 *(__m128d*)__dp = __a;
18321931}
18331932
1933/// \brief Moves the lower 64 bits of a 128-bit vector of [2 x double] twice to
1934/// the upper and lower 64 bits of a memory location.
1935///
1936/// \headerfile <x86intrin.h>
1937///
1938/// This intrinsic corresponds to the <c>VMOVDDUP + VMOVAPD / MOVLHPS + MOVAPS </c> instruction.
1939///
1940/// \param __dp
1941/// A pointer to a memory location that can store two double-precision
1942/// values.
1943/// \param __a
1944/// A 128-bit vector of [2 x double] whose lower 64 bits are copied to each
1945/// of the values in \a dp.
18341946static __inline__ void __DEFAULT_FN_ATTRS
18351947_mm_store1_pd(double *__dp, __m128d __a)
18361948{
......@@ -1940,8 +2052,9 @@ _mm_storel_pd(double *__dp, __m128d __a)
19402052
19412053/// \brief Adds the corresponding elements of two 128-bit vectors of [16 x i8],
19422054/// saving the lower 8 bits of each sum in the corresponding element of a
1943/// 128-bit result vector of [16 x i8]. The integer elements of both
1944/// parameters can be either signed or unsigned.
2055/// 128-bit result vector of [16 x i8].
2056///
2057/// The integer elements of both parameters can be either signed or unsigned.
19452058///
19462059/// \headerfile <x86intrin.h>
19472060///
......@@ -1961,8 +2074,9 @@ _mm_add_epi8(__m128i __a, __m128i __b)
19612074
19622075/// \brief Adds the corresponding elements of two 128-bit vectors of [8 x i16],
19632076/// saving the lower 16 bits of each sum in the corresponding element of a
1964/// 128-bit result vector of [8 x i16]. The integer elements of both
1965/// parameters can be either signed or unsigned.
2077/// 128-bit result vector of [8 x i16].
2078///
2079/// The integer elements of both parameters can be either signed or unsigned.
19662080///
19672081/// \headerfile <x86intrin.h>
19682082///
......@@ -1982,8 +2096,9 @@ _mm_add_epi16(__m128i __a, __m128i __b)
19822096
19832097/// \brief Adds the corresponding elements of two 128-bit vectors of [4 x i32],
19842098/// saving the lower 32 bits of each sum in the corresponding element of a
1985/// 128-bit result vector of [4 x i32]. The integer elements of both
1986/// parameters can be either signed or unsigned.
2099/// 128-bit result vector of [4 x i32].
2100///
2101/// The integer elements of both parameters can be either signed or unsigned.
19872102///
19882103/// \headerfile <x86intrin.h>
19892104///
......@@ -2021,8 +2136,9 @@ _mm_add_si64(__m64 __a, __m64 __b)
20212136
20222137/// \brief Adds the corresponding elements of two 128-bit vectors of [2 x i64],
20232138/// saving the lower 64 bits of each sum in the corresponding element of a
2024/// 128-bit result vector of [2 x i64]. The integer elements of both
2025/// parameters can be either signed or unsigned.
2139/// 128-bit result vector of [2 x i64].
2140///
2141/// The integer elements of both parameters can be either signed or unsigned.
20262142///
20272143/// \headerfile <x86intrin.h>
20282144///
......@@ -2168,10 +2284,12 @@ _mm_avg_epu16(__m128i __a, __m128i __b)
21682284/// \brief Multiplies the corresponding elements of two 128-bit signed [8 x i16]
21692285/// vectors, producing eight intermediate 32-bit signed integer products, and
21702286/// adds the consecutive pairs of 32-bit products to form a 128-bit signed
2171/// [4 x i32] vector. For example, bits [15:0] of both parameters are
2172/// multiplied producing a 32-bit product, bits [31:16] of both parameters
2173/// are multiplied producing a 32-bit product, and the sum of those two
2174/// products becomes bits [31:0] of the result.
2287/// [4 x i32] vector.
2288///
2289/// For example, bits [15:0] of both parameters are multiplied producing a
2290/// 32-bit product, bits [31:16] of both parameters are multiplied producing
2291/// a 32-bit product, and the sum of those two products becomes bits [31:0]
2292/// of the result.
21752293///
21762294/// \headerfile <x86intrin.h>
21772295///
......@@ -2369,7 +2487,7 @@ _mm_mul_epu32(__m128i __a, __m128i __b)
23692487
23702488/// \brief Computes the absolute differences of corresponding 8-bit integer
23712489/// values in two 128-bit vectors. Sums the first 8 absolute differences, and
2372/// separately sums the second 8 absolute differences. Packss these two
2490/// separately sums the second 8 absolute differences. Packs these two
23732491/// unsigned 16-bit integer sums into the upper and lower elements of a
23742492/// [2 x i64] vector.
23752493///
......@@ -3106,8 +3224,9 @@ _mm_cmpgt_epi8(__m128i __a, __m128i __b)
31063224
31073225/// \brief Compares each of the corresponding signed 16-bit values of the
31083226/// 128-bit integer vectors to determine if the values in the first operand
3109/// are greater than those in the second operand. Each comparison yields 0h
3110/// for false, FFFFh for true.
3227/// are greater than those in the second operand.
3228///
3229/// Each comparison yields 0h for false, FFFFh for true.
31113230///
31123231/// \headerfile <x86intrin.h>
31133232///
......@@ -3126,8 +3245,9 @@ _mm_cmpgt_epi16(__m128i __a, __m128i __b)
31263245
31273246/// \brief Compares each of the corresponding signed 32-bit values of the
31283247/// 128-bit integer vectors to determine if the values in the first operand
3129/// are greater than those in the second operand. Each comparison yields 0h
3130/// for false, FFFFFFFFh for true.
3248/// are greater than those in the second operand.
3249///
3250/// Each comparison yields 0h for false, FFFFFFFFh for true.
31313251///
31323252/// \headerfile <x86intrin.h>
31333253///
......@@ -3146,8 +3266,9 @@ _mm_cmpgt_epi32(__m128i __a, __m128i __b)
31463266
31473267/// \brief Compares each of the corresponding signed 8-bit values of the 128-bit
31483268/// integer vectors to determine if the values in the first operand are less
3149/// than those in the second operand. Each comparison yields 0h for false,
3150/// FFh for true.
3269/// than those in the second operand.
3270///
3271/// Each comparison yields 0h for false, FFh for true.
31513272///
31523273/// \headerfile <x86intrin.h>
31533274///
......@@ -3166,8 +3287,9 @@ _mm_cmplt_epi8(__m128i __a, __m128i __b)
31663287
31673288/// \brief Compares each of the corresponding signed 16-bit values of the
31683289/// 128-bit integer vectors to determine if the values in the first operand
3169/// are less than those in the second operand. Each comparison yields 0h for
3170/// false, FFFFh for true.
3290/// are less than those in the second operand.
3291///
3292/// Each comparison yields 0h for false, FFFFh for true.
31713293///
31723294/// \headerfile <x86intrin.h>
31733295///
......@@ -3186,8 +3308,9 @@ _mm_cmplt_epi16(__m128i __a, __m128i __b)
31863308
31873309/// \brief Compares each of the corresponding signed 32-bit values of the
31883310/// 128-bit integer vectors to determine if the values in the first operand
3189/// are less than those in the second operand. Each comparison yields 0h for
3190/// false, FFFFFFFFh for true.
3311/// are less than those in the second operand.
3312///
3313/// Each comparison yields 0h for false, FFFFFFFFh for true.
31913314///
31923315/// \headerfile <x86intrin.h>
31933316///
......@@ -3885,10 +4008,11 @@ _mm_storeu_si128(__m128i *__p, __m128i __b)
38854008
38864009/// \brief Moves bytes selected by the mask from the first operand to the
38874010/// specified unaligned memory location. When a mask bit is 1, the
3888/// corresponding byte is written, otherwise it is not written. To minimize
3889/// caching, the date is flagged as non-temporal (unlikely to be used again
3890/// soon). Exception and trap behavior for elements not selected for storage
3891/// to memory are implementation dependent.
4011/// corresponding byte is written, otherwise it is not written.
4012///
4013/// To minimize caching, the date is flagged as non-temporal (unlikely to be
4014/// used again soon). Exception and trap behavior for elements not selected
4015/// for storage to memory are implementation dependent.
38924016///
38934017/// \headerfile <x86intrin.h>
38944018///
......@@ -3932,8 +4056,10 @@ _mm_storel_epi64(__m128i *__p, __m128i __a)
39324056}
39334057
39344058/// \brief Stores a 128-bit floating point vector of [2 x double] to a 128-bit
3935/// aligned memory location. To minimize caching, the data is flagged as
3936/// non-temporal (unlikely to be used again soon).
4059/// aligned memory location.
4060///
4061/// To minimize caching, the data is flagged as non-temporal (unlikely to be
4062/// used again soon).
39374063///
39384064/// \headerfile <x86intrin.h>
39394065///
......@@ -3950,6 +4076,7 @@ _mm_stream_pd(double *__p, __m128d __a)
39504076}
39514077
39524078/// \brief Stores a 128-bit integer vector to a 128-bit aligned memory location.
4079///
39534080/// To minimize caching, the data is flagged as non-temporal (unlikely to be
39544081/// used again soon).
39554082///
......@@ -3967,8 +4094,9 @@ _mm_stream_si128(__m128i *__p, __m128i __a)
39674094 __builtin_nontemporal_store((__v2di)__a, (__v2di*)__p);
39684095}
39694096
3970/// \brief Stores a 32-bit integer value in the specified memory location. To
3971/// minimize caching, the data is flagged as non-temporal (unlikely to be
4097/// \brief Stores a 32-bit integer value in the specified memory location.
4098///
4099/// To minimize caching, the data is flagged as non-temporal (unlikely to be
39724100/// used again soon).
39734101///
39744102/// \headerfile <x86intrin.h>
......@@ -3986,8 +4114,9 @@ _mm_stream_si32(int *__p, int __a)
39864114}
39874115
39884116#ifdef __x86_64__
3989/// \brief Stores a 64-bit integer value in the specified memory location. To
3990/// minimize caching, the data is flagged as non-temporal (unlikely to be
4117/// \brief Stores a 64-bit integer value in the specified memory location.
4118///
4119/// To minimize caching, the data is flagged as non-temporal (unlikely to be
39914120/// used again soon).
39924121///
39934122/// \headerfile <x86intrin.h>
......@@ -4019,7 +4148,7 @@ extern "C" {
40194148/// \param __p
40204149/// A pointer to the memory location used to identify the cache line to be
40214150/// flushed.
4022void _mm_clflush(void const *);
4151void _mm_clflush(void const * __p);
40234152
40244153/// \brief Forces strong memory ordering (serialization) between load
40254154/// instructions preceding this instruction and load instructions following
......@@ -4141,7 +4270,7 @@ _mm_packus_epi16(__m128i __a, __m128i __b)
41414270/// \param __a
41424271/// A 128-bit integer vector.
41434272/// \param __imm
4144/// An immediate value. Bits [3:0] selects values from \a __a to be assigned
4273/// An immediate value. Bits [2:0] selects values from \a __a to be assigned
41454274/// to bits[15:0] of the result. \n
41464275/// 000: assign values from bits [15:0] of \a __a. \n
41474276/// 001: assign values from bits [31:16] of \a __a. \n
......@@ -4788,4 +4917,12 @@ void _mm_pause(void);
47884917
47894918#define _MM_SHUFFLE2(x, y) (((x) << 1) | (y))
47904919
4920#define _MM_DENORMALS_ZERO_ON (0x0040)
4921#define _MM_DENORMALS_ZERO_OFF (0x0000)
4922
4923#define _MM_DENORMALS_ZERO_MASK (0x0040)
4924
4925#define _MM_GET_DENORMALS_ZERO_MODE() (_mm_getcsr() & _MM_DENORMALS_ZERO_MASK)
4926#define _MM_SET_DENORMALS_ZERO_MODE(x) (_mm_setcsr((_mm_getcsr() & ~_MM_DENORMALS_ZERO_MASK) | (x)))
4927
47914928#endif /* __EMMINTRIN_H */
c_headers/f16cintrin.h+5-5
......@@ -72,9 +72,9 @@ _cvtsh_ss(unsigned short __a)
7272/// 011: Truncate \n
7373/// 1XX: Use MXCSR.RC for rounding
7474/// \returns The converted 16-bit half-precision float value.
75#define _cvtss_sh(a, imm) \
76 ((unsigned short)(((__v8hi)__builtin_ia32_vcvtps2ph((__v4sf){a, 0, 0, 0}, \
77 (imm)))[0]))
75#define _cvtss_sh(a, imm) __extension__ ({ \
76 (unsigned short)(((__v8hi)__builtin_ia32_vcvtps2ph((__v4sf){a, 0, 0, 0}, \
77 (imm)))[0]); })
7878
7979/// \brief Converts a 128-bit vector containing 32-bit float values into a
8080/// 128-bit vector containing 16-bit half-precision float values.
......@@ -99,8 +99,8 @@ _cvtsh_ss(unsigned short __a)
9999/// \returns A 128-bit vector containing converted 16-bit half-precision float
100100/// values. The lower 64 bits are used to store the converted 16-bit
101101/// half-precision floating-point values.
102#define _mm_cvtps_ph(a, imm) \
103 ((__m128i)__builtin_ia32_vcvtps2ph((__v4sf)(__m128)(a), (imm)))
102#define _mm_cvtps_ph(a, imm) __extension__ ({ \
103 (__m128i)__builtin_ia32_vcvtps2ph((__v4sf)(__m128)(a), (imm)); })
104104
105105/// \brief Converts a 128-bit vector containing 16-bit half-precision float
106106/// values into a 128-bit vector containing 32-bit float values.
c_headers/float.h+9
......@@ -33,6 +33,15 @@
3333 */
3434#if (defined(__APPLE__) || (defined(__MINGW32__) || defined(_MSC_VER))) && \
3535 __STDC_HOSTED__ && __has_include_next(<float.h>)
36
37/* Prior to Apple's 10.7 SDK, float.h SDK header used to apply an extra level
38 * of #include_next<float.h> to keep Metrowerks compilers happy. Avoid this
39 * extra indirection.
40 */
41#ifdef __APPLE__
42#define _FLOAT_H_
43#endif
44
3645# include_next <float.h>
3746
3847/* Undefine anything that we'll be redefining below. */
c_headers/htmxlintrin.h+5-9
......@@ -35,14 +35,10 @@
3535extern "C" {
3636#endif
3737
38#define _TEXASR_PTR(TM_BUF) \
39 ((texasr_t *)((TM_BUF)+0))
40#define _TEXASRU_PTR(TM_BUF) \
41 ((texasru_t *)((TM_BUF)+0))
42#define _TEXASRL_PTR(TM_BUF) \
43 ((texasrl_t *)((TM_BUF)+4))
44#define _TFIAR_PTR(TM_BUF) \
45 ((tfiar_t *)((TM_BUF)+8))
38#define _TEXASR_PTR(TM_BUF) ((texasr_t *)((char *)(TM_BUF) + 0))
39#define _TEXASRU_PTR(TM_BUF) ((texasru_t *)((char *)(TM_BUF) + 0))
40#define _TEXASRL_PTR(TM_BUF) ((texasrl_t *)((char *)(TM_BUF) + 4))
41#define _TFIAR_PTR(TM_BUF) ((tfiar_t *)((char *)(TM_BUF) + 8))
4642
4743typedef char TM_buff_type[16];
4844
......@@ -178,7 +174,7 @@ extern __inline long
178174__attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
179175__TM_is_conflict(void* const __TM_buff)
180176{
181 texasru_t texasru = *_TEXASRU_PTR (TM_buff);
177 texasru_t texasru = *_TEXASRU_PTR (__TM_buff);
182178 /* Return TEXASR bits 11 (Self-Induced Conflict) through
183179 14 (Translation Invalidation Conflict). */
184180 return (_TEXASRU_EXTRACT_BITS (texasru, 14, 4)) ? 1 : 0;
c_headers/immintrin.h+13-9
......@@ -146,6 +146,10 @@ _mm256_cvtph_ps(__m128i __a)
146146#include <avx512cdintrin.h>
147147#endif
148148
149#if !defined(_MSC_VER) || __has_feature(modules) || defined(__AVX512VPOPCNTDQ__)
150#include <avx512vpopcntdqintrin.h>
151#endif
152
149153#if !defined(_MSC_VER) || __has_feature(modules) || defined(__AVX512DQ__)
150154#include <avx512dqintrin.h>
151155#endif
......@@ -208,6 +212,15 @@ _rdrand32_step(unsigned int *__p)
208212 return __builtin_ia32_rdrand32_step(__p);
209213}
210214
215#ifdef __x86_64__
216static __inline__ int __attribute__((__always_inline__, __nodebug__, __target__("rdrnd")))
217_rdrand64_step(unsigned long long *__p)
218{
219 return __builtin_ia32_rdrand64_step(__p);
220}
221#endif
222#endif /* __RDRND__ */
223
211224/* __bit_scan_forward */
212225static __inline__ int __attribute__((__always_inline__, __nodebug__))
213226_bit_scan_forward(int __A) {
......@@ -220,15 +233,6 @@ _bit_scan_reverse(int __A) {
220233 return 31 - __builtin_clz(__A);
221234}
222235
223#ifdef __x86_64__
224static __inline__ int __attribute__((__always_inline__, __nodebug__, __target__("rdrnd")))
225_rdrand64_step(unsigned long long *__p)
226{
227 return __builtin_ia32_rdrand64_step(__p);
228}
229#endif
230#endif /* __RDRND__ */
231
232236#if !defined(_MSC_VER) || __has_feature(modules) || defined(__FSGSBASE__)
233237#ifdef __x86_64__
234238static __inline__ unsigned int __attribute__((__always_inline__, __nodebug__, __target__("fsgsbase")))
c_headers/intrin.h-56
......@@ -69,7 +69,6 @@ static __inline__
6969__int64 __emul(int, int);
7070static __inline__
7171unsigned __int64 __emulu(unsigned int, unsigned int);
72void __cdecl __fastfail(unsigned int);
7372unsigned int __getcallerseflags(void);
7473static __inline__
7574void __halt(void);
......@@ -80,16 +79,12 @@ void __incfsdword(unsigned long);
8079void __incfsword(unsigned long);
8180unsigned long __indword(unsigned short);
8281void __indwordstring(unsigned short, unsigned long *, unsigned long);
83void __int2c(void);
8482void __invlpg(void *);
8583unsigned short __inword(unsigned short);
8684void __inwordstring(unsigned short, unsigned short *, unsigned long);
8785void __lidt(void *);
8886unsigned __int64 __ll_lshift(unsigned __int64, int);
8987__int64 __ll_rshift(__int64, int);
90void __llwpcb(void *);
91unsigned char __lwpins32(unsigned int, unsigned int, unsigned int);
92void __lwpval32(unsigned int, unsigned int, unsigned int);
9388unsigned int __lzcnt(unsigned int);
9489unsigned short __lzcnt16(unsigned short);
9590static __inline__
......@@ -128,7 +123,6 @@ unsigned __int64 __readmsr(unsigned long);
128123unsigned __int64 __readpmc(unsigned long);
129124unsigned long __segmentlimit(unsigned long);
130125void __sidt(void *);
131void *__slwpcb(void);
132126static __inline__
133127void __stosb(unsigned char *, unsigned char, size_t);
134128static __inline__
......@@ -142,7 +136,6 @@ void __svm_stgi(void);
142136void __svm_vmload(size_t);
143137void __svm_vmrun(size_t);
144138void __svm_vmsave(size_t);
145void __ud2(void);
146139unsigned __int64 __ull_rshift(unsigned __int64, int);
147140void __vmx_off(void);
148141void __vmx_vmptrst(unsigned __int64 *);
......@@ -176,7 +169,6 @@ void __cdecl _disable(void);
176169void __cdecl _enable(void);
177170long _InterlockedAddLargeStatistic(__int64 volatile *_Addend, long _Value);
178171unsigned char _interlockedbittestandreset(long volatile *, long);
179static __inline__
180172unsigned char _interlockedbittestandset(long volatile *, long);
181173long _InterlockedCompareExchange_HLEAcquire(long volatile *, long, long);
182174long _InterlockedCompareExchange_HLERelease(long volatile *, long, long);
......@@ -231,8 +223,6 @@ void __incgsbyte(unsigned long);
231223void __incgsdword(unsigned long);
232224void __incgsqword(unsigned long);
233225void __incgsword(unsigned long);
234unsigned char __lwpins64(unsigned __int64, unsigned int, unsigned int);
235void __lwpval64(unsigned __int64, unsigned int, unsigned int);
236226unsigned __int64 __lzcnt64(unsigned __int64);
237227static __inline__
238228void __movsq(unsigned long long *, unsigned long long const *, size_t);
......@@ -372,11 +362,6 @@ _bittestandset(long *_BitBase, long _BitPos) {
372362 *_BitBase = *_BitBase | (1 << _BitPos);
373363 return _Res;
374364}
375static __inline__ unsigned char __DEFAULT_FN_ATTRS
376_interlockedbittestandset(long volatile *_BitBase, long _BitPos) {
377 long _PrevVal = __atomic_fetch_or(_BitBase, 1l << _BitPos, __ATOMIC_SEQ_CST);
378 return (_PrevVal >> _BitPos) & 1;
379}
380365#if defined(__arm__) || defined(__aarch64__)
381366static __inline__ unsigned char __DEFAULT_FN_ATTRS
382367_interlockedbittestandset_acq(long volatile *_BitBase, long _BitPos) {
......@@ -872,48 +857,7 @@ _InterlockedCompareExchange64_rel(__int64 volatile *_Destination,
872857 return _Comparand;
873858}
874859#endif
875/*----------------------------------------------------------------------------*\
876|* readfs, readgs
877|* (Pointers in address space #256 and #257 are relative to the GS and FS
878|* segment registers, respectively.)
879\*----------------------------------------------------------------------------*/
880#define __ptr_to_addr_space(__addr_space_nbr, __type, __offset) \
881 ((volatile __type __attribute__((__address_space__(__addr_space_nbr)))*) \
882 (__offset))
883860
884#ifdef __i386__
885static __inline__ unsigned char __DEFAULT_FN_ATTRS
886__readfsbyte(unsigned long __offset) {
887 return *__ptr_to_addr_space(257, unsigned char, __offset);
888}
889static __inline__ unsigned short __DEFAULT_FN_ATTRS
890__readfsword(unsigned long __offset) {
891 return *__ptr_to_addr_space(257, unsigned short, __offset);
892}
893static __inline__ unsigned __int64 __DEFAULT_FN_ATTRS
894__readfsqword(unsigned long __offset) {
895 return *__ptr_to_addr_space(257, unsigned __int64, __offset);
896}
897#endif
898#ifdef __x86_64__
899static __inline__ unsigned char __DEFAULT_FN_ATTRS
900__readgsbyte(unsigned long __offset) {
901 return *__ptr_to_addr_space(256, unsigned char, __offset);
902}
903static __inline__ unsigned short __DEFAULT_FN_ATTRS
904__readgsword(unsigned long __offset) {
905 return *__ptr_to_addr_space(256, unsigned short, __offset);
906}
907static __inline__ unsigned long __DEFAULT_FN_ATTRS
908__readgsdword(unsigned long __offset) {
909 return *__ptr_to_addr_space(256, unsigned long, __offset);
910}
911static __inline__ unsigned __int64 __DEFAULT_FN_ATTRS
912__readgsqword(unsigned long __offset) {
913 return *__ptr_to_addr_space(256, unsigned __int64, __offset);
914}
915#endif
916#undef __ptr_to_addr_space
917861/*----------------------------------------------------------------------------*\
918862|* movs, stos
919863\*----------------------------------------------------------------------------*/
c_headers/lwpintrin.h created+150
......@@ -0,0 +1,150 @@
1/*===---- lwpintrin.h - LWP intrinsics -------------------------------------===
2 *
3 * Permission is hereby granted, free of charge, to any person obtaining a copy
4 * of this software and associated documentation files (the "Software"), to deal
5 * in the Software without restriction, including without limitation the rights
6 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7 * copies of the Software, and to permit persons to whom the Software is
8 * furnished to do so, subject to the following conditions:
9 *
10 * The above copyright notice and this permission notice shall be included in
11 * all copies or substantial portions of the Software.
12 *
13 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19 * THE SOFTWARE.
20 *
21 *===-----------------------------------------------------------------------===
22 */
23
24#ifndef __X86INTRIN_H
25#error "Never use <lwpintrin.h> directly; include <x86intrin.h> instead."
26#endif
27
28#ifndef __LWPINTRIN_H
29#define __LWPINTRIN_H
30
31/* Define the default attributes for the functions in this file. */
32#define __DEFAULT_FN_ATTRS __attribute__((__always_inline__, __nodebug__, __target__("lwp")))
33
34/// \brief Parses the LWPCB at the specified address and enables
35/// profiling if valid.
36///
37/// \headerfile <x86intrin.h>
38///
39/// This intrinsic corresponds to the <c> LLWPCB </c> instruction.
40///
41/// \param __addr
42/// Address to the new Lightweight Profiling Control Block (LWPCB). If the
43/// LWPCB is valid, writes the address into the LWP_CBADDR MSR and enables
44/// Lightweight Profiling.
45static __inline__ void __DEFAULT_FN_ATTRS
46__llwpcb (void *__addr)
47{
48 __builtin_ia32_llwpcb(__addr);
49}
50
51/// \brief Flushes the LWP state to memory and returns the address of the LWPCB.
52///
53/// \headerfile <x86intrin.h>
54///
55/// This intrinsic corresponds to the <c> SLWPCB </c> instruction.
56///
57/// \return
58/// Address to the current Lightweight Profiling Control Block (LWPCB).
59/// If LWP is not currently enabled, returns NULL.
60static __inline__ void* __DEFAULT_FN_ATTRS
61__slwpcb ()
62{
63 return __builtin_ia32_slwpcb();
64}
65
66/// \brief Inserts programmed event record into the LWP event ring buffer
67/// and advances the ring buffer pointer.
68///
69/// \headerfile <x86intrin.h>
70///
71/// This intrinsic corresponds to the <c> LWPINS </c> instruction.
72///
73/// \param DATA2
74/// A 32-bit value is zero-extended and inserted into the 64-bit Data2 field.
75/// \param DATA1
76/// A 32-bit value is inserted into the 32-bit Data1 field.
77/// \param FLAGS
78/// A 32-bit immediate value is inserted into the 32-bit Flags field.
79/// \returns If the ring buffer is full and LWP is running in Synchronized Mode,
80/// the event record overwrites the last record in the buffer, the MissedEvents
81/// counter in the LWPCB is incremented, the head pointer is not advanced, and
82/// 1 is returned. Otherwise 0 is returned.
83#define __lwpins32(DATA2, DATA1, FLAGS) \
84 (__builtin_ia32_lwpins32((unsigned int) (DATA2), (unsigned int) (DATA1), \
85 (unsigned int) (FLAGS)))
86
87/// \brief Decrements the LWP programmed value sample event counter. If the result is
88/// negative, inserts an event record into the LWP event ring buffer in memory
89/// and advances the ring buffer pointer.
90///
91/// \headerfile <x86intrin.h>
92///
93/// This intrinsic corresponds to the <c> LWPVAL </c> instruction.
94///
95/// \param DATA2
96/// A 32-bit value is zero-extended and inserted into the 64-bit Data2 field.
97/// \param DATA1
98/// A 32-bit value is inserted into the 32-bit Data1 field.
99/// \param FLAGS
100/// A 32-bit immediate value is inserted into the 32-bit Flags field.
101#define __lwpval32(DATA2, DATA1, FLAGS) \
102 (__builtin_ia32_lwpval32((unsigned int) (DATA2), (unsigned int) (DATA1), \
103 (unsigned int) (FLAGS)))
104
105#ifdef __x86_64__
106
107/// \brief Inserts programmed event record into the LWP event ring buffer
108/// and advances the ring buffer pointer.
109///
110/// \headerfile <x86intrin.h>
111///
112/// This intrinsic corresponds to the <c> LWPINS </c> instruction.
113///
114/// \param DATA2
115/// A 64-bit value is inserted into the 64-bit Data2 field.
116/// \param DATA1
117/// A 32-bit value is inserted into the 32-bit Data1 field.
118/// \param FLAGS
119/// A 32-bit immediate value is inserted into the 32-bit Flags field.
120/// \returns If the ring buffer is full and LWP is running in Synchronized Mode,
121/// the event record overwrites the last record in the buffer, the MissedEvents
122/// counter in the LWPCB is incremented, the head pointer is not advanced, and
123/// 1 is returned. Otherwise 0 is returned.
124#define __lwpins64(DATA2, DATA1, FLAGS) \
125 (__builtin_ia32_lwpins64((unsigned long long) (DATA2), (unsigned int) (DATA1), \
126 (unsigned int) (FLAGS)))
127
128/// \brief Decrements the LWP programmed value sample event counter. If the result is
129/// negative, inserts an event record into the LWP event ring buffer in memory
130/// and advances the ring buffer pointer.
131///
132/// \headerfile <x86intrin.h>
133///
134/// This intrinsic corresponds to the <c> LWPVAL </c> instruction.
135///
136/// \param DATA2
137/// A 64-bit value is and inserted into the 64-bit Data2 field.
138/// \param DATA1
139/// A 32-bit value is inserted into the 32-bit Data1 field.
140/// \param FLAGS
141/// A 32-bit immediate value is inserted into the 32-bit Flags field.
142#define __lwpval64(DATA2, DATA1, FLAGS) \
143 (__builtin_ia32_lwpval64((unsigned long long) (DATA2), (unsigned int) (DATA1), \
144 (unsigned int) (FLAGS)))
145
146#endif
147
148#undef __DEFAULT_FN_ATTRS
149
150#endif /* __LWPINTRIN_H */
c_headers/mmintrin.h+63-42
......@@ -211,7 +211,7 @@ _mm_packs_pu16(__m64 __m1, __m64 __m2)
211211/// This intrinsic corresponds to the <c> PUNPCKHBW </c> instruction.
212212///
213213/// \param __m1
214/// A 64-bit integer vector of [8 x i8]. \n
214/// A 64-bit integer vector of [8 x i8]. \n
215215/// Bits [39:32] are written to bits [7:0] of the result. \n
216216/// Bits [47:40] are written to bits [23:16] of the result. \n
217217/// Bits [55:48] are written to bits [39:32] of the result. \n
......@@ -608,10 +608,11 @@ _mm_subs_pi16(__m64 __m1, __m64 __m2)
608608
609609/// \brief Subtracts each 8-bit unsigned integer element of the second 64-bit
610610/// integer vector of [8 x i8] from the corresponding 8-bit unsigned integer
611/// element of the first 64-bit integer vector of [8 x i8]. If an element of
612/// the first vector is less than the corresponding element of the second
613/// vector, the result is saturated to 0. The results are packed into a
614/// 64-bit integer vector of [8 x i8].
611/// element of the first 64-bit integer vector of [8 x i8].
612///
613/// If an element of the first vector is less than the corresponding element
614/// of the second vector, the result is saturated to 0. The results are
615/// packed into a 64-bit integer vector of [8 x i8].
615616///
616617/// \headerfile <x86intrin.h>
617618///
......@@ -631,10 +632,11 @@ _mm_subs_pu8(__m64 __m1, __m64 __m2)
631632
632633/// \brief Subtracts each 16-bit unsigned integer element of the second 64-bit
633634/// integer vector of [4 x i16] from the corresponding 16-bit unsigned
634/// integer element of the first 64-bit integer vector of [4 x i16]. If an
635/// element of the first vector is less than the corresponding element of the
636/// second vector, the result is saturated to 0. The results are packed into
637/// a 64-bit integer vector of [4 x i16].
635/// integer element of the first 64-bit integer vector of [4 x i16].
636///
637/// If an element of the first vector is less than the corresponding element
638/// of the second vector, the result is saturated to 0. The results are
639/// packed into a 64-bit integer vector of [4 x i16].
638640///
639641/// \headerfile <x86intrin.h>
640642///
......@@ -657,9 +659,11 @@ _mm_subs_pu16(__m64 __m1, __m64 __m2)
657659/// element of the second 64-bit integer vector of [4 x i16] and get four
658660/// 32-bit products. Adds adjacent pairs of products to get two 32-bit sums.
659661/// The lower 32 bits of these two sums are packed into a 64-bit integer
660/// vector of [2 x i32]. For example, bits [15:0] of both parameters are
661/// multiplied, bits [31:16] of both parameters are multiplied, and the sum
662/// of both results is written to bits [31:0] of the result.
662/// vector of [2 x i32].
663///
664/// For example, bits [15:0] of both parameters are multiplied, bits [31:16]
665/// of both parameters are multiplied, and the sum of both results is written
666/// to bits [31:0] of the result.
663667///
664668/// \headerfile <x86intrin.h>
665669///
......@@ -851,10 +855,11 @@ _mm_slli_si64(__m64 __m, int __count)
851855
852856/// \brief Right-shifts each 16-bit integer element of the first parameter,
853857/// which is a 64-bit integer vector of [4 x i16], by the number of bits
854/// specified by the second parameter, which is a 64-bit integer. High-order
855/// bits are filled with the sign bit of the initial value of each 16-bit
856/// element. The 16-bit results are packed into a 64-bit integer vector of
857/// [4 x i16].
858/// specified by the second parameter, which is a 64-bit integer.
859///
860/// High-order bits are filled with the sign bit of the initial value of each
861/// 16-bit element. The 16-bit results are packed into a 64-bit integer
862/// vector of [4 x i16].
858863///
859864/// \headerfile <x86intrin.h>
860865///
......@@ -874,6 +879,7 @@ _mm_sra_pi16(__m64 __m, __m64 __count)
874879
875880/// \brief Right-shifts each 16-bit integer element of a 64-bit integer vector
876881/// of [4 x i16] by the number of bits specified by a 32-bit integer.
882///
877883/// High-order bits are filled with the sign bit of the initial value of each
878884/// 16-bit element. The 16-bit results are packed into a 64-bit integer
879885/// vector of [4 x i16].
......@@ -896,10 +902,11 @@ _mm_srai_pi16(__m64 __m, int __count)
896902
897903/// \brief Right-shifts each 32-bit integer element of the first parameter,
898904/// which is a 64-bit integer vector of [2 x i32], by the number of bits
899/// specified by the second parameter, which is a 64-bit integer. High-order
900/// bits are filled with the sign bit of the initial value of each 32-bit
901/// element. The 32-bit results are packed into a 64-bit integer vector of
902/// [2 x i32].
905/// specified by the second parameter, which is a 64-bit integer.
906///
907/// High-order bits are filled with the sign bit of the initial value of each
908/// 32-bit element. The 32-bit results are packed into a 64-bit integer
909/// vector of [2 x i32].
903910///
904911/// \headerfile <x86intrin.h>
905912///
......@@ -919,6 +926,7 @@ _mm_sra_pi32(__m64 __m, __m64 __count)
919926
920927/// \brief Right-shifts each 32-bit integer element of a 64-bit integer vector
921928/// of [2 x i32] by the number of bits specified by a 32-bit integer.
929///
922930/// High-order bits are filled with the sign bit of the initial value of each
923931/// 32-bit element. The 32-bit results are packed into a 64-bit integer
924932/// vector of [2 x i32].
......@@ -941,9 +949,10 @@ _mm_srai_pi32(__m64 __m, int __count)
941949
942950/// \brief Right-shifts each 16-bit integer element of the first parameter,
943951/// which is a 64-bit integer vector of [4 x i16], by the number of bits
944/// specified by the second parameter, which is a 64-bit integer. High-order
945/// bits are cleared. The 16-bit results are packed into a 64-bit integer
946/// vector of [4 x i16].
952/// specified by the second parameter, which is a 64-bit integer.
953///
954/// High-order bits are cleared. The 16-bit results are packed into a 64-bit
955/// integer vector of [4 x i16].
947956///
948957/// \headerfile <x86intrin.h>
949958///
......@@ -963,6 +972,7 @@ _mm_srl_pi16(__m64 __m, __m64 __count)
963972
964973/// \brief Right-shifts each 16-bit integer element of a 64-bit integer vector
965974/// of [4 x i16] by the number of bits specified by a 32-bit integer.
975///
966976/// High-order bits are cleared. The 16-bit results are packed into a 64-bit
967977/// integer vector of [4 x i16].
968978///
......@@ -984,9 +994,10 @@ _mm_srli_pi16(__m64 __m, int __count)
984994
985995/// \brief Right-shifts each 32-bit integer element of the first parameter,
986996/// which is a 64-bit integer vector of [2 x i32], by the number of bits
987/// specified by the second parameter, which is a 64-bit integer. High-order
988/// bits are cleared. The 32-bit results are packed into a 64-bit integer
989/// vector of [2 x i32].
997/// specified by the second parameter, which is a 64-bit integer.
998///
999/// High-order bits are cleared. The 32-bit results are packed into a 64-bit
1000/// integer vector of [2 x i32].
9901001///
9911002/// \headerfile <x86intrin.h>
9921003///
......@@ -1006,6 +1017,7 @@ _mm_srl_pi32(__m64 __m, __m64 __count)
10061017
10071018/// \brief Right-shifts each 32-bit integer element of a 64-bit integer vector
10081019/// of [2 x i32] by the number of bits specified by a 32-bit integer.
1020///
10091021/// High-order bits are cleared. The 32-bit results are packed into a 64-bit
10101022/// integer vector of [2 x i32].
10111023///
......@@ -1026,8 +1038,9 @@ _mm_srli_pi32(__m64 __m, int __count)
10261038}
10271039
10281040/// \brief Right-shifts the first 64-bit integer parameter by the number of bits
1029/// specified by the second 64-bit integer parameter. High-order bits are
1030/// cleared.
1041/// specified by the second 64-bit integer parameter.
1042///
1043/// High-order bits are cleared.
10311044///
10321045/// \headerfile <x86intrin.h>
10331046///
......@@ -1046,7 +1059,9 @@ _mm_srl_si64(__m64 __m, __m64 __count)
10461059
10471060/// \brief Right-shifts the first parameter, which is a 64-bit integer, by the
10481061/// number of bits specified by the second parameter, which is a 32-bit
1049/// integer. High-order bits are cleared.
1062/// integer.
1063///
1064/// High-order bits are cleared.
10501065///
10511066/// \headerfile <x86intrin.h>
10521067///
......@@ -1140,8 +1155,9 @@ _mm_xor_si64(__m64 __m1, __m64 __m2)
11401155
11411156/// \brief Compares the 8-bit integer elements of two 64-bit integer vectors of
11421157/// [8 x i8] to determine if the element of the first vector is equal to the
1143/// corresponding element of the second vector. The comparison yields 0 for
1144/// false, 0xFF for true.
1158/// corresponding element of the second vector.
1159///
1160/// The comparison yields 0 for false, 0xFF for true.
11451161///
11461162/// \headerfile <x86intrin.h>
11471163///
......@@ -1161,8 +1177,9 @@ _mm_cmpeq_pi8(__m64 __m1, __m64 __m2)
11611177
11621178/// \brief Compares the 16-bit integer elements of two 64-bit integer vectors of
11631179/// [4 x i16] to determine if the element of the first vector is equal to the
1164/// corresponding element of the second vector. The comparison yields 0 for
1165/// false, 0xFFFF for true.
1180/// corresponding element of the second vector.
1181///
1182/// The comparison yields 0 for false, 0xFFFF for true.
11661183///
11671184/// \headerfile <x86intrin.h>
11681185///
......@@ -1182,8 +1199,9 @@ _mm_cmpeq_pi16(__m64 __m1, __m64 __m2)
11821199
11831200/// \brief Compares the 32-bit integer elements of two 64-bit integer vectors of
11841201/// [2 x i32] to determine if the element of the first vector is equal to the
1185/// corresponding element of the second vector. The comparison yields 0 for
1186/// false, 0xFFFFFFFF for true.
1202/// corresponding element of the second vector.
1203///
1204/// The comparison yields 0 for false, 0xFFFFFFFF for true.
11871205///
11881206/// \headerfile <x86intrin.h>
11891207///
......@@ -1203,8 +1221,9 @@ _mm_cmpeq_pi32(__m64 __m1, __m64 __m2)
12031221
12041222/// \brief Compares the 8-bit integer elements of two 64-bit integer vectors of
12051223/// [8 x i8] to determine if the element of the first vector is greater than
1206/// the corresponding element of the second vector. The comparison yields 0
1207/// for false, 0xFF for true.
1224/// the corresponding element of the second vector.
1225///
1226/// The comparison yields 0 for false, 0xFF for true.
12081227///
12091228/// \headerfile <x86intrin.h>
12101229///
......@@ -1224,8 +1243,9 @@ _mm_cmpgt_pi8(__m64 __m1, __m64 __m2)
12241243
12251244/// \brief Compares the 16-bit integer elements of two 64-bit integer vectors of
12261245/// [4 x i16] to determine if the element of the first vector is greater than
1227/// the corresponding element of the second vector. The comparison yields 0
1228/// for false, 0xFFFF for true.
1246/// the corresponding element of the second vector.
1247///
1248/// The comparison yields 0 for false, 0xFFFF for true.
12291249///
12301250/// \headerfile <x86intrin.h>
12311251///
......@@ -1245,8 +1265,9 @@ _mm_cmpgt_pi16(__m64 __m1, __m64 __m2)
12451265
12461266/// \brief Compares the 32-bit integer elements of two 64-bit integer vectors of
12471267/// [2 x i32] to determine if the element of the first vector is greater than
1248/// the corresponding element of the second vector. The comparison yields 0
1249/// for false, 0xFFFFFFFF for true.
1268/// the corresponding element of the second vector.
1269///
1270/// The comparison yields 0 for false, 0xFFFFFFFF for true.
12501271///
12511272/// \headerfile <x86intrin.h>
12521273///
......@@ -1268,7 +1289,7 @@ _mm_cmpgt_pi32(__m64 __m1, __m64 __m2)
12681289///
12691290/// \headerfile <x86intrin.h>
12701291///
1271/// This intrinsic corresponds to the the <c> VXORPS / XORPS </c> instruction.
1292/// This intrinsic corresponds to the <c> VXORPS / XORPS </c> instruction.
12721293///
12731294/// \returns An initialized 64-bit integer vector with all elements set to zero.
12741295static __inline__ __m64 __DEFAULT_FN_ATTRS
c_headers/module.modulemap+1
......@@ -61,6 +61,7 @@ module _Builtin_intrinsics [system] [extern_c] {
6161 textual header "xopintrin.h"
6262 textual header "fma4intrin.h"
6363 textual header "mwaitxintrin.h"
64 textual header "clzerointrin.h"
6465
6566 explicit module mm_malloc {
6667 requires !freestanding
c_headers/opencl-c.h+120-778
......@@ -16,6 +16,12 @@
1616#endif //cl_khr_depth_images
1717#endif //__OPENCL_C_VERSION__ >= CL_VERSION_2_0
1818
19#if __OPENCL_C_VERSION__ < CL_VERSION_2_0
20#ifdef cl_khr_3d_image_writes
21#pragma OPENCL EXTENSION cl_khr_3d_image_writes : enable
22#endif //cl_khr_3d_image_writes
23#endif //__OPENCL_C_VERSION__ < CL_VERSION_2_0
24
1925#define __ovld __attribute__((overloadable))
2026#define __conv __attribute__((convergent))
2127
......@@ -6578,777 +6584,85 @@ half16 __ovld __cnfn convert_half16_rtz(double16);
65786584 * OpenCL v1.1/1.2/2.0 s6.2.4.2 - as_type operators
65796585 * Reinterprets a data type as another data type of the same size
65806586 */
6581char __ovld __cnfn as_char(char);
6582char __ovld __cnfn as_char(uchar);
6583
6584char2 __ovld __cnfn as_char2(char2);
6585char2 __ovld __cnfn as_char2(uchar2);
6586char2 __ovld __cnfn as_char2(short);
6587char2 __ovld __cnfn as_char2(ushort);
6588
6589char3 __ovld __cnfn as_char3(char3);
6590char3 __ovld __cnfn as_char3(char4);
6591char3 __ovld __cnfn as_char3(uchar3);
6592char3 __ovld __cnfn as_char3(uchar4);
6593char3 __ovld __cnfn as_char3(short2);
6594char3 __ovld __cnfn as_char3(ushort2);
6595char3 __ovld __cnfn as_char3(int);
6596char3 __ovld __cnfn as_char3(uint);
6597char3 __ovld __cnfn as_char3(float);
6598
6599char4 __ovld __cnfn as_char4(char3);
6600char4 __ovld __cnfn as_char4(char4);
6601char4 __ovld __cnfn as_char4(uchar3);
6602char4 __ovld __cnfn as_char4(uchar4);
6603char4 __ovld __cnfn as_char4(short2);
6604char4 __ovld __cnfn as_char4(ushort2);
6605char4 __ovld __cnfn as_char4(int);
6606char4 __ovld __cnfn as_char4(uint);
6607char4 __ovld __cnfn as_char4(float);
6608
6609char8 __ovld __cnfn as_char8(char8);
6610char8 __ovld __cnfn as_char8(uchar8);
6611char8 __ovld __cnfn as_char8(short3);
6612char8 __ovld __cnfn as_char8(short4);
6613char8 __ovld __cnfn as_char8(ushort3);
6614char8 __ovld __cnfn as_char8(ushort4);
6615char8 __ovld __cnfn as_char8(int2);
6616char8 __ovld __cnfn as_char8(uint2);
6617char8 __ovld __cnfn as_char8(long);
6618char8 __ovld __cnfn as_char8(ulong);
6619char8 __ovld __cnfn as_char8(float2);
6620
6621char16 __ovld __cnfn as_char16(char16);
6622char16 __ovld __cnfn as_char16(uchar16);
6623char16 __ovld __cnfn as_char16(short8);
6624char16 __ovld __cnfn as_char16(ushort8);
6625char16 __ovld __cnfn as_char16(int3);
6626char16 __ovld __cnfn as_char16(int4);
6627char16 __ovld __cnfn as_char16(uint3);
6628char16 __ovld __cnfn as_char16(uint4);
6629char16 __ovld __cnfn as_char16(long2);
6630char16 __ovld __cnfn as_char16(ulong2);
6631char16 __ovld __cnfn as_char16(float3);
6632char16 __ovld __cnfn as_char16(float4);
6633
6634uchar __ovld __cnfn as_uchar(char);
6635uchar __ovld __cnfn as_uchar(uchar);
6636
6637uchar2 __ovld __cnfn as_uchar2(char2);
6638uchar2 __ovld __cnfn as_uchar2(uchar2);
6639uchar2 __ovld __cnfn as_uchar2(short);
6640uchar2 __ovld __cnfn as_uchar2(ushort);
6641
6642uchar3 __ovld __cnfn as_uchar3(char3);
6643uchar3 __ovld __cnfn as_uchar3(char4);
6644uchar3 __ovld __cnfn as_uchar3(uchar3);
6645uchar3 __ovld __cnfn as_uchar3(uchar4);
6646uchar3 __ovld __cnfn as_uchar3(short2);
6647uchar3 __ovld __cnfn as_uchar3(ushort2);
6648uchar3 __ovld __cnfn as_uchar3(int);
6649uchar3 __ovld __cnfn as_uchar3(uint);
6650uchar3 __ovld __cnfn as_uchar3(float);
6651
6652uchar4 __ovld __cnfn as_uchar4(char3);
6653uchar4 __ovld __cnfn as_uchar4(char4);
6654uchar4 __ovld __cnfn as_uchar4(uchar3);
6655uchar4 __ovld __cnfn as_uchar4(uchar4);
6656uchar4 __ovld __cnfn as_uchar4(short2);
6657uchar4 __ovld __cnfn as_uchar4(ushort2);
6658uchar4 __ovld __cnfn as_uchar4(int);
6659uchar4 __ovld __cnfn as_uchar4(uint);
6660uchar4 __ovld __cnfn as_uchar4(float);
6661
6662uchar8 __ovld __cnfn as_uchar8(char8);
6663uchar8 __ovld __cnfn as_uchar8(uchar8);
6664uchar8 __ovld __cnfn as_uchar8(short3);
6665uchar8 __ovld __cnfn as_uchar8(short4);
6666uchar8 __ovld __cnfn as_uchar8(ushort3);
6667uchar8 __ovld __cnfn as_uchar8(ushort4);
6668uchar8 __ovld __cnfn as_uchar8(int2);
6669uchar8 __ovld __cnfn as_uchar8(uint2);
6670uchar8 __ovld __cnfn as_uchar8(long);
6671uchar8 __ovld __cnfn as_uchar8(ulong);
6672uchar8 __ovld __cnfn as_uchar8(float2);
6673
6674uchar16 __ovld __cnfn as_uchar16(char16);
6675uchar16 __ovld __cnfn as_uchar16(uchar16);
6676uchar16 __ovld __cnfn as_uchar16(short8);
6677uchar16 __ovld __cnfn as_uchar16(ushort8);
6678uchar16 __ovld __cnfn as_uchar16(int3);
6679uchar16 __ovld __cnfn as_uchar16(int4);
6680uchar16 __ovld __cnfn as_uchar16(uint3);
6681uchar16 __ovld __cnfn as_uchar16(uint4);
6682uchar16 __ovld __cnfn as_uchar16(long2);
6683uchar16 __ovld __cnfn as_uchar16(ulong2);
6684uchar16 __ovld __cnfn as_uchar16(float3);
6685uchar16 __ovld __cnfn as_uchar16(float4);
6686
6687short __ovld __cnfn as_short(char2);
6688short __ovld __cnfn as_short(uchar2);
6689short __ovld __cnfn as_short(short);
6690short __ovld __cnfn as_short(ushort);
6691
6692short2 __ovld __cnfn as_short2(char3);
6693short2 __ovld __cnfn as_short2(char4);
6694short2 __ovld __cnfn as_short2(uchar3);
6695short2 __ovld __cnfn as_short2(uchar4);
6696short2 __ovld __cnfn as_short2(short2);
6697short2 __ovld __cnfn as_short2(ushort2);
6698short2 __ovld __cnfn as_short2(int);
6699short2 __ovld __cnfn as_short2(uint);
6700short2 __ovld __cnfn as_short2(float);
6701
6702short3 __ovld __cnfn as_short3(char8);
6703short3 __ovld __cnfn as_short3(uchar8);
6704short3 __ovld __cnfn as_short3(short3);
6705short3 __ovld __cnfn as_short3(short4);
6706short3 __ovld __cnfn as_short3(ushort3);
6707short3 __ovld __cnfn as_short3(ushort4);
6708short3 __ovld __cnfn as_short3(int2);
6709short3 __ovld __cnfn as_short3(uint2);
6710short3 __ovld __cnfn as_short3(long);
6711short3 __ovld __cnfn as_short3(ulong);
6712short3 __ovld __cnfn as_short3(float2);
6713
6714short4 __ovld __cnfn as_short4(char8);
6715short4 __ovld __cnfn as_short4(uchar8);
6716short4 __ovld __cnfn as_short4(short3);
6717short4 __ovld __cnfn as_short4(short4);
6718short4 __ovld __cnfn as_short4(ushort3);
6719short4 __ovld __cnfn as_short4(ushort4);
6720short4 __ovld __cnfn as_short4(int2);
6721short4 __ovld __cnfn as_short4(uint2);
6722short4 __ovld __cnfn as_short4(long);
6723short4 __ovld __cnfn as_short4(ulong);
6724short4 __ovld __cnfn as_short4(float2);
6725
6726short8 __ovld __cnfn as_short8(char16);
6727short8 __ovld __cnfn as_short8(uchar16);
6728short8 __ovld __cnfn as_short8(short8);
6729short8 __ovld __cnfn as_short8(ushort8);
6730short8 __ovld __cnfn as_short8(int3);
6731short8 __ovld __cnfn as_short8(int4);
6732short8 __ovld __cnfn as_short8(uint3);
6733short8 __ovld __cnfn as_short8(uint4);
6734short8 __ovld __cnfn as_short8(long2);
6735short8 __ovld __cnfn as_short8(ulong2);
6736short8 __ovld __cnfn as_short8(float3);
6737short8 __ovld __cnfn as_short8(float4);
6738
6739short16 __ovld __cnfn as_short16(short16);
6740short16 __ovld __cnfn as_short16(ushort16);
6741short16 __ovld __cnfn as_short16(int8);
6742short16 __ovld __cnfn as_short16(uint8);
6743short16 __ovld __cnfn as_short16(long3);
6744short16 __ovld __cnfn as_short16(long4);
6745short16 __ovld __cnfn as_short16(ulong3);
6746short16 __ovld __cnfn as_short16(ulong4);
6747short16 __ovld __cnfn as_short16(float8);
6748
6749ushort __ovld __cnfn as_ushort(char2);
6750ushort __ovld __cnfn as_ushort(uchar2);
6751ushort __ovld __cnfn as_ushort(short);
6752ushort __ovld __cnfn as_ushort(ushort);
6753
6754ushort2 __ovld __cnfn as_ushort2(char3);
6755ushort2 __ovld __cnfn as_ushort2(char4);
6756ushort2 __ovld __cnfn as_ushort2(uchar3);
6757ushort2 __ovld __cnfn as_ushort2(uchar4);
6758ushort2 __ovld __cnfn as_ushort2(short2);
6759ushort2 __ovld __cnfn as_ushort2(ushort2);
6760ushort2 __ovld __cnfn as_ushort2(int);
6761ushort2 __ovld __cnfn as_ushort2(uint);
6762ushort2 __ovld __cnfn as_ushort2(float);
6763
6764ushort3 __ovld __cnfn as_ushort3(char8);
6765ushort3 __ovld __cnfn as_ushort3(uchar8);
6766ushort3 __ovld __cnfn as_ushort3(short3);
6767ushort3 __ovld __cnfn as_ushort3(short4);
6768ushort3 __ovld __cnfn as_ushort3(ushort3);
6769ushort3 __ovld __cnfn as_ushort3(ushort4);
6770ushort3 __ovld __cnfn as_ushort3(int2);
6771ushort3 __ovld __cnfn as_ushort3(uint2);
6772ushort3 __ovld __cnfn as_ushort3(long);
6773ushort3 __ovld __cnfn as_ushort3(ulong);
6774ushort3 __ovld __cnfn as_ushort3(float2);
6775
6776ushort4 __ovld __cnfn as_ushort4(char8);
6777ushort4 __ovld __cnfn as_ushort4(uchar8);
6778ushort4 __ovld __cnfn as_ushort4(short3);
6779ushort4 __ovld __cnfn as_ushort4(short4);
6780ushort4 __ovld __cnfn as_ushort4(ushort3);
6781ushort4 __ovld __cnfn as_ushort4(ushort4);
6782ushort4 __ovld __cnfn as_ushort4(int2);
6783ushort4 __ovld __cnfn as_ushort4(uint2);
6784ushort4 __ovld __cnfn as_ushort4(long);
6785ushort4 __ovld __cnfn as_ushort4(ulong);
6786ushort4 __ovld __cnfn as_ushort4(float2);
6787
6788ushort8 __ovld __cnfn as_ushort8(char16);
6789ushort8 __ovld __cnfn as_ushort8(uchar16);
6790ushort8 __ovld __cnfn as_ushort8(short8);
6791ushort8 __ovld __cnfn as_ushort8(ushort8);
6792ushort8 __ovld __cnfn as_ushort8(int3);
6793ushort8 __ovld __cnfn as_ushort8(int4);
6794ushort8 __ovld __cnfn as_ushort8(uint3);
6795ushort8 __ovld __cnfn as_ushort8(uint4);
6796ushort8 __ovld __cnfn as_ushort8(long2);
6797ushort8 __ovld __cnfn as_ushort8(ulong2);
6798ushort8 __ovld __cnfn as_ushort8(float3);
6799ushort8 __ovld __cnfn as_ushort8(float4);
6800
6801ushort16 __ovld __cnfn as_ushort16(short16);
6802ushort16 __ovld __cnfn as_ushort16(ushort16);
6803ushort16 __ovld __cnfn as_ushort16(int8);
6804ushort16 __ovld __cnfn as_ushort16(uint8);
6805ushort16 __ovld __cnfn as_ushort16(long3);
6806ushort16 __ovld __cnfn as_ushort16(long4);
6807ushort16 __ovld __cnfn as_ushort16(ulong3);
6808ushort16 __ovld __cnfn as_ushort16(ulong4);
6809ushort16 __ovld __cnfn as_ushort16(float8);
6810
6811int __ovld __cnfn as_int(char3);
6812int __ovld __cnfn as_int(char4);
6813int __ovld __cnfn as_int(uchar3);
6814int __ovld __cnfn as_int(uchar4);
6815int __ovld __cnfn as_int(short2);
6816int __ovld __cnfn as_int(ushort2);
6817int __ovld __cnfn as_int(int);
6818int __ovld __cnfn as_int(uint);
6819int __ovld __cnfn as_int(float);
6820
6821int2 __ovld __cnfn as_int2(char8);
6822int2 __ovld __cnfn as_int2(uchar8);
6823int2 __ovld __cnfn as_int2(short3);
6824int2 __ovld __cnfn as_int2(short4);
6825int2 __ovld __cnfn as_int2(ushort3);
6826int2 __ovld __cnfn as_int2(ushort4);
6827int2 __ovld __cnfn as_int2(int2);
6828int2 __ovld __cnfn as_int2(uint2);
6829int2 __ovld __cnfn as_int2(long);
6830int2 __ovld __cnfn as_int2(ulong);
6831int2 __ovld __cnfn as_int2(float2);
6832
6833int3 __ovld __cnfn as_int3(char16);
6834int3 __ovld __cnfn as_int3(uchar16);
6835int3 __ovld __cnfn as_int3(short8);
6836int3 __ovld __cnfn as_int3(ushort8);
6837int3 __ovld __cnfn as_int3(int3);
6838int3 __ovld __cnfn as_int3(int4);
6839int3 __ovld __cnfn as_int3(uint3);
6840int3 __ovld __cnfn as_int3(uint4);
6841int3 __ovld __cnfn as_int3(long2);
6842int3 __ovld __cnfn as_int3(ulong2);
6843int3 __ovld __cnfn as_int3(float3);
6844int3 __ovld __cnfn as_int3(float4);
6845
6846int4 __ovld __cnfn as_int4(char16);
6847int4 __ovld __cnfn as_int4(uchar16);
6848int4 __ovld __cnfn as_int4(short8);
6849int4 __ovld __cnfn as_int4(ushort8);
6850int4 __ovld __cnfn as_int4(int3);
6851int4 __ovld __cnfn as_int4(int4);
6852int4 __ovld __cnfn as_int4(uint3);
6853int4 __ovld __cnfn as_int4(uint4);
6854int4 __ovld __cnfn as_int4(long2);
6855int4 __ovld __cnfn as_int4(ulong2);
6856int4 __ovld __cnfn as_int4(float3);
6857int4 __ovld __cnfn as_int4(float4);
6858
6859int8 __ovld __cnfn as_int8(short16);
6860int8 __ovld __cnfn as_int8(ushort16);
6861int8 __ovld __cnfn as_int8(int8);
6862int8 __ovld __cnfn as_int8(uint8);
6863int8 __ovld __cnfn as_int8(long3);
6864int8 __ovld __cnfn as_int8(long4);
6865int8 __ovld __cnfn as_int8(ulong3);
6866int8 __ovld __cnfn as_int8(ulong4);
6867int8 __ovld __cnfn as_int8(float8);
6868
6869int16 __ovld __cnfn as_int16(int16);
6870int16 __ovld __cnfn as_int16(uint16);
6871int16 __ovld __cnfn as_int16(long8);
6872int16 __ovld __cnfn as_int16(ulong8);
6873int16 __ovld __cnfn as_int16(float16);
6874
6875uint __ovld __cnfn as_uint(char3);
6876uint __ovld __cnfn as_uint(char4);
6877uint __ovld __cnfn as_uint(uchar3);
6878uint __ovld __cnfn as_uint(uchar4);
6879uint __ovld __cnfn as_uint(short2);
6880uint __ovld __cnfn as_uint(ushort2);
6881uint __ovld __cnfn as_uint(int);
6882uint __ovld __cnfn as_uint(uint);
6883uint __ovld __cnfn as_uint(float);
6884
6885uint2 __ovld __cnfn as_uint2(char8);
6886uint2 __ovld __cnfn as_uint2(uchar8);
6887uint2 __ovld __cnfn as_uint2(short3);
6888uint2 __ovld __cnfn as_uint2(short4);
6889uint2 __ovld __cnfn as_uint2(ushort3);
6890uint2 __ovld __cnfn as_uint2(ushort4);
6891uint2 __ovld __cnfn as_uint2(int2);
6892uint2 __ovld __cnfn as_uint2(uint2);
6893uint2 __ovld __cnfn as_uint2(long);
6894uint2 __ovld __cnfn as_uint2(ulong);
6895uint2 __ovld __cnfn as_uint2(float2);
6896
6897uint3 __ovld __cnfn as_uint3(char16);
6898uint3 __ovld __cnfn as_uint3(uchar16);
6899uint3 __ovld __cnfn as_uint3(short8);
6900uint3 __ovld __cnfn as_uint3(ushort8);
6901uint3 __ovld __cnfn as_uint3(int3);
6902uint3 __ovld __cnfn as_uint3(int4);
6903uint3 __ovld __cnfn as_uint3(uint3);
6904uint3 __ovld __cnfn as_uint3(uint4);
6905uint3 __ovld __cnfn as_uint3(long2);
6906uint3 __ovld __cnfn as_uint3(ulong2);
6907uint3 __ovld __cnfn as_uint3(float3);
6908uint3 __ovld __cnfn as_uint3(float4);
6909
6910uint4 __ovld __cnfn as_uint4(char16);
6911uint4 __ovld __cnfn as_uint4(uchar16);
6912uint4 __ovld __cnfn as_uint4(short8);
6913uint4 __ovld __cnfn as_uint4(ushort8);
6914uint4 __ovld __cnfn as_uint4(int3);
6915uint4 __ovld __cnfn as_uint4(int4);
6916uint4 __ovld __cnfn as_uint4(uint3);
6917uint4 __ovld __cnfn as_uint4(uint4);
6918uint4 __ovld __cnfn as_uint4(long2);
6919uint4 __ovld __cnfn as_uint4(ulong2);
6920uint4 __ovld __cnfn as_uint4(float3);
6921uint4 __ovld __cnfn as_uint4(float4);
6922
6923uint8 __ovld __cnfn as_uint8(short16);
6924uint8 __ovld __cnfn as_uint8(ushort16);
6925uint8 __ovld __cnfn as_uint8(int8);
6926uint8 __ovld __cnfn as_uint8(uint8);
6927uint8 __ovld __cnfn as_uint8(long3);
6928uint8 __ovld __cnfn as_uint8(long4);
6929uint8 __ovld __cnfn as_uint8(ulong3);
6930uint8 __ovld __cnfn as_uint8(ulong4);
6931uint8 __ovld __cnfn as_uint8(float8);
6932
6933uint16 __ovld __cnfn as_uint16(int16);
6934uint16 __ovld __cnfn as_uint16(uint16);
6935uint16 __ovld __cnfn as_uint16(long8);
6936uint16 __ovld __cnfn as_uint16(ulong8);
6937uint16 __ovld __cnfn as_uint16(float16);
6938
6939long __ovld __cnfn as_long(char8);
6940long __ovld __cnfn as_long(uchar8);
6941long __ovld __cnfn as_long(short3);
6942long __ovld __cnfn as_long(short4);
6943long __ovld __cnfn as_long(ushort3);
6944long __ovld __cnfn as_long(ushort4);
6945long __ovld __cnfn as_long(int2);
6946long __ovld __cnfn as_long(uint2);
6947long __ovld __cnfn as_long(long);
6948long __ovld __cnfn as_long(ulong);
6949long __ovld __cnfn as_long(float2);
6950
6951long2 __ovld __cnfn as_long2(char16);
6952long2 __ovld __cnfn as_long2(uchar16);
6953long2 __ovld __cnfn as_long2(short8);
6954long2 __ovld __cnfn as_long2(ushort8);
6955long2 __ovld __cnfn as_long2(int3);
6956long2 __ovld __cnfn as_long2(int4);
6957long2 __ovld __cnfn as_long2(uint3);
6958long2 __ovld __cnfn as_long2(uint4);
6959long2 __ovld __cnfn as_long2(long2);
6960long2 __ovld __cnfn as_long2(ulong2);
6961long2 __ovld __cnfn as_long2(float3);
6962long2 __ovld __cnfn as_long2(float4);
6963
6964long3 __ovld __cnfn as_long3(short16);
6965long3 __ovld __cnfn as_long3(ushort16);
6966long3 __ovld __cnfn as_long3(int8);
6967long3 __ovld __cnfn as_long3(uint8);
6968long3 __ovld __cnfn as_long3(long3);
6969long3 __ovld __cnfn as_long3(long4);
6970long3 __ovld __cnfn as_long3(ulong3);
6971long3 __ovld __cnfn as_long3(ulong4);
6972long3 __ovld __cnfn as_long3(float8);
6973
6974long4 __ovld __cnfn as_long4(short16);
6975long4 __ovld __cnfn as_long4(ushort16);
6976long4 __ovld __cnfn as_long4(int8);
6977long4 __ovld __cnfn as_long4(uint8);
6978long4 __ovld __cnfn as_long4(long3);
6979long4 __ovld __cnfn as_long4(long4);
6980long4 __ovld __cnfn as_long4(ulong3);
6981long4 __ovld __cnfn as_long4(ulong4);
6982long4 __ovld __cnfn as_long4(float8);
6983
6984long8 __ovld __cnfn as_long8(int16);
6985long8 __ovld __cnfn as_long8(uint16);
6986long8 __ovld __cnfn as_long8(long8);
6987long8 __ovld __cnfn as_long8(ulong8);
6988long8 __ovld __cnfn as_long8(float16);
6989
6990long16 __ovld __cnfn as_long16(long16);
6991long16 __ovld __cnfn as_long16(ulong16);
6992
6993ulong __ovld __cnfn as_ulong(char8);
6994ulong __ovld __cnfn as_ulong(uchar8);
6995ulong __ovld __cnfn as_ulong(short3);
6996ulong __ovld __cnfn as_ulong(short4);
6997ulong __ovld __cnfn as_ulong(ushort3);
6998ulong __ovld __cnfn as_ulong(ushort4);
6999ulong __ovld __cnfn as_ulong(int2);
7000ulong __ovld __cnfn as_ulong(uint2);
7001ulong __ovld __cnfn as_ulong(long);
7002ulong __ovld __cnfn as_ulong(ulong);
7003ulong __ovld __cnfn as_ulong(float2);
7004
7005ulong2 __ovld __cnfn as_ulong2(char16);
7006ulong2 __ovld __cnfn as_ulong2(uchar16);
7007ulong2 __ovld __cnfn as_ulong2(short8);
7008ulong2 __ovld __cnfn as_ulong2(ushort8);
7009ulong2 __ovld __cnfn as_ulong2(int3);
7010ulong2 __ovld __cnfn as_ulong2(int4);
7011ulong2 __ovld __cnfn as_ulong2(uint3);
7012ulong2 __ovld __cnfn as_ulong2(uint4);
7013ulong2 __ovld __cnfn as_ulong2(long2);
7014ulong2 __ovld __cnfn as_ulong2(ulong2);
7015ulong2 __ovld __cnfn as_ulong2(float3);
7016ulong2 __ovld __cnfn as_ulong2(float4);
7017
7018ulong3 __ovld __cnfn as_ulong3(short16);
7019ulong3 __ovld __cnfn as_ulong3(ushort16);
7020ulong3 __ovld __cnfn as_ulong3(int8);
7021ulong3 __ovld __cnfn as_ulong3(uint8);
7022ulong3 __ovld __cnfn as_ulong3(long3);
7023ulong3 __ovld __cnfn as_ulong3(long4);
7024ulong3 __ovld __cnfn as_ulong3(ulong3);
7025ulong3 __ovld __cnfn as_ulong3(ulong4);
7026ulong3 __ovld __cnfn as_ulong3(float8);
7027
7028ulong4 __ovld __cnfn as_ulong4(short16);
7029ulong4 __ovld __cnfn as_ulong4(ushort16);
7030ulong4 __ovld __cnfn as_ulong4(int8);
7031ulong4 __ovld __cnfn as_ulong4(uint8);
7032ulong4 __ovld __cnfn as_ulong4(long3);
7033ulong4 __ovld __cnfn as_ulong4(long4);
7034ulong4 __ovld __cnfn as_ulong4(ulong3);
7035ulong4 __ovld __cnfn as_ulong4(ulong4);
7036ulong4 __ovld __cnfn as_ulong4(float8);
7037
7038ulong8 __ovld __cnfn as_ulong8(int16);
7039ulong8 __ovld __cnfn as_ulong8(uint16);
7040ulong8 __ovld __cnfn as_ulong8(long8);
7041ulong8 __ovld __cnfn as_ulong8(ulong8);
7042ulong8 __ovld __cnfn as_ulong8(float16);
7043
7044ulong16 __ovld __cnfn as_ulong16(long16);
7045ulong16 __ovld __cnfn as_ulong16(ulong16);
7046
7047float __ovld __cnfn as_float(char3);
7048float __ovld __cnfn as_float(char4);
7049float __ovld __cnfn as_float(uchar3);
7050float __ovld __cnfn as_float(uchar4);
7051float __ovld __cnfn as_float(short2);
7052float __ovld __cnfn as_float(ushort2);
7053float __ovld __cnfn as_float(int);
7054float __ovld __cnfn as_float(uint);
7055float __ovld __cnfn as_float(float);
7056
7057float2 __ovld __cnfn as_float2(char8);
7058float2 __ovld __cnfn as_float2(uchar8);
7059float2 __ovld __cnfn as_float2(short3);
7060float2 __ovld __cnfn as_float2(short4);
7061float2 __ovld __cnfn as_float2(ushort3);
7062float2 __ovld __cnfn as_float2(ushort4);
7063float2 __ovld __cnfn as_float2(int2);
7064float2 __ovld __cnfn as_float2(uint2);
7065float2 __ovld __cnfn as_float2(long);
7066float2 __ovld __cnfn as_float2(ulong);
7067float2 __ovld __cnfn as_float2(float2);
7068
7069float3 __ovld __cnfn as_float3(char16);
7070float3 __ovld __cnfn as_float3(uchar16);
7071float3 __ovld __cnfn as_float3(short8);
7072float3 __ovld __cnfn as_float3(ushort8);
7073float3 __ovld __cnfn as_float3(int3);
7074float3 __ovld __cnfn as_float3(int4);
7075float3 __ovld __cnfn as_float3(uint3);
7076float3 __ovld __cnfn as_float3(uint4);
7077float3 __ovld __cnfn as_float3(long2);
7078float3 __ovld __cnfn as_float3(ulong2);
7079float3 __ovld __cnfn as_float3(float3);
7080float3 __ovld __cnfn as_float3(float4);
7081
7082float4 __ovld __cnfn as_float4(char16);
7083float4 __ovld __cnfn as_float4(uchar16);
7084float4 __ovld __cnfn as_float4(short8);
7085float4 __ovld __cnfn as_float4(ushort8);
7086float4 __ovld __cnfn as_float4(int3);
7087float4 __ovld __cnfn as_float4(int4);
7088float4 __ovld __cnfn as_float4(uint3);
7089float4 __ovld __cnfn as_float4(uint4);
7090float4 __ovld __cnfn as_float4(long2);
7091float4 __ovld __cnfn as_float4(ulong2);
7092float4 __ovld __cnfn as_float4(float3);
7093float4 __ovld __cnfn as_float4(float4);
7094
7095float8 __ovld __cnfn as_float8(short16);
7096float8 __ovld __cnfn as_float8(ushort16);
7097float8 __ovld __cnfn as_float8(int8);
7098float8 __ovld __cnfn as_float8(uint8);
7099float8 __ovld __cnfn as_float8(long3);
7100float8 __ovld __cnfn as_float8(long4);
7101float8 __ovld __cnfn as_float8(ulong3);
7102float8 __ovld __cnfn as_float8(ulong4);
7103float8 __ovld __cnfn as_float8(float8);
7104
7105float16 __ovld __cnfn as_float16(int16);
7106float16 __ovld __cnfn as_float16(uint16);
7107float16 __ovld __cnfn as_float16(long8);
7108float16 __ovld __cnfn as_float16(ulong8);
7109float16 __ovld __cnfn as_float16(float16);
6587#define as_char(x) __builtin_astype((x), char)
6588#define as_char2(x) __builtin_astype((x), char2)
6589#define as_char3(x) __builtin_astype((x), char3)
6590#define as_char4(x) __builtin_astype((x), char4)
6591#define as_char8(x) __builtin_astype((x), char8)
6592#define as_char16(x) __builtin_astype((x), char16)
6593
6594#define as_uchar(x) __builtin_astype((x), uchar)
6595#define as_uchar2(x) __builtin_astype((x), uchar2)
6596#define as_uchar3(x) __builtin_astype((x), uchar3)
6597#define as_uchar4(x) __builtin_astype((x), uchar4)
6598#define as_uchar8(x) __builtin_astype((x), uchar8)
6599#define as_uchar16(x) __builtin_astype((x), uchar16)
6600
6601#define as_short(x) __builtin_astype((x), short)
6602#define as_short2(x) __builtin_astype((x), short2)
6603#define as_short3(x) __builtin_astype((x), short3)
6604#define as_short4(x) __builtin_astype((x), short4)
6605#define as_short8(x) __builtin_astype((x), short8)
6606#define as_short16(x) __builtin_astype((x), short16)
6607
6608#define as_ushort(x) __builtin_astype((x), ushort)
6609#define as_ushort2(x) __builtin_astype((x), ushort2)
6610#define as_ushort3(x) __builtin_astype((x), ushort3)
6611#define as_ushort4(x) __builtin_astype((x), ushort4)
6612#define as_ushort8(x) __builtin_astype((x), ushort8)
6613#define as_ushort16(x) __builtin_astype((x), ushort16)
6614
6615#define as_int(x) __builtin_astype((x), int)
6616#define as_int2(x) __builtin_astype((x), int2)
6617#define as_int3(x) __builtin_astype((x), int3)
6618#define as_int4(x) __builtin_astype((x), int4)
6619#define as_int8(x) __builtin_astype((x), int8)
6620#define as_int16(x) __builtin_astype((x), int16)
6621
6622#define as_uint(x) __builtin_astype((x), uint)
6623#define as_uint2(x) __builtin_astype((x), uint2)
6624#define as_uint3(x) __builtin_astype((x), uint3)
6625#define as_uint4(x) __builtin_astype((x), uint4)
6626#define as_uint8(x) __builtin_astype((x), uint8)
6627#define as_uint16(x) __builtin_astype((x), uint16)
6628
6629#define as_long(x) __builtin_astype((x), long)
6630#define as_long2(x) __builtin_astype((x), long2)
6631#define as_long3(x) __builtin_astype((x), long3)
6632#define as_long4(x) __builtin_astype((x), long4)
6633#define as_long8(x) __builtin_astype((x), long8)
6634#define as_long16(x) __builtin_astype((x), long16)
6635
6636#define as_ulong(x) __builtin_astype((x), ulong)
6637#define as_ulong2(x) __builtin_astype((x), ulong2)
6638#define as_ulong3(x) __builtin_astype((x), ulong3)
6639#define as_ulong4(x) __builtin_astype((x), ulong4)
6640#define as_ulong8(x) __builtin_astype((x), ulong8)
6641#define as_ulong16(x) __builtin_astype((x), ulong16)
6642
6643#define as_float(x) __builtin_astype((x), float)
6644#define as_float2(x) __builtin_astype((x), float2)
6645#define as_float3(x) __builtin_astype((x), float3)
6646#define as_float4(x) __builtin_astype((x), float4)
6647#define as_float8(x) __builtin_astype((x), float8)
6648#define as_float16(x) __builtin_astype((x), float16)
71106649
71116650#ifdef cl_khr_fp64
7112char8 __ovld __cnfn as_char8(double);
7113char16 __ovld __cnfn as_char16(double2);
7114uchar8 __ovld __cnfn as_uchar8(double);
7115uchar16 __ovld __cnfn as_uchar16(double2);
7116short3 __ovld __cnfn as_short3(double);
7117short4 __ovld __cnfn as_short4(double);
7118short8 __ovld __cnfn as_short8(double2);
7119short16 __ovld __cnfn as_short16(double3);
7120short16 __ovld __cnfn as_short16(double4);
7121ushort3 __ovld __cnfn as_ushort3(double);
7122ushort4 __ovld __cnfn as_ushort4(double);
7123ushort8 __ovld __cnfn as_ushort8(double2);
7124ushort16 __ovld __cnfn as_ushort16(double3);
7125ushort16 __ovld __cnfn as_ushort16(double4);
7126int2 __ovld __cnfn as_int2(double);
7127int3 __ovld __cnfn as_int3(double2);
7128int4 __ovld __cnfn as_int4(double2);
7129int8 __ovld __cnfn as_int8(double3);
7130int8 __ovld __cnfn as_int8(double4);
7131int16 __ovld __cnfn as_int16(double8);
7132uint2 __ovld __cnfn as_uint2(double);
7133uint3 __ovld __cnfn as_uint3(double2);
7134uint4 __ovld __cnfn as_uint4(double2);
7135uint8 __ovld __cnfn as_uint8(double3);
7136uint8 __ovld __cnfn as_uint8(double4);
7137uint16 __ovld __cnfn as_uint16(double8);
7138long __ovld __cnfn as_long(double);
7139long2 __ovld __cnfn as_long2(double2);
7140long3 __ovld __cnfn as_long3(double3);
7141long3 __ovld __cnfn as_long3(double4);
7142long4 __ovld __cnfn as_long4(double3);
7143long4 __ovld __cnfn as_long4(double4);
7144long8 __ovld __cnfn as_long8(double8);
7145long16 __ovld __cnfn as_long16(double16);
7146ulong __ovld __cnfn as_ulong(double);
7147ulong2 __ovld __cnfn as_ulong2(double2);
7148ulong3 __ovld __cnfn as_ulong3(double3);
7149ulong3 __ovld __cnfn as_ulong3(double4);
7150ulong4 __ovld __cnfn as_ulong4(double3);
7151ulong4 __ovld __cnfn as_ulong4(double4);
7152ulong8 __ovld __cnfn as_ulong8(double8);
7153ulong16 __ovld __cnfn as_ulong16(double16);
7154float2 __ovld __cnfn as_float2(double);
7155float3 __ovld __cnfn as_float3(double2);
7156float4 __ovld __cnfn as_float4(double2);
7157float8 __ovld __cnfn as_float8(double3);
7158float8 __ovld __cnfn as_float8(double4);
7159float16 __ovld __cnfn as_float16(double8);
7160double __ovld __cnfn as_double(char8);
7161double __ovld __cnfn as_double(uchar8);
7162double __ovld __cnfn as_double(short3);
7163double __ovld __cnfn as_double(short4);
7164double __ovld __cnfn as_double(ushort3);
7165double __ovld __cnfn as_double(ushort4);
7166double __ovld __cnfn as_double(int2);
7167double __ovld __cnfn as_double(uint2);
7168double __ovld __cnfn as_double(long);
7169double __ovld __cnfn as_double(ulong);
7170double __ovld __cnfn as_double(float2);
7171double __ovld __cnfn as_double(double);
7172double2 __ovld __cnfn as_double2(char16);
7173double2 __ovld __cnfn as_double2(uchar16);
7174double2 __ovld __cnfn as_double2(short8);
7175double2 __ovld __cnfn as_double2(ushort8);
7176double2 __ovld __cnfn as_double2(int3);
7177double2 __ovld __cnfn as_double2(int4);
7178double2 __ovld __cnfn as_double2(uint3);
7179double2 __ovld __cnfn as_double2(uint4);
7180double2 __ovld __cnfn as_double2(long2);
7181double2 __ovld __cnfn as_double2(ulong2);
7182double2 __ovld __cnfn as_double2(float3);
7183double2 __ovld __cnfn as_double2(float4);
7184double2 __ovld __cnfn as_double2(double2);
7185double3 __ovld __cnfn as_double3(short16);
7186double3 __ovld __cnfn as_double3(ushort16);
7187double3 __ovld __cnfn as_double3(int8);
7188double3 __ovld __cnfn as_double3(uint8);
7189double3 __ovld __cnfn as_double3(long3);
7190double3 __ovld __cnfn as_double3(long4);
7191double3 __ovld __cnfn as_double3(ulong3);
7192double3 __ovld __cnfn as_double3(ulong4);
7193double3 __ovld __cnfn as_double3(float8);
7194double3 __ovld __cnfn as_double3(double3);
7195double3 __ovld __cnfn as_double3(double4);
7196double4 __ovld __cnfn as_double4(short16);
7197double4 __ovld __cnfn as_double4(ushort16);
7198double4 __ovld __cnfn as_double4(int8);
7199double4 __ovld __cnfn as_double4(uint8);
7200double4 __ovld __cnfn as_double4(long3);
7201double4 __ovld __cnfn as_double4(long4);
7202double4 __ovld __cnfn as_double4(ulong3);
7203double4 __ovld __cnfn as_double4(ulong4);
7204double4 __ovld __cnfn as_double4(float8);
7205double4 __ovld __cnfn as_double4(double3);
7206double4 __ovld __cnfn as_double4(double4);
7207double8 __ovld __cnfn as_double8(int16);
7208double8 __ovld __cnfn as_double8(uint16);
7209double8 __ovld __cnfn as_double8(long8);
7210double8 __ovld __cnfn as_double8(ulong8);
7211double8 __ovld __cnfn as_double8(float16);
7212double8 __ovld __cnfn as_double8(double8);
7213double16 __ovld __cnfn as_double16(long16);
7214double16 __ovld __cnfn as_double16(ulong16);
7215double16 __ovld __cnfn as_double16(double16);
6651#define as_double(x) __builtin_astype((x), double)
6652#define as_double2(x) __builtin_astype((x), double2)
6653#define as_double3(x) __builtin_astype((x), double3)
6654#define as_double4(x) __builtin_astype((x), double4)
6655#define as_double8(x) __builtin_astype((x), double8)
6656#define as_double16(x) __builtin_astype((x), double16)
72166657#endif //cl_khr_fp64
72176658
72186659#ifdef cl_khr_fp16
7219char2 __ovld __cnfn as_char2(half);
7220char3 __ovld __cnfn as_char3(half2);
7221char4 __ovld __cnfn as_char4(half2);
7222char8 __ovld __cnfn as_char8(half3);
7223char8 __ovld __cnfn as_char8(half4);
7224char16 __ovld __cnfn as_char16(half8);
7225uchar2 __ovld __cnfn as_uchar2(half);
7226uchar3 __ovld __cnfn as_uchar3(half2);
7227uchar4 __ovld __cnfn as_uchar4(half2);
7228uchar8 __ovld __cnfn as_uchar8(half3);
7229uchar8 __ovld __cnfn as_uchar8(half4);
7230uchar16 __ovld __cnfn as_uchar16(half8);
7231short __ovld __cnfn as_short(half);
7232short2 __ovld __cnfn as_short2(half2);
7233short3 __ovld __cnfn as_short3(half3);
7234short3 __ovld __cnfn as_short3(half4);
7235short4 __ovld __cnfn as_short4(half3);
7236short4 __ovld __cnfn as_short4(half4);
7237short8 __ovld __cnfn as_short8(half8);
7238short16 __ovld __cnfn as_short16(half16);
7239ushort __ovld __cnfn as_ushort(half);
7240ushort2 __ovld __cnfn as_ushort2(half2);
7241ushort3 __ovld __cnfn as_ushort3(half3);
7242ushort3 __ovld __cnfn as_ushort3(half4);
7243ushort4 __ovld __cnfn as_ushort4(half3);
7244ushort4 __ovld __cnfn as_ushort4(half4);
7245ushort8 __ovld __cnfn as_ushort8(half8);
7246ushort16 __ovld __cnfn as_ushort16(half16);
7247int __ovld __cnfn as_int(half2);
7248int2 __ovld __cnfn as_int2(half3);
7249int2 __ovld __cnfn as_int2(half4);
7250int3 __ovld __cnfn as_int3(half8);
7251int4 __ovld __cnfn as_int4(half8);
7252int8 __ovld __cnfn as_int8(half16);
7253uint __ovld __cnfn as_uint(half2);
7254uint2 __ovld __cnfn as_uint2(half3);
7255uint2 __ovld __cnfn as_uint2(half4);
7256uint3 __ovld __cnfn as_uint3(half8);
7257uint4 __ovld __cnfn as_uint4(half8);
7258uint8 __ovld __cnfn as_uint8(half16);
7259long __ovld __cnfn as_long(half3);
7260long __ovld __cnfn as_long(half4);
7261long2 __ovld __cnfn as_long2(half8);
7262long3 __ovld __cnfn as_long3(half16);
7263long4 __ovld __cnfn as_long4(half16);
7264ulong __ovld __cnfn as_ulong(half3);
7265ulong __ovld __cnfn as_ulong(half4);
7266ulong2 __ovld __cnfn as_ulong2(half8);
7267ulong3 __ovld __cnfn as_ulong3(half16);
7268ulong4 __ovld __cnfn as_ulong4(half16);
7269half __ovld __cnfn as_half(char2);
7270half __ovld __cnfn as_half(uchar2);
7271half __ovld __cnfn as_half(short);
7272half __ovld __cnfn as_half(ushort);
7273half __ovld __cnfn as_half(half);
7274half2 __ovld __cnfn as_half2(char3);
7275half2 __ovld __cnfn as_half2(char4);
7276half2 __ovld __cnfn as_half2(uchar3);
7277half2 __ovld __cnfn as_half2(uchar4);
7278half2 __ovld __cnfn as_half2(short2);
7279half2 __ovld __cnfn as_half2(ushort2);
7280half2 __ovld __cnfn as_half2(int);
7281half2 __ovld __cnfn as_half2(uint);
7282half2 __ovld __cnfn as_half2(half2);
7283half2 __ovld __cnfn as_half2(float);
7284half3 __ovld __cnfn as_half3(char8);
7285half3 __ovld __cnfn as_half3(uchar8);
7286half3 __ovld __cnfn as_half3(short3);
7287half3 __ovld __cnfn as_half3(short4);
7288half3 __ovld __cnfn as_half3(ushort3);
7289half3 __ovld __cnfn as_half3(ushort4);
7290half3 __ovld __cnfn as_half3(int2);
7291half3 __ovld __cnfn as_half3(uint2);
7292half3 __ovld __cnfn as_half3(long);
7293half3 __ovld __cnfn as_half3(ulong);
7294half3 __ovld __cnfn as_half3(half3);
7295half3 __ovld __cnfn as_half3(half4);
7296half3 __ovld __cnfn as_half3(float2);
7297half4 __ovld __cnfn as_half4(char8);
7298half4 __ovld __cnfn as_half4(uchar8);
7299half4 __ovld __cnfn as_half4(short3);
7300half4 __ovld __cnfn as_half4(short4);
7301half4 __ovld __cnfn as_half4(ushort3);
7302half4 __ovld __cnfn as_half4(ushort4);
7303half4 __ovld __cnfn as_half4(int2);
7304half4 __ovld __cnfn as_half4(uint2);
7305half4 __ovld __cnfn as_half4(long);
7306half4 __ovld __cnfn as_half4(ulong);
7307half4 __ovld __cnfn as_half4(half3);
7308half4 __ovld __cnfn as_half4(half4);
7309half4 __ovld __cnfn as_half4(float2);
7310half8 __ovld __cnfn as_half8(char16);
7311half8 __ovld __cnfn as_half8(uchar16);
7312half8 __ovld __cnfn as_half8(short8);
7313half8 __ovld __cnfn as_half8(ushort8);
7314half8 __ovld __cnfn as_half8(int3);
7315half8 __ovld __cnfn as_half8(int4);
7316half8 __ovld __cnfn as_half8(uint3);
7317half8 __ovld __cnfn as_half8(uint4);
7318half8 __ovld __cnfn as_half8(long2);
7319half8 __ovld __cnfn as_half8(ulong2);
7320half8 __ovld __cnfn as_half8(half8);
7321half8 __ovld __cnfn as_half8(float3);
7322half8 __ovld __cnfn as_half8(float4);
7323half16 __ovld __cnfn as_half16(short16);
7324half16 __ovld __cnfn as_half16(ushort16);
7325half16 __ovld __cnfn as_half16(int8);
7326half16 __ovld __cnfn as_half16(uint8);
7327half16 __ovld __cnfn as_half16(long3);
7328half16 __ovld __cnfn as_half16(long4);
7329half16 __ovld __cnfn as_half16(ulong3);
7330half16 __ovld __cnfn as_half16(ulong4);
7331half16 __ovld __cnfn as_half16(half16);
7332half16 __ovld __cnfn as_half16(float8);
7333float __ovld __cnfn as_float(half2);
7334float2 __ovld __cnfn as_float2(half3);
7335float2 __ovld __cnfn as_float2(half4);
7336float3 __ovld __cnfn as_float3(half8);
7337float4 __ovld __cnfn as_float4(half8);
7338float8 __ovld __cnfn as_float8(half16);
7339
7340#ifdef cl_khr_fp64
7341half3 __ovld __cnfn as_half3(double);
7342half4 __ovld __cnfn as_half4(double);
7343half8 __ovld __cnfn as_half8(double2);
7344half16 __ovld __cnfn as_half16(double3);
7345half16 __ovld __cnfn as_half16(double4);
7346double __ovld __cnfn as_double(half3);
7347double __ovld __cnfn as_double(half4);
7348double2 __ovld __cnfn as_double2(half8);
7349double3 __ovld __cnfn as_double3(half16);
7350double4 __ovld __cnfn as_double4(half16);
7351#endif //cl_khr_fp64
6660#define as_half(x) __builtin_astype((x), half)
6661#define as_half2(x) __builtin_astype((x), half2)
6662#define as_half3(x) __builtin_astype((x), half3)
6663#define as_half4(x) __builtin_astype((x), half4)
6664#define as_half8(x) __builtin_astype((x), half8)
6665#define as_half16(x) __builtin_astype((x), half16)
73526666#endif //cl_khr_fp16
73536667
73546668// OpenCL v1.1 s6.9, v1.2/2.0 s6.10 - Function qualifiers
......@@ -14389,10 +13703,10 @@ float __ovld atomic_xchg(volatile __local float *p, float val);
1438913703
1439013704#if defined(cl_khr_global_int32_base_atomics)
1439113705int __ovld atom_xchg(volatile __global int *p, int val);
14392int __ovld atom_xchg(volatile __local int *p, int val);
13706unsigned int __ovld atom_xchg(volatile __global unsigned int *p, unsigned int val);
1439313707#endif
1439413708#if defined(cl_khr_local_int32_base_atomics)
14395unsigned int __ovld atom_xchg(volatile __global unsigned int *p, unsigned int val);
13709int __ovld atom_xchg(volatile __local int *p, int val);
1439613710unsigned int __ovld atom_xchg(volatile __local unsigned int *p, unsigned int val);
1439713711#endif
1439813712
......@@ -14509,8 +13823,6 @@ unsigned int __ovld atom_min(volatile __local unsigned int *p, unsigned int val)
1450913823#if defined(cl_khr_int64_extended_atomics)
1451013824long __ovld atom_min(volatile __global long *p, long val);
1451113825unsigned long __ovld atom_min(volatile __global unsigned long *p, unsigned long val);
14512#endif
14513#if defined(cl_khr_local_int32_extended_atomics)
1451413826long __ovld atom_min(volatile __local long *p, long val);
1451513827unsigned long __ovld atom_min(volatile __local unsigned long *p, unsigned long val);
1451613828#endif
......@@ -15650,6 +14962,7 @@ float __purefn __ovld read_imagef(read_only image2d_array_msaa_depth_t image, in
1565014962#endif //cl_khr_gl_msaa_sharing
1565114963
1565214964// OpenCL Extension v2.0 s9.18 - Mipmaps
14965#if __OPENCL_C_VERSION__ >= CL_VERSION_2_0
1565314966#ifdef cl_khr_mipmap_image
1565414967
1565514968float4 __purefn __ovld read_imagef(read_only image1d_t image, sampler_t sampler, float coord, float lod);
......@@ -15725,6 +15038,7 @@ int4 __purefn __ovld read_imagei(read_only image3d_t image, sampler_t sampler, f
1572515038uint4 __purefn __ovld read_imageui(read_only image3d_t image, sampler_t sampler, float4 coord, float lod);
1572615039
1572715040#endif //cl_khr_mipmap_image
15041#endif //__OPENCL_C_VERSION__ >= CL_VERSION_2_0
1572815042
1572915043/**
1573015044* Sampler-less Image Access
......@@ -15823,6 +15137,7 @@ float __purefn __ovld read_imagef(read_write image2d_msaa_depth_t image, int2 co
1582315137float __purefn __ovld read_imagef(read_write image2d_array_msaa_depth_t image, int4 coord, int sample);
1582415138#endif //cl_khr_gl_msaa_sharing
1582515139
15140#if __OPENCL_C_VERSION__ >= CL_VERSION_2_0
1582615141#ifdef cl_khr_mipmap_image
1582715142float4 __purefn __ovld read_imagef(read_write image1d_t image, sampler_t sampler, float coord, float lod);
1582815143int4 __purefn __ovld read_imagei(read_write image1d_t image, sampler_t sampler, float coord, float lod);
......@@ -15896,6 +15211,7 @@ float4 __purefn __ovld read_imagef(read_write image3d_t image, sampler_t sampler
1589615211int4 __purefn __ovld read_imagei(read_write image3d_t image, sampler_t sampler, float4 coord, float lod);
1589715212uint4 __purefn __ovld read_imageui(read_write image3d_t image, sampler_t sampler, float4 coord, float lod);
1589815213#endif //cl_khr_mipmap_image
15214#endif //__OPENCL_C_VERSION__ >= CL_VERSION_2_0
1589915215
1590015216// Image read functions returning half4 type
1590115217#ifdef cl_khr_fp16
......@@ -15995,9 +15311,11 @@ void __ovld write_imagef(write_only image1d_array_t image_array, int2 coord, flo
1599515311void __ovld write_imagei(write_only image1d_array_t image_array, int2 coord, int4 color);
1599615312void __ovld write_imageui(write_only image1d_array_t image_array, int2 coord, uint4 color);
1599715313
15314#ifdef cl_khr_3d_image_writes
1599815315void __ovld write_imagef(write_only image3d_t image, int4 coord, float4 color);
1599915316void __ovld write_imagei(write_only image3d_t image, int4 coord, int4 color);
1600015317void __ovld write_imageui(write_only image3d_t image, int4 coord, uint4 color);
15318#endif
1600115319
1600215320#ifdef cl_khr_depth_images
1600315321void __ovld write_imagef(write_only image2d_depth_t image, int2 coord, float color);
......@@ -16005,6 +15323,7 @@ void __ovld write_imagef(write_only image2d_array_depth_t image, int4 coord, flo
1600515323#endif //cl_khr_depth_images
1600615324
1600715325// OpenCL Extension v2.0 s9.18 - Mipmaps
15326#if __OPENCL_C_VERSION__ >= CL_VERSION_2_0
1600815327#ifdef cl_khr_mipmap_image
1600915328void __ovld write_imagef(write_only image1d_t image, int coord, int lod, float4 color);
1601015329void __ovld write_imagei(write_only image1d_t image, int coord, int lod, int4 color);
......@@ -16025,16 +15344,21 @@ void __ovld write_imageui(write_only image2d_array_t image_array, int4 coord, in
1602515344void __ovld write_imagef(write_only image2d_depth_t image, int2 coord, int lod, float color);
1602615345void __ovld write_imagef(write_only image2d_array_depth_t image, int4 coord, int lod, float color);
1602715346
15347#ifdef cl_khr_3d_image_writes
1602815348void __ovld write_imagef(write_only image3d_t image, int4 coord, int lod, float4 color);
1602915349void __ovld write_imagei(write_only image3d_t image, int4 coord, int lod, int4 color);
1603015350void __ovld write_imageui(write_only image3d_t image, int4 coord, int lod, uint4 color);
15351#endif
1603115352#endif //cl_khr_mipmap_image
15353#endif //__OPENCL_C_VERSION__ >= CL_VERSION_2_0
1603215354
1603315355// Image write functions for half4 type
1603415356#ifdef cl_khr_fp16
1603515357void __ovld write_imageh(write_only image1d_t image, int coord, half4 color);
1603615358void __ovld write_imageh(write_only image2d_t image, int2 coord, half4 color);
15359#ifdef cl_khr_3d_image_writes
1603715360void __ovld write_imageh(write_only image3d_t image, int4 coord, half4 color);
15361#endif
1603815362void __ovld write_imageh(write_only image1d_array_t image, int2 coord, half4 color);
1603915363void __ovld write_imageh(write_only image2d_array_t image, int4 coord, half4 color);
1604015364void __ovld write_imageh(write_only image1d_buffer_t image, int coord, half4 color);
......@@ -16062,15 +15386,18 @@ void __ovld write_imagef(read_write image1d_array_t image_array, int2 coord, flo
1606215386void __ovld write_imagei(read_write image1d_array_t image_array, int2 coord, int4 color);
1606315387void __ovld write_imageui(read_write image1d_array_t image_array, int2 coord, uint4 color);
1606415388
15389#ifdef cl_khr_3d_image_writes
1606515390void __ovld write_imagef(read_write image3d_t image, int4 coord, float4 color);
1606615391void __ovld write_imagei(read_write image3d_t image, int4 coord, int4 color);
1606715392void __ovld write_imageui(read_write image3d_t image, int4 coord, uint4 color);
15393#endif
1606815394
1606915395#ifdef cl_khr_depth_images
1607015396void __ovld write_imagef(read_write image2d_depth_t image, int2 coord, float color);
1607115397void __ovld write_imagef(read_write image2d_array_depth_t image, int4 coord, float color);
1607215398#endif //cl_khr_depth_images
1607315399
15400#if __OPENCL_C_VERSION__ >= CL_VERSION_2_0
1607415401#ifdef cl_khr_mipmap_image
1607515402void __ovld write_imagef(read_write image1d_t image, int coord, int lod, float4 color);
1607615403void __ovld write_imagei(read_write image1d_t image, int coord, int lod, int4 color);
......@@ -16091,16 +15418,21 @@ void __ovld write_imageui(read_write image2d_array_t image_array, int4 coord, in
1609115418void __ovld write_imagef(read_write image2d_depth_t image, int2 coord, int lod, float color);
1609215419void __ovld write_imagef(read_write image2d_array_depth_t image, int4 coord, int lod, float color);
1609315420
15421#ifdef cl_khr_3d_image_writes
1609415422void __ovld write_imagef(read_write image3d_t image, int4 coord, int lod, float4 color);
1609515423void __ovld write_imagei(read_write image3d_t image, int4 coord, int lod, int4 color);
1609615424void __ovld write_imageui(read_write image3d_t image, int4 coord, int lod, uint4 color);
15425#endif
1609715426#endif //cl_khr_mipmap_image
15427#endif //__OPENCL_C_VERSION__ >= CL_VERSION_2_0
1609815428
1609915429// Image write functions for half4 type
1610015430#ifdef cl_khr_fp16
1610115431void __ovld write_imageh(read_write image1d_t image, int coord, half4 color);
1610215432void __ovld write_imageh(read_write image2d_t image, int2 coord, half4 color);
15433#ifdef cl_khr_3d_image_writes
1610315434void __ovld write_imageh(read_write image3d_t image, int4 coord, half4 color);
15435#endif
1610415436void __ovld write_imageh(read_write image1d_array_t image, int2 coord, half4 color);
1610515437void __ovld write_imageh(read_write image2d_array_t image, int4 coord, half4 color);
1610615438void __ovld write_imageh(read_write image1d_buffer_t image, int coord, half4 color);
......@@ -16118,7 +15450,9 @@ void __ovld write_imageh(read_write image1d_buffer_t image, int coord, half4 col
1611815450int __ovld __cnfn get_image_width(read_only image1d_t image);
1611915451int __ovld __cnfn get_image_width(read_only image1d_buffer_t image);
1612015452int __ovld __cnfn get_image_width(read_only image2d_t image);
15453#ifdef cl_khr_3d_image_writes
1612115454int __ovld __cnfn get_image_width(read_only image3d_t image);
15455#endif
1612215456int __ovld __cnfn get_image_width(read_only image1d_array_t image);
1612315457int __ovld __cnfn get_image_width(read_only image2d_array_t image);
1612415458#ifdef cl_khr_depth_images
......@@ -16135,7 +15469,9 @@ int __ovld __cnfn get_image_width(read_only image2d_array_msaa_depth_t image);
1613515469int __ovld __cnfn get_image_width(write_only image1d_t image);
1613615470int __ovld __cnfn get_image_width(write_only image1d_buffer_t image);
1613715471int __ovld __cnfn get_image_width(write_only image2d_t image);
15472#ifdef cl_khr_3d_image_writes
1613815473int __ovld __cnfn get_image_width(write_only image3d_t image);
15474#endif
1613915475int __ovld __cnfn get_image_width(write_only image1d_array_t image);
1614015476int __ovld __cnfn get_image_width(write_only image2d_array_t image);
1614115477#ifdef cl_khr_depth_images
......@@ -16186,7 +15522,9 @@ int __ovld __cnfn get_image_height(read_only image2d_array_msaa_depth_t image);
1618615522#endif //cl_khr_gl_msaa_sharing
1618715523
1618815524int __ovld __cnfn get_image_height(write_only image2d_t image);
15525#ifdef cl_khr_3d_image_writes
1618915526int __ovld __cnfn get_image_height(write_only image3d_t image);
15527#endif
1619015528int __ovld __cnfn get_image_height(write_only image2d_array_t image);
1619115529#ifdef cl_khr_depth_images
1619215530int __ovld __cnfn get_image_height(write_only image2d_depth_t image);
......@@ -16220,13 +15558,16 @@ int __ovld __cnfn get_image_height(read_write image2d_array_msaa_depth_t image);
1622015558 */
1622115559int __ovld __cnfn get_image_depth(read_only image3d_t image);
1622215560
15561#ifdef cl_khr_3d_image_writes
1622315562int __ovld __cnfn get_image_depth(write_only image3d_t image);
15563#endif
1622415564
1622515565#if __OPENCL_C_VERSION__ >= CL_VERSION_2_0
1622615566int __ovld __cnfn get_image_depth(read_write image3d_t image);
1622715567#endif //__OPENCL_C_VERSION__ >= CL_VERSION_2_0
1622815568
1622915569// OpenCL Extension v2.0 s9.18 - Mipmaps
15570#if __OPENCL_C_VERSION__ >= CL_VERSION_2_0
1623015571#ifdef cl_khr_mipmap_image
1623115572/**
1623215573 * Return the image miplevels.
......@@ -16238,13 +15579,13 @@ int __ovld get_image_num_mip_levels(read_only image3d_t image);
1623815579
1623915580int __ovld get_image_num_mip_levels(write_only image1d_t image);
1624015581int __ovld get_image_num_mip_levels(write_only image2d_t image);
15582#ifdef cl_khr_3d_image_writes
1624115583int __ovld get_image_num_mip_levels(write_only image3d_t image);
15584#endif
1624215585
16243#if __OPENCL_C_VERSION__ >= CL_VERSION_2_0
1624415586int __ovld get_image_num_mip_levels(read_write image1d_t image);
1624515587int __ovld get_image_num_mip_levels(read_write image2d_t image);
1624615588int __ovld get_image_num_mip_levels(read_write image3d_t image);
16247#endif //__OPENCL_C_VERSION__ >= CL_VERSION_2_0
1624815589
1624915590int __ovld get_image_num_mip_levels(read_only image1d_array_t image);
1625015591int __ovld get_image_num_mip_levels(read_only image2d_array_t image);
......@@ -16256,14 +15597,13 @@ int __ovld get_image_num_mip_levels(write_only image2d_array_t image);
1625615597int __ovld get_image_num_mip_levels(write_only image2d_array_depth_t image);
1625715598int __ovld get_image_num_mip_levels(write_only image2d_depth_t image);
1625815599
16259#if __OPENCL_C_VERSION__ >= CL_VERSION_2_0
1626015600int __ovld get_image_num_mip_levels(read_write image1d_array_t image);
1626115601int __ovld get_image_num_mip_levels(read_write image2d_array_t image);
1626215602int __ovld get_image_num_mip_levels(read_write image2d_array_depth_t image);
1626315603int __ovld get_image_num_mip_levels(read_write image2d_depth_t image);
16264#endif //__OPENCL_C_VERSION__ >= CL_VERSION_2_0
1626515604
1626615605#endif //cl_khr_mipmap_image
15606#endif //__OPENCL_C_VERSION__ >= CL_VERSION_2_0
1626715607
1626815608/**
1626915609 * Return the channel data type. Valid values are:
......@@ -16324,7 +15664,9 @@ int __ovld __cnfn get_image_channel_data_type(read_only image2d_array_msaa_depth
1632415664int __ovld __cnfn get_image_channel_data_type(write_only image1d_t image);
1632515665int __ovld __cnfn get_image_channel_data_type(write_only image1d_buffer_t image);
1632615666int __ovld __cnfn get_image_channel_data_type(write_only image2d_t image);
15667#ifdef cl_khr_3d_image_writes
1632715668int __ovld __cnfn get_image_channel_data_type(write_only image3d_t image);
15669#endif
1632815670int __ovld __cnfn get_image_channel_data_type(write_only image1d_array_t image);
1632915671int __ovld __cnfn get_image_channel_data_type(write_only image2d_array_t image);
1633015672#ifdef cl_khr_depth_images
......@@ -16418,7 +15760,9 @@ int __ovld __cnfn get_image_channel_order(read_only image2d_array_msaa_depth_t i
1641815760int __ovld __cnfn get_image_channel_order(write_only image1d_t image);
1641915761int __ovld __cnfn get_image_channel_order(write_only image1d_buffer_t image);
1642015762int __ovld __cnfn get_image_channel_order(write_only image2d_t image);
15763#ifdef cl_khr_3d_image_writes
1642115764int __ovld __cnfn get_image_channel_order(write_only image3d_t image);
15765#endif
1642215766int __ovld __cnfn get_image_channel_order(write_only image1d_array_t image);
1642315767int __ovld __cnfn get_image_channel_order(write_only image2d_array_t image);
1642415768#ifdef cl_khr_depth_images
......@@ -16504,7 +15848,9 @@ int2 __ovld __cnfn get_image_dim(read_write image2d_array_msaa_depth_t image);
1650415848 * component and the w component is 0.
1650515849 */
1650615850int4 __ovld __cnfn get_image_dim(read_only image3d_t image);
15851#ifdef cl_khr_3d_image_writes
1650715852int4 __ovld __cnfn get_image_dim(write_only image3d_t image);
15853#endif
1650815854#if __OPENCL_C_VERSION__ >= CL_VERSION_2_0
1650915855int4 __ovld __cnfn get_image_dim(read_write image3d_t image);
1651015856#endif //__OPENCL_C_VERSION__ >= CL_VERSION_2_0
......@@ -16714,16 +16060,12 @@ typedef int clk_profiling_info;
1671416060
1671516061#define MAX_WORK_DIM 3
1671616062
16717// ToDo: Remove definition of ndrange_t in Clang as an opaque type and add back
16718// the following ndrange_t definition.
16719#if 0
1672016063typedef struct {
1672116064 unsigned int workDimension;
1672216065 size_t globalWorkOffset[MAX_WORK_DIM];
1672316066 size_t globalWorkSize[MAX_WORK_DIM];
1672416067 size_t localWorkSize[MAX_WORK_DIM];
1672516068} ndrange_t;
16726#endif
1672716069
1672816070ndrange_t __ovld ndrange_1D(size_t);
1672916071ndrange_t __ovld ndrange_1D(size_t, size_t);
c_headers/pmmintrin.h+7-13
......@@ -31,9 +31,11 @@
3131 __attribute__((__always_inline__, __nodebug__, __target__("sse3")))
3232
3333/// \brief Loads data from an unaligned memory location to elements in a 128-bit
34/// vector. If the address of the data is not 16-byte aligned, the
35/// instruction may read two adjacent aligned blocks of memory to retrieve
36/// the requested data.
34/// vector.
35///
36/// If the address of the data is not 16-byte aligned, the instruction may
37/// read two adjacent aligned blocks of memory to retrieve the requested
38/// data.
3739///
3840/// \headerfile <x86intrin.h>
3941///
......@@ -115,7 +117,7 @@ _mm_hsub_ps(__m128 __a, __m128 __b)
115117
116118/// \brief Moves and duplicates high-order (odd-indexed) values from a 128-bit
117119/// vector of [4 x float] to float values stored in a 128-bit vector of
118/// [4 x float].
120/// [4 x float].
119121///
120122/// \headerfile <x86intrin.h>
121123///
......@@ -136,7 +138,7 @@ _mm_movehdup_ps(__m128 __a)
136138}
137139
138140/// \brief Duplicates low-order (even-indexed) values from a 128-bit vector of
139/// [4 x float] to float values stored in a 128-bit vector of [4 x float].
141/// [4 x float] to float values stored in a 128-bit vector of [4 x float].
140142///
141143/// \headerfile <x86intrin.h>
142144///
......@@ -257,14 +259,6 @@ _mm_movedup_pd(__m128d __a)
257259 return __builtin_shufflevector((__v2df)__a, (__v2df)__a, 0, 0);
258260}
259261
260#define _MM_DENORMALS_ZERO_ON (0x0040)
261#define _MM_DENORMALS_ZERO_OFF (0x0000)
262
263#define _MM_DENORMALS_ZERO_MASK (0x0040)
264
265#define _MM_GET_DENORMALS_ZERO_MODE() (_mm_getcsr() & _MM_DENORMALS_ZERO_MASK)
266#define _MM_SET_DENORMALS_ZERO_MODE(x) (_mm_setcsr((_mm_getcsr() & ~_MM_DENORMALS_ZERO_MASK) | (x)))
267
268262/// \brief Establishes a linear address memory range to be monitored and puts
269263/// the processor in the monitor event pending state. Data stored in the
270264/// monitored address range causes the processor to exit the pending state.
c_headers/prfchwintrin.h+26
......@@ -29,12 +29,38 @@
2929#define __PRFCHWINTRIN_H
3030
3131#if defined(__PRFCHW__) || defined(__3dNOW__)
32/// \brief Loads a memory sequence containing the specified memory address into
33/// all data cache levels. The cache-coherency state is set to exclusive.
34/// Data can be read from and written to the cache line without additional
35/// delay.
36///
37/// \headerfile <x86intrin.h>
38///
39/// This intrinsic corresponds to the \c PREFETCHT0 instruction.
40///
41/// \param __P
42/// A pointer specifying the memory address to be prefetched.
3243static __inline__ void __attribute__((__always_inline__, __nodebug__))
3344_m_prefetch(void *__P)
3445{
3546 __builtin_prefetch (__P, 0, 3 /* _MM_HINT_T0 */);
3647}
3748
49/// \brief Loads a memory sequence containing the specified memory address into
50/// the L1 data cache and sets the cache-coherency to modified. This
51/// provides a hint to the processor that the cache line will be modified.
52/// It is intended for use when the cache line will be written to shortly
53/// after the prefetch is performed.
54///
55/// Note that the effect of this intrinsic is dependent on the processor
56/// implementation.
57///
58/// \headerfile <x86intrin.h>
59///
60/// This intrinsic corresponds to the \c PREFETCHW instruction.
61///
62/// \param __P
63/// A pointer specifying the memory address to be prefetched.
3864static __inline__ void __attribute__((__always_inline__, __nodebug__))
3965_m_prefetchw(void *__P)
4066{
c_headers/smmintrin.h+1959-1
......@@ -46,37 +46,379 @@
4646#define _MM_FROUND_RINT (_MM_FROUND_RAISE_EXC | _MM_FROUND_CUR_DIRECTION)
4747#define _MM_FROUND_NEARBYINT (_MM_FROUND_NO_EXC | _MM_FROUND_CUR_DIRECTION)
4848
49/// \brief Rounds up each element of the 128-bit vector of [4 x float] to an
50/// integer and returns the rounded values in a 128-bit vector of
51/// [4 x float].
52///
53/// \headerfile <x86intrin.h>
54///
55/// \code
56/// __m128 _mm_ceil_ps(__m128 X);
57/// \endcode
58///
59/// This intrinsic corresponds to the <c> VROUNDPS / ROUNDPS </c> instruction.
60///
61/// \param X
62/// A 128-bit vector of [4 x float] values to be rounded up.
63/// \returns A 128-bit vector of [4 x float] containing the rounded values.
4964#define _mm_ceil_ps(X) _mm_round_ps((X), _MM_FROUND_CEIL)
65
66/// \brief Rounds up each element of the 128-bit vector of [2 x double] to an
67/// integer and returns the rounded values in a 128-bit vector of
68/// [2 x double].
69///
70/// \headerfile <x86intrin.h>
71///
72/// \code
73/// __m128d _mm_ceil_pd(__m128d X);
74/// \endcode
75///
76/// This intrinsic corresponds to the <c> VROUNDPD / ROUNDPD </c> instruction.
77///
78/// \param X
79/// A 128-bit vector of [2 x double] values to be rounded up.
80/// \returns A 128-bit vector of [2 x double] containing the rounded values.
5081#define _mm_ceil_pd(X) _mm_round_pd((X), _MM_FROUND_CEIL)
82
83/// \brief Copies three upper elements of the first 128-bit vector operand to
84/// the corresponding three upper elements of the 128-bit result vector of
85/// [4 x float]. Rounds up the lowest element of the second 128-bit vector
86/// operand to an integer and copies it to the lowest element of the 128-bit
87/// result vector of [4 x float].
88///
89/// \headerfile <x86intrin.h>
90///
91/// \code
92/// __m128 _mm_ceil_ss(__m128 X, __m128 Y);
93/// \endcode
94///
95/// This intrinsic corresponds to the <c> VROUNDSS / ROUNDSS </c> instruction.
96///
97/// \param X
98/// A 128-bit vector of [4 x float]. The values stored in bits [127:32] are
99/// copied to the corresponding bits of the result.
100/// \param Y
101/// A 128-bit vector of [4 x float]. The value stored in bits [31:0] is
102/// rounded up to the nearest integer and copied to the corresponding bits
103/// of the result.
104/// \returns A 128-bit vector of [4 x float] containing the copied and rounded
105/// values.
51106#define _mm_ceil_ss(X, Y) _mm_round_ss((X), (Y), _MM_FROUND_CEIL)
107
108/// \brief Copies the upper element of the first 128-bit vector operand to the
109/// corresponding upper element of the 128-bit result vector of [2 x double].
110/// Rounds up the lower element of the second 128-bit vector operand to an
111/// integer and copies it to the lower element of the 128-bit result vector
112/// of [2 x double].
113///
114/// \headerfile <x86intrin.h>
115///
116/// \code
117/// __m128d _mm_ceil_sd(__m128d X, __m128d Y);
118/// \endcode
119///
120/// This intrinsic corresponds to the <c> VROUNDSD / ROUNDSD </c> instruction.
121///
122/// \param X
123/// A 128-bit vector of [2 x double]. The value stored in bits [127:64] is
124/// copied to the corresponding bits of the result.
125/// \param Y
126/// A 128-bit vector of [2 x double]. The value stored in bits [63:0] is
127/// rounded up to the nearest integer and copied to the corresponding bits
128/// of the result.
129/// \returns A 128-bit vector of [2 x double] containing the copied and rounded
130/// values.
52131#define _mm_ceil_sd(X, Y) _mm_round_sd((X), (Y), _MM_FROUND_CEIL)
53132
133/// \brief Rounds down each element of the 128-bit vector of [4 x float] to an
134/// an integer and returns the rounded values in a 128-bit vector of
135/// [4 x float].
136///
137/// \headerfile <x86intrin.h>
138///
139/// \code
140/// __m128 _mm_floor_ps(__m128 X);
141/// \endcode
142///
143/// This intrinsic corresponds to the <c> VROUNDPS / ROUNDPS </c> instruction.
144///
145/// \param X
146/// A 128-bit vector of [4 x float] values to be rounded down.
147/// \returns A 128-bit vector of [4 x float] containing the rounded values.
54148#define _mm_floor_ps(X) _mm_round_ps((X), _MM_FROUND_FLOOR)
149
150/// \brief Rounds down each element of the 128-bit vector of [2 x double] to an
151/// integer and returns the rounded values in a 128-bit vector of
152/// [2 x double].
153///
154/// \headerfile <x86intrin.h>
155///
156/// \code
157/// __m128d _mm_floor_pd(__m128d X);
158/// \endcode
159///
160/// This intrinsic corresponds to the <c> VROUNDPD / ROUNDPD </c> instruction.
161///
162/// \param X
163/// A 128-bit vector of [2 x double].
164/// \returns A 128-bit vector of [2 x double] containing the rounded values.
55165#define _mm_floor_pd(X) _mm_round_pd((X), _MM_FROUND_FLOOR)
166
167/// \brief Copies three upper elements of the first 128-bit vector operand to
168/// the corresponding three upper elements of the 128-bit result vector of
169/// [4 x float]. Rounds down the lowest element of the second 128-bit vector
170/// operand to an integer and copies it to the lowest element of the 128-bit
171/// result vector of [4 x float].
172///
173/// \headerfile <x86intrin.h>
174///
175/// \code
176/// __m128 _mm_floor_ss(__m128 X, __m128 Y);
177/// \endcode
178///
179/// This intrinsic corresponds to the <c> VROUNDSS / ROUNDSS </c> instruction.
180///
181/// \param X
182/// A 128-bit vector of [4 x float]. The values stored in bits [127:32] are
183/// copied to the corresponding bits of the result.
184/// \param Y
185/// A 128-bit vector of [4 x float]. The value stored in bits [31:0] is
186/// rounded down to the nearest integer and copied to the corresponding bits
187/// of the result.
188/// \returns A 128-bit vector of [4 x float] containing the copied and rounded
189/// values.
56190#define _mm_floor_ss(X, Y) _mm_round_ss((X), (Y), _MM_FROUND_FLOOR)
191
192/// \brief Copies the upper element of the first 128-bit vector operand to the
193/// corresponding upper element of the 128-bit result vector of [2 x double].
194/// Rounds down the lower element of the second 128-bit vector operand to an
195/// integer and copies it to the lower element of the 128-bit result vector
196/// of [2 x double].
197///
198/// \headerfile <x86intrin.h>
199///
200/// \code
201/// __m128d _mm_floor_sd(__m128d X, __m128d Y);
202/// \endcode
203///
204/// This intrinsic corresponds to the <c> VROUNDSD / ROUNDSD </c> instruction.
205///
206/// \param X
207/// A 128-bit vector of [2 x double]. The value stored in bits [127:64] is
208/// copied to the corresponding bits of the result.
209/// \param Y
210/// A 128-bit vector of [2 x double]. The value stored in bits [63:0] is
211/// rounded down to the nearest integer and copied to the corresponding bits
212/// of the result.
213/// \returns A 128-bit vector of [2 x double] containing the copied and rounded
214/// values.
57215#define _mm_floor_sd(X, Y) _mm_round_sd((X), (Y), _MM_FROUND_FLOOR)
58216
217/// \brief Rounds each element of the 128-bit vector of [4 x float] to an
218/// integer value according to the rounding control specified by the second
219/// argument and returns the rounded values in a 128-bit vector of
220/// [4 x float].
221///
222/// \headerfile <x86intrin.h>
223///
224/// \code
225/// __m128 _mm_round_ps(__m128 X, const int M);
226/// \endcode
227///
228/// This intrinsic corresponds to the <c> VROUNDPS / ROUNDPS </c> instruction.
229///
230/// \param X
231/// A 128-bit vector of [4 x float].
232/// \param M
233/// An integer value that specifies the rounding operation. \n
234/// Bits [7:4] are reserved. \n
235/// Bit [3] is a precision exception value: \n
236/// 0: A normal PE exception is used \n
237/// 1: The PE field is not updated \n
238/// Bit [2] is the rounding control source: \n
239/// 0: Use bits [1:0] of \a M \n
240/// 1: Use the current MXCSR setting \n
241/// Bits [1:0] contain the rounding control definition: \n
242/// 00: Nearest \n
243/// 01: Downward (toward negative infinity) \n
244/// 10: Upward (toward positive infinity) \n
245/// 11: Truncated
246/// \returns A 128-bit vector of [4 x float] containing the rounded values.
59247#define _mm_round_ps(X, M) __extension__ ({ \
60248 (__m128)__builtin_ia32_roundps((__v4sf)(__m128)(X), (M)); })
61249
250/// \brief Copies three upper elements of the first 128-bit vector operand to
251/// the corresponding three upper elements of the 128-bit result vector of
252/// [4 x float]. Rounds the lowest element of the second 128-bit vector
253/// operand to an integer value according to the rounding control specified
254/// by the third argument and copies it to the lowest element of the 128-bit
255/// result vector of [4 x float].
256///
257/// \headerfile <x86intrin.h>
258///
259/// \code
260/// __m128 _mm_round_ss(__m128 X, __m128 Y, const int M);
261/// \endcode
262///
263/// This intrinsic corresponds to the <c> VROUNDSS / ROUNDSS </c> instruction.
264///
265/// \param X
266/// A 128-bit vector of [4 x float]. The values stored in bits [127:32] are
267/// copied to the corresponding bits of the result.
268/// \param Y
269/// A 128-bit vector of [4 x float]. The value stored in bits [31:0] is
270/// rounded to the nearest integer using the specified rounding control and
271/// copied to the corresponding bits of the result.
272/// \param M
273/// An integer value that specifies the rounding operation. \n
274/// Bits [7:4] are reserved. \n
275/// Bit [3] is a precision exception value: \n
276/// 0: A normal PE exception is used \n
277/// 1: The PE field is not updated \n
278/// Bit [2] is the rounding control source: \n
279/// 0: Use bits [1:0] of \a M \n
280/// 1: Use the current MXCSR setting \n
281/// Bits [1:0] contain the rounding control definition: \n
282/// 00: Nearest \n
283/// 01: Downward (toward negative infinity) \n
284/// 10: Upward (toward positive infinity) \n
285/// 11: Truncated
286/// \returns A 128-bit vector of [4 x float] containing the copied and rounded
287/// values.
62288#define _mm_round_ss(X, Y, M) __extension__ ({ \
63289 (__m128)__builtin_ia32_roundss((__v4sf)(__m128)(X), \
64290 (__v4sf)(__m128)(Y), (M)); })
65291
292/// \brief Rounds each element of the 128-bit vector of [2 x double] to an
293/// integer value according to the rounding control specified by the second
294/// argument and returns the rounded values in a 128-bit vector of
295/// [2 x double].
296///
297/// \headerfile <x86intrin.h>
298///
299/// \code
300/// __m128d _mm_round_pd(__m128d X, const int M);
301/// \endcode
302///
303/// This intrinsic corresponds to the <c> VROUNDPD / ROUNDPD </c> instruction.
304///
305/// \param X
306/// A 128-bit vector of [2 x double].
307/// \param M
308/// An integer value that specifies the rounding operation. \n
309/// Bits [7:4] are reserved. \n
310/// Bit [3] is a precision exception value: \n
311/// 0: A normal PE exception is used \n
312/// 1: The PE field is not updated \n
313/// Bit [2] is the rounding control source: \n
314/// 0: Use bits [1:0] of \a M \n
315/// 1: Use the current MXCSR setting \n
316/// Bits [1:0] contain the rounding control definition: \n
317/// 00: Nearest \n
318/// 01: Downward (toward negative infinity) \n
319/// 10: Upward (toward positive infinity) \n
320/// 11: Truncated
321/// \returns A 128-bit vector of [2 x double] containing the rounded values.
66322#define _mm_round_pd(X, M) __extension__ ({ \
67323 (__m128d)__builtin_ia32_roundpd((__v2df)(__m128d)(X), (M)); })
68324
325/// \brief Copies the upper element of the first 128-bit vector operand to the
326/// corresponding upper element of the 128-bit result vector of [2 x double].
327/// Rounds the lower element of the second 128-bit vector operand to an
328/// integer value according to the rounding control specified by the third
329/// argument and copies it to the lower element of the 128-bit result vector
330/// of [2 x double].
331///
332/// \headerfile <x86intrin.h>
333///
334/// \code
335/// __m128d _mm_round_sd(__m128d X, __m128d Y, const int M);
336/// \endcode
337///
338/// This intrinsic corresponds to the <c> VROUNDSD / ROUNDSD </c> instruction.
339///
340/// \param X
341/// A 128-bit vector of [2 x double]. The value stored in bits [127:64] is
342/// copied to the corresponding bits of the result.
343/// \param Y
344/// A 128-bit vector of [2 x double]. The value stored in bits [63:0] is
345/// rounded to the nearest integer using the specified rounding control and
346/// copied to the corresponding bits of the result.
347/// \param M
348/// An integer value that specifies the rounding operation. \n
349/// Bits [7:4] are reserved. \n
350/// Bit [3] is a precision exception value: \n
351/// 0: A normal PE exception is used \n
352/// 1: The PE field is not updated \n
353/// Bit [2] is the rounding control source: \n
354/// 0: Use bits [1:0] of \a M \n
355/// 1: Use the current MXCSR setting \n
356/// Bits [1:0] contain the rounding control definition: \n
357/// 00: Nearest \n
358/// 01: Downward (toward negative infinity) \n
359/// 10: Upward (toward positive infinity) \n
360/// 11: Truncated
361/// \returns A 128-bit vector of [2 x double] containing the copied and rounded
362/// values.
69363#define _mm_round_sd(X, Y, M) __extension__ ({ \
70364 (__m128d)__builtin_ia32_roundsd((__v2df)(__m128d)(X), \
71365 (__v2df)(__m128d)(Y), (M)); })
72366
73367/* SSE4 Packed Blending Intrinsics. */
368/// \brief Returns a 128-bit vector of [2 x double] where the values are
369/// selected from either the first or second operand as specified by the
370/// third operand, the control mask.
371///
372/// \headerfile <x86intrin.h>
373///
374/// \code
375/// __m128d _mm_blend_pd(__m128d V1, __m128d V2, const int M);
376/// \endcode
377///
378/// This intrinsic corresponds to the <c> VBLENDPD / BLENDPD </c> instruction.
379///
380/// \param V1
381/// A 128-bit vector of [2 x double].
382/// \param V2
383/// A 128-bit vector of [2 x double].
384/// \param M
385/// An immediate integer operand, with mask bits [1:0] specifying how the
386/// values are to be copied. The position of the mask bit corresponds to the
387/// index of a copied value. When a mask bit is 0, the corresponding 64-bit
388/// element in operand \a V1 is copied to the same position in the result.
389/// When a mask bit is 1, the corresponding 64-bit element in operand \a V2
390/// is copied to the same position in the result.
391/// \returns A 128-bit vector of [2 x double] containing the copied values.
74392#define _mm_blend_pd(V1, V2, M) __extension__ ({ \
75393 (__m128d)__builtin_shufflevector((__v2df)(__m128d)(V1), \
76394 (__v2df)(__m128d)(V2), \
77395 (((M) & 0x01) ? 2 : 0), \
78396 (((M) & 0x02) ? 3 : 1)); })
79397
398/// \brief Returns a 128-bit vector of [4 x float] where the values are selected
399/// from either the first or second operand as specified by the third
400/// operand, the control mask.
401///
402/// \headerfile <x86intrin.h>
403///
404/// \code
405/// __m128 _mm_blend_ps(__m128 V1, __m128 V2, const int M);
406/// \endcode
407///
408/// This intrinsic corresponds to the <c> VBLENDPS / BLENDPS </c> instruction.
409///
410/// \param V1
411/// A 128-bit vector of [4 x float].
412/// \param V2
413/// A 128-bit vector of [4 x float].
414/// \param M
415/// An immediate integer operand, with mask bits [3:0] specifying how the
416/// values are to be copied. The position of the mask bit corresponds to the
417/// index of a copied value. When a mask bit is 0, the corresponding 32-bit
418/// element in operand \a V1 is copied to the same position in the result.
419/// When a mask bit is 1, the corresponding 32-bit element in operand \a V2
420/// is copied to the same position in the result.
421/// \returns A 128-bit vector of [4 x float] containing the copied values.
80422#define _mm_blend_ps(V1, V2, M) __extension__ ({ \
81423 (__m128)__builtin_shufflevector((__v4sf)(__m128)(V1), (__v4sf)(__m128)(V2), \
82424 (((M) & 0x01) ? 4 : 0), \
......@@ -84,6 +426,26 @@
84426 (((M) & 0x04) ? 6 : 2), \
85427 (((M) & 0x08) ? 7 : 3)); })
86428
429/// \brief Returns a 128-bit vector of [2 x double] where the values are
430/// selected from either the first or second operand as specified by the
431/// third operand, the control mask.
432///
433/// \headerfile <x86intrin.h>
434///
435/// This intrinsic corresponds to the <c> VBLENDVPD / BLENDVPD </c> instruction.
436///
437/// \param __V1
438/// A 128-bit vector of [2 x double].
439/// \param __V2
440/// A 128-bit vector of [2 x double].
441/// \param __M
442/// A 128-bit vector operand, with mask bits 127 and 63 specifying how the
443/// values are to be copied. The position of the mask bit corresponds to the
444/// most significant bit of a copied value. When a mask bit is 0, the
445/// corresponding 64-bit element in operand \a __V1 is copied to the same
446/// position in the result. When a mask bit is 1, the corresponding 64-bit
447/// element in operand \a __V2 is copied to the same position in the result.
448/// \returns A 128-bit vector of [2 x double] containing the copied values.
87449static __inline__ __m128d __DEFAULT_FN_ATTRS
88450_mm_blendv_pd (__m128d __V1, __m128d __V2, __m128d __M)
89451{
......@@ -91,6 +453,26 @@ _mm_blendv_pd (__m128d __V1, __m128d __V2, __m128d __M)
91453 (__v2df)__M);
92454}
93455
456/// \brief Returns a 128-bit vector of [4 x float] where the values are
457/// selected from either the first or second operand as specified by the
458/// third operand, the control mask.
459///
460/// \headerfile <x86intrin.h>
461///
462/// This intrinsic corresponds to the <c> VBLENDVPS / BLENDVPS </c> instruction.
463///
464/// \param __V1
465/// A 128-bit vector of [4 x float].
466/// \param __V2
467/// A 128-bit vector of [4 x float].
468/// \param __M
469/// A 128-bit vector operand, with mask bits 127, 95, 63, and 31 specifying
470/// how the values are to be copied. The position of the mask bit corresponds
471/// to the most significant bit of a copied value. When a mask bit is 0, the
472/// corresponding 32-bit element in operand \a __V1 is copied to the same
473/// position in the result. When a mask bit is 1, the corresponding 32-bit
474/// element in operand \a __V2 is copied to the same position in the result.
475/// \returns A 128-bit vector of [4 x float] containing the copied values.
94476static __inline__ __m128 __DEFAULT_FN_ATTRS
95477_mm_blendv_ps (__m128 __V1, __m128 __V2, __m128 __M)
96478{
......@@ -98,6 +480,26 @@ _mm_blendv_ps (__m128 __V1, __m128 __V2, __m128 __M)
98480 (__v4sf)__M);
99481}
100482
483/// \brief Returns a 128-bit vector of [16 x i8] where the values are selected
484/// from either of the first or second operand as specified by the third
485/// operand, the control mask.
486///
487/// \headerfile <x86intrin.h>
488///
489/// This intrinsic corresponds to the <c> VPBLENDVB / PBLENDVB </c> instruction.
490///
491/// \param __V1
492/// A 128-bit vector of [16 x i8].
493/// \param __V2
494/// A 128-bit vector of [16 x i8].
495/// \param __M
496/// A 128-bit vector operand, with mask bits 127, 119, 111 ... 7 specifying
497/// how the values are to be copied. The position of the mask bit corresponds
498/// to the most significant bit of a copied value. When a mask bit is 0, the
499/// corresponding 8-bit element in operand \a __V1 is copied to the same
500/// position in the result. When a mask bit is 1, the corresponding 8-bit
501/// element in operand \a __V2 is copied to the same position in the result.
502/// \returns A 128-bit vector of [16 x i8] containing the copied values.
101503static __inline__ __m128i __DEFAULT_FN_ATTRS
102504_mm_blendv_epi8 (__m128i __V1, __m128i __V2, __m128i __M)
103505{
......@@ -105,6 +507,30 @@ _mm_blendv_epi8 (__m128i __V1, __m128i __V2, __m128i __M)
105507 (__v16qi)__M);
106508}
107509
510/// \brief Returns a 128-bit vector of [8 x i16] where the values are selected
511/// from either of the first or second operand as specified by the third
512/// operand, the control mask.
513///
514/// \headerfile <x86intrin.h>
515///
516/// \code
517/// __m128i _mm_blend_epi16(__m128i V1, __m128i V2, const int M);
518/// \endcode
519///
520/// This intrinsic corresponds to the <c> VPBLENDW / PBLENDW </c> instruction.
521///
522/// \param V1
523/// A 128-bit vector of [8 x i16].
524/// \param V2
525/// A 128-bit vector of [8 x i16].
526/// \param M
527/// An immediate integer operand, with mask bits [7:0] specifying how the
528/// values are to be copied. The position of the mask bit corresponds to the
529/// index of a copied value. When a mask bit is 0, the corresponding 16-bit
530/// element in operand \a V1 is copied to the same position in the result.
531/// When a mask bit is 1, the corresponding 16-bit element in operand \a V2
532/// is copied to the same position in the result.
533/// \returns A 128-bit vector of [8 x i16] containing the copied values.
108534#define _mm_blend_epi16(V1, V2, M) __extension__ ({ \
109535 (__m128i)__builtin_shufflevector((__v8hi)(__m128i)(V1), \
110536 (__v8hi)(__m128i)(V2), \
......@@ -118,12 +544,39 @@ _mm_blendv_epi8 (__m128i __V1, __m128i __V2, __m128i __M)
118544 (((M) & 0x80) ? 15 : 7)); })
119545
120546/* SSE4 Dword Multiply Instructions. */
547/// \brief Multiples corresponding elements of two 128-bit vectors of [4 x i32]
548/// and returns the lower 32 bits of the each product in a 128-bit vector of
549/// [4 x i32].
550///
551/// \headerfile <x86intrin.h>
552///
553/// This intrinsic corresponds to the <c> VPMULLD / PMULLD </c> instruction.
554///
555/// \param __V1
556/// A 128-bit integer vector.
557/// \param __V2
558/// A 128-bit integer vector.
559/// \returns A 128-bit integer vector containing the products of both operands.
121560static __inline__ __m128i __DEFAULT_FN_ATTRS
122561_mm_mullo_epi32 (__m128i __V1, __m128i __V2)
123562{
124563 return (__m128i) ((__v4su)__V1 * (__v4su)__V2);
125564}
126565
566/// \brief Multiplies corresponding even-indexed elements of two 128-bit
567/// vectors of [4 x i32] and returns a 128-bit vector of [2 x i64]
568/// containing the products.
569///
570/// \headerfile <x86intrin.h>
571///
572/// This intrinsic corresponds to the <c> VPMULDQ / PMULDQ </c> instruction.
573///
574/// \param __V1
575/// A 128-bit vector of [4 x i32].
576/// \param __V2
577/// A 128-bit vector of [4 x i32].
578/// \returns A 128-bit vector of [2 x i64] containing the products of both
579/// operands.
127580static __inline__ __m128i __DEFAULT_FN_ATTRS
128581_mm_mul_epi32 (__m128i __V1, __m128i __V2)
129582{
......@@ -131,64 +584,243 @@ _mm_mul_epi32 (__m128i __V1, __m128i __V2)
131584}
132585
133586/* SSE4 Floating Point Dot Product Instructions. */
587/// \brief Computes the dot product of the two 128-bit vectors of [4 x float]
588/// and returns it in the elements of the 128-bit result vector of
589/// [4 x float].
590///
591/// The immediate integer operand controls which input elements
592/// will contribute to the dot product, and where the final results are
593/// returned.
594///
595/// \headerfile <x86intrin.h>
596///
597/// \code
598/// __m128 _mm_dp_ps(__m128 X, __m128 Y, const int M);
599/// \endcode
600///
601/// This intrinsic corresponds to the <c> VDPPS / DPPS </c> instruction.
602///
603/// \param X
604/// A 128-bit vector of [4 x float].
605/// \param Y
606/// A 128-bit vector of [4 x float].
607/// \param M
608/// An immediate integer operand. Mask bits [7:4] determine which elements
609/// of the input vectors are used, with bit [4] corresponding to the lowest
610/// element and bit [7] corresponding to the highest element of each [4 x
611/// float] vector. If a bit is set, the corresponding elements from the two
612/// input vectors are used as an input for dot product; otherwise that input
613/// is treated as zero. Bits [3:0] determine which elements of the result
614/// will receive a copy of the final dot product, with bit [0] corresponding
615/// to the lowest element and bit [3] corresponding to the highest element of
616/// each [4 x float] subvector. If a bit is set, the dot product is returned
617/// in the corresponding element; otherwise that element is set to zero.
618/// \returns A 128-bit vector of [4 x float] containing the dot product.
134619#define _mm_dp_ps(X, Y, M) __extension__ ({ \
135620 (__m128) __builtin_ia32_dpps((__v4sf)(__m128)(X), \
136621 (__v4sf)(__m128)(Y), (M)); })
137622
623/// \brief Computes the dot product of the two 128-bit vectors of [2 x double]
624/// and returns it in the elements of the 128-bit result vector of
625/// [2 x double].
626///
627/// The immediate integer operand controls which input
628/// elements will contribute to the dot product, and where the final results
629/// are returned.
630///
631/// \headerfile <x86intrin.h>
632///
633/// \code
634/// __m128d _mm_dp_pd(__m128d X, __m128d Y, const int M);
635/// \endcode
636///
637/// This intrinsic corresponds to the <c> VDPPD / DPPD </c> instruction.
638///
639/// \param X
640/// A 128-bit vector of [2 x double].
641/// \param Y
642/// A 128-bit vector of [2 x double].
643/// \param M
644/// An immediate integer operand. Mask bits [5:4] determine which elements
645/// of the input vectors are used, with bit [4] corresponding to the lowest
646/// element and bit [5] corresponding to the highest element of each of [2 x
647/// double] vector. If a bit is set, the corresponding elements from the two
648/// input vectors are used as an input for dot product; otherwise that input
649/// is treated as zero. Bits [1:0] determine which elements of the result
650/// will receive a copy of the final dot product, with bit [0] corresponding
651/// to the lowest element and bit [3] corresponding to the highest element of
652/// each [2 x double] vector. If a bit is set, the dot product is returned in
653/// the corresponding element; otherwise that element is set to zero.
138654#define _mm_dp_pd(X, Y, M) __extension__ ({\
139655 (__m128d) __builtin_ia32_dppd((__v2df)(__m128d)(X), \
140656 (__v2df)(__m128d)(Y), (M)); })
141657
142658/* SSE4 Streaming Load Hint Instruction. */
659/// \brief Loads integer values from a 128-bit aligned memory location to a
660/// 128-bit integer vector.
661///
662/// \headerfile <x86intrin.h>
663///
664/// This intrinsic corresponds to the <c> VMOVNTDQA / MOVNTDQA </c> instruction.
665///
666/// \param __V
667/// A pointer to a 128-bit aligned memory location that contains the integer
668/// values.
669/// \returns A 128-bit integer vector containing the data stored at the
670/// specified memory location.
143671static __inline__ __m128i __DEFAULT_FN_ATTRS
144672_mm_stream_load_si128 (__m128i const *__V)
145673{
146 return (__m128i) __builtin_ia32_movntdqa ((const __v2di *) __V);
674 return (__m128i) __builtin_nontemporal_load ((const __v2di *) __V);
147675}
148676
149677/* SSE4 Packed Integer Min/Max Instructions. */
678/// \brief Compares the corresponding elements of two 128-bit vectors of
679/// [16 x i8] and returns a 128-bit vector of [16 x i8] containing the lesser
680/// of the two values.
681///
682/// \headerfile <x86intrin.h>
683///
684/// This intrinsic corresponds to the <c> VPMINSB / PMINSB </c> instruction.
685///
686/// \param __V1
687/// A 128-bit vector of [16 x i8].
688/// \param __V2
689/// A 128-bit vector of [16 x i8]
690/// \returns A 128-bit vector of [16 x i8] containing the lesser values.
150691static __inline__ __m128i __DEFAULT_FN_ATTRS
151692_mm_min_epi8 (__m128i __V1, __m128i __V2)
152693{
153694 return (__m128i) __builtin_ia32_pminsb128 ((__v16qi) __V1, (__v16qi) __V2);
154695}
155696
697/// \brief Compares the corresponding elements of two 128-bit vectors of
698/// [16 x i8] and returns a 128-bit vector of [16 x i8] containing the
699/// greater value of the two.
700///
701/// \headerfile <x86intrin.h>
702///
703/// This intrinsic corresponds to the <c> VPMAXSB / PMAXSB </c> instruction.
704///
705/// \param __V1
706/// A 128-bit vector of [16 x i8].
707/// \param __V2
708/// A 128-bit vector of [16 x i8].
709/// \returns A 128-bit vector of [16 x i8] containing the greater values.
156710static __inline__ __m128i __DEFAULT_FN_ATTRS
157711_mm_max_epi8 (__m128i __V1, __m128i __V2)
158712{
159713 return (__m128i) __builtin_ia32_pmaxsb128 ((__v16qi) __V1, (__v16qi) __V2);
160714}
161715
716/// \brief Compares the corresponding elements of two 128-bit vectors of
717/// [8 x u16] and returns a 128-bit vector of [8 x u16] containing the lesser
718/// value of the two.
719///
720/// \headerfile <x86intrin.h>
721///
722/// This intrinsic corresponds to the <c> VPMINUW / PMINUW </c> instruction.
723///
724/// \param __V1
725/// A 128-bit vector of [8 x u16].
726/// \param __V2
727/// A 128-bit vector of [8 x u16].
728/// \returns A 128-bit vector of [8 x u16] containing the lesser values.
162729static __inline__ __m128i __DEFAULT_FN_ATTRS
163730_mm_min_epu16 (__m128i __V1, __m128i __V2)
164731{
165732 return (__m128i) __builtin_ia32_pminuw128 ((__v8hi) __V1, (__v8hi) __V2);
166733}
167734
735/// \brief Compares the corresponding elements of two 128-bit vectors of
736/// [8 x u16] and returns a 128-bit vector of [8 x u16] containing the
737/// greater value of the two.
738///
739/// \headerfile <x86intrin.h>
740///
741/// This intrinsic corresponds to the <c> VPMAXUW / PMAXUW </c> instruction.
742///
743/// \param __V1
744/// A 128-bit vector of [8 x u16].
745/// \param __V2
746/// A 128-bit vector of [8 x u16].
747/// \returns A 128-bit vector of [8 x u16] containing the greater values.
168748static __inline__ __m128i __DEFAULT_FN_ATTRS
169749_mm_max_epu16 (__m128i __V1, __m128i __V2)
170750{
171751 return (__m128i) __builtin_ia32_pmaxuw128 ((__v8hi) __V1, (__v8hi) __V2);
172752}
173753
754/// \brief Compares the corresponding elements of two 128-bit vectors of
755/// [4 x i32] and returns a 128-bit vector of [4 x i32] containing the lesser
756/// value of the two.
757///
758/// \headerfile <x86intrin.h>
759///
760/// This intrinsic corresponds to the <c> VPMINSD / PMINSD </c> instruction.
761///
762/// \param __V1
763/// A 128-bit vector of [4 x i32].
764/// \param __V2
765/// A 128-bit vector of [4 x i32].
766/// \returns A 128-bit vector of [4 x i32] containing the lesser values.
174767static __inline__ __m128i __DEFAULT_FN_ATTRS
175768_mm_min_epi32 (__m128i __V1, __m128i __V2)
176769{
177770 return (__m128i) __builtin_ia32_pminsd128 ((__v4si) __V1, (__v4si) __V2);
178771}
179772
773/// \brief Compares the corresponding elements of two 128-bit vectors of
774/// [4 x i32] and returns a 128-bit vector of [4 x i32] containing the
775/// greater value of the two.
776///
777/// \headerfile <x86intrin.h>
778///
779/// This intrinsic corresponds to the <c> VPMAXSD / PMAXSD </c> instruction.
780///
781/// \param __V1
782/// A 128-bit vector of [4 x i32].
783/// \param __V2
784/// A 128-bit vector of [4 x i32].
785/// \returns A 128-bit vector of [4 x i32] containing the greater values.
180786static __inline__ __m128i __DEFAULT_FN_ATTRS
181787_mm_max_epi32 (__m128i __V1, __m128i __V2)
182788{
183789 return (__m128i) __builtin_ia32_pmaxsd128 ((__v4si) __V1, (__v4si) __V2);
184790}
185791
792/// \brief Compares the corresponding elements of two 128-bit vectors of
793/// [4 x u32] and returns a 128-bit vector of [4 x u32] containing the lesser
794/// value of the two.
795///
796/// \headerfile <x86intrin.h>
797///
798/// This intrinsic corresponds to the <c> VPMINUD / PMINUD </c> instruction.
799///
800/// \param __V1
801/// A 128-bit vector of [4 x u32].
802/// \param __V2
803/// A 128-bit vector of [4 x u32].
804/// \returns A 128-bit vector of [4 x u32] containing the lesser values.
186805static __inline__ __m128i __DEFAULT_FN_ATTRS
187806_mm_min_epu32 (__m128i __V1, __m128i __V2)
188807{
189808 return (__m128i) __builtin_ia32_pminud128((__v4si) __V1, (__v4si) __V2);
190809}
191810
811/// \brief Compares the corresponding elements of two 128-bit vectors of
812/// [4 x u32] and returns a 128-bit vector of [4 x u32] containing the
813/// greater value of the two.
814///
815/// \headerfile <x86intrin.h>
816///
817/// This intrinsic corresponds to the <c> VPMAXUD / PMAXUD </c> instruction.
818///
819/// \param __V1
820/// A 128-bit vector of [4 x u32].
821/// \param __V2
822/// A 128-bit vector of [4 x u32].
823/// \returns A 128-bit vector of [4 x u32] containing the greater values.
192824static __inline__ __m128i __DEFAULT_FN_ATTRS
193825_mm_max_epu32 (__m128i __V1, __m128i __V2)
194826{
......@@ -196,7 +828,70 @@ _mm_max_epu32 (__m128i __V1, __m128i __V2)
196828}
197829
198830/* SSE4 Insertion and Extraction from XMM Register Instructions. */
831/// \brief Takes the first argument \a X and inserts an element from the second
832/// argument \a Y as selected by the third argument \a N. That result then
833/// has elements zeroed out also as selected by the third argument \a N. The
834/// resulting 128-bit vector of [4 x float] is then returned.
835///
836/// \headerfile <x86intrin.h>
837///
838/// \code
839/// __m128 _mm_insert_ps(__m128 X, __m128 Y, const int N);
840/// \endcode
841///
842/// This intrinsic corresponds to the <c> VINSERTPS </c> instruction.
843///
844/// \param X
845/// A 128-bit vector source operand of [4 x float]. With the exception of
846/// those bits in the result copied from parameter \a Y and zeroed by bits
847/// [3:0] of \a N, all bits from this parameter are copied to the result.
848/// \param Y
849/// A 128-bit vector source operand of [4 x float]. One single-precision
850/// floating-point element from this source, as determined by the immediate
851/// parameter, is copied to the result.
852/// \param N
853/// Specifies which bits from operand \a Y will be copied, which bits in the
854/// result they will be be copied to, and which bits in the result will be
855/// cleared. The following assignments are made: \n
856/// Bits [7:6] specify the bits to copy from operand \a Y: \n
857/// 00: Selects bits [31:0] from operand \a Y. \n
858/// 01: Selects bits [63:32] from operand \a Y. \n
859/// 10: Selects bits [95:64] from operand \a Y. \n
860/// 11: Selects bits [127:96] from operand \a Y. \n
861/// Bits [5:4] specify the bits in the result to which the selected bits
862/// from operand \a Y are copied: \n
863/// 00: Copies the selected bits from \a Y to result bits [31:0]. \n
864/// 01: Copies the selected bits from \a Y to result bits [63:32]. \n
865/// 10: Copies the selected bits from \a Y to result bits [95:64]. \n
866/// 11: Copies the selected bits from \a Y to result bits [127:96]. \n
867/// Bits[3:0]: If any of these bits are set, the corresponding result
868/// element is cleared.
869/// \returns A 128-bit vector of [4 x float] containing the copied single-
870/// precision floating point elements from the operands.
199871#define _mm_insert_ps(X, Y, N) __builtin_ia32_insertps128((X), (Y), (N))
872
873/// \brief Extracts a 32-bit integer from a 128-bit vector of [4 x float] and
874/// returns it, using the immediate value parameter \a N as a selector.
875///
876/// \headerfile <x86intrin.h>
877///
878/// \code
879/// int _mm_extract_ps(__m128 X, const int N);
880/// \endcode
881///
882/// This intrinsic corresponds to the <c> VEXTRACTPS / EXTRACTPS </c>
883/// instruction.
884///
885/// \param X
886/// A 128-bit vector of [4 x float].
887/// \param N
888/// An immediate value. Bits [1:0] determines which bits from the argument
889/// \a X are extracted and returned: \n
890/// 00: Bits [31:0] of parameter \a X are returned. \n
891/// 01: Bits [63:32] of parameter \a X are returned. \n
892/// 10: Bits [95:64] of parameter \a X are returned. \n
893/// 11: Bits [127:96] of parameter \a X are returned.
894/// \returns A 32-bit integer containing the extracted 32 bits of float data.
200895#define _mm_extract_ps(X, N) (__extension__ \
201896 ({ union { int __i; float __f; } __t; \
202897 __v4sf __a = (__v4sf)(__m128)(X); \
......@@ -217,15 +912,111 @@ _mm_max_epu32 (__m128i __V1, __m128i __V2)
217912 _MM_MK_INSERTPS_NDX((N), 0, 0x0e))
218913
219914/* Insert int into packed integer array at index. */
915/// \brief Constructs a 128-bit vector of [16 x i8] by first making a copy of
916/// the 128-bit integer vector parameter, and then inserting the lower 8 bits
917/// of an integer parameter \a I into an offset specified by the immediate
918/// value parameter \a N.
919///
920/// \headerfile <x86intrin.h>
921///
922/// \code
923/// __m128i _mm_insert_epi8(__m128i X, int I, const int N);
924/// \endcode
925///
926/// This intrinsic corresponds to the <c> VPINSRB / PINSRB </c> instruction.
927///
928/// \param X
929/// A 128-bit integer vector of [16 x i8]. This vector is copied to the
930/// result and then one of the sixteen elements in the result vector is
931/// replaced by the lower 8 bits of \a I.
932/// \param I
933/// An integer. The lower 8 bits of this operand are written to the result
934/// beginning at the offset specified by \a N.
935/// \param N
936/// An immediate value. Bits [3:0] specify the bit offset in the result at
937/// which the lower 8 bits of \a I are written. \n
938/// 0000: Bits [7:0] of the result are used for insertion. \n
939/// 0001: Bits [15:8] of the result are used for insertion. \n
940/// 0010: Bits [23:16] of the result are used for insertion. \n
941/// 0011: Bits [31:24] of the result are used for insertion. \n
942/// 0100: Bits [39:32] of the result are used for insertion. \n
943/// 0101: Bits [47:40] of the result are used for insertion. \n
944/// 0110: Bits [55:48] of the result are used for insertion. \n
945/// 0111: Bits [63:56] of the result are used for insertion. \n
946/// 1000: Bits [71:64] of the result are used for insertion. \n
947/// 1001: Bits [79:72] of the result are used for insertion. \n
948/// 1010: Bits [87:80] of the result are used for insertion. \n
949/// 1011: Bits [95:88] of the result are used for insertion. \n
950/// 1100: Bits [103:96] of the result are used for insertion. \n
951/// 1101: Bits [111:104] of the result are used for insertion. \n
952/// 1110: Bits [119:112] of the result are used for insertion. \n
953/// 1111: Bits [127:120] of the result are used for insertion.
954/// \returns A 128-bit integer vector containing the constructed values.
220955#define _mm_insert_epi8(X, I, N) (__extension__ \
221956 ({ __v16qi __a = (__v16qi)(__m128i)(X); \
222957 __a[(N) & 15] = (I); \
223958 (__m128i)__a;}))
959
960/// \brief Constructs a 128-bit vector of [4 x i32] by first making a copy of
961/// the 128-bit integer vector parameter, and then inserting the 32-bit
962/// integer parameter \a I at the offset specified by the immediate value
963/// parameter \a N.
964///
965/// \headerfile <x86intrin.h>
966///
967/// \code
968/// __m128i _mm_insert_epi32(__m128i X, int I, const int N);
969/// \endcode
970///
971/// This intrinsic corresponds to the <c> VPINSRD / PINSRD </c> instruction.
972///
973/// \param X
974/// A 128-bit integer vector of [4 x i32]. This vector is copied to the
975/// result and then one of the four elements in the result vector is
976/// replaced by \a I.
977/// \param I
978/// A 32-bit integer that is written to the result beginning at the offset
979/// specified by \a N.
980/// \param N
981/// An immediate value. Bits [1:0] specify the bit offset in the result at
982/// which the integer \a I is written. \n
983/// 00: Bits [31:0] of the result are used for insertion. \n
984/// 01: Bits [63:32] of the result are used for insertion. \n
985/// 10: Bits [95:64] of the result are used for insertion. \n
986/// 11: Bits [127:96] of the result are used for insertion.
987/// \returns A 128-bit integer vector containing the constructed values.
224988#define _mm_insert_epi32(X, I, N) (__extension__ \
225989 ({ __v4si __a = (__v4si)(__m128i)(X); \
226990 __a[(N) & 3] = (I); \
227991 (__m128i)__a;}))
992
228993#ifdef __x86_64__
994/// \brief Constructs a 128-bit vector of [2 x i64] by first making a copy of
995/// the 128-bit integer vector parameter, and then inserting the 64-bit
996/// integer parameter \a I, using the immediate value parameter \a N as an
997/// insertion location selector.
998///
999/// \headerfile <x86intrin.h>
1000///
1001/// \code
1002/// __m128i _mm_insert_epi64(__m128i X, long long I, const int N);
1003/// \endcode
1004///
1005/// This intrinsic corresponds to the <c> VPINSRQ / PINSRQ </c> instruction.
1006///
1007/// \param X
1008/// A 128-bit integer vector of [2 x i64]. This vector is copied to the
1009/// result and then one of the two elements in the result vector is replaced
1010/// by \a I.
1011/// \param I
1012/// A 64-bit integer that is written to the result beginning at the offset
1013/// specified by \a N.
1014/// \param N
1015/// An immediate value. Bit [0] specifies the bit offset in the result at
1016/// which the integer \a I is written. \n
1017/// 0: Bits [63:0] of the result are used for insertion. \n
1018/// 1: Bits [127:64] of the result are used for insertion. \n
1019/// \returns A 128-bit integer vector containing the constructed values.
2291020#define _mm_insert_epi64(X, I, N) (__extension__ \
2301021 ({ __v2di __a = (__v2di)(__m128i)(X); \
2311022 __a[(N) & 1] = (I); \
......@@ -235,42 +1026,219 @@ _mm_max_epu32 (__m128i __V1, __m128i __V2)
2351026/* Extract int from packed integer array at index. This returns the element
2361027 * as a zero extended value, so it is unsigned.
2371028 */
1029/// \brief Extracts an 8-bit element from the 128-bit integer vector of
1030/// [16 x i8], using the immediate value parameter \a N as a selector.
1031///
1032/// \headerfile <x86intrin.h>
1033///
1034/// \code
1035/// int _mm_extract_epi8(__m128i X, const int N);
1036/// \endcode
1037///
1038/// This intrinsic corresponds to the <c> VPEXTRB / PEXTRB </c> instruction.
1039///
1040/// \param X
1041/// A 128-bit integer vector.
1042/// \param N
1043/// An immediate value. Bits [3:0] specify which 8-bit vector element from
1044/// the argument \a X to extract and copy to the result. \n
1045/// 0000: Bits [7:0] of parameter \a X are extracted. \n
1046/// 0001: Bits [15:8] of the parameter \a X are extracted. \n
1047/// 0010: Bits [23:16] of the parameter \a X are extracted. \n
1048/// 0011: Bits [31:24] of the parameter \a X are extracted. \n
1049/// 0100: Bits [39:32] of the parameter \a X are extracted. \n
1050/// 0101: Bits [47:40] of the parameter \a X are extracted. \n
1051/// 0110: Bits [55:48] of the parameter \a X are extracted. \n
1052/// 0111: Bits [63:56] of the parameter \a X are extracted. \n
1053/// 1000: Bits [71:64] of the parameter \a X are extracted. \n
1054/// 1001: Bits [79:72] of the parameter \a X are extracted. \n
1055/// 1010: Bits [87:80] of the parameter \a X are extracted. \n
1056/// 1011: Bits [95:88] of the parameter \a X are extracted. \n
1057/// 1100: Bits [103:96] of the parameter \a X are extracted. \n
1058/// 1101: Bits [111:104] of the parameter \a X are extracted. \n
1059/// 1110: Bits [119:112] of the parameter \a X are extracted. \n
1060/// 1111: Bits [127:120] of the parameter \a X are extracted.
1061/// \returns An unsigned integer, whose lower 8 bits are selected from the
1062/// 128-bit integer vector parameter and the remaining bits are assigned
1063/// zeros.
2381064#define _mm_extract_epi8(X, N) (__extension__ \
2391065 ({ __v16qi __a = (__v16qi)(__m128i)(X); \
2401066 (int)(unsigned char) __a[(N) & 15];}))
1067
1068/// \brief Extracts a 32-bit element from the 128-bit integer vector of
1069/// [4 x i32], using the immediate value parameter \a N as a selector.
1070///
1071/// \headerfile <x86intrin.h>
1072///
1073/// \code
1074/// int _mm_extract_epi32(__m128i X, const int N);
1075/// \endcode
1076///
1077/// This intrinsic corresponds to the <c> VPEXTRD / PEXTRD </c> instruction.
1078///
1079/// \param X
1080/// A 128-bit integer vector.
1081/// \param N
1082/// An immediate value. Bits [1:0] specify which 32-bit vector element from
1083/// the argument \a X to extract and copy to the result. \n
1084/// 00: Bits [31:0] of the parameter \a X are extracted. \n
1085/// 01: Bits [63:32] of the parameter \a X are extracted. \n
1086/// 10: Bits [95:64] of the parameter \a X are extracted. \n
1087/// 11: Bits [127:96] of the parameter \a X are exracted.
1088/// \returns An integer, whose lower 32 bits are selected from the 128-bit
1089/// integer vector parameter and the remaining bits are assigned zeros.
2411090#define _mm_extract_epi32(X, N) (__extension__ \
2421091 ({ __v4si __a = (__v4si)(__m128i)(X); \
2431092 (int)__a[(N) & 3];}))
1093
2441094#ifdef __x86_64__
1095/// \brief Extracts a 64-bit element from the 128-bit integer vector of
1096/// [2 x i64], using the immediate value parameter \a N as a selector.
1097///
1098/// \headerfile <x86intrin.h>
1099///
1100/// \code
1101/// long long _mm_extract_epi64(__m128i X, const int N);
1102/// \endcode
1103///
1104/// This intrinsic corresponds to the <c> VPEXTRQ / PEXTRQ </c> instruction.
1105///
1106/// \param X
1107/// A 128-bit integer vector.
1108/// \param N
1109/// An immediate value. Bit [0] specifies which 64-bit vector element from
1110/// the argument \a X to return. \n
1111/// 0: Bits [63:0] are returned. \n
1112/// 1: Bits [127:64] are returned. \n
1113/// \returns A 64-bit integer.
2451114#define _mm_extract_epi64(X, N) (__extension__ \
2461115 ({ __v2di __a = (__v2di)(__m128i)(X); \
2471116 (long long)__a[(N) & 1];}))
2481117#endif /* __x86_64 */
2491118
2501119/* SSE4 128-bit Packed Integer Comparisons. */
1120/// \brief Tests whether the specified bits in a 128-bit integer vector are all
1121/// zeros.
1122///
1123/// \headerfile <x86intrin.h>
1124///
1125/// This intrinsic corresponds to the <c> VPTEST / PTEST </c> instruction.
1126///
1127/// \param __M
1128/// A 128-bit integer vector containing the bits to be tested.
1129/// \param __V
1130/// A 128-bit integer vector selecting which bits to test in operand \a __M.
1131/// \returns TRUE if the specified bits are all zeros; FALSE otherwise.
2511132static __inline__ int __DEFAULT_FN_ATTRS
2521133_mm_testz_si128(__m128i __M, __m128i __V)
2531134{
2541135 return __builtin_ia32_ptestz128((__v2di)__M, (__v2di)__V);
2551136}
2561137
1138/// \brief Tests whether the specified bits in a 128-bit integer vector are all
1139/// ones.
1140///
1141/// \headerfile <x86intrin.h>
1142///
1143/// This intrinsic corresponds to the <c> VPTEST / PTEST </c> instruction.
1144///
1145/// \param __M
1146/// A 128-bit integer vector containing the bits to be tested.
1147/// \param __V
1148/// A 128-bit integer vector selecting which bits to test in operand \a __M.
1149/// \returns TRUE if the specified bits are all ones; FALSE otherwise.
2571150static __inline__ int __DEFAULT_FN_ATTRS
2581151_mm_testc_si128(__m128i __M, __m128i __V)
2591152{
2601153 return __builtin_ia32_ptestc128((__v2di)__M, (__v2di)__V);
2611154}
2621155
1156/// \brief Tests whether the specified bits in a 128-bit integer vector are
1157/// neither all zeros nor all ones.
1158///
1159/// \headerfile <x86intrin.h>
1160///
1161/// This intrinsic corresponds to the <c> VPTEST / PTEST </c> instruction.
1162///
1163/// \param __M
1164/// A 128-bit integer vector containing the bits to be tested.
1165/// \param __V
1166/// A 128-bit integer vector selecting which bits to test in operand \a __M.
1167/// \returns TRUE if the specified bits are neither all zeros nor all ones;
1168/// FALSE otherwise.
2631169static __inline__ int __DEFAULT_FN_ATTRS
2641170_mm_testnzc_si128(__m128i __M, __m128i __V)
2651171{
2661172 return __builtin_ia32_ptestnzc128((__v2di)__M, (__v2di)__V);
2671173}
2681174
1175/// \brief Tests whether the specified bits in a 128-bit integer vector are all
1176/// ones.
1177///
1178/// \headerfile <x86intrin.h>
1179///
1180/// \code
1181/// int _mm_test_all_ones(__m128i V);
1182/// \endcode
1183///
1184/// This intrinsic corresponds to the <c> VPTEST / PTEST </c> instruction.
1185///
1186/// \param V
1187/// A 128-bit integer vector containing the bits to be tested.
1188/// \returns TRUE if the bits specified in the operand are all set to 1; FALSE
1189/// otherwise.
2691190#define _mm_test_all_ones(V) _mm_testc_si128((V), _mm_cmpeq_epi32((V), (V)))
1191
1192/// \brief Tests whether the specified bits in a 128-bit integer vector are
1193/// neither all zeros nor all ones.
1194///
1195/// \headerfile <x86intrin.h>
1196///
1197/// \code
1198/// int _mm_test_mix_ones_zeros(__m128i M, __m128i V);
1199/// \endcode
1200///
1201/// This intrinsic corresponds to the <c> VPTEST / PTEST </c> instruction.
1202///
1203/// \param M
1204/// A 128-bit integer vector containing the bits to be tested.
1205/// \param V
1206/// A 128-bit integer vector selecting which bits to test in operand \a M.
1207/// \returns TRUE if the specified bits are neither all zeros nor all ones;
1208/// FALSE otherwise.
2701209#define _mm_test_mix_ones_zeros(M, V) _mm_testnzc_si128((M), (V))
1210
1211/// \brief Tests whether the specified bits in a 128-bit integer vector are all
1212/// zeros.
1213///
1214/// \headerfile <x86intrin.h>
1215///
1216/// \code
1217/// int _mm_test_all_zeros(__m128i M, __m128i V);
1218/// \endcode
1219///
1220/// This intrinsic corresponds to the <c> VPTEST / PTEST </c> instruction.
1221///
1222/// \param M
1223/// A 128-bit integer vector containing the bits to be tested.
1224/// \param V
1225/// A 128-bit integer vector selecting which bits to test in operand \a M.
1226/// \returns TRUE if the specified bits are all zeros; FALSE otherwise.
2711227#define _mm_test_all_zeros(M, V) _mm_testz_si128 ((M), (V))
2721228
2731229/* SSE4 64-bit Packed Integer Comparisons. */
1230/// \brief Compares each of the corresponding 64-bit values of the 128-bit
1231/// integer vectors for equality.
1232///
1233/// \headerfile <x86intrin.h>
1234///
1235/// This intrinsic corresponds to the <c> VPCMPEQQ / PCMPEQQ </c> instruction.
1236///
1237/// \param __V1
1238/// A 128-bit integer vector.
1239/// \param __V2
1240/// A 128-bit integer vector.
1241/// \returns A 128-bit integer vector containing the comparison results.
2741242static __inline__ __m128i __DEFAULT_FN_ATTRS
2751243_mm_cmpeq_epi64(__m128i __V1, __m128i __V2)
2761244{
......@@ -278,6 +1246,19 @@ _mm_cmpeq_epi64(__m128i __V1, __m128i __V2)
2781246}
2791247
2801248/* SSE4 Packed Integer Sign-Extension. */
1249/// \brief Sign-extends each of the lower eight 8-bit integer elements of a
1250/// 128-bit vector of [16 x i8] to 16-bit values and returns them in a
1251/// 128-bit vector of [8 x i16]. The upper eight elements of the input vector
1252/// are unused.
1253///
1254/// \headerfile <x86intrin.h>
1255///
1256/// This intrinsic corresponds to the <c> VPMOVSXBW / PMOVSXBW </c> instruction.
1257///
1258/// \param __V
1259/// A 128-bit vector of [16 x i8]. The lower eight 8-bit elements are sign-
1260/// extended to 16-bit values.
1261/// \returns A 128-bit vector of [8 x i16] containing the sign-extended values.
2811262static __inline__ __m128i __DEFAULT_FN_ATTRS
2821263_mm_cvtepi8_epi16(__m128i __V)
2831264{
......@@ -286,6 +1267,19 @@ _mm_cvtepi8_epi16(__m128i __V)
2861267 return (__m128i)__builtin_convertvector(__builtin_shufflevector((__v16qs)__V, (__v16qs)__V, 0, 1, 2, 3, 4, 5, 6, 7), __v8hi);
2871268}
2881269
1270/// \brief Sign-extends each of the lower four 8-bit integer elements of a
1271/// 128-bit vector of [16 x i8] to 32-bit values and returns them in a
1272/// 128-bit vector of [4 x i32]. The upper twelve elements of the input
1273/// vector are unused.
1274///
1275/// \headerfile <x86intrin.h>
1276///
1277/// This intrinsic corresponds to the <c> VPMOVSXBD / PMOVSXBD </c> instruction.
1278///
1279/// \param __V
1280/// A 128-bit vector of [16 x i8]. The lower four 8-bit elements are sign-
1281/// extended to 32-bit values.
1282/// \returns A 128-bit vector of [4 x i32] containing the sign-extended values.
2891283static __inline__ __m128i __DEFAULT_FN_ATTRS
2901284_mm_cvtepi8_epi32(__m128i __V)
2911285{
......@@ -294,6 +1288,19 @@ _mm_cvtepi8_epi32(__m128i __V)
2941288 return (__m128i)__builtin_convertvector(__builtin_shufflevector((__v16qs)__V, (__v16qs)__V, 0, 1, 2, 3), __v4si);
2951289}
2961290
1291/// \brief Sign-extends each of the lower two 8-bit integer elements of a
1292/// 128-bit integer vector of [16 x i8] to 64-bit values and returns them in
1293/// a 128-bit vector of [2 x i64]. The upper fourteen elements of the input
1294/// vector are unused.
1295///
1296/// \headerfile <x86intrin.h>
1297///
1298/// This intrinsic corresponds to the <c> VPMOVSXBQ / PMOVSXBQ </c> instruction.
1299///
1300/// \param __V
1301/// A 128-bit vector of [16 x i8]. The lower two 8-bit elements are sign-
1302/// extended to 64-bit values.
1303/// \returns A 128-bit vector of [2 x i64] containing the sign-extended values.
2971304static __inline__ __m128i __DEFAULT_FN_ATTRS
2981305_mm_cvtepi8_epi64(__m128i __V)
2991306{
......@@ -302,18 +1309,57 @@ _mm_cvtepi8_epi64(__m128i __V)
3021309 return (__m128i)__builtin_convertvector(__builtin_shufflevector((__v16qs)__V, (__v16qs)__V, 0, 1), __v2di);
3031310}
3041311
1312/// \brief Sign-extends each of the lower four 16-bit integer elements of a
1313/// 128-bit integer vector of [8 x i16] to 32-bit values and returns them in
1314/// a 128-bit vector of [4 x i32]. The upper four elements of the input
1315/// vector are unused.
1316///
1317/// \headerfile <x86intrin.h>
1318///
1319/// This intrinsic corresponds to the <c> VPMOVSXWD / PMOVSXWD </c> instruction.
1320///
1321/// \param __V
1322/// A 128-bit vector of [8 x i16]. The lower four 16-bit elements are sign-
1323/// extended to 32-bit values.
1324/// \returns A 128-bit vector of [4 x i32] containing the sign-extended values.
3051325static __inline__ __m128i __DEFAULT_FN_ATTRS
3061326_mm_cvtepi16_epi32(__m128i __V)
3071327{
3081328 return (__m128i)__builtin_convertvector(__builtin_shufflevector((__v8hi)__V, (__v8hi)__V, 0, 1, 2, 3), __v4si);
3091329}
3101330
1331/// \brief Sign-extends each of the lower two 16-bit integer elements of a
1332/// 128-bit integer vector of [8 x i16] to 64-bit values and returns them in
1333/// a 128-bit vector of [2 x i64]. The upper six elements of the input
1334/// vector are unused.
1335///
1336/// \headerfile <x86intrin.h>
1337///
1338/// This intrinsic corresponds to the <c> VPMOVSXWQ / PMOVSXWQ </c> instruction.
1339///
1340/// \param __V
1341/// A 128-bit vector of [8 x i16]. The lower two 16-bit elements are sign-
1342/// extended to 64-bit values.
1343/// \returns A 128-bit vector of [2 x i64] containing the sign-extended values.
3111344static __inline__ __m128i __DEFAULT_FN_ATTRS
3121345_mm_cvtepi16_epi64(__m128i __V)
3131346{
3141347 return (__m128i)__builtin_convertvector(__builtin_shufflevector((__v8hi)__V, (__v8hi)__V, 0, 1), __v2di);
3151348}
3161349
1350/// \brief Sign-extends each of the lower two 32-bit integer elements of a
1351/// 128-bit integer vector of [4 x i32] to 64-bit values and returns them in
1352/// a 128-bit vector of [2 x i64]. The upper two elements of the input vector
1353/// are unused.
1354///
1355/// \headerfile <x86intrin.h>
1356///
1357/// This intrinsic corresponds to the <c> VPMOVSXDQ / PMOVSXDQ </c> instruction.
1358///
1359/// \param __V
1360/// A 128-bit vector of [4 x i32]. The lower two 32-bit elements are sign-
1361/// extended to 64-bit values.
1362/// \returns A 128-bit vector of [2 x i64] containing the sign-extended values.
3171363static __inline__ __m128i __DEFAULT_FN_ATTRS
3181364_mm_cvtepi32_epi64(__m128i __V)
3191365{
......@@ -321,36 +1367,114 @@ _mm_cvtepi32_epi64(__m128i __V)
3211367}
3221368
3231369/* SSE4 Packed Integer Zero-Extension. */
1370/// \brief Zero-extends each of the lower eight 8-bit integer elements of a
1371/// 128-bit vector of [16 x i8] to 16-bit values and returns them in a
1372/// 128-bit vector of [8 x i16]. The upper eight elements of the input vector
1373/// are unused.
1374///
1375/// \headerfile <x86intrin.h>
1376///
1377/// This intrinsic corresponds to the <c> VPMOVZXBW / PMOVZXBW </c> instruction.
1378///
1379/// \param __V
1380/// A 128-bit vector of [16 x i8]. The lower eight 8-bit elements are zero-
1381/// extended to 16-bit values.
1382/// \returns A 128-bit vector of [8 x i16] containing the zero-extended values.
3241383static __inline__ __m128i __DEFAULT_FN_ATTRS
3251384_mm_cvtepu8_epi16(__m128i __V)
3261385{
3271386 return (__m128i)__builtin_convertvector(__builtin_shufflevector((__v16qu)__V, (__v16qu)__V, 0, 1, 2, 3, 4, 5, 6, 7), __v8hi);
3281387}
3291388
1389/// \brief Zero-extends each of the lower four 8-bit integer elements of a
1390/// 128-bit vector of [16 x i8] to 32-bit values and returns them in a
1391/// 128-bit vector of [4 x i32]. The upper twelve elements of the input
1392/// vector are unused.
1393///
1394/// \headerfile <x86intrin.h>
1395///
1396/// This intrinsic corresponds to the <c> VPMOVZXBD / PMOVZXBD </c> instruction.
1397///
1398/// \param __V
1399/// A 128-bit vector of [16 x i8]. The lower four 8-bit elements are zero-
1400/// extended to 32-bit values.
1401/// \returns A 128-bit vector of [4 x i32] containing the zero-extended values.
3301402static __inline__ __m128i __DEFAULT_FN_ATTRS
3311403_mm_cvtepu8_epi32(__m128i __V)
3321404{
3331405 return (__m128i)__builtin_convertvector(__builtin_shufflevector((__v16qu)__V, (__v16qu)__V, 0, 1, 2, 3), __v4si);
3341406}
3351407
1408/// \brief Zero-extends each of the lower two 8-bit integer elements of a
1409/// 128-bit integer vector of [16 x i8] to 64-bit values and returns them in
1410/// a 128-bit vector of [2 x i64]. The upper fourteen elements of the input
1411/// vector are unused.
1412///
1413/// \headerfile <x86intrin.h>
1414///
1415/// This intrinsic corresponds to the <c> VPMOVZXBQ / PMOVZXBQ </c> instruction.
1416///
1417/// \param __V
1418/// A 128-bit vector of [16 x i8]. The lower two 8-bit elements are zero-
1419/// extended to 64-bit values.
1420/// \returns A 128-bit vector of [2 x i64] containing the zero-extended values.
3361421static __inline__ __m128i __DEFAULT_FN_ATTRS
3371422_mm_cvtepu8_epi64(__m128i __V)
3381423{
3391424 return (__m128i)__builtin_convertvector(__builtin_shufflevector((__v16qu)__V, (__v16qu)__V, 0, 1), __v2di);
3401425}
3411426
1427/// \brief Zero-extends each of the lower four 16-bit integer elements of a
1428/// 128-bit integer vector of [8 x i16] to 32-bit values and returns them in
1429/// a 128-bit vector of [4 x i32]. The upper four elements of the input
1430/// vector are unused.
1431///
1432/// \headerfile <x86intrin.h>
1433///
1434/// This intrinsic corresponds to the <c> VPMOVZXWD / PMOVZXWD </c> instruction.
1435///
1436/// \param __V
1437/// A 128-bit vector of [8 x i16]. The lower four 16-bit elements are zero-
1438/// extended to 32-bit values.
1439/// \returns A 128-bit vector of [4 x i32] containing the zero-extended values.
3421440static __inline__ __m128i __DEFAULT_FN_ATTRS
3431441_mm_cvtepu16_epi32(__m128i __V)
3441442{
3451443 return (__m128i)__builtin_convertvector(__builtin_shufflevector((__v8hu)__V, (__v8hu)__V, 0, 1, 2, 3), __v4si);
3461444}
3471445
1446/// \brief Zero-extends each of the lower two 16-bit integer elements of a
1447/// 128-bit integer vector of [8 x i16] to 64-bit values and returns them in
1448/// a 128-bit vector of [2 x i64]. The upper six elements of the input vector
1449/// are unused.
1450///
1451/// \headerfile <x86intrin.h>
1452///
1453/// This intrinsic corresponds to the <c> VPMOVZXWQ / PMOVZXWQ </c> instruction.
1454///
1455/// \param __V
1456/// A 128-bit vector of [8 x i16]. The lower two 16-bit elements are zero-
1457/// extended to 64-bit values.
1458/// \returns A 128-bit vector of [2 x i64] containing the zero-extended values.
3481459static __inline__ __m128i __DEFAULT_FN_ATTRS
3491460_mm_cvtepu16_epi64(__m128i __V)
3501461{
3511462 return (__m128i)__builtin_convertvector(__builtin_shufflevector((__v8hu)__V, (__v8hu)__V, 0, 1), __v2di);
3521463}
3531464
1465/// \brief Zero-extends each of the lower two 32-bit integer elements of a
1466/// 128-bit integer vector of [4 x i32] to 64-bit values and returns them in
1467/// a 128-bit vector of [2 x i64]. The upper two elements of the input vector
1468/// are unused.
1469///
1470/// \headerfile <x86intrin.h>
1471///
1472/// This intrinsic corresponds to the <c> VPMOVZXDQ / PMOVZXDQ </c> instruction.
1473///
1474/// \param __V
1475/// A 128-bit vector of [4 x i32]. The lower two 32-bit elements are zero-
1476/// extended to 64-bit values.
1477/// \returns A 128-bit vector of [2 x i64] containing the zero-extended values.
3541478static __inline__ __m128i __DEFAULT_FN_ATTRS
3551479_mm_cvtepu32_epi64(__m128i __V)
3561480{
......@@ -358,6 +1482,28 @@ _mm_cvtepu32_epi64(__m128i __V)
3581482}
3591483
3601484/* SSE4 Pack with Unsigned Saturation. */
1485/// \brief Converts 32-bit signed integers from both 128-bit integer vector
1486/// operands into 16-bit unsigned integers, and returns the packed result.
1487/// Values greater than 0xFFFF are saturated to 0xFFFF. Values less than
1488/// 0x0000 are saturated to 0x0000.
1489///
1490/// \headerfile <x86intrin.h>
1491///
1492/// This intrinsic corresponds to the <c> VPACKUSDW / PACKUSDW </c> instruction.
1493///
1494/// \param __V1
1495/// A 128-bit vector of [4 x i32]. Each 32-bit element is treated as a
1496/// signed integer and is converted to a 16-bit unsigned integer with
1497/// saturation. Values greater than 0xFFFF are saturated to 0xFFFF. Values
1498/// less than 0x0000 are saturated to 0x0000. The converted [4 x i16] values
1499/// are written to the lower 64 bits of the result.
1500/// \param __V2
1501/// A 128-bit vector of [4 x i32]. Each 32-bit element is treated as a
1502/// signed integer and is converted to a 16-bit unsigned integer with
1503/// saturation. Values greater than 0xFFFF are saturated to 0xFFFF. Values
1504/// less than 0x0000 are saturated to 0x0000. The converted [4 x i16] values
1505/// are written to the higher 64 bits of the result.
1506/// \returns A 128-bit vector of [8 x i16] containing the converted values.
3611507static __inline__ __m128i __DEFAULT_FN_ATTRS
3621508_mm_packus_epi32(__m128i __V1, __m128i __V2)
3631509{
......@@ -365,10 +1511,58 @@ _mm_packus_epi32(__m128i __V1, __m128i __V2)
3651511}
3661512
3671513/* SSE4 Multiple Packed Sums of Absolute Difference. */
1514/// \brief Subtracts 8-bit unsigned integer values and computes the absolute
1515/// values of the differences to the corresponding bits in the destination.
1516/// Then sums of the absolute differences are returned according to the bit
1517/// fields in the immediate operand.
1518///
1519/// \headerfile <x86intrin.h>
1520///
1521/// \code
1522/// __m128i _mm_mpsadbw_epu8(__m128i X, __m128i Y, const int M);
1523/// \endcode
1524///
1525/// This intrinsic corresponds to the <c> VMPSADBW / MPSADBW </c> instruction.
1526///
1527/// \param X
1528/// A 128-bit vector of [16 x i8].
1529/// \param Y
1530/// A 128-bit vector of [16 x i8].
1531/// \param M
1532/// An 8-bit immediate operand specifying how the absolute differences are to
1533/// be calculated, according to the following algorithm:
1534/// \code
1535/// // M2 represents bit 2 of the immediate operand
1536/// // M10 represents bits [1:0] of the immediate operand
1537/// i = M2 * 4
1538/// j = M10 * 4
1539/// for (k = 0; k < 8; k = k + 1) {
1540/// d0 = abs(X[i + k + 0] - Y[j + 0])
1541/// d1 = abs(X[i + k + 1] - Y[j + 1])
1542/// d2 = abs(X[i + k + 2] - Y[j + 2])
1543/// d3 = abs(X[i + k + 3] - Y[j + 3])
1544/// r[k] = d0 + d1 + d2 + d3
1545/// }
1546/// \endcode
1547/// \returns A 128-bit integer vector containing the sums of the sets of
1548/// absolute differences between both operands.
3681549#define _mm_mpsadbw_epu8(X, Y, M) __extension__ ({ \
3691550 (__m128i) __builtin_ia32_mpsadbw128((__v16qi)(__m128i)(X), \
3701551 (__v16qi)(__m128i)(Y), (M)); })
3711552
1553/// \brief Finds the minimum unsigned 16-bit element in the input 128-bit
1554/// vector of [8 x u16] and returns it and along with its index.
1555///
1556/// \headerfile <x86intrin.h>
1557///
1558/// This intrinsic corresponds to the <c> VPHMINPOSUW / PHMINPOSUW </c>
1559/// instruction.
1560///
1561/// \param __V
1562/// A 128-bit vector of [8 x u16].
1563/// \returns A 128-bit value where bits [15:0] contain the minimum value found
1564/// in parameter \a __V, bits [18:16] contain the index of the minimum value
1565/// and the remaining bits are set to 0.
3721566static __inline__ __m128i __DEFAULT_FN_ATTRS
3731567_mm_minpos_epu16(__m128i __V)
3741568{
......@@ -410,61 +1604,769 @@ _mm_minpos_epu16(__m128i __V)
4101604#define _SIDD_UNIT_MASK 0x40
4111605
4121606/* SSE4.2 Packed Comparison Intrinsics. */
1607/// \brief Uses the immediate operand \a M to perform a comparison of string
1608/// data with implicitly defined lengths that is contained in source operands
1609/// \a A and \a B. Returns a 128-bit integer vector representing the result
1610/// mask of the comparison.
1611///
1612/// \headerfile <x86intrin.h>
1613///
1614/// \code
1615/// __m128i _mm_cmpistrm(__m128i A, __m128i B, const int M);
1616/// \endcode
1617///
1618/// This intrinsic corresponds to the <c> VPCMPISTRM / PCMPISTRM </c>
1619/// instruction.
1620///
1621/// \param A
1622/// A 128-bit integer vector containing one of the source operands to be
1623/// compared.
1624/// \param B
1625/// A 128-bit integer vector containing one of the source operands to be
1626/// compared.
1627/// \param M
1628/// An 8-bit immediate operand specifying whether the characters are bytes or
1629/// words, the type of comparison to perform, and the format of the return
1630/// value. \n
1631/// Bits [1:0]: Determine source data format. \n
1632/// 00: 16 unsigned bytes \n
1633/// 01: 8 unsigned words \n
1634/// 10: 16 signed bytes \n
1635/// 11: 8 signed words \n
1636/// Bits [3:2]: Determine comparison type and aggregation method. \n
1637/// 00: Subset: Each character in \a B is compared for equality with all
1638/// the characters in \a A. \n
1639/// 01: Ranges: Each character in \a B is compared to \a A. The comparison
1640/// basis is greater than or equal for even-indexed elements in \a A,
1641/// and less than or equal for odd-indexed elements in \a A. \n
1642/// 10: Match: Compare each pair of corresponding characters in \a A and
1643/// \a B for equality. \n
1644/// 11: Substring: Search \a B for substring matches of \a A. \n
1645/// Bits [5:4]: Determine whether to perform a one's complement on the bit
1646/// mask of the comparison results. \n
1647/// 00: No effect. \n
1648/// 01: Negate the bit mask. \n
1649/// 10: No effect. \n
1650/// 11: Negate the bit mask only for bits with an index less than or equal
1651/// to the size of \a A or \a B. \n
1652/// Bit [6]: Determines whether the result is zero-extended or expanded to 16
1653/// bytes. \n
1654/// 0: The result is zero-extended to 16 bytes. \n
1655/// 1: The result is expanded to 16 bytes (this expansion is performed by
1656/// repeating each bit 8 or 16 times).
1657/// \returns Returns a 128-bit integer vector representing the result mask of
1658/// the comparison.
4131659#define _mm_cmpistrm(A, B, M) \
4141660 (__m128i)__builtin_ia32_pcmpistrm128((__v16qi)(__m128i)(A), \
4151661 (__v16qi)(__m128i)(B), (int)(M))
1662
1663/// \brief Uses the immediate operand \a M to perform a comparison of string
1664/// data with implicitly defined lengths that is contained in source operands
1665/// \a A and \a B. Returns an integer representing the result index of the
1666/// comparison.
1667///
1668/// \headerfile <x86intrin.h>
1669///
1670/// \code
1671/// int _mm_cmpistri(__m128i A, __m128i B, const int M);
1672/// \endcode
1673///
1674/// This intrinsic corresponds to the <c> VPCMPISTRI / PCMPISTRI </c>
1675/// instruction.
1676///
1677/// \param A
1678/// A 128-bit integer vector containing one of the source operands to be
1679/// compared.
1680/// \param B
1681/// A 128-bit integer vector containing one of the source operands to be
1682/// compared.
1683/// \param M
1684/// An 8-bit immediate operand specifying whether the characters are bytes or
1685/// words, the type of comparison to perform, and the format of the return
1686/// value. \n
1687/// Bits [1:0]: Determine source data format. \n
1688/// 00: 16 unsigned bytes \n
1689/// 01: 8 unsigned words \n
1690/// 10: 16 signed bytes \n
1691/// 11: 8 signed words \n
1692/// Bits [3:2]: Determine comparison type and aggregation method. \n
1693/// 00: Subset: Each character in \a B is compared for equality with all
1694/// the characters in \a A. \n
1695/// 01: Ranges: Each character in \a B is compared to \a A. The comparison
1696/// basis is greater than or equal for even-indexed elements in \a A,
1697/// and less than or equal for odd-indexed elements in \a A. \n
1698/// 10: Match: Compare each pair of corresponding characters in \a A and
1699/// \a B for equality. \n
1700/// 11: Substring: Search B for substring matches of \a A. \n
1701/// Bits [5:4]: Determine whether to perform a one's complement on the bit
1702/// mask of the comparison results. \n
1703/// 00: No effect. \n
1704/// 01: Negate the bit mask. \n
1705/// 10: No effect. \n
1706/// 11: Negate the bit mask only for bits with an index less than or equal
1707/// to the size of \a A or \a B. \n
1708/// Bit [6]: Determines whether the index of the lowest set bit or the
1709/// highest set bit is returned. \n
1710/// 0: The index of the least significant set bit. \n
1711/// 1: The index of the most significant set bit. \n
1712/// \returns Returns an integer representing the result index of the comparison.
4161713#define _mm_cmpistri(A, B, M) \
4171714 (int)__builtin_ia32_pcmpistri128((__v16qi)(__m128i)(A), \
4181715 (__v16qi)(__m128i)(B), (int)(M))
4191716
1717/// \brief Uses the immediate operand \a M to perform a comparison of string
1718/// data with explicitly defined lengths that is contained in source operands
1719/// \a A and \a B. Returns a 128-bit integer vector representing the result
1720/// mask of the comparison.
1721///
1722/// \headerfile <x86intrin.h>
1723///
1724/// \code
1725/// __m128i _mm_cmpestrm(__m128i A, int LA, __m128i B, int LB, const int M);
1726/// \endcode
1727///
1728/// This intrinsic corresponds to the <c> VPCMPESTRM / PCMPESTRM </c>
1729/// instruction.
1730///
1731/// \param A
1732/// A 128-bit integer vector containing one of the source operands to be
1733/// compared.
1734/// \param LA
1735/// An integer that specifies the length of the string in \a A.
1736/// \param B
1737/// A 128-bit integer vector containing one of the source operands to be
1738/// compared.
1739/// \param LB
1740/// An integer that specifies the length of the string in \a B.
1741/// \param M
1742/// An 8-bit immediate operand specifying whether the characters are bytes or
1743/// words, the type of comparison to perform, and the format of the return
1744/// value. \n
1745/// Bits [1:0]: Determine source data format. \n
1746/// 00: 16 unsigned bytes \n
1747/// 01: 8 unsigned words \n
1748/// 10: 16 signed bytes \n
1749/// 11: 8 signed words \n
1750/// Bits [3:2]: Determine comparison type and aggregation method. \n
1751/// 00: Subset: Each character in \a B is compared for equality with all
1752/// the characters in \a A. \n
1753/// 01: Ranges: Each character in \a B is compared to \a A. The comparison
1754/// basis is greater than or equal for even-indexed elements in \a A,
1755/// and less than or equal for odd-indexed elements in \a A. \n
1756/// 10: Match: Compare each pair of corresponding characters in \a A and
1757/// \a B for equality. \n
1758/// 11: Substring: Search \a B for substring matches of \a A. \n
1759/// Bits [5:4]: Determine whether to perform a one's complement on the bit
1760/// mask of the comparison results. \n
1761/// 00: No effect. \n
1762/// 01: Negate the bit mask. \n
1763/// 10: No effect. \n
1764/// 11: Negate the bit mask only for bits with an index less than or equal
1765/// to the size of \a A or \a B. \n
1766/// Bit [6]: Determines whether the result is zero-extended or expanded to 16
1767/// bytes. \n
1768/// 0: The result is zero-extended to 16 bytes. \n
1769/// 1: The result is expanded to 16 bytes (this expansion is performed by
1770/// repeating each bit 8 or 16 times). \n
1771/// \returns Returns a 128-bit integer vector representing the result mask of
1772/// the comparison.
4201773#define _mm_cmpestrm(A, LA, B, LB, M) \
4211774 (__m128i)__builtin_ia32_pcmpestrm128((__v16qi)(__m128i)(A), (int)(LA), \
4221775 (__v16qi)(__m128i)(B), (int)(LB), \
4231776 (int)(M))
1777
1778/// \brief Uses the immediate operand \a M to perform a comparison of string
1779/// data with explicitly defined lengths that is contained in source operands
1780/// \a A and \a B. Returns an integer representing the result index of the
1781/// comparison.
1782///
1783/// \headerfile <x86intrin.h>
1784///
1785/// \code
1786/// int _mm_cmpestri(__m128i A, int LA, __m128i B, int LB, const int M);
1787/// \endcode
1788///
1789/// This intrinsic corresponds to the <c> VPCMPESTRI / PCMPESTRI </c>
1790/// instruction.
1791///
1792/// \param A
1793/// A 128-bit integer vector containing one of the source operands to be
1794/// compared.
1795/// \param LA
1796/// An integer that specifies the length of the string in \a A.
1797/// \param B
1798/// A 128-bit integer vector containing one of the source operands to be
1799/// compared.
1800/// \param LB
1801/// An integer that specifies the length of the string in \a B.
1802/// \param M
1803/// An 8-bit immediate operand specifying whether the characters are bytes or
1804/// words, the type of comparison to perform, and the format of the return
1805/// value. \n
1806/// Bits [1:0]: Determine source data format. \n
1807/// 00: 16 unsigned bytes \n
1808/// 01: 8 unsigned words \n
1809/// 10: 16 signed bytes \n
1810/// 11: 8 signed words \n
1811/// Bits [3:2]: Determine comparison type and aggregation method. \n
1812/// 00: Subset: Each character in \a B is compared for equality with all
1813/// the characters in \a A. \n
1814/// 01: Ranges: Each character in \a B is compared to \a A. The comparison
1815/// basis is greater than or equal for even-indexed elements in \a A,
1816/// and less than or equal for odd-indexed elements in \a A. \n
1817/// 10: Match: Compare each pair of corresponding characters in \a A and
1818/// \a B for equality. \n
1819/// 11: Substring: Search B for substring matches of \a A. \n
1820/// Bits [5:4]: Determine whether to perform a one's complement on the bit
1821/// mask of the comparison results. \n
1822/// 00: No effect. \n
1823/// 01: Negate the bit mask. \n
1824/// 10: No effect. \n
1825/// 11: Negate the bit mask only for bits with an index less than or equal
1826/// to the size of \a A or \a B. \n
1827/// Bit [6]: Determines whether the index of the lowest set bit or the
1828/// highest set bit is returned. \n
1829/// 0: The index of the least significant set bit. \n
1830/// 1: The index of the most significant set bit. \n
1831/// \returns Returns an integer representing the result index of the comparison.
4241832#define _mm_cmpestri(A, LA, B, LB, M) \
4251833 (int)__builtin_ia32_pcmpestri128((__v16qi)(__m128i)(A), (int)(LA), \
4261834 (__v16qi)(__m128i)(B), (int)(LB), \
4271835 (int)(M))
4281836
4291837/* SSE4.2 Packed Comparison Intrinsics and EFlag Reading. */
1838/// \brief Uses the immediate operand \a M to perform a comparison of string
1839/// data with implicitly defined lengths that is contained in source operands
1840/// \a A and \a B. Returns 1 if the bit mask is zero and the length of the
1841/// string in \a B is the maximum, otherwise, returns 0.
1842///
1843/// \headerfile <x86intrin.h>
1844///
1845/// \code
1846/// int _mm_cmpistra(__m128i A, __m128i B, const int M);
1847/// \endcode
1848///
1849/// This intrinsic corresponds to the <c> VPCMPISTRI / PCMPISTRI </c>
1850/// instruction.
1851///
1852/// \param A
1853/// A 128-bit integer vector containing one of the source operands to be
1854/// compared.
1855/// \param B
1856/// A 128-bit integer vector containing one of the source operands to be
1857/// compared.
1858/// \param M
1859/// An 8-bit immediate operand specifying whether the characters are bytes or
1860/// words and the type of comparison to perform. \n
1861/// Bits [1:0]: Determine source data format. \n
1862/// 00: 16 unsigned bytes \n
1863/// 01: 8 unsigned words \n
1864/// 10: 16 signed bytes \n
1865/// 11: 8 signed words \n
1866/// Bits [3:2]: Determine comparison type and aggregation method. \n
1867/// 00: Subset: Each character in \a B is compared for equality with all
1868/// the characters in \a A. \n
1869/// 01: Ranges: Each character in \a B is compared to \a A. The comparison
1870/// basis is greater than or equal for even-indexed elements in \a A,
1871/// and less than or equal for odd-indexed elements in \a A. \n
1872/// 10: Match: Compare each pair of corresponding characters in \a A and
1873/// \a B for equality. \n
1874/// 11: Substring: Search \a B for substring matches of \a A. \n
1875/// Bits [5:4]: Determine whether to perform a one's complement on the bit
1876/// mask of the comparison results. \n
1877/// 00: No effect. \n
1878/// 01: Negate the bit mask. \n
1879/// 10: No effect. \n
1880/// 11: Negate the bit mask only for bits with an index less than or equal
1881/// to the size of \a A or \a B. \n
1882/// \returns Returns 1 if the bit mask is zero and the length of the string in
1883/// \a B is the maximum; otherwise, returns 0.
4301884#define _mm_cmpistra(A, B, M) \
4311885 (int)__builtin_ia32_pcmpistria128((__v16qi)(__m128i)(A), \
4321886 (__v16qi)(__m128i)(B), (int)(M))
1887
1888/// \brief Uses the immediate operand \a M to perform a comparison of string
1889/// data with implicitly defined lengths that is contained in source operands
1890/// \a A and \a B. Returns 1 if the bit mask is non-zero, otherwise, returns
1891/// 0.
1892///
1893/// \headerfile <x86intrin.h>
1894///
1895/// \code
1896/// int _mm_cmpistrc(__m128i A, __m128i B, const int M);
1897/// \endcode
1898///
1899/// This intrinsic corresponds to the <c> VPCMPISTRI / PCMPISTRI </c>
1900/// instruction.
1901///
1902/// \param A
1903/// A 128-bit integer vector containing one of the source operands to be
1904/// compared.
1905/// \param B
1906/// A 128-bit integer vector containing one of the source operands to be
1907/// compared.
1908/// \param M
1909/// An 8-bit immediate operand specifying whether the characters are bytes or
1910/// words and the type of comparison to perform. \n
1911/// Bits [1:0]: Determine source data format. \n
1912/// 00: 16 unsigned bytes \n
1913/// 01: 8 unsigned words \n
1914/// 10: 16 signed bytes \n
1915/// 11: 8 signed words \n
1916/// Bits [3:2]: Determine comparison type and aggregation method. \n
1917/// 00: Subset: Each character in \a B is compared for equality with all
1918/// the characters in \a A. \n
1919/// 01: Ranges: Each character in \a B is compared to \a A. The comparison
1920/// basis is greater than or equal for even-indexed elements in \a A,
1921/// and less than or equal for odd-indexed elements in \a A. \n
1922/// 10: Match: Compare each pair of corresponding characters in \a A and
1923/// \a B for equality. \n
1924/// 11: Substring: Search B for substring matches of \a A. \n
1925/// Bits [5:4]: Determine whether to perform a one's complement on the bit
1926/// mask of the comparison results. \n
1927/// 00: No effect. \n
1928/// 01: Negate the bit mask. \n
1929/// 10: No effect. \n
1930/// 11: Negate the bit mask only for bits with an index less than or equal
1931/// to the size of \a A or \a B.
1932/// \returns Returns 1 if the bit mask is non-zero, otherwise, returns 0.
4331933#define _mm_cmpistrc(A, B, M) \
4341934 (int)__builtin_ia32_pcmpistric128((__v16qi)(__m128i)(A), \
4351935 (__v16qi)(__m128i)(B), (int)(M))
1936
1937/// \brief Uses the immediate operand \a M to perform a comparison of string
1938/// data with implicitly defined lengths that is contained in source operands
1939/// \a A and \a B. Returns bit 0 of the resulting bit mask.
1940///
1941/// \headerfile <x86intrin.h>
1942///
1943/// \code
1944/// int _mm_cmpistro(__m128i A, __m128i B, const int M);
1945/// \endcode
1946///
1947/// This intrinsic corresponds to the <c> VPCMPISTRI / PCMPISTRI </c>
1948/// instruction.
1949///
1950/// \param A
1951/// A 128-bit integer vector containing one of the source operands to be
1952/// compared.
1953/// \param B
1954/// A 128-bit integer vector containing one of the source operands to be
1955/// compared.
1956/// \param M
1957/// An 8-bit immediate operand specifying whether the characters are bytes or
1958/// words and the type of comparison to perform. \n
1959/// Bits [1:0]: Determine source data format. \n
1960/// 00: 16 unsigned bytes \n
1961/// 01: 8 unsigned words \n
1962/// 10: 16 signed bytes \n
1963/// 11: 8 signed words \n
1964/// Bits [3:2]: Determine comparison type and aggregation method. \n
1965/// 00: Subset: Each character in \a B is compared for equality with all
1966/// the characters in \a A. \n
1967/// 01: Ranges: Each character in \a B is compared to \a A. The comparison
1968/// basis is greater than or equal for even-indexed elements in \a A,
1969/// and less than or equal for odd-indexed elements in \a A. \n
1970/// 10: Match: Compare each pair of corresponding characters in \a A and
1971/// \a B for equality. \n
1972/// 11: Substring: Search B for substring matches of \a A. \n
1973/// Bits [5:4]: Determine whether to perform a one's complement on the bit
1974/// mask of the comparison results. \n
1975/// 00: No effect. \n
1976/// 01: Negate the bit mask. \n
1977/// 10: No effect. \n
1978/// 11: Negate the bit mask only for bits with an index less than or equal
1979/// to the size of \a A or \a B. \n
1980/// \returns Returns bit 0 of the resulting bit mask.
4361981#define _mm_cmpistro(A, B, M) \
4371982 (int)__builtin_ia32_pcmpistrio128((__v16qi)(__m128i)(A), \
4381983 (__v16qi)(__m128i)(B), (int)(M))
1984
1985/// \brief Uses the immediate operand \a M to perform a comparison of string
1986/// data with implicitly defined lengths that is contained in source operands
1987/// \a A and \a B. Returns 1 if the length of the string in \a A is less than
1988/// the maximum, otherwise, returns 0.
1989///
1990/// \headerfile <x86intrin.h>
1991///
1992/// \code
1993/// int _mm_cmpistrs(__m128i A, __m128i B, const int M);
1994/// \endcode
1995///
1996/// This intrinsic corresponds to the <c> VPCMPISTRI / PCMPISTRI </c>
1997/// instruction.
1998///
1999/// \param A
2000/// A 128-bit integer vector containing one of the source operands to be
2001/// compared.
2002/// \param B
2003/// A 128-bit integer vector containing one of the source operands to be
2004/// compared.
2005/// \param M
2006/// An 8-bit immediate operand specifying whether the characters are bytes or
2007/// words and the type of comparison to perform. \n
2008/// Bits [1:0]: Determine source data format. \n
2009/// 00: 16 unsigned bytes \n
2010/// 01: 8 unsigned words \n
2011/// 10: 16 signed bytes \n
2012/// 11: 8 signed words \n
2013/// Bits [3:2]: Determine comparison type and aggregation method. \n
2014/// 00: Subset: Each character in \a B is compared for equality with all
2015/// the characters in \a A. \n
2016/// 01: Ranges: Each character in \a B is compared to \a A. The comparison
2017/// basis is greater than or equal for even-indexed elements in \a A,
2018/// and less than or equal for odd-indexed elements in \a A. \n
2019/// 10: Match: Compare each pair of corresponding characters in \a A and
2020/// \a B for equality. \n
2021/// 11: Substring: Search \a B for substring matches of \a A. \n
2022/// Bits [5:4]: Determine whether to perform a one's complement on the bit
2023/// mask of the comparison results. \n
2024/// 00: No effect. \n
2025/// 01: Negate the bit mask. \n
2026/// 10: No effect. \n
2027/// 11: Negate the bit mask only for bits with an index less than or equal
2028/// to the size of \a A or \a B. \n
2029/// \returns Returns 1 if the length of the string in \a A is less than the
2030/// maximum, otherwise, returns 0.
4392031#define _mm_cmpistrs(A, B, M) \
4402032 (int)__builtin_ia32_pcmpistris128((__v16qi)(__m128i)(A), \
4412033 (__v16qi)(__m128i)(B), (int)(M))
2034
2035/// \brief Uses the immediate operand \a M to perform a comparison of string
2036/// data with implicitly defined lengths that is contained in source operands
2037/// \a A and \a B. Returns 1 if the length of the string in \a B is less than
2038/// the maximum, otherwise, returns 0.
2039///
2040/// \headerfile <x86intrin.h>
2041///
2042/// \code
2043/// int _mm_cmpistrz(__m128i A, __m128i B, const int M);
2044/// \endcode
2045///
2046/// This intrinsic corresponds to the <c> VPCMPISTRI / PCMPISTRI </c>
2047/// instruction.
2048///
2049/// \param A
2050/// A 128-bit integer vector containing one of the source operands to be
2051/// compared.
2052/// \param B
2053/// A 128-bit integer vector containing one of the source operands to be
2054/// compared.
2055/// \param M
2056/// An 8-bit immediate operand specifying whether the characters are bytes or
2057/// words and the type of comparison to perform. \n
2058/// Bits [1:0]: Determine source data format. \n
2059/// 00: 16 unsigned bytes \n
2060/// 01: 8 unsigned words \n
2061/// 10: 16 signed bytes \n
2062/// 11: 8 signed words \n
2063/// Bits [3:2]: Determine comparison type and aggregation method. \n
2064/// 00: Subset: Each character in \a B is compared for equality with all
2065/// the characters in \a A. \n
2066/// 01: Ranges: Each character in \a B is compared to \a A. The comparison
2067/// basis is greater than or equal for even-indexed elements in \a A,
2068/// and less than or equal for odd-indexed elements in \a A. \n
2069/// 10: Match: Compare each pair of corresponding characters in \a A and
2070/// \a B for equality. \n
2071/// 11: Substring: Search \a B for substring matches of \a A. \n
2072/// Bits [5:4]: Determine whether to perform a one's complement on the bit
2073/// mask of the comparison results. \n
2074/// 00: No effect. \n
2075/// 01: Negate the bit mask. \n
2076/// 10: No effect. \n
2077/// 11: Negate the bit mask only for bits with an index less than or equal
2078/// to the size of \a A or \a B.
2079/// \returns Returns 1 if the length of the string in \a B is less than the
2080/// maximum, otherwise, returns 0.
4422081#define _mm_cmpistrz(A, B, M) \
4432082 (int)__builtin_ia32_pcmpistriz128((__v16qi)(__m128i)(A), \
4442083 (__v16qi)(__m128i)(B), (int)(M))
4452084
2085/// \brief Uses the immediate operand \a M to perform a comparison of string
2086/// data with explicitly defined lengths that is contained in source operands
2087/// \a A and \a B. Returns 1 if the bit mask is zero and the length of the
2088/// string in \a B is the maximum, otherwise, returns 0.
2089///
2090/// \headerfile <x86intrin.h>
2091///
2092/// \code
2093/// int _mm_cmpestra(__m128i A, int LA, __m128i B, int LB, const int M);
2094/// \endcode
2095///
2096/// This intrinsic corresponds to the <c> VPCMPESTRI / PCMPESTRI </c>
2097/// instruction.
2098///
2099/// \param A
2100/// A 128-bit integer vector containing one of the source operands to be
2101/// compared.
2102/// \param LA
2103/// An integer that specifies the length of the string in \a A.
2104/// \param B
2105/// A 128-bit integer vector containing one of the source operands to be
2106/// compared.
2107/// \param LB
2108/// An integer that specifies the length of the string in \a B.
2109/// \param M
2110/// An 8-bit immediate operand specifying whether the characters are bytes or
2111/// words and the type of comparison to perform. \n
2112/// Bits [1:0]: Determine source data format. \n
2113/// 00: 16 unsigned bytes \n
2114/// 01: 8 unsigned words \n
2115/// 10: 16 signed bytes \n
2116/// 11: 8 signed words \n
2117/// Bits [3:2]: Determine comparison type and aggregation method. \n
2118/// 00: Subset: Each character in \a B is compared for equality with all
2119/// the characters in \a A. \n
2120/// 01: Ranges: Each character in \a B is compared to \a A. The comparison
2121/// basis is greater than or equal for even-indexed elements in \a A,
2122/// and less than or equal for odd-indexed elements in \a A. \n
2123/// 10: Match: Compare each pair of corresponding characters in \a A and
2124/// \a B for equality. \n
2125/// 11: Substring: Search \a B for substring matches of \a A. \n
2126/// Bits [5:4]: Determine whether to perform a one's complement on the bit
2127/// mask of the comparison results. \n
2128/// 00: No effect. \n
2129/// 01: Negate the bit mask. \n
2130/// 10: No effect. \n
2131/// 11: Negate the bit mask only for bits with an index less than or equal
2132/// to the size of \a A or \a B.
2133/// \returns Returns 1 if the bit mask is zero and the length of the string in
2134/// \a B is the maximum, otherwise, returns 0.
4462135#define _mm_cmpestra(A, LA, B, LB, M) \
4472136 (int)__builtin_ia32_pcmpestria128((__v16qi)(__m128i)(A), (int)(LA), \
4482137 (__v16qi)(__m128i)(B), (int)(LB), \
4492138 (int)(M))
2139
2140/// \brief Uses the immediate operand \a M to perform a comparison of string
2141/// data with explicitly defined lengths that is contained in source operands
2142/// \a A and \a B. Returns 1 if the resulting mask is non-zero, otherwise,
2143/// returns 0.
2144///
2145/// \headerfile <x86intrin.h>
2146///
2147/// \code
2148/// int _mm_cmpestrc(__m128i A, int LA, __m128i B, int LB, const int M);
2149/// \endcode
2150///
2151/// This intrinsic corresponds to the <c> VPCMPESTRI / PCMPESTRI </c>
2152/// instruction.
2153///
2154/// \param A
2155/// A 128-bit integer vector containing one of the source operands to be
2156/// compared.
2157/// \param LA
2158/// An integer that specifies the length of the string in \a A.
2159/// \param B
2160/// A 128-bit integer vector containing one of the source operands to be
2161/// compared.
2162/// \param LB
2163/// An integer that specifies the length of the string in \a B.
2164/// \param M
2165/// An 8-bit immediate operand specifying whether the characters are bytes or
2166/// words and the type of comparison to perform. \n
2167/// Bits [1:0]: Determine source data format. \n
2168/// 00: 16 unsigned bytes \n
2169/// 01: 8 unsigned words \n
2170/// 10: 16 signed bytes \n
2171/// 11: 8 signed words \n
2172/// Bits [3:2]: Determine comparison type and aggregation method. \n
2173/// 00: Subset: Each character in \a B is compared for equality with all
2174/// the characters in \a A. \n
2175/// 01: Ranges: Each character in \a B is compared to \a A. The comparison
2176/// basis is greater than or equal for even-indexed elements in \a A,
2177/// and less than or equal for odd-indexed elements in \a A. \n
2178/// 10: Match: Compare each pair of corresponding characters in \a A and
2179/// \a B for equality. \n
2180/// 11: Substring: Search \a B for substring matches of \a A. \n
2181/// Bits [5:4]: Determine whether to perform a one's complement on the bit
2182/// mask of the comparison results. \n
2183/// 00: No effect. \n
2184/// 01: Negate the bit mask. \n
2185/// 10: No effect. \n
2186/// 11: Negate the bit mask only for bits with an index less than or equal
2187/// to the size of \a A or \a B. \n
2188/// \returns Returns 1 if the resulting mask is non-zero, otherwise, returns 0.
4502189#define _mm_cmpestrc(A, LA, B, LB, M) \
4512190 (int)__builtin_ia32_pcmpestric128((__v16qi)(__m128i)(A), (int)(LA), \
4522191 (__v16qi)(__m128i)(B), (int)(LB), \
4532192 (int)(M))
2193
2194/// \brief Uses the immediate operand \a M to perform a comparison of string
2195/// data with explicitly defined lengths that is contained in source operands
2196/// \a A and \a B. Returns bit 0 of the resulting bit mask.
2197///
2198/// \headerfile <x86intrin.h>
2199///
2200/// \code
2201/// int _mm_cmpestro(__m128i A, int LA, __m128i B, int LB, const int M);
2202/// \endcode
2203///
2204/// This intrinsic corresponds to the <c> VPCMPESTRI / PCMPESTRI </c>
2205/// instruction.
2206///
2207/// \param A
2208/// A 128-bit integer vector containing one of the source operands to be
2209/// compared.
2210/// \param LA
2211/// An integer that specifies the length of the string in \a A.
2212/// \param B
2213/// A 128-bit integer vector containing one of the source operands to be
2214/// compared.
2215/// \param LB
2216/// An integer that specifies the length of the string in \a B.
2217/// \param M
2218/// An 8-bit immediate operand specifying whether the characters are bytes or
2219/// words and the type of comparison to perform. \n
2220/// Bits [1:0]: Determine source data format. \n
2221/// 00: 16 unsigned bytes \n
2222/// 01: 8 unsigned words \n
2223/// 10: 16 signed bytes \n
2224/// 11: 8 signed words \n
2225/// Bits [3:2]: Determine comparison type and aggregation method. \n
2226/// 00: Subset: Each character in \a B is compared for equality with all
2227/// the characters in \a A. \n
2228/// 01: Ranges: Each character in \a B is compared to \a A. The comparison
2229/// basis is greater than or equal for even-indexed elements in \a A,
2230/// and less than or equal for odd-indexed elements in \a A. \n
2231/// 10: Match: Compare each pair of corresponding characters in \a A and
2232/// \a B for equality. \n
2233/// 11: Substring: Search \a B for substring matches of \a A. \n
2234/// Bits [5:4]: Determine whether to perform a one's complement on the bit
2235/// mask of the comparison results. \n
2236/// 00: No effect. \n
2237/// 01: Negate the bit mask. \n
2238/// 10: No effect. \n
2239/// 11: Negate the bit mask only for bits with an index less than or equal
2240/// to the size of \a A or \a B.
2241/// \returns Returns bit 0 of the resulting bit mask.
4542242#define _mm_cmpestro(A, LA, B, LB, M) \
4552243 (int)__builtin_ia32_pcmpestrio128((__v16qi)(__m128i)(A), (int)(LA), \
4562244 (__v16qi)(__m128i)(B), (int)(LB), \
4572245 (int)(M))
2246
2247/// \brief Uses the immediate operand \a M to perform a comparison of string
2248/// data with explicitly defined lengths that is contained in source operands
2249/// \a A and \a B. Returns 1 if the length of the string in \a A is less than
2250/// the maximum, otherwise, returns 0.
2251///
2252/// \headerfile <x86intrin.h>
2253///
2254/// \code
2255/// int _mm_cmpestrs(__m128i A, int LA, __m128i B, int LB, const int M);
2256/// \endcode
2257///
2258/// This intrinsic corresponds to the <c> VPCMPESTRI / PCMPESTRI </c>
2259/// instruction.
2260///
2261/// \param A
2262/// A 128-bit integer vector containing one of the source operands to be
2263/// compared.
2264/// \param LA
2265/// An integer that specifies the length of the string in \a A.
2266/// \param B
2267/// A 128-bit integer vector containing one of the source operands to be
2268/// compared.
2269/// \param LB
2270/// An integer that specifies the length of the string in \a B.
2271/// \param M
2272/// An 8-bit immediate operand specifying whether the characters are bytes or
2273/// words and the type of comparison to perform. \n
2274/// Bits [1:0]: Determine source data format. \n
2275/// 00: 16 unsigned bytes \n
2276/// 01: 8 unsigned words \n
2277/// 10: 16 signed bytes \n
2278/// 11: 8 signed words \n
2279/// Bits [3:2]: Determine comparison type and aggregation method. \n
2280/// 00: Subset: Each character in \a B is compared for equality with all
2281/// the characters in \a A. \n
2282/// 01: Ranges: Each character in \a B is compared to \a A. The comparison
2283/// basis is greater than or equal for even-indexed elements in \a A,
2284/// and less than or equal for odd-indexed elements in \a A. \n
2285/// 10: Match: Compare each pair of corresponding characters in \a A and
2286/// \a B for equality. \n
2287/// 11: Substring: Search \a B for substring matches of \a A. \n
2288/// Bits [5:4]: Determine whether to perform a one's complement in the bit
2289/// mask of the comparison results. \n
2290/// 00: No effect. \n
2291/// 01: Negate the bit mask. \n
2292/// 10: No effect. \n
2293/// 11: Negate the bit mask only for bits with an index less than or equal
2294/// to the size of \a A or \a B. \n
2295/// \returns Returns 1 if the length of the string in \a A is less than the
2296/// maximum, otherwise, returns 0.
4582297#define _mm_cmpestrs(A, LA, B, LB, M) \
4592298 (int)__builtin_ia32_pcmpestris128((__v16qi)(__m128i)(A), (int)(LA), \
4602299 (__v16qi)(__m128i)(B), (int)(LB), \
4612300 (int)(M))
2301
2302/// \brief Uses the immediate operand \a M to perform a comparison of string
2303/// data with explicitly defined lengths that is contained in source operands
2304/// \a A and \a B. Returns 1 if the length of the string in \a B is less than
2305/// the maximum, otherwise, returns 0.
2306///
2307/// \headerfile <x86intrin.h>
2308///
2309/// \code
2310/// int _mm_cmpestrz(__m128i A, int LA, __m128i B, int LB, const int M);
2311/// \endcode
2312///
2313/// This intrinsic corresponds to the <c> VPCMPESTRI </c> instruction.
2314///
2315/// \param A
2316/// A 128-bit integer vector containing one of the source operands to be
2317/// compared.
2318/// \param LA
2319/// An integer that specifies the length of the string in \a A.
2320/// \param B
2321/// A 128-bit integer vector containing one of the source operands to be
2322/// compared.
2323/// \param LB
2324/// An integer that specifies the length of the string in \a B.
2325/// \param M
2326/// An 8-bit immediate operand specifying whether the characters are bytes or
2327/// words and the type of comparison to perform. \n
2328/// Bits [1:0]: Determine source data format. \n
2329/// 00: 16 unsigned bytes \n
2330/// 01: 8 unsigned words \n
2331/// 10: 16 signed bytes \n
2332/// 11: 8 signed words \n
2333/// Bits [3:2]: Determine comparison type and aggregation method. \n
2334/// 00: Subset: Each character in \a B is compared for equality with all
2335/// the characters in \a A. \n
2336/// 01: Ranges: Each character in \a B is compared to \a A. The comparison
2337/// basis is greater than or equal for even-indexed elements in \a A,
2338/// and less than or equal for odd-indexed elements in \a A. \n
2339/// 10: Match: Compare each pair of corresponding characters in \a A and
2340/// \a B for equality. \n
2341/// 11: Substring: Search \a B for substring matches of \a A. \n
2342/// Bits [5:4]: Determine whether to perform a one's complement on the bit
2343/// mask of the comparison results. \n
2344/// 00: No effect. \n
2345/// 01: Negate the bit mask. \n
2346/// 10: No effect. \n
2347/// 11: Negate the bit mask only for bits with an index less than or equal
2348/// to the size of \a A or \a B.
2349/// \returns Returns 1 if the length of the string in \a B is less than the
2350/// maximum, otherwise, returns 0.
4622351#define _mm_cmpestrz(A, LA, B, LB, M) \
4632352 (int)__builtin_ia32_pcmpestriz128((__v16qi)(__m128i)(A), (int)(LA), \
4642353 (__v16qi)(__m128i)(B), (int)(LB), \
4652354 (int)(M))
4662355
4672356/* SSE4.2 Compare Packed Data -- Greater Than. */
2357/// \brief Compares each of the corresponding 64-bit values of the 128-bit
2358/// integer vectors to determine if the values in the first operand are
2359/// greater than those in the second operand.
2360///
2361/// \headerfile <x86intrin.h>
2362///
2363/// This intrinsic corresponds to the <c> VPCMPGTQ / PCMPGTQ </c> instruction.
2364///
2365/// \param __V1
2366/// A 128-bit integer vector.
2367/// \param __V2
2368/// A 128-bit integer vector.
2369/// \returns A 128-bit integer vector containing the comparison results.
4682370static __inline__ __m128i __DEFAULT_FN_ATTRS
4692371_mm_cmpgt_epi64(__m128i __V1, __m128i __V2)
4702372{
......@@ -472,18 +2374,60 @@ _mm_cmpgt_epi64(__m128i __V1, __m128i __V2)
4722374}
4732375
4742376/* SSE4.2 Accumulate CRC32. */
2377/// \brief Adds the unsigned integer operand to the CRC-32C checksum of the
2378/// unsigned char operand.
2379///
2380/// \headerfile <x86intrin.h>
2381///
2382/// This intrinsic corresponds to the <c> CRC32B </c> instruction.
2383///
2384/// \param __C
2385/// An unsigned integer operand to add to the CRC-32C checksum of operand
2386/// \a __D.
2387/// \param __D
2388/// An unsigned 8-bit integer operand used to compute the CRC-32C checksum.
2389/// \returns The result of adding operand \a __C to the CRC-32C checksum of
2390/// operand \a __D.
4752391static __inline__ unsigned int __DEFAULT_FN_ATTRS
4762392_mm_crc32_u8(unsigned int __C, unsigned char __D)
4772393{
4782394 return __builtin_ia32_crc32qi(__C, __D);
4792395}
4802396
2397/// \brief Adds the unsigned integer operand to the CRC-32C checksum of the
2398/// unsigned short operand.
2399///
2400/// \headerfile <x86intrin.h>
2401///
2402/// This intrinsic corresponds to the <c> CRC32W </c> instruction.
2403///
2404/// \param __C
2405/// An unsigned integer operand to add to the CRC-32C checksum of operand
2406/// \a __D.
2407/// \param __D
2408/// An unsigned 16-bit integer operand used to compute the CRC-32C checksum.
2409/// \returns The result of adding operand \a __C to the CRC-32C checksum of
2410/// operand \a __D.
4812411static __inline__ unsigned int __DEFAULT_FN_ATTRS
4822412_mm_crc32_u16(unsigned int __C, unsigned short __D)
4832413{
4842414 return __builtin_ia32_crc32hi(__C, __D);
4852415}
4862416
2417/// \brief Adds the first unsigned integer operand to the CRC-32C checksum of
2418/// the second unsigned integer operand.
2419///
2420/// \headerfile <x86intrin.h>
2421///
2422/// This intrinsic corresponds to the <c> CRC32L </c> instruction.
2423///
2424/// \param __C
2425/// An unsigned integer operand to add to the CRC-32C checksum of operand
2426/// \a __D.
2427/// \param __D
2428/// An unsigned 32-bit integer operand used to compute the CRC-32C checksum.
2429/// \returns The result of adding operand \a __C to the CRC-32C checksum of
2430/// operand \a __D.
4872431static __inline__ unsigned int __DEFAULT_FN_ATTRS
4882432_mm_crc32_u32(unsigned int __C, unsigned int __D)
4892433{
......@@ -491,6 +2435,20 @@ _mm_crc32_u32(unsigned int __C, unsigned int __D)
4912435}
4922436
4932437#ifdef __x86_64__
2438/// \brief Adds the unsigned integer operand to the CRC-32C checksum of the
2439/// unsigned 64-bit integer operand.
2440///
2441/// \headerfile <x86intrin.h>
2442///
2443/// This intrinsic corresponds to the <c> CRC32Q </c> instruction.
2444///
2445/// \param __C
2446/// An unsigned integer operand to add to the CRC-32C checksum of operand
2447/// \a __D.
2448/// \param __D
2449/// An unsigned 64-bit integer operand used to compute the CRC-32C checksum.
2450/// \returns The result of adding operand \a __C to the CRC-32C checksum of
2451/// operand \a __D.
4942452static __inline__ unsigned long long __DEFAULT_FN_ATTRS
4952453_mm_crc32_u64(unsigned long long __C, unsigned long long __D)
4962454{
c_headers/stdarg.h+1-3
......@@ -43,14 +43,12 @@ typedef __builtin_va_list va_list;
4343#define va_copy(dest, src) __builtin_va_copy(dest, src)
4444#endif
4545
46/* Hack required to make standard headers work, at least on Ubuntu */
4746#ifndef __GNUC_VA_LIST
4847#define __GNUC_VA_LIST 1
49#endif
5048typedef __builtin_va_list __gnuc_va_list;
51
5249/* zig: added because glibc stdio.h was duplicately defining va_list
5350 */
5451#define _VA_LIST_DEFINED
52#endif
5553
5654#endif /* __STDARG_H */
c_headers/stdatomic.h+10-10
......@@ -40,16 +40,16 @@ extern "C" {
4040
4141/* 7.17.1 Introduction */
4242
43#define ATOMIC_BOOL_LOCK_FREE __GCC_ATOMIC_BOOL_LOCK_FREE
44#define ATOMIC_CHAR_LOCK_FREE __GCC_ATOMIC_CHAR_LOCK_FREE
45#define ATOMIC_CHAR16_T_LOCK_FREE __GCC_ATOMIC_CHAR16_T_LOCK_FREE
46#define ATOMIC_CHAR32_T_LOCK_FREE __GCC_ATOMIC_CHAR32_T_LOCK_FREE
47#define ATOMIC_WCHAR_T_LOCK_FREE __GCC_ATOMIC_WCHAR_T_LOCK_FREE
48#define ATOMIC_SHORT_LOCK_FREE __GCC_ATOMIC_SHORT_LOCK_FREE
49#define ATOMIC_INT_LOCK_FREE __GCC_ATOMIC_INT_LOCK_FREE
50#define ATOMIC_LONG_LOCK_FREE __GCC_ATOMIC_LONG_LOCK_FREE
51#define ATOMIC_LLONG_LOCK_FREE __GCC_ATOMIC_LLONG_LOCK_FREE
52#define ATOMIC_POINTER_LOCK_FREE __GCC_ATOMIC_POINTER_LOCK_FREE
43#define ATOMIC_BOOL_LOCK_FREE __CLANG_ATOMIC_BOOL_LOCK_FREE
44#define ATOMIC_CHAR_LOCK_FREE __CLANG_ATOMIC_CHAR_LOCK_FREE
45#define ATOMIC_CHAR16_T_LOCK_FREE __CLANG_ATOMIC_CHAR16_T_LOCK_FREE
46#define ATOMIC_CHAR32_T_LOCK_FREE __CLANG_ATOMIC_CHAR32_T_LOCK_FREE
47#define ATOMIC_WCHAR_T_LOCK_FREE __CLANG_ATOMIC_WCHAR_T_LOCK_FREE
48#define ATOMIC_SHORT_LOCK_FREE __CLANG_ATOMIC_SHORT_LOCK_FREE
49#define ATOMIC_INT_LOCK_FREE __CLANG_ATOMIC_INT_LOCK_FREE
50#define ATOMIC_LONG_LOCK_FREE __CLANG_ATOMIC_LONG_LOCK_FREE
51#define ATOMIC_LLONG_LOCK_FREE __CLANG_ATOMIC_LLONG_LOCK_FREE
52#define ATOMIC_POINTER_LOCK_FREE __CLANG_ATOMIC_POINTER_LOCK_FREE
5353
5454/* 7.17.2 Initialization */
5555
c_headers/stdint.h+13-16
......@@ -255,19 +255,16 @@ typedef __uint_least8_t uint_fast8_t;
255255 */
256256#define __stdint_join3(a,b,c) a ## b ## c
257257
258#define __intn_t(n) __stdint_join3( int, n, _t)
259#define __uintn_t(n) __stdint_join3(uint, n, _t)
260
261258#ifndef _INTPTR_T
262259#ifndef __intptr_t_defined
263typedef __intn_t(__INTPTR_WIDTH__) intptr_t;
260typedef __INTPTR_TYPE__ intptr_t;
264261#define __intptr_t_defined
265262#define _INTPTR_T
266263#endif
267264#endif
268265
269266#ifndef _UINTPTR_T
270typedef __uintn_t(__INTPTR_WIDTH__) uintptr_t;
267typedef __UINTPTR_TYPE__ uintptr_t;
271268#define _UINTPTR_T
272269#endif
273270
......@@ -659,12 +656,12 @@ typedef __UINTMAX_TYPE__ uintmax_t;
659656/* C99 7.18.2.4 Limits of integer types capable of holding object pointers. */
660657/* C99 7.18.3 Limits of other integer types. */
661658
662#define INTPTR_MIN __INTN_MIN(__INTPTR_WIDTH__)
663#define INTPTR_MAX __INTN_MAX(__INTPTR_WIDTH__)
664#define UINTPTR_MAX __UINTN_MAX(__INTPTR_WIDTH__)
665#define PTRDIFF_MIN __INTN_MIN(__PTRDIFF_WIDTH__)
666#define PTRDIFF_MAX __INTN_MAX(__PTRDIFF_WIDTH__)
667#define SIZE_MAX __UINTN_MAX(__SIZE_WIDTH__)
659#define INTPTR_MIN (-__INTPTR_MAX__-1)
660#define INTPTR_MAX __INTPTR_MAX__
661#define UINTPTR_MAX __UINTPTR_MAX__
662#define PTRDIFF_MIN (-__PTRDIFF_MAX__-1)
663#define PTRDIFF_MAX __PTRDIFF_MAX__
664#define SIZE_MAX __SIZE_MAX__
668665
669666/* ISO9899:2011 7.20 (C11 Annex K): Define RSIZE_MAX if __STDC_WANT_LIB_EXT1__
670667 * is enabled. */
......@@ -673,9 +670,9 @@ typedef __UINTMAX_TYPE__ uintmax_t;
673670#endif
674671
675672/* C99 7.18.2.5 Limits of greatest-width integer types. */
676#define INTMAX_MIN __INTN_MIN(__INTMAX_WIDTH__)
677#define INTMAX_MAX __INTN_MAX(__INTMAX_WIDTH__)
678#define UINTMAX_MAX __UINTN_MAX(__INTMAX_WIDTH__)
673#define INTMAX_MIN (-__INTMAX_MAX__-1)
674#define INTMAX_MAX __INTMAX_MAX__
675#define UINTMAX_MAX __UINTMAX_MAX__
679676
680677/* C99 7.18.3 Limits of other integer types. */
681678#define SIG_ATOMIC_MIN __INTN_MIN(__SIG_ATOMIC_WIDTH__)
......@@ -700,8 +697,8 @@ typedef __UINTMAX_TYPE__ uintmax_t;
700697#endif
701698
702699/* 7.18.4.2 Macros for greatest-width integer constants. */
703#define INTMAX_C(v) __INTN_C(__INTMAX_WIDTH__, v)
704#define UINTMAX_C(v) __UINTN_C(__INTMAX_WIDTH__, v)
700#define INTMAX_C(v) __int_c(v, __INTMAX_C_SUFFIX__)
701#define UINTMAX_C(v) __int_c(v, __UINTMAX_C_SUFFIX__)
705702
706703#endif /* __STDC_HOSTED__ */
707704#endif /* __CLANG_STDINT_H */
c_headers/tgmath.h+13-3
......@@ -22,12 +22,21 @@
2222 *
2323\*===----------------------------------------------------------------------===*/
2424
25#ifndef __TGMATH_H
26#define __TGMATH_H
25#ifndef __CLANG_TGMATH_H
26#define __CLANG_TGMATH_H
2727
2828/* C99 7.22 Type-generic math <tgmath.h>. */
2929#include <math.h>
3030
31/*
32 * Allow additional definitions and implementation-defined values on Apple
33 * platforms. This is done after #include <math.h> to avoid depcycle conflicts
34 * between libcxx and darwin in C++ modules builds.
35 */
36#if defined(__APPLE__) && __STDC_HOSTED__ && __has_include_next(<tgmath.h>)
37# include_next <tgmath.h>
38#else
39
3140/* C++ handles type genericity with overloading in math.h. */
3241#ifndef __cplusplus
3342#include <complex.h>
......@@ -1371,4 +1380,5 @@ static long double
13711380#undef _TG_ATTRS
13721381
13731382#endif /* __cplusplus */
1374#endif /* __TGMATH_H */
1383#endif /* __has_include_next */
1384#endif /* __CLANG_TGMATH_H */
c_headers/tmmintrin.h+48-40
......@@ -469,10 +469,11 @@ _mm_hsubs_pi16(__m64 __a, __m64 __b)
469469/// values contained in the first source operand and packed 8-bit signed
470470/// integer values contained in the second source operand, adds pairs of
471471/// contiguous products with signed saturation, and writes the 16-bit sums to
472/// the corresponding bits in the destination. For example, bits [7:0] of
473/// both operands are multiplied, bits [15:8] of both operands are
474/// multiplied, and the sum of both results is written to bits [15:0] of the
475/// destination.
472/// the corresponding bits in the destination.
473///
474/// For example, bits [7:0] of both operands are multiplied, bits [15:8] of
475/// both operands are multiplied, and the sum of both results is written to
476/// bits [15:0] of the destination.
476477///
477478/// \headerfile <x86intrin.h>
478479///
......@@ -502,10 +503,11 @@ _mm_maddubs_epi16(__m128i __a, __m128i __b)
502503/// values contained in the first source operand and packed 8-bit signed
503504/// integer values contained in the second source operand, adds pairs of
504505/// contiguous products with signed saturation, and writes the 16-bit sums to
505/// the corresponding bits in the destination. For example, bits [7:0] of
506/// both operands are multiplied, bits [15:8] of both operands are
507/// multiplied, and the sum of both results is written to bits [15:0] of the
508/// destination.
506/// the corresponding bits in the destination.
507///
508/// For example, bits [7:0] of both operands are multiplied, bits [15:8] of
509/// both operands are multiplied, and the sum of both results is written to
510/// bits [15:0] of the destination.
509511///
510512/// \headerfile <x86intrin.h>
511513///
......@@ -619,13 +621,14 @@ _mm_shuffle_pi8(__m64 __a, __m64 __b)
619621}
620622
621623/// \brief For each 8-bit integer in the first source operand, perform one of
622/// the following actions as specified by the second source operand: If the
623/// byte in the second source is negative, calculate the two's complement of
624/// the corresponding byte in the first source, and write that value to the
625/// destination. If the byte in the second source is positive, copy the
626/// corresponding byte from the first source to the destination. If the byte
627/// in the second source is zero, clear the corresponding byte in the
628/// destination.
624/// the following actions as specified by the second source operand.
625///
626/// If the byte in the second source is negative, calculate the two's
627/// complement of the corresponding byte in the first source, and write that
628/// value to the destination. If the byte in the second source is positive,
629/// copy the corresponding byte from the first source to the destination. If
630/// the byte in the second source is zero, clear the corresponding byte in
631/// the destination.
629632///
630633/// \headerfile <x86intrin.h>
631634///
......@@ -644,13 +647,14 @@ _mm_sign_epi8(__m128i __a, __m128i __b)
644647}
645648
646649/// \brief For each 16-bit integer in the first source operand, perform one of
647/// the following actions as specified by the second source operand: If the
648/// word in the second source is negative, calculate the two's complement of
649/// the corresponding word in the first source, and write that value to the
650/// destination. If the word in the second source is positive, copy the
651/// corresponding word from the first source to the destination. If the word
652/// in the second source is zero, clear the corresponding word in the
653/// destination.
650/// the following actions as specified by the second source operand.
651///
652/// If the word in the second source is negative, calculate the two's
653/// complement of the corresponding word in the first source, and write that
654/// value to the destination. If the word in the second source is positive,
655/// copy the corresponding word from the first source to the destination. If
656/// the word in the second source is zero, clear the corresponding word in
657/// the destination.
654658///
655659/// \headerfile <x86intrin.h>
656660///
......@@ -669,8 +673,9 @@ _mm_sign_epi16(__m128i __a, __m128i __b)
669673}
670674
671675/// \brief For each 32-bit integer in the first source operand, perform one of
672/// the following actions as specified by the second source operand: If the
673/// doubleword in the second source is negative, calculate the two's
676/// the following actions as specified by the second source operand.
677///
678/// If the doubleword in the second source is negative, calculate the two's
674679/// complement of the corresponding word in the first source, and write that
675680/// value to the destination. If the doubleword in the second source is
676681/// positive, copy the corresponding word from the first source to the
......@@ -694,13 +699,14 @@ _mm_sign_epi32(__m128i __a, __m128i __b)
694699}
695700
696701/// \brief For each 8-bit integer in the first source operand, perform one of
697/// the following actions as specified by the second source operand: If the
698/// byte in the second source is negative, calculate the two's complement of
699/// the corresponding byte in the first source, and write that value to the
700/// destination. If the byte in the second source is positive, copy the
701/// corresponding byte from the first source to the destination. If the byte
702/// in the second source is zero, clear the corresponding byte in the
703/// destination.
702/// the following actions as specified by the second source operand.
703///
704/// If the byte in the second source is negative, calculate the two's
705/// complement of the corresponding byte in the first source, and write that
706/// value to the destination. If the byte in the second source is positive,
707/// copy the corresponding byte from the first source to the destination. If
708/// the byte in the second source is zero, clear the corresponding byte in
709/// the destination.
704710///
705711/// \headerfile <x86intrin.h>
706712///
......@@ -719,13 +725,14 @@ _mm_sign_pi8(__m64 __a, __m64 __b)
719725}
720726
721727/// \brief For each 16-bit integer in the first source operand, perform one of
722/// the following actions as specified by the second source operand: If the
723/// word in the second source is negative, calculate the two's complement of
724/// the corresponding word in the first source, and write that value to the
725/// destination. If the word in the second source is positive, copy the
726/// corresponding word from the first source to the destination. If the word
727/// in the second source is zero, clear the corresponding word in the
728/// destination.
728/// the following actions as specified by the second source operand.
729///
730/// If the word in the second source is negative, calculate the two's
731/// complement of the corresponding word in the first source, and write that
732/// value to the destination. If the word in the second source is positive,
733/// copy the corresponding word from the first source to the destination. If
734/// the word in the second source is zero, clear the corresponding word in
735/// the destination.
729736///
730737/// \headerfile <x86intrin.h>
731738///
......@@ -744,8 +751,9 @@ _mm_sign_pi16(__m64 __a, __m64 __b)
744751}
745752
746753/// \brief For each 32-bit integer in the first source operand, perform one of
747/// the following actions as specified by the second source operand: If the
748/// doubleword in the second source is negative, calculate the two's
754/// the following actions as specified by the second source operand.
755///
756/// If the doubleword in the second source is negative, calculate the two's
749757/// complement of the corresponding doubleword in the first source, and
750758/// write that value to the destination. If the doubleword in the second
751759/// source is positive, copy the corresponding doubleword from the first
c_headers/vecintrin.h+1548-24
......@@ -116,6 +116,13 @@ vec_extract(vector unsigned long long __vec, int __index) {
116116 return __vec[__index & 1];
117117}
118118
119#if __ARCH__ >= 12
120static inline __ATTRS_o_ai float
121vec_extract(vector float __vec, int __index) {
122 return __vec[__index & 3];
123}
124#endif
125
119126static inline __ATTRS_o_ai double
120127vec_extract(vector double __vec, int __index) {
121128 return __vec[__index & 1];
......@@ -129,6 +136,7 @@ vec_insert(signed char __scalar, vector signed char __vec, int __index) {
129136 return __vec;
130137}
131138
139// This prototype is deprecated.
132140static inline __ATTRS_o_ai vector unsigned char
133141vec_insert(unsigned char __scalar, vector bool char __vec, int __index) {
134142 vector unsigned char __newvec = (vector unsigned char)__vec;
......@@ -148,6 +156,7 @@ vec_insert(signed short __scalar, vector signed short __vec, int __index) {
148156 return __vec;
149157}
150158
159// This prototype is deprecated.
151160static inline __ATTRS_o_ai vector unsigned short
152161vec_insert(unsigned short __scalar, vector bool short __vec, int __index) {
153162 vector unsigned short __newvec = (vector unsigned short)__vec;
......@@ -167,6 +176,7 @@ vec_insert(signed int __scalar, vector signed int __vec, int __index) {
167176 return __vec;
168177}
169178
179// This prototype is deprecated.
170180static inline __ATTRS_o_ai vector unsigned int
171181vec_insert(unsigned int __scalar, vector bool int __vec, int __index) {
172182 vector unsigned int __newvec = (vector unsigned int)__vec;
......@@ -187,6 +197,7 @@ vec_insert(signed long long __scalar, vector signed long long __vec,
187197 return __vec;
188198}
189199
200// This prototype is deprecated.
190201static inline __ATTRS_o_ai vector unsigned long long
191202vec_insert(unsigned long long __scalar, vector bool long long __vec,
192203 int __index) {
......@@ -202,6 +213,14 @@ vec_insert(unsigned long long __scalar, vector unsigned long long __vec,
202213 return __vec;
203214}
204215
216#if __ARCH__ >= 12
217static inline __ATTRS_o_ai vector float
218vec_insert(float __scalar, vector float __vec, int __index) {
219 __vec[__index & 1] = __scalar;
220 return __vec;
221}
222#endif
223
205224static inline __ATTRS_o_ai vector double
206225vec_insert(double __scalar, vector double __vec, int __index) {
207226 __vec[__index & 1] = __scalar;
......@@ -282,6 +301,16 @@ vec_promote(unsigned long long __scalar, int __index) {
282301 return __vec;
283302}
284303
304#if __ARCH__ >= 12
305static inline __ATTRS_o_ai vector float
306vec_promote(float __scalar, int __index) {
307 const vector float __zero = (vector float)0;
308 vector float __vec = __builtin_shufflevector(__zero, __zero, -1, -1, -1, -1);
309 __vec[__index & 3] = __scalar;
310 return __vec;
311}
312#endif
313
285314static inline __ATTRS_o_ai vector double
286315vec_promote(double __scalar, int __index) {
287316 const vector double __zero = (vector double)0;
......@@ -348,6 +377,15 @@ vec_insert_and_zero(const unsigned long long *__ptr) {
348377 return __vec;
349378}
350379
380#if __ARCH__ >= 12
381static inline __ATTRS_o_ai vector float
382vec_insert_and_zero(const float *__ptr) {
383 vector float __vec = (vector float)0;
384 __vec[0] = *__ptr;
385 return __vec;
386}
387#endif
388
351389static inline __ATTRS_o_ai vector double
352390vec_insert_and_zero(const double *__ptr) {
353391 vector double __vec = (vector double)0;
......@@ -441,6 +479,15 @@ vec_perm(vector bool long long __a, vector bool long long __b,
441479 (vector unsigned char)__a, (vector unsigned char)__b, __c);
442480}
443481
482#if __ARCH__ >= 12
483static inline __ATTRS_o_ai vector float
484vec_perm(vector float __a, vector float __b,
485 vector unsigned char __c) {
486 return (vector float)__builtin_s390_vperm(
487 (vector unsigned char)__a, (vector unsigned char)__b, __c);
488}
489#endif
490
444491static inline __ATTRS_o_ai vector double
445492vec_perm(vector double __a, vector double __b,
446493 vector unsigned char __c) {
......@@ -450,18 +497,22 @@ vec_perm(vector double __a, vector double __b,
450497
451498/*-- vec_permi --------------------------------------------------------------*/
452499
500// This prototype is deprecated.
453501extern __ATTRS_o vector signed long long
454502vec_permi(vector signed long long __a, vector signed long long __b, int __c)
455503 __constant_range(__c, 0, 3);
456504
505// This prototype is deprecated.
457506extern __ATTRS_o vector unsigned long long
458507vec_permi(vector unsigned long long __a, vector unsigned long long __b, int __c)
459508 __constant_range(__c, 0, 3);
460509
510// This prototype is deprecated.
461511extern __ATTRS_o vector bool long long
462512vec_permi(vector bool long long __a, vector bool long long __b, int __c)
463513 __constant_range(__c, 0, 3);
464514
515// This prototype is deprecated.
465516extern __ATTRS_o vector double
466517vec_permi(vector double __a, vector double __b, int __c)
467518 __constant_range(__c, 0, 3);
......@@ -471,6 +522,15 @@ vec_permi(vector double __a, vector double __b, int __c)
471522 (vector unsigned long long)(Y), \
472523 (((Z) & 2) << 1) | ((Z) & 1)))
473524
525/*-- vec_bperm_u128 ---------------------------------------------------------*/
526
527#if __ARCH__ >= 12
528static inline __ATTRS_ai vector unsigned long long
529vec_bperm_u128(vector unsigned char __a, vector unsigned char __b) {
530 return __builtin_s390_vbperm(__a, __b);
531}
532#endif
533
474534/*-- vec_sel ----------------------------------------------------------------*/
475535
476536static inline __ATTRS_o_ai vector signed char
......@@ -614,6 +674,22 @@ vec_sel(vector unsigned long long __a, vector unsigned long long __b,
614674 (~(vector unsigned long long)__c & __a));
615675}
616676
677#if __ARCH__ >= 12
678static inline __ATTRS_o_ai vector float
679vec_sel(vector float __a, vector float __b, vector unsigned int __c) {
680 return (vector float)((__c & (vector unsigned int)__b) |
681 (~__c & (vector unsigned int)__a));
682}
683
684static inline __ATTRS_o_ai vector float
685vec_sel(vector float __a, vector float __b, vector bool int __c) {
686 vector unsigned int __ac = (vector unsigned int)__a;
687 vector unsigned int __bc = (vector unsigned int)__b;
688 vector unsigned int __cc = (vector unsigned int)__c;
689 return (vector float)((__cc & __bc) | (~__cc & __ac));
690}
691#endif
692
617693static inline __ATTRS_o_ai vector double
618694vec_sel(vector double __a, vector double __b, vector unsigned long long __c) {
619695 return (vector double)((__c & (vector unsigned long long)__b) |
......@@ -687,6 +763,17 @@ vec_gather_element(vector unsigned long long __vec,
687763 return __vec;
688764}
689765
766#if __ARCH__ >= 12
767static inline __ATTRS_o_ai vector float
768vec_gather_element(vector float __vec, vector unsigned int __offset,
769 const float *__ptr, int __index)
770 __constant_range(__index, 0, 3) {
771 __vec[__index] = *(const float *)(
772 (__INTPTR_TYPE__)__ptr + (__INTPTR_TYPE__)__offset[__index]);
773 return __vec;
774}
775#endif
776
690777static inline __ATTRS_o_ai vector double
691778vec_gather_element(vector double __vec, vector unsigned long long __offset,
692779 const double *__ptr, int __index)
......@@ -749,6 +836,16 @@ vec_scatter_element(vector unsigned long long __vec,
749836 __vec[__index];
750837}
751838
839#if __ARCH__ >= 12
840static inline __ATTRS_o_ai void
841vec_scatter_element(vector float __vec, vector unsigned int __offset,
842 float *__ptr, int __index)
843 __constant_range(__index, 0, 3) {
844 *(float *)((__INTPTR_TYPE__)__ptr + __offset[__index]) =
845 __vec[__index];
846}
847#endif
848
752849static inline __ATTRS_o_ai void
753850vec_scatter_element(vector double __vec, vector unsigned long long __offset,
754851 double *__ptr, int __index)
......@@ -757,48 +854,111 @@ vec_scatter_element(vector double __vec, vector unsigned long long __offset,
757854 __vec[__index];
758855}
759856
857/*-- vec_xl -----------------------------------------------------------------*/
858
859static inline __ATTRS_o_ai vector signed char
860vec_xl(long __offset, const signed char *__ptr) {
861 return *(const vector signed char *)((__INTPTR_TYPE__)__ptr + __offset);
862}
863
864static inline __ATTRS_o_ai vector unsigned char
865vec_xl(long __offset, const unsigned char *__ptr) {
866 return *(const vector unsigned char *)((__INTPTR_TYPE__)__ptr + __offset);
867}
868
869static inline __ATTRS_o_ai vector signed short
870vec_xl(long __offset, const signed short *__ptr) {
871 return *(const vector signed short *)((__INTPTR_TYPE__)__ptr + __offset);
872}
873
874static inline __ATTRS_o_ai vector unsigned short
875vec_xl(long __offset, const unsigned short *__ptr) {
876 return *(const vector unsigned short *)((__INTPTR_TYPE__)__ptr + __offset);
877}
878
879static inline __ATTRS_o_ai vector signed int
880vec_xl(long __offset, const signed int *__ptr) {
881 return *(const vector signed int *)((__INTPTR_TYPE__)__ptr + __offset);
882}
883
884static inline __ATTRS_o_ai vector unsigned int
885vec_xl(long __offset, const unsigned int *__ptr) {
886 return *(const vector unsigned int *)((__INTPTR_TYPE__)__ptr + __offset);
887}
888
889static inline __ATTRS_o_ai vector signed long long
890vec_xl(long __offset, const signed long long *__ptr) {
891 return *(const vector signed long long *)((__INTPTR_TYPE__)__ptr + __offset);
892}
893
894static inline __ATTRS_o_ai vector unsigned long long
895vec_xl(long __offset, const unsigned long long *__ptr) {
896 return *(const vector unsigned long long *)((__INTPTR_TYPE__)__ptr + __offset);
897}
898
899#if __ARCH__ >= 12
900static inline __ATTRS_o_ai vector float
901vec_xl(long __offset, const float *__ptr) {
902 return *(const vector float *)((__INTPTR_TYPE__)__ptr + __offset);
903}
904#endif
905
906static inline __ATTRS_o_ai vector double
907vec_xl(long __offset, const double *__ptr) {
908 return *(const vector double *)((__INTPTR_TYPE__)__ptr + __offset);
909}
910
760911/*-- vec_xld2 ---------------------------------------------------------------*/
761912
913// This prototype is deprecated.
762914static inline __ATTRS_o_ai vector signed char
763915vec_xld2(long __offset, const signed char *__ptr) {
764916 return *(const vector signed char *)((__INTPTR_TYPE__)__ptr + __offset);
765917}
766918
919// This prototype is deprecated.
767920static inline __ATTRS_o_ai vector unsigned char
768921vec_xld2(long __offset, const unsigned char *__ptr) {
769922 return *(const vector unsigned char *)((__INTPTR_TYPE__)__ptr + __offset);
770923}
771924
925// This prototype is deprecated.
772926static inline __ATTRS_o_ai vector signed short
773927vec_xld2(long __offset, const signed short *__ptr) {
774928 return *(const vector signed short *)((__INTPTR_TYPE__)__ptr + __offset);
775929}
776930
931// This prototype is deprecated.
777932static inline __ATTRS_o_ai vector unsigned short
778933vec_xld2(long __offset, const unsigned short *__ptr) {
779934 return *(const vector unsigned short *)((__INTPTR_TYPE__)__ptr + __offset);
780935}
781936
937// This prototype is deprecated.
782938static inline __ATTRS_o_ai vector signed int
783939vec_xld2(long __offset, const signed int *__ptr) {
784940 return *(const vector signed int *)((__INTPTR_TYPE__)__ptr + __offset);
785941}
786942
943// This prototype is deprecated.
787944static inline __ATTRS_o_ai vector unsigned int
788945vec_xld2(long __offset, const unsigned int *__ptr) {
789946 return *(const vector unsigned int *)((__INTPTR_TYPE__)__ptr + __offset);
790947}
791948
949// This prototype is deprecated.
792950static inline __ATTRS_o_ai vector signed long long
793951vec_xld2(long __offset, const signed long long *__ptr) {
794952 return *(const vector signed long long *)((__INTPTR_TYPE__)__ptr + __offset);
795953}
796954
955// This prototype is deprecated.
797956static inline __ATTRS_o_ai vector unsigned long long
798957vec_xld2(long __offset, const unsigned long long *__ptr) {
799958 return *(const vector unsigned long long *)((__INTPTR_TYPE__)__ptr + __offset);
800959}
801960
961// This prototype is deprecated.
802962static inline __ATTRS_o_ai vector double
803963vec_xld2(long __offset, const double *__ptr) {
804964 return *(const vector double *)((__INTPTR_TYPE__)__ptr + __offset);
......@@ -806,74 +966,145 @@ vec_xld2(long __offset, const double *__ptr) {
806966
807967/*-- vec_xlw4 ---------------------------------------------------------------*/
808968
969// This prototype is deprecated.
809970static inline __ATTRS_o_ai vector signed char
810971vec_xlw4(long __offset, const signed char *__ptr) {
811972 return *(const vector signed char *)((__INTPTR_TYPE__)__ptr + __offset);
812973}
813974
975// This prototype is deprecated.
814976static inline __ATTRS_o_ai vector unsigned char
815977vec_xlw4(long __offset, const unsigned char *__ptr) {
816978 return *(const vector unsigned char *)((__INTPTR_TYPE__)__ptr + __offset);
817979}
818980
981// This prototype is deprecated.
819982static inline __ATTRS_o_ai vector signed short
820983vec_xlw4(long __offset, const signed short *__ptr) {
821984 return *(const vector signed short *)((__INTPTR_TYPE__)__ptr + __offset);
822985}
823986
987// This prototype is deprecated.
824988static inline __ATTRS_o_ai vector unsigned short
825989vec_xlw4(long __offset, const unsigned short *__ptr) {
826990 return *(const vector unsigned short *)((__INTPTR_TYPE__)__ptr + __offset);
827991}
828992
993// This prototype is deprecated.
829994static inline __ATTRS_o_ai vector signed int
830995vec_xlw4(long __offset, const signed int *__ptr) {
831996 return *(const vector signed int *)((__INTPTR_TYPE__)__ptr + __offset);
832997}
833998
999// This prototype is deprecated.
8341000static inline __ATTRS_o_ai vector unsigned int
8351001vec_xlw4(long __offset, const unsigned int *__ptr) {
8361002 return *(const vector unsigned int *)((__INTPTR_TYPE__)__ptr + __offset);
8371003}
8381004
1005/*-- vec_xst ----------------------------------------------------------------*/
1006
1007static inline __ATTRS_o_ai void
1008vec_xst(vector signed char __vec, long __offset, signed char *__ptr) {
1009 *(vector signed char *)((__INTPTR_TYPE__)__ptr + __offset) = __vec;
1010}
1011
1012static inline __ATTRS_o_ai void
1013vec_xst(vector unsigned char __vec, long __offset, unsigned char *__ptr) {
1014 *(vector unsigned char *)((__INTPTR_TYPE__)__ptr + __offset) = __vec;
1015}
1016
1017static inline __ATTRS_o_ai void
1018vec_xst(vector signed short __vec, long __offset, signed short *__ptr) {
1019 *(vector signed short *)((__INTPTR_TYPE__)__ptr + __offset) = __vec;
1020}
1021
1022static inline __ATTRS_o_ai void
1023vec_xst(vector unsigned short __vec, long __offset, unsigned short *__ptr) {
1024 *(vector unsigned short *)((__INTPTR_TYPE__)__ptr + __offset) = __vec;
1025}
1026
1027static inline __ATTRS_o_ai void
1028vec_xst(vector signed int __vec, long __offset, signed int *__ptr) {
1029 *(vector signed int *)((__INTPTR_TYPE__)__ptr + __offset) = __vec;
1030}
1031
1032static inline __ATTRS_o_ai void
1033vec_xst(vector unsigned int __vec, long __offset, unsigned int *__ptr) {
1034 *(vector unsigned int *)((__INTPTR_TYPE__)__ptr + __offset) = __vec;
1035}
1036
1037static inline __ATTRS_o_ai void
1038vec_xst(vector signed long long __vec, long __offset,
1039 signed long long *__ptr) {
1040 *(vector signed long long *)((__INTPTR_TYPE__)__ptr + __offset) = __vec;
1041}
1042
1043static inline __ATTRS_o_ai void
1044vec_xst(vector unsigned long long __vec, long __offset,
1045 unsigned long long *__ptr) {
1046 *(vector unsigned long long *)((__INTPTR_TYPE__)__ptr + __offset) =
1047 __vec;
1048}
1049
1050#if __ARCH__ >= 12
1051static inline __ATTRS_o_ai void
1052vec_xst(vector float __vec, long __offset, float *__ptr) {
1053 *(vector float *)((__INTPTR_TYPE__)__ptr + __offset) = __vec;
1054}
1055#endif
1056
1057static inline __ATTRS_o_ai void
1058vec_xst(vector double __vec, long __offset, double *__ptr) {
1059 *(vector double *)((__INTPTR_TYPE__)__ptr + __offset) = __vec;
1060}
1061
8391062/*-- vec_xstd2 --------------------------------------------------------------*/
8401063
1064// This prototype is deprecated.
8411065static inline __ATTRS_o_ai void
8421066vec_xstd2(vector signed char __vec, long __offset, signed char *__ptr) {
8431067 *(vector signed char *)((__INTPTR_TYPE__)__ptr + __offset) = __vec;
8441068}
8451069
1070// This prototype is deprecated.
8461071static inline __ATTRS_o_ai void
8471072vec_xstd2(vector unsigned char __vec, long __offset, unsigned char *__ptr) {
8481073 *(vector unsigned char *)((__INTPTR_TYPE__)__ptr + __offset) = __vec;
8491074}
8501075
1076// This prototype is deprecated.
8511077static inline __ATTRS_o_ai void
8521078vec_xstd2(vector signed short __vec, long __offset, signed short *__ptr) {
8531079 *(vector signed short *)((__INTPTR_TYPE__)__ptr + __offset) = __vec;
8541080}
8551081
1082// This prototype is deprecated.
8561083static inline __ATTRS_o_ai void
8571084vec_xstd2(vector unsigned short __vec, long __offset, unsigned short *__ptr) {
8581085 *(vector unsigned short *)((__INTPTR_TYPE__)__ptr + __offset) = __vec;
8591086}
8601087
1088// This prototype is deprecated.
8611089static inline __ATTRS_o_ai void
8621090vec_xstd2(vector signed int __vec, long __offset, signed int *__ptr) {
8631091 *(vector signed int *)((__INTPTR_TYPE__)__ptr + __offset) = __vec;
8641092}
8651093
1094// This prototype is deprecated.
8661095static inline __ATTRS_o_ai void
8671096vec_xstd2(vector unsigned int __vec, long __offset, unsigned int *__ptr) {
8681097 *(vector unsigned int *)((__INTPTR_TYPE__)__ptr + __offset) = __vec;
8691098}
8701099
1100// This prototype is deprecated.
8711101static inline __ATTRS_o_ai void
8721102vec_xstd2(vector signed long long __vec, long __offset,
8731103 signed long long *__ptr) {
8741104 *(vector signed long long *)((__INTPTR_TYPE__)__ptr + __offset) = __vec;
8751105}
8761106
1107// This prototype is deprecated.
8771108static inline __ATTRS_o_ai void
8781109vec_xstd2(vector unsigned long long __vec, long __offset,
8791110 unsigned long long *__ptr) {
......@@ -881,6 +1112,7 @@ vec_xstd2(vector unsigned long long __vec, long __offset,
8811112 __vec;
8821113}
8831114
1115// This prototype is deprecated.
8841116static inline __ATTRS_o_ai void
8851117vec_xstd2(vector double __vec, long __offset, double *__ptr) {
8861118 *(vector double *)((__INTPTR_TYPE__)__ptr + __offset) = __vec;
......@@ -888,31 +1120,37 @@ vec_xstd2(vector double __vec, long __offset, double *__ptr) {
8881120
8891121/*-- vec_xstw4 --------------------------------------------------------------*/
8901122
1123// This prototype is deprecated.
8911124static inline __ATTRS_o_ai void
8921125vec_xstw4(vector signed char __vec, long __offset, signed char *__ptr) {
8931126 *(vector signed char *)((__INTPTR_TYPE__)__ptr + __offset) = __vec;
8941127}
8951128
1129// This prototype is deprecated.
8961130static inline __ATTRS_o_ai void
8971131vec_xstw4(vector unsigned char __vec, long __offset, unsigned char *__ptr) {
8981132 *(vector unsigned char *)((__INTPTR_TYPE__)__ptr + __offset) = __vec;
8991133}
9001134
1135// This prototype is deprecated.
9011136static inline __ATTRS_o_ai void
9021137vec_xstw4(vector signed short __vec, long __offset, signed short *__ptr) {
9031138 *(vector signed short *)((__INTPTR_TYPE__)__ptr + __offset) = __vec;
9041139}
9051140
1141// This prototype is deprecated.
9061142static inline __ATTRS_o_ai void
9071143vec_xstw4(vector unsigned short __vec, long __offset, unsigned short *__ptr) {
9081144 *(vector unsigned short *)((__INTPTR_TYPE__)__ptr + __offset) = __vec;
9091145}
9101146
1147// This prototype is deprecated.
9111148static inline __ATTRS_o_ai void
9121149vec_xstw4(vector signed int __vec, long __offset, signed int *__ptr) {
9131150 *(vector signed int *)((__INTPTR_TYPE__)__ptr + __offset) = __vec;
9141151}
9151152
1153// This prototype is deprecated.
9161154static inline __ATTRS_o_ai void
9171155vec_xstw4(vector unsigned int __vec, long __offset, unsigned int *__ptr) {
9181156 *(vector unsigned int *)((__INTPTR_TYPE__)__ptr + __offset) = __vec;
......@@ -952,6 +1190,12 @@ extern __ATTRS_o vector unsigned long long
9521190vec_load_bndry(const unsigned long long *__ptr, unsigned short __len)
9531191 __constant_pow2_range(__len, 64, 4096);
9541192
1193#if __ARCH__ >= 12
1194extern __ATTRS_o vector float
1195vec_load_bndry(const float *__ptr, unsigned short __len)
1196 __constant_pow2_range(__len, 64, 4096);
1197#endif
1198
9551199extern __ATTRS_o vector double
9561200vec_load_bndry(const double *__ptr, unsigned short __len)
9571201 __constant_pow2_range(__len, 64, 4096);
......@@ -1007,11 +1251,27 @@ vec_load_len(const unsigned long long *__ptr, unsigned int __len) {
10071251 return (vector unsigned long long)__builtin_s390_vll(__len, __ptr);
10081252}
10091253
1254#if __ARCH__ >= 12
1255static inline __ATTRS_o_ai vector float
1256vec_load_len(const float *__ptr, unsigned int __len) {
1257 return (vector float)__builtin_s390_vll(__len, __ptr);
1258}
1259#endif
1260
10101261static inline __ATTRS_o_ai vector double
10111262vec_load_len(const double *__ptr, unsigned int __len) {
10121263 return (vector double)__builtin_s390_vll(__len, __ptr);
10131264}
10141265
1266/*-- vec_load_len_r ---------------------------------------------------------*/
1267
1268#if __ARCH__ >= 12
1269static inline __ATTRS_ai vector unsigned char
1270vec_load_len_r(const unsigned char *__ptr, unsigned int __len) {
1271 return (vector unsigned char)__builtin_s390_vlrl(__len, __ptr);
1272}
1273#endif
1274
10151275/*-- vec_store_len ----------------------------------------------------------*/
10161276
10171277static inline __ATTRS_o_ai void
......@@ -1062,12 +1322,30 @@ vec_store_len(vector unsigned long long __vec, unsigned long long *__ptr,
10621322 __builtin_s390_vstl((vector signed char)__vec, __len, __ptr);
10631323}
10641324
1325#if __ARCH__ >= 12
1326static inline __ATTRS_o_ai void
1327vec_store_len(vector float __vec, float *__ptr,
1328 unsigned int __len) {
1329 __builtin_s390_vstl((vector signed char)__vec, __len, __ptr);
1330}
1331#endif
1332
10651333static inline __ATTRS_o_ai void
10661334vec_store_len(vector double __vec, double *__ptr,
10671335 unsigned int __len) {
10681336 __builtin_s390_vstl((vector signed char)__vec, __len, __ptr);
10691337}
10701338
1339/*-- vec_store_len_r --------------------------------------------------------*/
1340
1341#if __ARCH__ >= 12
1342static inline __ATTRS_ai void
1343vec_store_len_r(vector unsigned char __vec, unsigned char *__ptr,
1344 unsigned int __len) {
1345 __builtin_s390_vstrl((vector signed char)__vec, __len, __ptr);
1346}
1347#endif
1348
10711349/*-- vec_load_pair ----------------------------------------------------------*/
10721350
10731351static inline __ATTRS_o_ai vector signed long long
......@@ -1232,6 +1510,14 @@ vec_splat(vector unsigned long long __vec, int __index)
12321510 return (vector unsigned long long)__vec[__index];
12331511}
12341512
1513#if __ARCH__ >= 12
1514static inline __ATTRS_o_ai vector float
1515vec_splat(vector float __vec, int __index)
1516 __constant_range(__index, 0, 3) {
1517 return (vector float)__vec[__index];
1518}
1519#endif
1520
12351521static inline __ATTRS_o_ai vector double
12361522vec_splat(vector double __vec, int __index)
12371523 __constant_range(__index, 0, 1) {
......@@ -1332,6 +1618,13 @@ vec_splats(unsigned long long __scalar) {
13321618 return (vector unsigned long long)__scalar;
13331619}
13341620
1621#if __ARCH__ >= 12
1622static inline __ATTRS_o_ai vector float
1623vec_splats(float __scalar) {
1624 return (vector float)__scalar;
1625}
1626#endif
1627
13351628static inline __ATTRS_o_ai vector double
13361629vec_splats(double __scalar) {
13371630 return (vector double)__scalar;
......@@ -1425,6 +1718,13 @@ vec_mergeh(vector unsigned long long __a, vector unsigned long long __b) {
14251718 return (vector unsigned long long)(__a[0], __b[0]);
14261719}
14271720
1721#if __ARCH__ >= 12
1722static inline __ATTRS_o_ai vector float
1723vec_mergeh(vector float __a, vector float __b) {
1724 return (vector float)(__a[0], __b[0], __a[1], __b[1]);
1725}
1726#endif
1727
14281728static inline __ATTRS_o_ai vector double
14291729vec_mergeh(vector double __a, vector double __b) {
14301730 return (vector double)(__a[0], __b[0]);
......@@ -1501,6 +1801,13 @@ vec_mergel(vector unsigned long long __a, vector unsigned long long __b) {
15011801 return (vector unsigned long long)(__a[1], __b[1]);
15021802}
15031803
1804#if __ARCH__ >= 12
1805static inline __ATTRS_o_ai vector float
1806vec_mergel(vector float __a, vector float __b) {
1807 return (vector float)(__a[2], __b[2], __a[3], __b[3]);
1808}
1809#endif
1810
15041811static inline __ATTRS_o_ai vector double
15051812vec_mergel(vector double __a, vector double __b) {
15061813 return (vector double)(__a[1], __b[1]);
......@@ -1866,6 +2173,13 @@ vec_cmpeq(vector unsigned long long __a, vector unsigned long long __b) {
18662173 return (vector bool long long)(__a == __b);
18672174}
18682175
2176#if __ARCH__ >= 12
2177static inline __ATTRS_o_ai vector bool int
2178vec_cmpeq(vector float __a, vector float __b) {
2179 return (vector bool int)(__a == __b);
2180}
2181#endif
2182
18692183static inline __ATTRS_o_ai vector bool long long
18702184vec_cmpeq(vector double __a, vector double __b) {
18712185 return (vector bool long long)(__a == __b);
......@@ -1913,6 +2227,13 @@ vec_cmpge(vector unsigned long long __a, vector unsigned long long __b) {
19132227 return (vector bool long long)(__a >= __b);
19142228}
19152229
2230#if __ARCH__ >= 12
2231static inline __ATTRS_o_ai vector bool int
2232vec_cmpge(vector float __a, vector float __b) {
2233 return (vector bool int)(__a >= __b);
2234}
2235#endif
2236
19162237static inline __ATTRS_o_ai vector bool long long
19172238vec_cmpge(vector double __a, vector double __b) {
19182239 return (vector bool long long)(__a >= __b);
......@@ -1960,6 +2281,13 @@ vec_cmpgt(vector unsigned long long __a, vector unsigned long long __b) {
19602281 return (vector bool long long)(__a > __b);
19612282}
19622283
2284#if __ARCH__ >= 12
2285static inline __ATTRS_o_ai vector bool int
2286vec_cmpgt(vector float __a, vector float __b) {
2287 return (vector bool int)(__a > __b);
2288}
2289#endif
2290
19632291static inline __ATTRS_o_ai vector bool long long
19642292vec_cmpgt(vector double __a, vector double __b) {
19652293 return (vector bool long long)(__a > __b);
......@@ -2007,6 +2335,13 @@ vec_cmple(vector unsigned long long __a, vector unsigned long long __b) {
20072335 return (vector bool long long)(__a <= __b);
20082336}
20092337
2338#if __ARCH__ >= 12
2339static inline __ATTRS_o_ai vector bool int
2340vec_cmple(vector float __a, vector float __b) {
2341 return (vector bool int)(__a <= __b);
2342}
2343#endif
2344
20102345static inline __ATTRS_o_ai vector bool long long
20112346vec_cmple(vector double __a, vector double __b) {
20122347 return (vector bool long long)(__a <= __b);
......@@ -2054,6 +2389,13 @@ vec_cmplt(vector unsigned long long __a, vector unsigned long long __b) {
20542389 return (vector bool long long)(__a < __b);
20552390}
20562391
2392#if __ARCH__ >= 12
2393static inline __ATTRS_o_ai vector bool int
2394vec_cmplt(vector float __a, vector float __b) {
2395 return (vector bool int)(__a < __b);
2396}
2397#endif
2398
20572399static inline __ATTRS_o_ai vector bool long long
20582400vec_cmplt(vector double __a, vector double __b) {
20592401 return (vector bool long long)(__a < __b);
......@@ -2068,6 +2410,7 @@ vec_all_eq(vector signed char __a, vector signed char __b) {
20682410 return __cc == 0;
20692411}
20702412
2413// This prototype is deprecated.
20712414static inline __ATTRS_o_ai int
20722415vec_all_eq(vector signed char __a, vector bool char __b) {
20732416 int __cc;
......@@ -2075,6 +2418,7 @@ vec_all_eq(vector signed char __a, vector bool char __b) {
20752418 return __cc == 0;
20762419}
20772420
2421// This prototype is deprecated.
20782422static inline __ATTRS_o_ai int
20792423vec_all_eq(vector bool char __a, vector signed char __b) {
20802424 int __cc;
......@@ -2090,6 +2434,7 @@ vec_all_eq(vector unsigned char __a, vector unsigned char __b) {
20902434 return __cc == 0;
20912435}
20922436
2437// This prototype is deprecated.
20932438static inline __ATTRS_o_ai int
20942439vec_all_eq(vector unsigned char __a, vector bool char __b) {
20952440 int __cc;
......@@ -2098,6 +2443,7 @@ vec_all_eq(vector unsigned char __a, vector bool char __b) {
20982443 return __cc == 0;
20992444}
21002445
2446// This prototype is deprecated.
21012447static inline __ATTRS_o_ai int
21022448vec_all_eq(vector bool char __a, vector unsigned char __b) {
21032449 int __cc;
......@@ -2121,6 +2467,7 @@ vec_all_eq(vector signed short __a, vector signed short __b) {
21212467 return __cc == 0;
21222468}
21232469
2470// This prototype is deprecated.
21242471static inline __ATTRS_o_ai int
21252472vec_all_eq(vector signed short __a, vector bool short __b) {
21262473 int __cc;
......@@ -2128,6 +2475,7 @@ vec_all_eq(vector signed short __a, vector bool short __b) {
21282475 return __cc == 0;
21292476}
21302477
2478// This prototype is deprecated.
21312479static inline __ATTRS_o_ai int
21322480vec_all_eq(vector bool short __a, vector signed short __b) {
21332481 int __cc;
......@@ -2143,6 +2491,7 @@ vec_all_eq(vector unsigned short __a, vector unsigned short __b) {
21432491 return __cc == 0;
21442492}
21452493
2494// This prototype is deprecated.
21462495static inline __ATTRS_o_ai int
21472496vec_all_eq(vector unsigned short __a, vector bool short __b) {
21482497 int __cc;
......@@ -2151,6 +2500,7 @@ vec_all_eq(vector unsigned short __a, vector bool short __b) {
21512500 return __cc == 0;
21522501}
21532502
2503// This prototype is deprecated.
21542504static inline __ATTRS_o_ai int
21552505vec_all_eq(vector bool short __a, vector unsigned short __b) {
21562506 int __cc;
......@@ -2174,6 +2524,7 @@ vec_all_eq(vector signed int __a, vector signed int __b) {
21742524 return __cc == 0;
21752525}
21762526
2527// This prototype is deprecated.
21772528static inline __ATTRS_o_ai int
21782529vec_all_eq(vector signed int __a, vector bool int __b) {
21792530 int __cc;
......@@ -2181,6 +2532,7 @@ vec_all_eq(vector signed int __a, vector bool int __b) {
21812532 return __cc == 0;
21822533}
21832534
2535// This prototype is deprecated.
21842536static inline __ATTRS_o_ai int
21852537vec_all_eq(vector bool int __a, vector signed int __b) {
21862538 int __cc;
......@@ -2196,6 +2548,7 @@ vec_all_eq(vector unsigned int __a, vector unsigned int __b) {
21962548 return __cc == 0;
21972549}
21982550
2551// This prototype is deprecated.
21992552static inline __ATTRS_o_ai int
22002553vec_all_eq(vector unsigned int __a, vector bool int __b) {
22012554 int __cc;
......@@ -2204,6 +2557,7 @@ vec_all_eq(vector unsigned int __a, vector bool int __b) {
22042557 return __cc == 0;
22052558}
22062559
2560// This prototype is deprecated.
22072561static inline __ATTRS_o_ai int
22082562vec_all_eq(vector bool int __a, vector unsigned int __b) {
22092563 int __cc;
......@@ -2227,6 +2581,7 @@ vec_all_eq(vector signed long long __a, vector signed long long __b) {
22272581 return __cc == 0;
22282582}
22292583
2584// This prototype is deprecated.
22302585static inline __ATTRS_o_ai int
22312586vec_all_eq(vector signed long long __a, vector bool long long __b) {
22322587 int __cc;
......@@ -2234,6 +2589,7 @@ vec_all_eq(vector signed long long __a, vector bool long long __b) {
22342589 return __cc == 0;
22352590}
22362591
2592// This prototype is deprecated.
22372593static inline __ATTRS_o_ai int
22382594vec_all_eq(vector bool long long __a, vector signed long long __b) {
22392595 int __cc;
......@@ -2249,6 +2605,7 @@ vec_all_eq(vector unsigned long long __a, vector unsigned long long __b) {
22492605 return __cc == 0;
22502606}
22512607
2608// This prototype is deprecated.
22522609static inline __ATTRS_o_ai int
22532610vec_all_eq(vector unsigned long long __a, vector bool long long __b) {
22542611 int __cc;
......@@ -2257,6 +2614,7 @@ vec_all_eq(vector unsigned long long __a, vector bool long long __b) {
22572614 return __cc == 0;
22582615}
22592616
2617// This prototype is deprecated.
22602618static inline __ATTRS_o_ai int
22612619vec_all_eq(vector bool long long __a, vector unsigned long long __b) {
22622620 int __cc;
......@@ -2273,6 +2631,15 @@ vec_all_eq(vector bool long long __a, vector bool long long __b) {
22732631 return __cc == 0;
22742632}
22752633
2634#if __ARCH__ >= 12
2635static inline __ATTRS_o_ai int
2636vec_all_eq(vector float __a, vector float __b) {
2637 int __cc;
2638 __builtin_s390_vfcesbs(__a, __b, &__cc);
2639 return __cc == 0;
2640}
2641#endif
2642
22762643static inline __ATTRS_o_ai int
22772644vec_all_eq(vector double __a, vector double __b) {
22782645 int __cc;
......@@ -2289,6 +2656,7 @@ vec_all_ne(vector signed char __a, vector signed char __b) {
22892656 return __cc == 3;
22902657}
22912658
2659// This prototype is deprecated.
22922660static inline __ATTRS_o_ai int
22932661vec_all_ne(vector signed char __a, vector bool char __b) {
22942662 int __cc;
......@@ -2296,6 +2664,7 @@ vec_all_ne(vector signed char __a, vector bool char __b) {
22962664 return __cc == 3;
22972665}
22982666
2667// This prototype is deprecated.
22992668static inline __ATTRS_o_ai int
23002669vec_all_ne(vector bool char __a, vector signed char __b) {
23012670 int __cc;
......@@ -2311,6 +2680,7 @@ vec_all_ne(vector unsigned char __a, vector unsigned char __b) {
23112680 return __cc == 3;
23122681}
23132682
2683// This prototype is deprecated.
23142684static inline __ATTRS_o_ai int
23152685vec_all_ne(vector unsigned char __a, vector bool char __b) {
23162686 int __cc;
......@@ -2319,6 +2689,7 @@ vec_all_ne(vector unsigned char __a, vector bool char __b) {
23192689 return __cc == 3;
23202690}
23212691
2692// This prototype is deprecated.
23222693static inline __ATTRS_o_ai int
23232694vec_all_ne(vector bool char __a, vector unsigned char __b) {
23242695 int __cc;
......@@ -2342,6 +2713,7 @@ vec_all_ne(vector signed short __a, vector signed short __b) {
23422713 return __cc == 3;
23432714}
23442715
2716// This prototype is deprecated.
23452717static inline __ATTRS_o_ai int
23462718vec_all_ne(vector signed short __a, vector bool short __b) {
23472719 int __cc;
......@@ -2349,6 +2721,7 @@ vec_all_ne(vector signed short __a, vector bool short __b) {
23492721 return __cc == 3;
23502722}
23512723
2724// This prototype is deprecated.
23522725static inline __ATTRS_o_ai int
23532726vec_all_ne(vector bool short __a, vector signed short __b) {
23542727 int __cc;
......@@ -2364,6 +2737,7 @@ vec_all_ne(vector unsigned short __a, vector unsigned short __b) {
23642737 return __cc == 3;
23652738}
23662739
2740// This prototype is deprecated.
23672741static inline __ATTRS_o_ai int
23682742vec_all_ne(vector unsigned short __a, vector bool short __b) {
23692743 int __cc;
......@@ -2372,6 +2746,7 @@ vec_all_ne(vector unsigned short __a, vector bool short __b) {
23722746 return __cc == 3;
23732747}
23742748
2749// This prototype is deprecated.
23752750static inline __ATTRS_o_ai int
23762751vec_all_ne(vector bool short __a, vector unsigned short __b) {
23772752 int __cc;
......@@ -2395,6 +2770,7 @@ vec_all_ne(vector signed int __a, vector signed int __b) {
23952770 return __cc == 3;
23962771}
23972772
2773// This prototype is deprecated.
23982774static inline __ATTRS_o_ai int
23992775vec_all_ne(vector signed int __a, vector bool int __b) {
24002776 int __cc;
......@@ -2402,6 +2778,7 @@ vec_all_ne(vector signed int __a, vector bool int __b) {
24022778 return __cc == 3;
24032779}
24042780
2781// This prototype is deprecated.
24052782static inline __ATTRS_o_ai int
24062783vec_all_ne(vector bool int __a, vector signed int __b) {
24072784 int __cc;
......@@ -2417,6 +2794,7 @@ vec_all_ne(vector unsigned int __a, vector unsigned int __b) {
24172794 return __cc == 3;
24182795}
24192796
2797// This prototype is deprecated.
24202798static inline __ATTRS_o_ai int
24212799vec_all_ne(vector unsigned int __a, vector bool int __b) {
24222800 int __cc;
......@@ -2425,6 +2803,7 @@ vec_all_ne(vector unsigned int __a, vector bool int __b) {
24252803 return __cc == 3;
24262804}
24272805
2806// This prototype is deprecated.
24282807static inline __ATTRS_o_ai int
24292808vec_all_ne(vector bool int __a, vector unsigned int __b) {
24302809 int __cc;
......@@ -2448,6 +2827,7 @@ vec_all_ne(vector signed long long __a, vector signed long long __b) {
24482827 return __cc == 3;
24492828}
24502829
2830// This prototype is deprecated.
24512831static inline __ATTRS_o_ai int
24522832vec_all_ne(vector signed long long __a, vector bool long long __b) {
24532833 int __cc;
......@@ -2455,6 +2835,7 @@ vec_all_ne(vector signed long long __a, vector bool long long __b) {
24552835 return __cc == 3;
24562836}
24572837
2838// This prototype is deprecated.
24582839static inline __ATTRS_o_ai int
24592840vec_all_ne(vector bool long long __a, vector signed long long __b) {
24602841 int __cc;
......@@ -2470,6 +2851,7 @@ vec_all_ne(vector unsigned long long __a, vector unsigned long long __b) {
24702851 return __cc == 3;
24712852}
24722853
2854// This prototype is deprecated.
24732855static inline __ATTRS_o_ai int
24742856vec_all_ne(vector unsigned long long __a, vector bool long long __b) {
24752857 int __cc;
......@@ -2478,6 +2860,7 @@ vec_all_ne(vector unsigned long long __a, vector bool long long __b) {
24782860 return __cc == 3;
24792861}
24802862
2863// This prototype is deprecated.
24812864static inline __ATTRS_o_ai int
24822865vec_all_ne(vector bool long long __a, vector unsigned long long __b) {
24832866 int __cc;
......@@ -2494,6 +2877,15 @@ vec_all_ne(vector bool long long __a, vector bool long long __b) {
24942877 return __cc == 3;
24952878}
24962879
2880#if __ARCH__ >= 12
2881static inline __ATTRS_o_ai int
2882vec_all_ne(vector float __a, vector float __b) {
2883 int __cc;
2884 __builtin_s390_vfcesbs(__a, __b, &__cc);
2885 return __cc == 3;
2886}
2887#endif
2888
24972889static inline __ATTRS_o_ai int
24982890vec_all_ne(vector double __a, vector double __b) {
24992891 int __cc;
......@@ -2510,6 +2902,7 @@ vec_all_ge(vector signed char __a, vector signed char __b) {
25102902 return __cc == 3;
25112903}
25122904
2905// This prototype is deprecated.
25132906static inline __ATTRS_o_ai int
25142907vec_all_ge(vector signed char __a, vector bool char __b) {
25152908 int __cc;
......@@ -2517,6 +2910,7 @@ vec_all_ge(vector signed char __a, vector bool char __b) {
25172910 return __cc == 3;
25182911}
25192912
2913// This prototype is deprecated.
25202914static inline __ATTRS_o_ai int
25212915vec_all_ge(vector bool char __a, vector signed char __b) {
25222916 int __cc;
......@@ -2531,6 +2925,7 @@ vec_all_ge(vector unsigned char __a, vector unsigned char __b) {
25312925 return __cc == 3;
25322926}
25332927
2928// This prototype is deprecated.
25342929static inline __ATTRS_o_ai int
25352930vec_all_ge(vector unsigned char __a, vector bool char __b) {
25362931 int __cc;
......@@ -2538,6 +2933,7 @@ vec_all_ge(vector unsigned char __a, vector bool char __b) {
25382933 return __cc == 3;
25392934}
25402935
2936// This prototype is deprecated.
25412937static inline __ATTRS_o_ai int
25422938vec_all_ge(vector bool char __a, vector unsigned char __b) {
25432939 int __cc;
......@@ -2545,6 +2941,7 @@ vec_all_ge(vector bool char __a, vector unsigned char __b) {
25452941 return __cc == 3;
25462942}
25472943
2944// This prototype is deprecated.
25482945static inline __ATTRS_o_ai int
25492946vec_all_ge(vector bool char __a, vector bool char __b) {
25502947 int __cc;
......@@ -2560,6 +2957,7 @@ vec_all_ge(vector signed short __a, vector signed short __b) {
25602957 return __cc == 3;
25612958}
25622959
2960// This prototype is deprecated.
25632961static inline __ATTRS_o_ai int
25642962vec_all_ge(vector signed short __a, vector bool short __b) {
25652963 int __cc;
......@@ -2567,6 +2965,7 @@ vec_all_ge(vector signed short __a, vector bool short __b) {
25672965 return __cc == 3;
25682966}
25692967
2968// This prototype is deprecated.
25702969static inline __ATTRS_o_ai int
25712970vec_all_ge(vector bool short __a, vector signed short __b) {
25722971 int __cc;
......@@ -2581,6 +2980,7 @@ vec_all_ge(vector unsigned short __a, vector unsigned short __b) {
25812980 return __cc == 3;
25822981}
25832982
2983// This prototype is deprecated.
25842984static inline __ATTRS_o_ai int
25852985vec_all_ge(vector unsigned short __a, vector bool short __b) {
25862986 int __cc;
......@@ -2588,6 +2988,7 @@ vec_all_ge(vector unsigned short __a, vector bool short __b) {
25882988 return __cc == 3;
25892989}
25902990
2991// This prototype is deprecated.
25912992static inline __ATTRS_o_ai int
25922993vec_all_ge(vector bool short __a, vector unsigned short __b) {
25932994 int __cc;
......@@ -2595,6 +2996,7 @@ vec_all_ge(vector bool short __a, vector unsigned short __b) {
25952996 return __cc == 3;
25962997}
25972998
2999// This prototype is deprecated.
25983000static inline __ATTRS_o_ai int
25993001vec_all_ge(vector bool short __a, vector bool short __b) {
26003002 int __cc;
......@@ -2610,6 +3012,7 @@ vec_all_ge(vector signed int __a, vector signed int __b) {
26103012 return __cc == 3;
26113013}
26123014
3015// This prototype is deprecated.
26133016static inline __ATTRS_o_ai int
26143017vec_all_ge(vector signed int __a, vector bool int __b) {
26153018 int __cc;
......@@ -2617,6 +3020,7 @@ vec_all_ge(vector signed int __a, vector bool int __b) {
26173020 return __cc == 3;
26183021}
26193022
3023// This prototype is deprecated.
26203024static inline __ATTRS_o_ai int
26213025vec_all_ge(vector bool int __a, vector signed int __b) {
26223026 int __cc;
......@@ -2631,6 +3035,7 @@ vec_all_ge(vector unsigned int __a, vector unsigned int __b) {
26313035 return __cc == 3;
26323036}
26333037
3038// This prototype is deprecated.
26343039static inline __ATTRS_o_ai int
26353040vec_all_ge(vector unsigned int __a, vector bool int __b) {
26363041 int __cc;
......@@ -2638,6 +3043,7 @@ vec_all_ge(vector unsigned int __a, vector bool int __b) {
26383043 return __cc == 3;
26393044}
26403045
3046// This prototype is deprecated.
26413047static inline __ATTRS_o_ai int
26423048vec_all_ge(vector bool int __a, vector unsigned int __b) {
26433049 int __cc;
......@@ -2645,6 +3051,7 @@ vec_all_ge(vector bool int __a, vector unsigned int __b) {
26453051 return __cc == 3;
26463052}
26473053
3054// This prototype is deprecated.
26483055static inline __ATTRS_o_ai int
26493056vec_all_ge(vector bool int __a, vector bool int __b) {
26503057 int __cc;
......@@ -2660,6 +3067,7 @@ vec_all_ge(vector signed long long __a, vector signed long long __b) {
26603067 return __cc == 3;
26613068}
26623069
3070// This prototype is deprecated.
26633071static inline __ATTRS_o_ai int
26643072vec_all_ge(vector signed long long __a, vector bool long long __b) {
26653073 int __cc;
......@@ -2667,6 +3075,7 @@ vec_all_ge(vector signed long long __a, vector bool long long __b) {
26673075 return __cc == 3;
26683076}
26693077
3078// This prototype is deprecated.
26703079static inline __ATTRS_o_ai int
26713080vec_all_ge(vector bool long long __a, vector signed long long __b) {
26723081 int __cc;
......@@ -2681,6 +3090,7 @@ vec_all_ge(vector unsigned long long __a, vector unsigned long long __b) {
26813090 return __cc == 3;
26823091}
26833092
3093// This prototype is deprecated.
26843094static inline __ATTRS_o_ai int
26853095vec_all_ge(vector unsigned long long __a, vector bool long long __b) {
26863096 int __cc;
......@@ -2688,6 +3098,7 @@ vec_all_ge(vector unsigned long long __a, vector bool long long __b) {
26883098 return __cc == 3;
26893099}
26903100
3101// This prototype is deprecated.
26913102static inline __ATTRS_o_ai int
26923103vec_all_ge(vector bool long long __a, vector unsigned long long __b) {
26933104 int __cc;
......@@ -2695,6 +3106,7 @@ vec_all_ge(vector bool long long __a, vector unsigned long long __b) {
26953106 return __cc == 3;
26963107}
26973108
3109// This prototype is deprecated.
26983110static inline __ATTRS_o_ai int
26993111vec_all_ge(vector bool long long __a, vector bool long long __b) {
27003112 int __cc;
......@@ -2703,6 +3115,15 @@ vec_all_ge(vector bool long long __a, vector bool long long __b) {
27033115 return __cc == 3;
27043116}
27053117
3118#if __ARCH__ >= 12
3119static inline __ATTRS_o_ai int
3120vec_all_ge(vector float __a, vector float __b) {
3121 int __cc;
3122 __builtin_s390_vfchesbs(__a, __b, &__cc);
3123 return __cc == 0;
3124}
3125#endif
3126
27063127static inline __ATTRS_o_ai int
27073128vec_all_ge(vector double __a, vector double __b) {
27083129 int __cc;
......@@ -2719,6 +3140,7 @@ vec_all_gt(vector signed char __a, vector signed char __b) {
27193140 return __cc == 0;
27203141}
27213142
3143// This prototype is deprecated.
27223144static inline __ATTRS_o_ai int
27233145vec_all_gt(vector signed char __a, vector bool char __b) {
27243146 int __cc;
......@@ -2726,6 +3148,7 @@ vec_all_gt(vector signed char __a, vector bool char __b) {
27263148 return __cc == 0;
27273149}
27283150
3151// This prototype is deprecated.
27293152static inline __ATTRS_o_ai int
27303153vec_all_gt(vector bool char __a, vector signed char __b) {
27313154 int __cc;
......@@ -2740,6 +3163,7 @@ vec_all_gt(vector unsigned char __a, vector unsigned char __b) {
27403163 return __cc == 0;
27413164}
27423165
3166// This prototype is deprecated.
27433167static inline __ATTRS_o_ai int
27443168vec_all_gt(vector unsigned char __a, vector bool char __b) {
27453169 int __cc;
......@@ -2747,6 +3171,7 @@ vec_all_gt(vector unsigned char __a, vector bool char __b) {
27473171 return __cc == 0;
27483172}
27493173
3174// This prototype is deprecated.
27503175static inline __ATTRS_o_ai int
27513176vec_all_gt(vector bool char __a, vector unsigned char __b) {
27523177 int __cc;
......@@ -2754,6 +3179,7 @@ vec_all_gt(vector bool char __a, vector unsigned char __b) {
27543179 return __cc == 0;
27553180}
27563181
3182// This prototype is deprecated.
27573183static inline __ATTRS_o_ai int
27583184vec_all_gt(vector bool char __a, vector bool char __b) {
27593185 int __cc;
......@@ -2769,6 +3195,7 @@ vec_all_gt(vector signed short __a, vector signed short __b) {
27693195 return __cc == 0;
27703196}
27713197
3198// This prototype is deprecated.
27723199static inline __ATTRS_o_ai int
27733200vec_all_gt(vector signed short __a, vector bool short __b) {
27743201 int __cc;
......@@ -2776,6 +3203,7 @@ vec_all_gt(vector signed short __a, vector bool short __b) {
27763203 return __cc == 0;
27773204}
27783205
3206// This prototype is deprecated.
27793207static inline __ATTRS_o_ai int
27803208vec_all_gt(vector bool short __a, vector signed short __b) {
27813209 int __cc;
......@@ -2790,6 +3218,7 @@ vec_all_gt(vector unsigned short __a, vector unsigned short __b) {
27903218 return __cc == 0;
27913219}
27923220
3221// This prototype is deprecated.
27933222static inline __ATTRS_o_ai int
27943223vec_all_gt(vector unsigned short __a, vector bool short __b) {
27953224 int __cc;
......@@ -2797,6 +3226,7 @@ vec_all_gt(vector unsigned short __a, vector bool short __b) {
27973226 return __cc == 0;
27983227}
27993228
3229// This prototype is deprecated.
28003230static inline __ATTRS_o_ai int
28013231vec_all_gt(vector bool short __a, vector unsigned short __b) {
28023232 int __cc;
......@@ -2804,6 +3234,7 @@ vec_all_gt(vector bool short __a, vector unsigned short __b) {
28043234 return __cc == 0;
28053235}
28063236
3237// This prototype is deprecated.
28073238static inline __ATTRS_o_ai int
28083239vec_all_gt(vector bool short __a, vector bool short __b) {
28093240 int __cc;
......@@ -2819,6 +3250,7 @@ vec_all_gt(vector signed int __a, vector signed int __b) {
28193250 return __cc == 0;
28203251}
28213252
3253// This prototype is deprecated.
28223254static inline __ATTRS_o_ai int
28233255vec_all_gt(vector signed int __a, vector bool int __b) {
28243256 int __cc;
......@@ -2826,6 +3258,7 @@ vec_all_gt(vector signed int __a, vector bool int __b) {
28263258 return __cc == 0;
28273259}
28283260
3261// This prototype is deprecated.
28293262static inline __ATTRS_o_ai int
28303263vec_all_gt(vector bool int __a, vector signed int __b) {
28313264 int __cc;
......@@ -2840,6 +3273,7 @@ vec_all_gt(vector unsigned int __a, vector unsigned int __b) {
28403273 return __cc == 0;
28413274}
28423275
3276// This prototype is deprecated.
28433277static inline __ATTRS_o_ai int
28443278vec_all_gt(vector unsigned int __a, vector bool int __b) {
28453279 int __cc;
......@@ -2847,6 +3281,7 @@ vec_all_gt(vector unsigned int __a, vector bool int __b) {
28473281 return __cc == 0;
28483282}
28493283
3284// This prototype is deprecated.
28503285static inline __ATTRS_o_ai int
28513286vec_all_gt(vector bool int __a, vector unsigned int __b) {
28523287 int __cc;
......@@ -2854,6 +3289,7 @@ vec_all_gt(vector bool int __a, vector unsigned int __b) {
28543289 return __cc == 0;
28553290}
28563291
3292// This prototype is deprecated.
28573293static inline __ATTRS_o_ai int
28583294vec_all_gt(vector bool int __a, vector bool int __b) {
28593295 int __cc;
......@@ -2869,6 +3305,7 @@ vec_all_gt(vector signed long long __a, vector signed long long __b) {
28693305 return __cc == 0;
28703306}
28713307
3308// This prototype is deprecated.
28723309static inline __ATTRS_o_ai int
28733310vec_all_gt(vector signed long long __a, vector bool long long __b) {
28743311 int __cc;
......@@ -2876,6 +3313,7 @@ vec_all_gt(vector signed long long __a, vector bool long long __b) {
28763313 return __cc == 0;
28773314}
28783315
3316// This prototype is deprecated.
28793317static inline __ATTRS_o_ai int
28803318vec_all_gt(vector bool long long __a, vector signed long long __b) {
28813319 int __cc;
......@@ -2890,6 +3328,7 @@ vec_all_gt(vector unsigned long long __a, vector unsigned long long __b) {
28903328 return __cc == 0;
28913329}
28923330
3331// This prototype is deprecated.
28933332static inline __ATTRS_o_ai int
28943333vec_all_gt(vector unsigned long long __a, vector bool long long __b) {
28953334 int __cc;
......@@ -2897,6 +3336,7 @@ vec_all_gt(vector unsigned long long __a, vector bool long long __b) {
28973336 return __cc == 0;
28983337}
28993338
3339// This prototype is deprecated.
29003340static inline __ATTRS_o_ai int
29013341vec_all_gt(vector bool long long __a, vector unsigned long long __b) {
29023342 int __cc;
......@@ -2904,6 +3344,7 @@ vec_all_gt(vector bool long long __a, vector unsigned long long __b) {
29043344 return __cc == 0;
29053345}
29063346
3347// This prototype is deprecated.
29073348static inline __ATTRS_o_ai int
29083349vec_all_gt(vector bool long long __a, vector bool long long __b) {
29093350 int __cc;
......@@ -2912,6 +3353,15 @@ vec_all_gt(vector bool long long __a, vector bool long long __b) {
29123353 return __cc == 0;
29133354}
29143355
3356#if __ARCH__ >= 12
3357static inline __ATTRS_o_ai int
3358vec_all_gt(vector float __a, vector float __b) {
3359 int __cc;
3360 __builtin_s390_vfchsbs(__a, __b, &__cc);
3361 return __cc == 0;
3362}
3363#endif
3364
29153365static inline __ATTRS_o_ai int
29163366vec_all_gt(vector double __a, vector double __b) {
29173367 int __cc;
......@@ -2928,6 +3378,7 @@ vec_all_le(vector signed char __a, vector signed char __b) {
29283378 return __cc == 3;
29293379}
29303380
3381// This prototype is deprecated.
29313382static inline __ATTRS_o_ai int
29323383vec_all_le(vector signed char __a, vector bool char __b) {
29333384 int __cc;
......@@ -2935,6 +3386,7 @@ vec_all_le(vector signed char __a, vector bool char __b) {
29353386 return __cc == 3;
29363387}
29373388
3389// This prototype is deprecated.
29383390static inline __ATTRS_o_ai int
29393391vec_all_le(vector bool char __a, vector signed char __b) {
29403392 int __cc;
......@@ -2949,6 +3401,7 @@ vec_all_le(vector unsigned char __a, vector unsigned char __b) {
29493401 return __cc == 3;
29503402}
29513403
3404// This prototype is deprecated.
29523405static inline __ATTRS_o_ai int
29533406vec_all_le(vector unsigned char __a, vector bool char __b) {
29543407 int __cc;
......@@ -2956,6 +3409,7 @@ vec_all_le(vector unsigned char __a, vector bool char __b) {
29563409 return __cc == 3;
29573410}
29583411
3412// This prototype is deprecated.
29593413static inline __ATTRS_o_ai int
29603414vec_all_le(vector bool char __a, vector unsigned char __b) {
29613415 int __cc;
......@@ -2963,6 +3417,7 @@ vec_all_le(vector bool char __a, vector unsigned char __b) {
29633417 return __cc == 3;
29643418}
29653419
3420// This prototype is deprecated.
29663421static inline __ATTRS_o_ai int
29673422vec_all_le(vector bool char __a, vector bool char __b) {
29683423 int __cc;
......@@ -2978,6 +3433,7 @@ vec_all_le(vector signed short __a, vector signed short __b) {
29783433 return __cc == 3;
29793434}
29803435
3436// This prototype is deprecated.
29813437static inline __ATTRS_o_ai int
29823438vec_all_le(vector signed short __a, vector bool short __b) {
29833439 int __cc;
......@@ -2985,6 +3441,7 @@ vec_all_le(vector signed short __a, vector bool short __b) {
29853441 return __cc == 3;
29863442}
29873443
3444// This prototype is deprecated.
29883445static inline __ATTRS_o_ai int
29893446vec_all_le(vector bool short __a, vector signed short __b) {
29903447 int __cc;
......@@ -2999,6 +3456,7 @@ vec_all_le(vector unsigned short __a, vector unsigned short __b) {
29993456 return __cc == 3;
30003457}
30013458
3459// This prototype is deprecated.
30023460static inline __ATTRS_o_ai int
30033461vec_all_le(vector unsigned short __a, vector bool short __b) {
30043462 int __cc;
......@@ -3006,6 +3464,7 @@ vec_all_le(vector unsigned short __a, vector bool short __b) {
30063464 return __cc == 3;
30073465}
30083466
3467// This prototype is deprecated.
30093468static inline __ATTRS_o_ai int
30103469vec_all_le(vector bool short __a, vector unsigned short __b) {
30113470 int __cc;
......@@ -3013,6 +3472,7 @@ vec_all_le(vector bool short __a, vector unsigned short __b) {
30133472 return __cc == 3;
30143473}
30153474
3475// This prototype is deprecated.
30163476static inline __ATTRS_o_ai int
30173477vec_all_le(vector bool short __a, vector bool short __b) {
30183478 int __cc;
......@@ -3028,6 +3488,7 @@ vec_all_le(vector signed int __a, vector signed int __b) {
30283488 return __cc == 3;
30293489}
30303490
3491// This prototype is deprecated.
30313492static inline __ATTRS_o_ai int
30323493vec_all_le(vector signed int __a, vector bool int __b) {
30333494 int __cc;
......@@ -3035,6 +3496,7 @@ vec_all_le(vector signed int __a, vector bool int __b) {
30353496 return __cc == 3;
30363497}
30373498
3499// This prototype is deprecated.
30383500static inline __ATTRS_o_ai int
30393501vec_all_le(vector bool int __a, vector signed int __b) {
30403502 int __cc;
......@@ -3049,6 +3511,7 @@ vec_all_le(vector unsigned int __a, vector unsigned int __b) {
30493511 return __cc == 3;
30503512}
30513513
3514// This prototype is deprecated.
30523515static inline __ATTRS_o_ai int
30533516vec_all_le(vector unsigned int __a, vector bool int __b) {
30543517 int __cc;
......@@ -3056,6 +3519,7 @@ vec_all_le(vector unsigned int __a, vector bool int __b) {
30563519 return __cc == 3;
30573520}
30583521
3522// This prototype is deprecated.
30593523static inline __ATTRS_o_ai int
30603524vec_all_le(vector bool int __a, vector unsigned int __b) {
30613525 int __cc;
......@@ -3063,6 +3527,7 @@ vec_all_le(vector bool int __a, vector unsigned int __b) {
30633527 return __cc == 3;
30643528}
30653529
3530// This prototype is deprecated.
30663531static inline __ATTRS_o_ai int
30673532vec_all_le(vector bool int __a, vector bool int __b) {
30683533 int __cc;
......@@ -3078,6 +3543,7 @@ vec_all_le(vector signed long long __a, vector signed long long __b) {
30783543 return __cc == 3;
30793544}
30803545
3546// This prototype is deprecated.
30813547static inline __ATTRS_o_ai int
30823548vec_all_le(vector signed long long __a, vector bool long long __b) {
30833549 int __cc;
......@@ -3085,6 +3551,7 @@ vec_all_le(vector signed long long __a, vector bool long long __b) {
30853551 return __cc == 3;
30863552}
30873553
3554// This prototype is deprecated.
30883555static inline __ATTRS_o_ai int
30893556vec_all_le(vector bool long long __a, vector signed long long __b) {
30903557 int __cc;
......@@ -3099,6 +3566,7 @@ vec_all_le(vector unsigned long long __a, vector unsigned long long __b) {
30993566 return __cc == 3;
31003567}
31013568
3569// This prototype is deprecated.
31023570static inline __ATTRS_o_ai int
31033571vec_all_le(vector unsigned long long __a, vector bool long long __b) {
31043572 int __cc;
......@@ -3106,6 +3574,7 @@ vec_all_le(vector unsigned long long __a, vector bool long long __b) {
31063574 return __cc == 3;
31073575}
31083576
3577// This prototype is deprecated.
31093578static inline __ATTRS_o_ai int
31103579vec_all_le(vector bool long long __a, vector unsigned long long __b) {
31113580 int __cc;
......@@ -3113,6 +3582,7 @@ vec_all_le(vector bool long long __a, vector unsigned long long __b) {
31133582 return __cc == 3;
31143583}
31153584
3585// This prototype is deprecated.
31163586static inline __ATTRS_o_ai int
31173587vec_all_le(vector bool long long __a, vector bool long long __b) {
31183588 int __cc;
......@@ -3121,6 +3591,15 @@ vec_all_le(vector bool long long __a, vector bool long long __b) {
31213591 return __cc == 3;
31223592}
31233593
3594#if __ARCH__ >= 12
3595static inline __ATTRS_o_ai int
3596vec_all_le(vector float __a, vector float __b) {
3597 int __cc;
3598 __builtin_s390_vfchesbs(__b, __a, &__cc);
3599 return __cc == 0;
3600}
3601#endif
3602
31243603static inline __ATTRS_o_ai int
31253604vec_all_le(vector double __a, vector double __b) {
31263605 int __cc;
......@@ -3137,6 +3616,7 @@ vec_all_lt(vector signed char __a, vector signed char __b) {
31373616 return __cc == 0;
31383617}
31393618
3619// This prototype is deprecated.
31403620static inline __ATTRS_o_ai int
31413621vec_all_lt(vector signed char __a, vector bool char __b) {
31423622 int __cc;
......@@ -3144,6 +3624,7 @@ vec_all_lt(vector signed char __a, vector bool char __b) {
31443624 return __cc == 0;
31453625}
31463626
3627// This prototype is deprecated.
31473628static inline __ATTRS_o_ai int
31483629vec_all_lt(vector bool char __a, vector signed char __b) {
31493630 int __cc;
......@@ -3158,6 +3639,7 @@ vec_all_lt(vector unsigned char __a, vector unsigned char __b) {
31583639 return __cc == 0;
31593640}
31603641
3642// This prototype is deprecated.
31613643static inline __ATTRS_o_ai int
31623644vec_all_lt(vector unsigned char __a, vector bool char __b) {
31633645 int __cc;
......@@ -3165,6 +3647,7 @@ vec_all_lt(vector unsigned char __a, vector bool char __b) {
31653647 return __cc == 0;
31663648}
31673649
3650// This prototype is deprecated.
31683651static inline __ATTRS_o_ai int
31693652vec_all_lt(vector bool char __a, vector unsigned char __b) {
31703653 int __cc;
......@@ -3172,6 +3655,7 @@ vec_all_lt(vector bool char __a, vector unsigned char __b) {
31723655 return __cc == 0;
31733656}
31743657
3658// This prototype is deprecated.
31753659static inline __ATTRS_o_ai int
31763660vec_all_lt(vector bool char __a, vector bool char __b) {
31773661 int __cc;
......@@ -3187,6 +3671,7 @@ vec_all_lt(vector signed short __a, vector signed short __b) {
31873671 return __cc == 0;
31883672}
31893673
3674// This prototype is deprecated.
31903675static inline __ATTRS_o_ai int
31913676vec_all_lt(vector signed short __a, vector bool short __b) {
31923677 int __cc;
......@@ -3194,6 +3679,7 @@ vec_all_lt(vector signed short __a, vector bool short __b) {
31943679 return __cc == 0;
31953680}
31963681
3682// This prototype is deprecated.
31973683static inline __ATTRS_o_ai int
31983684vec_all_lt(vector bool short __a, vector signed short __b) {
31993685 int __cc;
......@@ -3208,6 +3694,7 @@ vec_all_lt(vector unsigned short __a, vector unsigned short __b) {
32083694 return __cc == 0;
32093695}
32103696
3697// This prototype is deprecated.
32113698static inline __ATTRS_o_ai int
32123699vec_all_lt(vector unsigned short __a, vector bool short __b) {
32133700 int __cc;
......@@ -3215,6 +3702,7 @@ vec_all_lt(vector unsigned short __a, vector bool short __b) {
32153702 return __cc == 0;
32163703}
32173704
3705// This prototype is deprecated.
32183706static inline __ATTRS_o_ai int
32193707vec_all_lt(vector bool short __a, vector unsigned short __b) {
32203708 int __cc;
......@@ -3222,6 +3710,7 @@ vec_all_lt(vector bool short __a, vector unsigned short __b) {
32223710 return __cc == 0;
32233711}
32243712
3713// This prototype is deprecated.
32253714static inline __ATTRS_o_ai int
32263715vec_all_lt(vector bool short __a, vector bool short __b) {
32273716 int __cc;
......@@ -3237,6 +3726,7 @@ vec_all_lt(vector signed int __a, vector signed int __b) {
32373726 return __cc == 0;
32383727}
32393728
3729// This prototype is deprecated.
32403730static inline __ATTRS_o_ai int
32413731vec_all_lt(vector signed int __a, vector bool int __b) {
32423732 int __cc;
......@@ -3244,6 +3734,7 @@ vec_all_lt(vector signed int __a, vector bool int __b) {
32443734 return __cc == 0;
32453735}
32463736
3737// This prototype is deprecated.
32473738static inline __ATTRS_o_ai int
32483739vec_all_lt(vector bool int __a, vector signed int __b) {
32493740 int __cc;
......@@ -3258,6 +3749,7 @@ vec_all_lt(vector unsigned int __a, vector unsigned int __b) {
32583749 return __cc == 0;
32593750}
32603751
3752// This prototype is deprecated.
32613753static inline __ATTRS_o_ai int
32623754vec_all_lt(vector unsigned int __a, vector bool int __b) {
32633755 int __cc;
......@@ -3265,6 +3757,7 @@ vec_all_lt(vector unsigned int __a, vector bool int __b) {
32653757 return __cc == 0;
32663758}
32673759
3760// This prototype is deprecated.
32683761static inline __ATTRS_o_ai int
32693762vec_all_lt(vector bool int __a, vector unsigned int __b) {
32703763 int __cc;
......@@ -3272,6 +3765,7 @@ vec_all_lt(vector bool int __a, vector unsigned int __b) {
32723765 return __cc == 0;
32733766}
32743767
3768// This prototype is deprecated.
32753769static inline __ATTRS_o_ai int
32763770vec_all_lt(vector bool int __a, vector bool int __b) {
32773771 int __cc;
......@@ -3287,6 +3781,7 @@ vec_all_lt(vector signed long long __a, vector signed long long __b) {
32873781 return __cc == 0;
32883782}
32893783
3784// This prototype is deprecated.
32903785static inline __ATTRS_o_ai int
32913786vec_all_lt(vector signed long long __a, vector bool long long __b) {
32923787 int __cc;
......@@ -3294,6 +3789,7 @@ vec_all_lt(vector signed long long __a, vector bool long long __b) {
32943789 return __cc == 0;
32953790}
32963791
3792// This prototype is deprecated.
32973793static inline __ATTRS_o_ai int
32983794vec_all_lt(vector bool long long __a, vector signed long long __b) {
32993795 int __cc;
......@@ -3308,6 +3804,7 @@ vec_all_lt(vector unsigned long long __a, vector unsigned long long __b) {
33083804 return __cc == 0;
33093805}
33103806
3807// This prototype is deprecated.
33113808static inline __ATTRS_o_ai int
33123809vec_all_lt(vector unsigned long long __a, vector bool long long __b) {
33133810 int __cc;
......@@ -3315,6 +3812,7 @@ vec_all_lt(vector unsigned long long __a, vector bool long long __b) {
33153812 return __cc == 0;
33163813}
33173814
3815// This prototype is deprecated.
33183816static inline __ATTRS_o_ai int
33193817vec_all_lt(vector bool long long __a, vector unsigned long long __b) {
33203818 int __cc;
......@@ -3322,6 +3820,7 @@ vec_all_lt(vector bool long long __a, vector unsigned long long __b) {
33223820 return __cc == 0;
33233821}
33243822
3823// This prototype is deprecated.
33253824static inline __ATTRS_o_ai int
33263825vec_all_lt(vector bool long long __a, vector bool long long __b) {
33273826 int __cc;
......@@ -3330,6 +3829,15 @@ vec_all_lt(vector bool long long __a, vector bool long long __b) {
33303829 return __cc == 0;
33313830}
33323831
3832#if __ARCH__ >= 12
3833static inline __ATTRS_o_ai int
3834vec_all_lt(vector float __a, vector float __b) {
3835 int __cc;
3836 __builtin_s390_vfchsbs(__b, __a, &__cc);
3837 return __cc == 0;
3838}
3839#endif
3840
33333841static inline __ATTRS_o_ai int
33343842vec_all_lt(vector double __a, vector double __b) {
33353843 int __cc;
......@@ -3339,7 +3847,16 @@ vec_all_lt(vector double __a, vector double __b) {
33393847
33403848/*-- vec_all_nge ------------------------------------------------------------*/
33413849
3342static inline __ATTRS_ai int
3850#if __ARCH__ >= 12
3851static inline __ATTRS_o_ai int
3852vec_all_nge(vector float __a, vector float __b) {
3853 int __cc;
3854 __builtin_s390_vfchesbs(__a, __b, &__cc);
3855 return __cc == 3;
3856}
3857#endif
3858
3859static inline __ATTRS_o_ai int
33433860vec_all_nge(vector double __a, vector double __b) {
33443861 int __cc;
33453862 __builtin_s390_vfchedbs(__a, __b, &__cc);
......@@ -3348,7 +3865,16 @@ vec_all_nge(vector double __a, vector double __b) {
33483865
33493866/*-- vec_all_ngt ------------------------------------------------------------*/
33503867
3351static inline __ATTRS_ai int
3868#if __ARCH__ >= 12
3869static inline __ATTRS_o_ai int
3870vec_all_ngt(vector float __a, vector float __b) {
3871 int __cc;
3872 __builtin_s390_vfchsbs(__a, __b, &__cc);
3873 return __cc == 3;
3874}
3875#endif
3876
3877static inline __ATTRS_o_ai int
33523878vec_all_ngt(vector double __a, vector double __b) {
33533879 int __cc;
33543880 __builtin_s390_vfchdbs(__a, __b, &__cc);
......@@ -3357,7 +3883,16 @@ vec_all_ngt(vector double __a, vector double __b) {
33573883
33583884/*-- vec_all_nle ------------------------------------------------------------*/
33593885
3360static inline __ATTRS_ai int
3886#if __ARCH__ >= 12
3887static inline __ATTRS_o_ai int
3888vec_all_nle(vector float __a, vector float __b) {
3889 int __cc;
3890 __builtin_s390_vfchesbs(__b, __a, &__cc);
3891 return __cc == 3;
3892}
3893#endif
3894
3895static inline __ATTRS_o_ai int
33613896vec_all_nle(vector double __a, vector double __b) {
33623897 int __cc;
33633898 __builtin_s390_vfchedbs(__b, __a, &__cc);
......@@ -3366,7 +3901,16 @@ vec_all_nle(vector double __a, vector double __b) {
33663901
33673902/*-- vec_all_nlt ------------------------------------------------------------*/
33683903
3369static inline __ATTRS_ai int
3904#if __ARCH__ >= 12
3905static inline __ATTRS_o_ai int
3906vec_all_nlt(vector float __a, vector float __b) {
3907 int __cc;
3908 __builtin_s390_vfchsbs(__b, __a, &__cc);
3909 return __cc == 3;
3910}
3911#endif
3912
3913static inline __ATTRS_o_ai int
33703914vec_all_nlt(vector double __a, vector double __b) {
33713915 int __cc;
33723916 __builtin_s390_vfchdbs(__b, __a, &__cc);
......@@ -3375,7 +3919,16 @@ vec_all_nlt(vector double __a, vector double __b) {
33753919
33763920/*-- vec_all_nan ------------------------------------------------------------*/
33773921
3378static inline __ATTRS_ai int
3922#if __ARCH__ >= 12
3923static inline __ATTRS_o_ai int
3924vec_all_nan(vector float __a) {
3925 int __cc;
3926 __builtin_s390_vftcisb(__a, 15, &__cc);
3927 return __cc == 0;
3928}
3929#endif
3930
3931static inline __ATTRS_o_ai int
33793932vec_all_nan(vector double __a) {
33803933 int __cc;
33813934 __builtin_s390_vftcidb(__a, 15, &__cc);
......@@ -3384,7 +3937,16 @@ vec_all_nan(vector double __a) {
33843937
33853938/*-- vec_all_numeric --------------------------------------------------------*/
33863939
3387static inline __ATTRS_ai int
3940#if __ARCH__ >= 12
3941static inline __ATTRS_o_ai int
3942vec_all_numeric(vector float __a) {
3943 int __cc;
3944 __builtin_s390_vftcisb(__a, 15, &__cc);
3945 return __cc == 3;
3946}
3947#endif
3948
3949static inline __ATTRS_o_ai int
33883950vec_all_numeric(vector double __a) {
33893951 int __cc;
33903952 __builtin_s390_vftcidb(__a, 15, &__cc);
......@@ -3400,6 +3962,7 @@ vec_any_eq(vector signed char __a, vector signed char __b) {
34003962 return __cc <= 1;
34013963}
34023964
3965// This prototype is deprecated.
34033966static inline __ATTRS_o_ai int
34043967vec_any_eq(vector signed char __a, vector bool char __b) {
34053968 int __cc;
......@@ -3407,6 +3970,7 @@ vec_any_eq(vector signed char __a, vector bool char __b) {
34073970 return __cc <= 1;
34083971}
34093972
3973// This prototype is deprecated.
34103974static inline __ATTRS_o_ai int
34113975vec_any_eq(vector bool char __a, vector signed char __b) {
34123976 int __cc;
......@@ -3422,6 +3986,7 @@ vec_any_eq(vector unsigned char __a, vector unsigned char __b) {
34223986 return __cc <= 1;
34233987}
34243988
3989// This prototype is deprecated.
34253990static inline __ATTRS_o_ai int
34263991vec_any_eq(vector unsigned char __a, vector bool char __b) {
34273992 int __cc;
......@@ -3430,6 +3995,7 @@ vec_any_eq(vector unsigned char __a, vector bool char __b) {
34303995 return __cc <= 1;
34313996}
34323997
3998// This prototype is deprecated.
34333999static inline __ATTRS_o_ai int
34344000vec_any_eq(vector bool char __a, vector unsigned char __b) {
34354001 int __cc;
......@@ -3453,6 +4019,7 @@ vec_any_eq(vector signed short __a, vector signed short __b) {
34534019 return __cc <= 1;
34544020}
34554021
4022// This prototype is deprecated.
34564023static inline __ATTRS_o_ai int
34574024vec_any_eq(vector signed short __a, vector bool short __b) {
34584025 int __cc;
......@@ -3460,6 +4027,7 @@ vec_any_eq(vector signed short __a, vector bool short __b) {
34604027 return __cc <= 1;
34614028}
34624029
4030// This prototype is deprecated.
34634031static inline __ATTRS_o_ai int
34644032vec_any_eq(vector bool short __a, vector signed short __b) {
34654033 int __cc;
......@@ -3475,6 +4043,7 @@ vec_any_eq(vector unsigned short __a, vector unsigned short __b) {
34754043 return __cc <= 1;
34764044}
34774045
4046// This prototype is deprecated.
34784047static inline __ATTRS_o_ai int
34794048vec_any_eq(vector unsigned short __a, vector bool short __b) {
34804049 int __cc;
......@@ -3483,6 +4052,7 @@ vec_any_eq(vector unsigned short __a, vector bool short __b) {
34834052 return __cc <= 1;
34844053}
34854054
4055// This prototype is deprecated.
34864056static inline __ATTRS_o_ai int
34874057vec_any_eq(vector bool short __a, vector unsigned short __b) {
34884058 int __cc;
......@@ -3506,6 +4076,7 @@ vec_any_eq(vector signed int __a, vector signed int __b) {
35064076 return __cc <= 1;
35074077}
35084078
4079// This prototype is deprecated.
35094080static inline __ATTRS_o_ai int
35104081vec_any_eq(vector signed int __a, vector bool int __b) {
35114082 int __cc;
......@@ -3513,6 +4084,7 @@ vec_any_eq(vector signed int __a, vector bool int __b) {
35134084 return __cc <= 1;
35144085}
35154086
4087// This prototype is deprecated.
35164088static inline __ATTRS_o_ai int
35174089vec_any_eq(vector bool int __a, vector signed int __b) {
35184090 int __cc;
......@@ -3528,6 +4100,7 @@ vec_any_eq(vector unsigned int __a, vector unsigned int __b) {
35284100 return __cc <= 1;
35294101}
35304102
4103// This prototype is deprecated.
35314104static inline __ATTRS_o_ai int
35324105vec_any_eq(vector unsigned int __a, vector bool int __b) {
35334106 int __cc;
......@@ -3536,6 +4109,7 @@ vec_any_eq(vector unsigned int __a, vector bool int __b) {
35364109 return __cc <= 1;
35374110}
35384111
4112// This prototype is deprecated.
35394113static inline __ATTRS_o_ai int
35404114vec_any_eq(vector bool int __a, vector unsigned int __b) {
35414115 int __cc;
......@@ -3559,6 +4133,7 @@ vec_any_eq(vector signed long long __a, vector signed long long __b) {
35594133 return __cc <= 1;
35604134}
35614135
4136// This prototype is deprecated.
35624137static inline __ATTRS_o_ai int
35634138vec_any_eq(vector signed long long __a, vector bool long long __b) {
35644139 int __cc;
......@@ -3566,6 +4141,7 @@ vec_any_eq(vector signed long long __a, vector bool long long __b) {
35664141 return __cc <= 1;
35674142}
35684143
4144// This prototype is deprecated.
35694145static inline __ATTRS_o_ai int
35704146vec_any_eq(vector bool long long __a, vector signed long long __b) {
35714147 int __cc;
......@@ -3581,6 +4157,7 @@ vec_any_eq(vector unsigned long long __a, vector unsigned long long __b) {
35814157 return __cc <= 1;
35824158}
35834159
4160// This prototype is deprecated.
35844161static inline __ATTRS_o_ai int
35854162vec_any_eq(vector unsigned long long __a, vector bool long long __b) {
35864163 int __cc;
......@@ -3589,6 +4166,7 @@ vec_any_eq(vector unsigned long long __a, vector bool long long __b) {
35894166 return __cc <= 1;
35904167}
35914168
4169// This prototype is deprecated.
35924170static inline __ATTRS_o_ai int
35934171vec_any_eq(vector bool long long __a, vector unsigned long long __b) {
35944172 int __cc;
......@@ -3605,6 +4183,15 @@ vec_any_eq(vector bool long long __a, vector bool long long __b) {
36054183 return __cc <= 1;
36064184}
36074185
4186#if __ARCH__ >= 12
4187static inline __ATTRS_o_ai int
4188vec_any_eq(vector float __a, vector float __b) {
4189 int __cc;
4190 __builtin_s390_vfcesbs(__a, __b, &__cc);
4191 return __cc <= 1;
4192}
4193#endif
4194
36084195static inline __ATTRS_o_ai int
36094196vec_any_eq(vector double __a, vector double __b) {
36104197 int __cc;
......@@ -3621,6 +4208,7 @@ vec_any_ne(vector signed char __a, vector signed char __b) {
36214208 return __cc != 0;
36224209}
36234210
4211// This prototype is deprecated.
36244212static inline __ATTRS_o_ai int
36254213vec_any_ne(vector signed char __a, vector bool char __b) {
36264214 int __cc;
......@@ -3628,6 +4216,7 @@ vec_any_ne(vector signed char __a, vector bool char __b) {
36284216 return __cc != 0;
36294217}
36304218
4219// This prototype is deprecated.
36314220static inline __ATTRS_o_ai int
36324221vec_any_ne(vector bool char __a, vector signed char __b) {
36334222 int __cc;
......@@ -3643,6 +4232,7 @@ vec_any_ne(vector unsigned char __a, vector unsigned char __b) {
36434232 return __cc != 0;
36444233}
36454234
4235// This prototype is deprecated.
36464236static inline __ATTRS_o_ai int
36474237vec_any_ne(vector unsigned char __a, vector bool char __b) {
36484238 int __cc;
......@@ -3651,6 +4241,7 @@ vec_any_ne(vector unsigned char __a, vector bool char __b) {
36514241 return __cc != 0;
36524242}
36534243
4244// This prototype is deprecated.
36544245static inline __ATTRS_o_ai int
36554246vec_any_ne(vector bool char __a, vector unsigned char __b) {
36564247 int __cc;
......@@ -3674,6 +4265,7 @@ vec_any_ne(vector signed short __a, vector signed short __b) {
36744265 return __cc != 0;
36754266}
36764267
4268// This prototype is deprecated.
36774269static inline __ATTRS_o_ai int
36784270vec_any_ne(vector signed short __a, vector bool short __b) {
36794271 int __cc;
......@@ -3681,6 +4273,7 @@ vec_any_ne(vector signed short __a, vector bool short __b) {
36814273 return __cc != 0;
36824274}
36834275
4276// This prototype is deprecated.
36844277static inline __ATTRS_o_ai int
36854278vec_any_ne(vector bool short __a, vector signed short __b) {
36864279 int __cc;
......@@ -3696,6 +4289,7 @@ vec_any_ne(vector unsigned short __a, vector unsigned short __b) {
36964289 return __cc != 0;
36974290}
36984291
4292// This prototype is deprecated.
36994293static inline __ATTRS_o_ai int
37004294vec_any_ne(vector unsigned short __a, vector bool short __b) {
37014295 int __cc;
......@@ -3704,6 +4298,7 @@ vec_any_ne(vector unsigned short __a, vector bool short __b) {
37044298 return __cc != 0;
37054299}
37064300
4301// This prototype is deprecated.
37074302static inline __ATTRS_o_ai int
37084303vec_any_ne(vector bool short __a, vector unsigned short __b) {
37094304 int __cc;
......@@ -3727,6 +4322,7 @@ vec_any_ne(vector signed int __a, vector signed int __b) {
37274322 return __cc != 0;
37284323}
37294324
4325// This prototype is deprecated.
37304326static inline __ATTRS_o_ai int
37314327vec_any_ne(vector signed int __a, vector bool int __b) {
37324328 int __cc;
......@@ -3734,6 +4330,7 @@ vec_any_ne(vector signed int __a, vector bool int __b) {
37344330 return __cc != 0;
37354331}
37364332
4333// This prototype is deprecated.
37374334static inline __ATTRS_o_ai int
37384335vec_any_ne(vector bool int __a, vector signed int __b) {
37394336 int __cc;
......@@ -3749,6 +4346,7 @@ vec_any_ne(vector unsigned int __a, vector unsigned int __b) {
37494346 return __cc != 0;
37504347}
37514348
4349// This prototype is deprecated.
37524350static inline __ATTRS_o_ai int
37534351vec_any_ne(vector unsigned int __a, vector bool int __b) {
37544352 int __cc;
......@@ -3757,6 +4355,7 @@ vec_any_ne(vector unsigned int __a, vector bool int __b) {
37574355 return __cc != 0;
37584356}
37594357
4358// This prototype is deprecated.
37604359static inline __ATTRS_o_ai int
37614360vec_any_ne(vector bool int __a, vector unsigned int __b) {
37624361 int __cc;
......@@ -3780,6 +4379,7 @@ vec_any_ne(vector signed long long __a, vector signed long long __b) {
37804379 return __cc != 0;
37814380}
37824381
4382// This prototype is deprecated.
37834383static inline __ATTRS_o_ai int
37844384vec_any_ne(vector signed long long __a, vector bool long long __b) {
37854385 int __cc;
......@@ -3787,6 +4387,7 @@ vec_any_ne(vector signed long long __a, vector bool long long __b) {
37874387 return __cc != 0;
37884388}
37894389
4390// This prototype is deprecated.
37904391static inline __ATTRS_o_ai int
37914392vec_any_ne(vector bool long long __a, vector signed long long __b) {
37924393 int __cc;
......@@ -3802,6 +4403,7 @@ vec_any_ne(vector unsigned long long __a, vector unsigned long long __b) {
38024403 return __cc != 0;
38034404}
38044405
4406// This prototype is deprecated.
38054407static inline __ATTRS_o_ai int
38064408vec_any_ne(vector unsigned long long __a, vector bool long long __b) {
38074409 int __cc;
......@@ -3810,6 +4412,7 @@ vec_any_ne(vector unsigned long long __a, vector bool long long __b) {
38104412 return __cc != 0;
38114413}
38124414
4415// This prototype is deprecated.
38134416static inline __ATTRS_o_ai int
38144417vec_any_ne(vector bool long long __a, vector unsigned long long __b) {
38154418 int __cc;
......@@ -3826,6 +4429,15 @@ vec_any_ne(vector bool long long __a, vector bool long long __b) {
38264429 return __cc != 0;
38274430}
38284431
4432#if __ARCH__ >= 12
4433static inline __ATTRS_o_ai int
4434vec_any_ne(vector float __a, vector float __b) {
4435 int __cc;
4436 __builtin_s390_vfcesbs(__a, __b, &__cc);
4437 return __cc != 0;
4438}
4439#endif
4440
38294441static inline __ATTRS_o_ai int
38304442vec_any_ne(vector double __a, vector double __b) {
38314443 int __cc;
......@@ -3842,6 +4454,7 @@ vec_any_ge(vector signed char __a, vector signed char __b) {
38424454 return __cc != 0;
38434455}
38444456
4457// This prototype is deprecated.
38454458static inline __ATTRS_o_ai int
38464459vec_any_ge(vector signed char __a, vector bool char __b) {
38474460 int __cc;
......@@ -3849,6 +4462,7 @@ vec_any_ge(vector signed char __a, vector bool char __b) {
38494462 return __cc != 0;
38504463}
38514464
4465// This prototype is deprecated.
38524466static inline __ATTRS_o_ai int
38534467vec_any_ge(vector bool char __a, vector signed char __b) {
38544468 int __cc;
......@@ -3863,6 +4477,7 @@ vec_any_ge(vector unsigned char __a, vector unsigned char __b) {
38634477 return __cc != 0;
38644478}
38654479
4480// This prototype is deprecated.
38664481static inline __ATTRS_o_ai int
38674482vec_any_ge(vector unsigned char __a, vector bool char __b) {
38684483 int __cc;
......@@ -3870,6 +4485,7 @@ vec_any_ge(vector unsigned char __a, vector bool char __b) {
38704485 return __cc != 0;
38714486}
38724487
4488// This prototype is deprecated.
38734489static inline __ATTRS_o_ai int
38744490vec_any_ge(vector bool char __a, vector unsigned char __b) {
38754491 int __cc;
......@@ -3877,6 +4493,7 @@ vec_any_ge(vector bool char __a, vector unsigned char __b) {
38774493 return __cc != 0;
38784494}
38794495
4496// This prototype is deprecated.
38804497static inline __ATTRS_o_ai int
38814498vec_any_ge(vector bool char __a, vector bool char __b) {
38824499 int __cc;
......@@ -3892,6 +4509,7 @@ vec_any_ge(vector signed short __a, vector signed short __b) {
38924509 return __cc != 0;
38934510}
38944511
4512// This prototype is deprecated.
38954513static inline __ATTRS_o_ai int
38964514vec_any_ge(vector signed short __a, vector bool short __b) {
38974515 int __cc;
......@@ -3899,6 +4517,7 @@ vec_any_ge(vector signed short __a, vector bool short __b) {
38994517 return __cc != 0;
39004518}
39014519
4520// This prototype is deprecated.
39024521static inline __ATTRS_o_ai int
39034522vec_any_ge(vector bool short __a, vector signed short __b) {
39044523 int __cc;
......@@ -3913,6 +4532,7 @@ vec_any_ge(vector unsigned short __a, vector unsigned short __b) {
39134532 return __cc != 0;
39144533}
39154534
4535// This prototype is deprecated.
39164536static inline __ATTRS_o_ai int
39174537vec_any_ge(vector unsigned short __a, vector bool short __b) {
39184538 int __cc;
......@@ -3920,6 +4540,7 @@ vec_any_ge(vector unsigned short __a, vector bool short __b) {
39204540 return __cc != 0;
39214541}
39224542
4543// This prototype is deprecated.
39234544static inline __ATTRS_o_ai int
39244545vec_any_ge(vector bool short __a, vector unsigned short __b) {
39254546 int __cc;
......@@ -3927,6 +4548,7 @@ vec_any_ge(vector bool short __a, vector unsigned short __b) {
39274548 return __cc != 0;
39284549}
39294550
4551// This prototype is deprecated.
39304552static inline __ATTRS_o_ai int
39314553vec_any_ge(vector bool short __a, vector bool short __b) {
39324554 int __cc;
......@@ -3942,6 +4564,7 @@ vec_any_ge(vector signed int __a, vector signed int __b) {
39424564 return __cc != 0;
39434565}
39444566
4567// This prototype is deprecated.
39454568static inline __ATTRS_o_ai int
39464569vec_any_ge(vector signed int __a, vector bool int __b) {
39474570 int __cc;
......@@ -3949,6 +4572,7 @@ vec_any_ge(vector signed int __a, vector bool int __b) {
39494572 return __cc != 0;
39504573}
39514574
4575// This prototype is deprecated.
39524576static inline __ATTRS_o_ai int
39534577vec_any_ge(vector bool int __a, vector signed int __b) {
39544578 int __cc;
......@@ -3963,6 +4587,7 @@ vec_any_ge(vector unsigned int __a, vector unsigned int __b) {
39634587 return __cc != 0;
39644588}
39654589
4590// This prototype is deprecated.
39664591static inline __ATTRS_o_ai int
39674592vec_any_ge(vector unsigned int __a, vector bool int __b) {
39684593 int __cc;
......@@ -3970,6 +4595,7 @@ vec_any_ge(vector unsigned int __a, vector bool int __b) {
39704595 return __cc != 0;
39714596}
39724597
4598// This prototype is deprecated.
39734599static inline __ATTRS_o_ai int
39744600vec_any_ge(vector bool int __a, vector unsigned int __b) {
39754601 int __cc;
......@@ -3977,6 +4603,7 @@ vec_any_ge(vector bool int __a, vector unsigned int __b) {
39774603 return __cc != 0;
39784604}
39794605
4606// This prototype is deprecated.
39804607static inline __ATTRS_o_ai int
39814608vec_any_ge(vector bool int __a, vector bool int __b) {
39824609 int __cc;
......@@ -3992,6 +4619,7 @@ vec_any_ge(vector signed long long __a, vector signed long long __b) {
39924619 return __cc != 0;
39934620}
39944621
4622// This prototype is deprecated.
39954623static inline __ATTRS_o_ai int
39964624vec_any_ge(vector signed long long __a, vector bool long long __b) {
39974625 int __cc;
......@@ -3999,6 +4627,7 @@ vec_any_ge(vector signed long long __a, vector bool long long __b) {
39994627 return __cc != 0;
40004628}
40014629
4630// This prototype is deprecated.
40024631static inline __ATTRS_o_ai int
40034632vec_any_ge(vector bool long long __a, vector signed long long __b) {
40044633 int __cc;
......@@ -4013,6 +4642,7 @@ vec_any_ge(vector unsigned long long __a, vector unsigned long long __b) {
40134642 return __cc != 0;
40144643}
40154644
4645// This prototype is deprecated.
40164646static inline __ATTRS_o_ai int
40174647vec_any_ge(vector unsigned long long __a, vector bool long long __b) {
40184648 int __cc;
......@@ -4020,6 +4650,7 @@ vec_any_ge(vector unsigned long long __a, vector bool long long __b) {
40204650 return __cc != 0;
40214651}
40224652
4653// This prototype is deprecated.
40234654static inline __ATTRS_o_ai int
40244655vec_any_ge(vector bool long long __a, vector unsigned long long __b) {
40254656 int __cc;
......@@ -4027,6 +4658,7 @@ vec_any_ge(vector bool long long __a, vector unsigned long long __b) {
40274658 return __cc != 0;
40284659}
40294660
4661// This prototype is deprecated.
40304662static inline __ATTRS_o_ai int
40314663vec_any_ge(vector bool long long __a, vector bool long long __b) {
40324664 int __cc;
......@@ -4035,6 +4667,15 @@ vec_any_ge(vector bool long long __a, vector bool long long __b) {
40354667 return __cc != 0;
40364668}
40374669
4670#if __ARCH__ >= 12
4671static inline __ATTRS_o_ai int
4672vec_any_ge(vector float __a, vector float __b) {
4673 int __cc;
4674 __builtin_s390_vfchesbs(__a, __b, &__cc);
4675 return __cc <= 1;
4676}
4677#endif
4678
40384679static inline __ATTRS_o_ai int
40394680vec_any_ge(vector double __a, vector double __b) {
40404681 int __cc;
......@@ -4051,6 +4692,7 @@ vec_any_gt(vector signed char __a, vector signed char __b) {
40514692 return __cc <= 1;
40524693}
40534694
4695// This prototype is deprecated.
40544696static inline __ATTRS_o_ai int
40554697vec_any_gt(vector signed char __a, vector bool char __b) {
40564698 int __cc;
......@@ -4058,6 +4700,7 @@ vec_any_gt(vector signed char __a, vector bool char __b) {
40584700 return __cc <= 1;
40594701}
40604702
4703// This prototype is deprecated.
40614704static inline __ATTRS_o_ai int
40624705vec_any_gt(vector bool char __a, vector signed char __b) {
40634706 int __cc;
......@@ -4072,6 +4715,7 @@ vec_any_gt(vector unsigned char __a, vector unsigned char __b) {
40724715 return __cc <= 1;
40734716}
40744717
4718// This prototype is deprecated.
40754719static inline __ATTRS_o_ai int
40764720vec_any_gt(vector unsigned char __a, vector bool char __b) {
40774721 int __cc;
......@@ -4079,6 +4723,7 @@ vec_any_gt(vector unsigned char __a, vector bool char __b) {
40794723 return __cc <= 1;
40804724}
40814725
4726// This prototype is deprecated.
40824727static inline __ATTRS_o_ai int
40834728vec_any_gt(vector bool char __a, vector unsigned char __b) {
40844729 int __cc;
......@@ -4086,6 +4731,7 @@ vec_any_gt(vector bool char __a, vector unsigned char __b) {
40864731 return __cc <= 1;
40874732}
40884733
4734// This prototype is deprecated.
40894735static inline __ATTRS_o_ai int
40904736vec_any_gt(vector bool char __a, vector bool char __b) {
40914737 int __cc;
......@@ -4101,6 +4747,7 @@ vec_any_gt(vector signed short __a, vector signed short __b) {
41014747 return __cc <= 1;
41024748}
41034749
4750// This prototype is deprecated.
41044751static inline __ATTRS_o_ai int
41054752vec_any_gt(vector signed short __a, vector bool short __b) {
41064753 int __cc;
......@@ -4108,6 +4755,7 @@ vec_any_gt(vector signed short __a, vector bool short __b) {
41084755 return __cc <= 1;
41094756}
41104757
4758// This prototype is deprecated.
41114759static inline __ATTRS_o_ai int
41124760vec_any_gt(vector bool short __a, vector signed short __b) {
41134761 int __cc;
......@@ -4122,6 +4770,7 @@ vec_any_gt(vector unsigned short __a, vector unsigned short __b) {
41224770 return __cc <= 1;
41234771}
41244772
4773// This prototype is deprecated.
41254774static inline __ATTRS_o_ai int
41264775vec_any_gt(vector unsigned short __a, vector bool short __b) {
41274776 int __cc;
......@@ -4129,6 +4778,7 @@ vec_any_gt(vector unsigned short __a, vector bool short __b) {
41294778 return __cc <= 1;
41304779}
41314780
4781// This prototype is deprecated.
41324782static inline __ATTRS_o_ai int
41334783vec_any_gt(vector bool short __a, vector unsigned short __b) {
41344784 int __cc;
......@@ -4136,6 +4786,7 @@ vec_any_gt(vector bool short __a, vector unsigned short __b) {
41364786 return __cc <= 1;
41374787}
41384788
4789// This prototype is deprecated.
41394790static inline __ATTRS_o_ai int
41404791vec_any_gt(vector bool short __a, vector bool short __b) {
41414792 int __cc;
......@@ -4151,6 +4802,7 @@ vec_any_gt(vector signed int __a, vector signed int __b) {
41514802 return __cc <= 1;
41524803}
41534804
4805// This prototype is deprecated.
41544806static inline __ATTRS_o_ai int
41554807vec_any_gt(vector signed int __a, vector bool int __b) {
41564808 int __cc;
......@@ -4158,6 +4810,7 @@ vec_any_gt(vector signed int __a, vector bool int __b) {
41584810 return __cc <= 1;
41594811}
41604812
4813// This prototype is deprecated.
41614814static inline __ATTRS_o_ai int
41624815vec_any_gt(vector bool int __a, vector signed int __b) {
41634816 int __cc;
......@@ -4172,6 +4825,7 @@ vec_any_gt(vector unsigned int __a, vector unsigned int __b) {
41724825 return __cc <= 1;
41734826}
41744827
4828// This prototype is deprecated.
41754829static inline __ATTRS_o_ai int
41764830vec_any_gt(vector unsigned int __a, vector bool int __b) {
41774831 int __cc;
......@@ -4179,6 +4833,7 @@ vec_any_gt(vector unsigned int __a, vector bool int __b) {
41794833 return __cc <= 1;
41804834}
41814835
4836// This prototype is deprecated.
41824837static inline __ATTRS_o_ai int
41834838vec_any_gt(vector bool int __a, vector unsigned int __b) {
41844839 int __cc;
......@@ -4186,6 +4841,7 @@ vec_any_gt(vector bool int __a, vector unsigned int __b) {
41864841 return __cc <= 1;
41874842}
41884843
4844// This prototype is deprecated.
41894845static inline __ATTRS_o_ai int
41904846vec_any_gt(vector bool int __a, vector bool int __b) {
41914847 int __cc;
......@@ -4201,6 +4857,7 @@ vec_any_gt(vector signed long long __a, vector signed long long __b) {
42014857 return __cc <= 1;
42024858}
42034859
4860// This prototype is deprecated.
42044861static inline __ATTRS_o_ai int
42054862vec_any_gt(vector signed long long __a, vector bool long long __b) {
42064863 int __cc;
......@@ -4208,6 +4865,7 @@ vec_any_gt(vector signed long long __a, vector bool long long __b) {
42084865 return __cc <= 1;
42094866}
42104867
4868// This prototype is deprecated.
42114869static inline __ATTRS_o_ai int
42124870vec_any_gt(vector bool long long __a, vector signed long long __b) {
42134871 int __cc;
......@@ -4222,6 +4880,7 @@ vec_any_gt(vector unsigned long long __a, vector unsigned long long __b) {
42224880 return __cc <= 1;
42234881}
42244882
4883// This prototype is deprecated.
42254884static inline __ATTRS_o_ai int
42264885vec_any_gt(vector unsigned long long __a, vector bool long long __b) {
42274886 int __cc;
......@@ -4229,6 +4888,7 @@ vec_any_gt(vector unsigned long long __a, vector bool long long __b) {
42294888 return __cc <= 1;
42304889}
42314890
4891// This prototype is deprecated.
42324892static inline __ATTRS_o_ai int
42334893vec_any_gt(vector bool long long __a, vector unsigned long long __b) {
42344894 int __cc;
......@@ -4236,6 +4896,7 @@ vec_any_gt(vector bool long long __a, vector unsigned long long __b) {
42364896 return __cc <= 1;
42374897}
42384898
4899// This prototype is deprecated.
42394900static inline __ATTRS_o_ai int
42404901vec_any_gt(vector bool long long __a, vector bool long long __b) {
42414902 int __cc;
......@@ -4244,6 +4905,15 @@ vec_any_gt(vector bool long long __a, vector bool long long __b) {
42444905 return __cc <= 1;
42454906}
42464907
4908#if __ARCH__ >= 12
4909static inline __ATTRS_o_ai int
4910vec_any_gt(vector float __a, vector float __b) {
4911 int __cc;
4912 __builtin_s390_vfchsbs(__a, __b, &__cc);
4913 return __cc <= 1;
4914}
4915#endif
4916
42474917static inline __ATTRS_o_ai int
42484918vec_any_gt(vector double __a, vector double __b) {
42494919 int __cc;
......@@ -4260,6 +4930,7 @@ vec_any_le(vector signed char __a, vector signed char __b) {
42604930 return __cc != 0;
42614931}
42624932
4933// This prototype is deprecated.
42634934static inline __ATTRS_o_ai int
42644935vec_any_le(vector signed char __a, vector bool char __b) {
42654936 int __cc;
......@@ -4267,6 +4938,7 @@ vec_any_le(vector signed char __a, vector bool char __b) {
42674938 return __cc != 0;
42684939}
42694940
4941// This prototype is deprecated.
42704942static inline __ATTRS_o_ai int
42714943vec_any_le(vector bool char __a, vector signed char __b) {
42724944 int __cc;
......@@ -4281,6 +4953,7 @@ vec_any_le(vector unsigned char __a, vector unsigned char __b) {
42814953 return __cc != 0;
42824954}
42834955
4956// This prototype is deprecated.
42844957static inline __ATTRS_o_ai int
42854958vec_any_le(vector unsigned char __a, vector bool char __b) {
42864959 int __cc;
......@@ -4288,6 +4961,7 @@ vec_any_le(vector unsigned char __a, vector bool char __b) {
42884961 return __cc != 0;
42894962}
42904963
4964// This prototype is deprecated.
42914965static inline __ATTRS_o_ai int
42924966vec_any_le(vector bool char __a, vector unsigned char __b) {
42934967 int __cc;
......@@ -4295,6 +4969,7 @@ vec_any_le(vector bool char __a, vector unsigned char __b) {
42954969 return __cc != 0;
42964970}
42974971
4972// This prototype is deprecated.
42984973static inline __ATTRS_o_ai int
42994974vec_any_le(vector bool char __a, vector bool char __b) {
43004975 int __cc;
......@@ -4310,6 +4985,7 @@ vec_any_le(vector signed short __a, vector signed short __b) {
43104985 return __cc != 0;
43114986}
43124987
4988// This prototype is deprecated.
43134989static inline __ATTRS_o_ai int
43144990vec_any_le(vector signed short __a, vector bool short __b) {
43154991 int __cc;
......@@ -4317,6 +4993,7 @@ vec_any_le(vector signed short __a, vector bool short __b) {
43174993 return __cc != 0;
43184994}
43194995
4996// This prototype is deprecated.
43204997static inline __ATTRS_o_ai int
43214998vec_any_le(vector bool short __a, vector signed short __b) {
43224999 int __cc;
......@@ -4331,6 +5008,7 @@ vec_any_le(vector unsigned short __a, vector unsigned short __b) {
43315008 return __cc != 0;
43325009}
43335010
5011// This prototype is deprecated.
43345012static inline __ATTRS_o_ai int
43355013vec_any_le(vector unsigned short __a, vector bool short __b) {
43365014 int __cc;
......@@ -4338,6 +5016,7 @@ vec_any_le(vector unsigned short __a, vector bool short __b) {
43385016 return __cc != 0;
43395017}
43405018
5019// This prototype is deprecated.
43415020static inline __ATTRS_o_ai int
43425021vec_any_le(vector bool short __a, vector unsigned short __b) {
43435022 int __cc;
......@@ -4345,6 +5024,7 @@ vec_any_le(vector bool short __a, vector unsigned short __b) {
43455024 return __cc != 0;
43465025}
43475026
5027// This prototype is deprecated.
43485028static inline __ATTRS_o_ai int
43495029vec_any_le(vector bool short __a, vector bool short __b) {
43505030 int __cc;
......@@ -4360,6 +5040,7 @@ vec_any_le(vector signed int __a, vector signed int __b) {
43605040 return __cc != 0;
43615041}
43625042
5043// This prototype is deprecated.
43635044static inline __ATTRS_o_ai int
43645045vec_any_le(vector signed int __a, vector bool int __b) {
43655046 int __cc;
......@@ -4367,6 +5048,7 @@ vec_any_le(vector signed int __a, vector bool int __b) {
43675048 return __cc != 0;
43685049}
43695050
5051// This prototype is deprecated.
43705052static inline __ATTRS_o_ai int
43715053vec_any_le(vector bool int __a, vector signed int __b) {
43725054 int __cc;
......@@ -4381,6 +5063,7 @@ vec_any_le(vector unsigned int __a, vector unsigned int __b) {
43815063 return __cc != 0;
43825064}
43835065
5066// This prototype is deprecated.
43845067static inline __ATTRS_o_ai int
43855068vec_any_le(vector unsigned int __a, vector bool int __b) {
43865069 int __cc;
......@@ -4388,6 +5071,7 @@ vec_any_le(vector unsigned int __a, vector bool int __b) {
43885071 return __cc != 0;
43895072}
43905073
5074// This prototype is deprecated.
43915075static inline __ATTRS_o_ai int
43925076vec_any_le(vector bool int __a, vector unsigned int __b) {
43935077 int __cc;
......@@ -4395,6 +5079,7 @@ vec_any_le(vector bool int __a, vector unsigned int __b) {
43955079 return __cc != 0;
43965080}
43975081
5082// This prototype is deprecated.
43985083static inline __ATTRS_o_ai int
43995084vec_any_le(vector bool int __a, vector bool int __b) {
44005085 int __cc;
......@@ -4410,6 +5095,7 @@ vec_any_le(vector signed long long __a, vector signed long long __b) {
44105095 return __cc != 0;
44115096}
44125097
5098// This prototype is deprecated.
44135099static inline __ATTRS_o_ai int
44145100vec_any_le(vector signed long long __a, vector bool long long __b) {
44155101 int __cc;
......@@ -4417,6 +5103,7 @@ vec_any_le(vector signed long long __a, vector bool long long __b) {
44175103 return __cc != 0;
44185104}
44195105
5106// This prototype is deprecated.
44205107static inline __ATTRS_o_ai int
44215108vec_any_le(vector bool long long __a, vector signed long long __b) {
44225109 int __cc;
......@@ -4431,6 +5118,7 @@ vec_any_le(vector unsigned long long __a, vector unsigned long long __b) {
44315118 return __cc != 0;
44325119}
44335120
5121// This prototype is deprecated.
44345122static inline __ATTRS_o_ai int
44355123vec_any_le(vector unsigned long long __a, vector bool long long __b) {
44365124 int __cc;
......@@ -4438,6 +5126,7 @@ vec_any_le(vector unsigned long long __a, vector bool long long __b) {
44385126 return __cc != 0;
44395127}
44405128
5129// This prototype is deprecated.
44415130static inline __ATTRS_o_ai int
44425131vec_any_le(vector bool long long __a, vector unsigned long long __b) {
44435132 int __cc;
......@@ -4445,6 +5134,7 @@ vec_any_le(vector bool long long __a, vector unsigned long long __b) {
44455134 return __cc != 0;
44465135}
44475136
5137// This prototype is deprecated.
44485138static inline __ATTRS_o_ai int
44495139vec_any_le(vector bool long long __a, vector bool long long __b) {
44505140 int __cc;
......@@ -4453,6 +5143,15 @@ vec_any_le(vector bool long long __a, vector bool long long __b) {
44535143 return __cc != 0;
44545144}
44555145
5146#if __ARCH__ >= 12
5147static inline __ATTRS_o_ai int
5148vec_any_le(vector float __a, vector float __b) {
5149 int __cc;
5150 __builtin_s390_vfchesbs(__b, __a, &__cc);
5151 return __cc <= 1;
5152}
5153#endif
5154
44565155static inline __ATTRS_o_ai int
44575156vec_any_le(vector double __a, vector double __b) {
44585157 int __cc;
......@@ -4469,6 +5168,7 @@ vec_any_lt(vector signed char __a, vector signed char __b) {
44695168 return __cc <= 1;
44705169}
44715170
5171// This prototype is deprecated.
44725172static inline __ATTRS_o_ai int
44735173vec_any_lt(vector signed char __a, vector bool char __b) {
44745174 int __cc;
......@@ -4476,6 +5176,7 @@ vec_any_lt(vector signed char __a, vector bool char __b) {
44765176 return __cc <= 1;
44775177}
44785178
5179// This prototype is deprecated.
44795180static inline __ATTRS_o_ai int
44805181vec_any_lt(vector bool char __a, vector signed char __b) {
44815182 int __cc;
......@@ -4490,6 +5191,7 @@ vec_any_lt(vector unsigned char __a, vector unsigned char __b) {
44905191 return __cc <= 1;
44915192}
44925193
5194// This prototype is deprecated.
44935195static inline __ATTRS_o_ai int
44945196vec_any_lt(vector unsigned char __a, vector bool char __b) {
44955197 int __cc;
......@@ -4497,6 +5199,7 @@ vec_any_lt(vector unsigned char __a, vector bool char __b) {
44975199 return __cc <= 1;
44985200}
44995201
5202// This prototype is deprecated.
45005203static inline __ATTRS_o_ai int
45015204vec_any_lt(vector bool char __a, vector unsigned char __b) {
45025205 int __cc;
......@@ -4504,6 +5207,7 @@ vec_any_lt(vector bool char __a, vector unsigned char __b) {
45045207 return __cc <= 1;
45055208}
45065209
5210// This prototype is deprecated.
45075211static inline __ATTRS_o_ai int
45085212vec_any_lt(vector bool char __a, vector bool char __b) {
45095213 int __cc;
......@@ -4519,6 +5223,7 @@ vec_any_lt(vector signed short __a, vector signed short __b) {
45195223 return __cc <= 1;
45205224}
45215225
5226// This prototype is deprecated.
45225227static inline __ATTRS_o_ai int
45235228vec_any_lt(vector signed short __a, vector bool short __b) {
45245229 int __cc;
......@@ -4526,6 +5231,7 @@ vec_any_lt(vector signed short __a, vector bool short __b) {
45265231 return __cc <= 1;
45275232}
45285233
5234// This prototype is deprecated.
45295235static inline __ATTRS_o_ai int
45305236vec_any_lt(vector bool short __a, vector signed short __b) {
45315237 int __cc;
......@@ -4540,6 +5246,7 @@ vec_any_lt(vector unsigned short __a, vector unsigned short __b) {
45405246 return __cc <= 1;
45415247}
45425248
5249// This prototype is deprecated.
45435250static inline __ATTRS_o_ai int
45445251vec_any_lt(vector unsigned short __a, vector bool short __b) {
45455252 int __cc;
......@@ -4547,6 +5254,7 @@ vec_any_lt(vector unsigned short __a, vector bool short __b) {
45475254 return __cc <= 1;
45485255}
45495256
5257// This prototype is deprecated.
45505258static inline __ATTRS_o_ai int
45515259vec_any_lt(vector bool short __a, vector unsigned short __b) {
45525260 int __cc;
......@@ -4554,6 +5262,7 @@ vec_any_lt(vector bool short __a, vector unsigned short __b) {
45545262 return __cc <= 1;
45555263}
45565264
5265// This prototype is deprecated.
45575266static inline __ATTRS_o_ai int
45585267vec_any_lt(vector bool short __a, vector bool short __b) {
45595268 int __cc;
......@@ -4569,6 +5278,7 @@ vec_any_lt(vector signed int __a, vector signed int __b) {
45695278 return __cc <= 1;
45705279}
45715280
5281// This prototype is deprecated.
45725282static inline __ATTRS_o_ai int
45735283vec_any_lt(vector signed int __a, vector bool int __b) {
45745284 int __cc;
......@@ -4576,6 +5286,7 @@ vec_any_lt(vector signed int __a, vector bool int __b) {
45765286 return __cc <= 1;
45775287}
45785288
5289// This prototype is deprecated.
45795290static inline __ATTRS_o_ai int
45805291vec_any_lt(vector bool int __a, vector signed int __b) {
45815292 int __cc;
......@@ -4590,6 +5301,7 @@ vec_any_lt(vector unsigned int __a, vector unsigned int __b) {
45905301 return __cc <= 1;
45915302}
45925303
5304// This prototype is deprecated.
45935305static inline __ATTRS_o_ai int
45945306vec_any_lt(vector unsigned int __a, vector bool int __b) {
45955307 int __cc;
......@@ -4597,6 +5309,7 @@ vec_any_lt(vector unsigned int __a, vector bool int __b) {
45975309 return __cc <= 1;
45985310}
45995311
5312// This prototype is deprecated.
46005313static inline __ATTRS_o_ai int
46015314vec_any_lt(vector bool int __a, vector unsigned int __b) {
46025315 int __cc;
......@@ -4604,6 +5317,7 @@ vec_any_lt(vector bool int __a, vector unsigned int __b) {
46045317 return __cc <= 1;
46055318}
46065319
5320// This prototype is deprecated.
46075321static inline __ATTRS_o_ai int
46085322vec_any_lt(vector bool int __a, vector bool int __b) {
46095323 int __cc;
......@@ -4619,6 +5333,7 @@ vec_any_lt(vector signed long long __a, vector signed long long __b) {
46195333 return __cc <= 1;
46205334}
46215335
5336// This prototype is deprecated.
46225337static inline __ATTRS_o_ai int
46235338vec_any_lt(vector signed long long __a, vector bool long long __b) {
46245339 int __cc;
......@@ -4626,6 +5341,7 @@ vec_any_lt(vector signed long long __a, vector bool long long __b) {
46265341 return __cc <= 1;
46275342}
46285343
5344// This prototype is deprecated.
46295345static inline __ATTRS_o_ai int
46305346vec_any_lt(vector bool long long __a, vector signed long long __b) {
46315347 int __cc;
......@@ -4640,6 +5356,7 @@ vec_any_lt(vector unsigned long long __a, vector unsigned long long __b) {
46405356 return __cc <= 1;
46415357}
46425358
5359// This prototype is deprecated.
46435360static inline __ATTRS_o_ai int
46445361vec_any_lt(vector unsigned long long __a, vector bool long long __b) {
46455362 int __cc;
......@@ -4647,6 +5364,7 @@ vec_any_lt(vector unsigned long long __a, vector bool long long __b) {
46475364 return __cc <= 1;
46485365}
46495366
5367// This prototype is deprecated.
46505368static inline __ATTRS_o_ai int
46515369vec_any_lt(vector bool long long __a, vector unsigned long long __b) {
46525370 int __cc;
......@@ -4654,6 +5372,7 @@ vec_any_lt(vector bool long long __a, vector unsigned long long __b) {
46545372 return __cc <= 1;
46555373}
46565374
5375// This prototype is deprecated.
46575376static inline __ATTRS_o_ai int
46585377vec_any_lt(vector bool long long __a, vector bool long long __b) {
46595378 int __cc;
......@@ -4662,6 +5381,15 @@ vec_any_lt(vector bool long long __a, vector bool long long __b) {
46625381 return __cc <= 1;
46635382}
46645383
5384#if __ARCH__ >= 12
5385static inline __ATTRS_o_ai int
5386vec_any_lt(vector float __a, vector float __b) {
5387 int __cc;
5388 __builtin_s390_vfchsbs(__b, __a, &__cc);
5389 return __cc <= 1;
5390}
5391#endif
5392
46655393static inline __ATTRS_o_ai int
46665394vec_any_lt(vector double __a, vector double __b) {
46675395 int __cc;
......@@ -4671,7 +5399,16 @@ vec_any_lt(vector double __a, vector double __b) {
46715399
46725400/*-- vec_any_nge ------------------------------------------------------------*/
46735401
4674static inline __ATTRS_ai int
5402#if __ARCH__ >= 12
5403static inline __ATTRS_o_ai int
5404vec_any_nge(vector float __a, vector float __b) {
5405 int __cc;
5406 __builtin_s390_vfchesbs(__a, __b, &__cc);
5407 return __cc != 0;
5408}
5409#endif
5410
5411static inline __ATTRS_o_ai int
46755412vec_any_nge(vector double __a, vector double __b) {
46765413 int __cc;
46775414 __builtin_s390_vfchedbs(__a, __b, &__cc);
......@@ -4680,7 +5417,16 @@ vec_any_nge(vector double __a, vector double __b) {
46805417
46815418/*-- vec_any_ngt ------------------------------------------------------------*/
46825419
4683static inline __ATTRS_ai int
5420#if __ARCH__ >= 12
5421static inline __ATTRS_o_ai int
5422vec_any_ngt(vector float __a, vector float __b) {
5423 int __cc;
5424 __builtin_s390_vfchsbs(__a, __b, &__cc);
5425 return __cc != 0;
5426}
5427#endif
5428
5429static inline __ATTRS_o_ai int
46845430vec_any_ngt(vector double __a, vector double __b) {
46855431 int __cc;
46865432 __builtin_s390_vfchdbs(__a, __b, &__cc);
......@@ -4689,7 +5435,16 @@ vec_any_ngt(vector double __a, vector double __b) {
46895435
46905436/*-- vec_any_nle ------------------------------------------------------------*/
46915437
4692static inline __ATTRS_ai int
5438#if __ARCH__ >= 12
5439static inline __ATTRS_o_ai int
5440vec_any_nle(vector float __a, vector float __b) {
5441 int __cc;
5442 __builtin_s390_vfchesbs(__b, __a, &__cc);
5443 return __cc != 0;
5444}
5445#endif
5446
5447static inline __ATTRS_o_ai int
46935448vec_any_nle(vector double __a, vector double __b) {
46945449 int __cc;
46955450 __builtin_s390_vfchedbs(__b, __a, &__cc);
......@@ -4698,7 +5453,16 @@ vec_any_nle(vector double __a, vector double __b) {
46985453
46995454/*-- vec_any_nlt ------------------------------------------------------------*/
47005455
4701static inline __ATTRS_ai int
5456#if __ARCH__ >= 12
5457static inline __ATTRS_o_ai int
5458vec_any_nlt(vector float __a, vector float __b) {
5459 int __cc;
5460 __builtin_s390_vfchsbs(__b, __a, &__cc);
5461 return __cc != 0;
5462}
5463#endif
5464
5465static inline __ATTRS_o_ai int
47025466vec_any_nlt(vector double __a, vector double __b) {
47035467 int __cc;
47045468 __builtin_s390_vfchdbs(__b, __a, &__cc);
......@@ -4707,7 +5471,16 @@ vec_any_nlt(vector double __a, vector double __b) {
47075471
47085472/*-- vec_any_nan ------------------------------------------------------------*/
47095473
4710static inline __ATTRS_ai int
5474#if __ARCH__ >= 12
5475static inline __ATTRS_o_ai int
5476vec_any_nan(vector float __a) {
5477 int __cc;
5478 __builtin_s390_vftcisb(__a, 15, &__cc);
5479 return __cc != 3;
5480}
5481#endif
5482
5483static inline __ATTRS_o_ai int
47115484vec_any_nan(vector double __a) {
47125485 int __cc;
47135486 __builtin_s390_vftcidb(__a, 15, &__cc);
......@@ -4716,7 +5489,16 @@ vec_any_nan(vector double __a) {
47165489
47175490/*-- vec_any_numeric --------------------------------------------------------*/
47185491
4719static inline __ATTRS_ai int
5492#if __ARCH__ >= 12
5493static inline __ATTRS_o_ai int
5494vec_any_numeric(vector float __a) {
5495 int __cc;
5496 __builtin_s390_vftcisb(__a, 15, &__cc);
5497 return __cc != 0;
5498}
5499#endif
5500
5501static inline __ATTRS_o_ai int
47205502vec_any_numeric(vector double __a) {
47215503 int __cc;
47225504 __builtin_s390_vftcidb(__a, 15, &__cc);
......@@ -4735,11 +5517,13 @@ vec_andc(vector signed char __a, vector signed char __b) {
47355517 return __a & ~__b;
47365518}
47375519
5520// This prototype is deprecated.
47385521static inline __ATTRS_o_ai vector signed char
47395522vec_andc(vector bool char __a, vector signed char __b) {
47405523 return __a & ~__b;
47415524}
47425525
5526// This prototype is deprecated.
47435527static inline __ATTRS_o_ai vector signed char
47445528vec_andc(vector signed char __a, vector bool char __b) {
47455529 return __a & ~__b;
......@@ -4750,11 +5534,13 @@ vec_andc(vector unsigned char __a, vector unsigned char __b) {
47505534 return __a & ~__b;
47515535}
47525536
5537// This prototype is deprecated.
47535538static inline __ATTRS_o_ai vector unsigned char
47545539vec_andc(vector bool char __a, vector unsigned char __b) {
47555540 return __a & ~__b;
47565541}
47575542
5543// This prototype is deprecated.
47585544static inline __ATTRS_o_ai vector unsigned char
47595545vec_andc(vector unsigned char __a, vector bool char __b) {
47605546 return __a & ~__b;
......@@ -4770,11 +5556,13 @@ vec_andc(vector signed short __a, vector signed short __b) {
47705556 return __a & ~__b;
47715557}
47725558
5559// This prototype is deprecated.
47735560static inline __ATTRS_o_ai vector signed short
47745561vec_andc(vector bool short __a, vector signed short __b) {
47755562 return __a & ~__b;
47765563}
47775564
5565// This prototype is deprecated.
47785566static inline __ATTRS_o_ai vector signed short
47795567vec_andc(vector signed short __a, vector bool short __b) {
47805568 return __a & ~__b;
......@@ -4785,11 +5573,13 @@ vec_andc(vector unsigned short __a, vector unsigned short __b) {
47855573 return __a & ~__b;
47865574}
47875575
5576// This prototype is deprecated.
47885577static inline __ATTRS_o_ai vector unsigned short
47895578vec_andc(vector bool short __a, vector unsigned short __b) {
47905579 return __a & ~__b;
47915580}
47925581
5582// This prototype is deprecated.
47935583static inline __ATTRS_o_ai vector unsigned short
47945584vec_andc(vector unsigned short __a, vector bool short __b) {
47955585 return __a & ~__b;
......@@ -4805,11 +5595,13 @@ vec_andc(vector signed int __a, vector signed int __b) {
48055595 return __a & ~__b;
48065596}
48075597
5598// This prototype is deprecated.
48085599static inline __ATTRS_o_ai vector signed int
48095600vec_andc(vector bool int __a, vector signed int __b) {
48105601 return __a & ~__b;
48115602}
48125603
5604// This prototype is deprecated.
48135605static inline __ATTRS_o_ai vector signed int
48145606vec_andc(vector signed int __a, vector bool int __b) {
48155607 return __a & ~__b;
......@@ -4820,11 +5612,13 @@ vec_andc(vector unsigned int __a, vector unsigned int __b) {
48205612 return __a & ~__b;
48215613}
48225614
5615// This prototype is deprecated.
48235616static inline __ATTRS_o_ai vector unsigned int
48245617vec_andc(vector bool int __a, vector unsigned int __b) {
48255618 return __a & ~__b;
48265619}
48275620
5621// This prototype is deprecated.
48285622static inline __ATTRS_o_ai vector unsigned int
48295623vec_andc(vector unsigned int __a, vector bool int __b) {
48305624 return __a & ~__b;
......@@ -4840,11 +5634,13 @@ vec_andc(vector signed long long __a, vector signed long long __b) {
48405634 return __a & ~__b;
48415635}
48425636
5637// This prototype is deprecated.
48435638static inline __ATTRS_o_ai vector signed long long
48445639vec_andc(vector bool long long __a, vector signed long long __b) {
48455640 return __a & ~__b;
48465641}
48475642
5643// This prototype is deprecated.
48485644static inline __ATTRS_o_ai vector signed long long
48495645vec_andc(vector signed long long __a, vector bool long long __b) {
48505646 return __a & ~__b;
......@@ -4855,28 +5651,40 @@ vec_andc(vector unsigned long long __a, vector unsigned long long __b) {
48555651 return __a & ~__b;
48565652}
48575653
5654// This prototype is deprecated.
48585655static inline __ATTRS_o_ai vector unsigned long long
48595656vec_andc(vector bool long long __a, vector unsigned long long __b) {
48605657 return __a & ~__b;
48615658}
48625659
5660// This prototype is deprecated.
48635661static inline __ATTRS_o_ai vector unsigned long long
48645662vec_andc(vector unsigned long long __a, vector bool long long __b) {
48655663 return __a & ~__b;
48665664}
48675665
5666#if __ARCH__ >= 12
5667static inline __ATTRS_o_ai vector float
5668vec_andc(vector float __a, vector float __b) {
5669 return (vector float)((vector unsigned int)__a &
5670 ~(vector unsigned int)__b);
5671}
5672#endif
5673
48685674static inline __ATTRS_o_ai vector double
48695675vec_andc(vector double __a, vector double __b) {
48705676 return (vector double)((vector unsigned long long)__a &
48715677 ~(vector unsigned long long)__b);
48725678}
48735679
5680// This prototype is deprecated.
48745681static inline __ATTRS_o_ai vector double
48755682vec_andc(vector bool long long __a, vector double __b) {
48765683 return (vector double)((vector unsigned long long)__a &
48775684 ~(vector unsigned long long)__b);
48785685}
48795686
5687// This prototype is deprecated.
48805688static inline __ATTRS_o_ai vector double
48815689vec_andc(vector double __a, vector bool long long __b) {
48825690 return (vector double)((vector unsigned long long)__a &
......@@ -4895,11 +5703,13 @@ vec_nor(vector signed char __a, vector signed char __b) {
48955703 return ~(__a | __b);
48965704}
48975705
5706// This prototype is deprecated.
48985707static inline __ATTRS_o_ai vector signed char
48995708vec_nor(vector bool char __a, vector signed char __b) {
49005709 return ~(__a | __b);
49015710}
49025711
5712// This prototype is deprecated.
49035713static inline __ATTRS_o_ai vector signed char
49045714vec_nor(vector signed char __a, vector bool char __b) {
49055715 return ~(__a | __b);
......@@ -4910,11 +5720,13 @@ vec_nor(vector unsigned char __a, vector unsigned char __b) {
49105720 return ~(__a | __b);
49115721}
49125722
5723// This prototype is deprecated.
49135724static inline __ATTRS_o_ai vector unsigned char
49145725vec_nor(vector bool char __a, vector unsigned char __b) {
49155726 return ~(__a | __b);
49165727}
49175728
5729// This prototype is deprecated.
49185730static inline __ATTRS_o_ai vector unsigned char
49195731vec_nor(vector unsigned char __a, vector bool char __b) {
49205732 return ~(__a | __b);
......@@ -4930,11 +5742,13 @@ vec_nor(vector signed short __a, vector signed short __b) {
49305742 return ~(__a | __b);
49315743}
49325744
5745// This prototype is deprecated.
49335746static inline __ATTRS_o_ai vector signed short
49345747vec_nor(vector bool short __a, vector signed short __b) {
49355748 return ~(__a | __b);
49365749}
49375750
5751// This prototype is deprecated.
49385752static inline __ATTRS_o_ai vector signed short
49395753vec_nor(vector signed short __a, vector bool short __b) {
49405754 return ~(__a | __b);
......@@ -4945,11 +5759,13 @@ vec_nor(vector unsigned short __a, vector unsigned short __b) {
49455759 return ~(__a | __b);
49465760}
49475761
5762// This prototype is deprecated.
49485763static inline __ATTRS_o_ai vector unsigned short
49495764vec_nor(vector bool short __a, vector unsigned short __b) {
49505765 return ~(__a | __b);
49515766}
49525767
5768// This prototype is deprecated.
49535769static inline __ATTRS_o_ai vector unsigned short
49545770vec_nor(vector unsigned short __a, vector bool short __b) {
49555771 return ~(__a | __b);
......@@ -4965,11 +5781,13 @@ vec_nor(vector signed int __a, vector signed int __b) {
49655781 return ~(__a | __b);
49665782}
49675783
5784// This prototype is deprecated.
49685785static inline __ATTRS_o_ai vector signed int
49695786vec_nor(vector bool int __a, vector signed int __b) {
49705787 return ~(__a | __b);
49715788}
49725789
5790// This prototype is deprecated.
49735791static inline __ATTRS_o_ai vector signed int
49745792vec_nor(vector signed int __a, vector bool int __b) {
49755793 return ~(__a | __b);
......@@ -4980,11 +5798,13 @@ vec_nor(vector unsigned int __a, vector unsigned int __b) {
49805798 return ~(__a | __b);
49815799}
49825800
5801// This prototype is deprecated.
49835802static inline __ATTRS_o_ai vector unsigned int
49845803vec_nor(vector bool int __a, vector unsigned int __b) {
49855804 return ~(__a | __b);
49865805}
49875806
5807// This prototype is deprecated.
49885808static inline __ATTRS_o_ai vector unsigned int
49895809vec_nor(vector unsigned int __a, vector bool int __b) {
49905810 return ~(__a | __b);
......@@ -5000,11 +5820,13 @@ vec_nor(vector signed long long __a, vector signed long long __b) {
50005820 return ~(__a | __b);
50015821}
50025822
5823// This prototype is deprecated.
50035824static inline __ATTRS_o_ai vector signed long long
50045825vec_nor(vector bool long long __a, vector signed long long __b) {
50055826 return ~(__a | __b);
50065827}
50075828
5829// This prototype is deprecated.
50085830static inline __ATTRS_o_ai vector signed long long
50095831vec_nor(vector signed long long __a, vector bool long long __b) {
50105832 return ~(__a | __b);
......@@ -5015,34 +5837,274 @@ vec_nor(vector unsigned long long __a, vector unsigned long long __b) {
50155837 return ~(__a | __b);
50165838}
50175839
5840// This prototype is deprecated.
50185841static inline __ATTRS_o_ai vector unsigned long long
50195842vec_nor(vector bool long long __a, vector unsigned long long __b) {
50205843 return ~(__a | __b);
50215844}
50225845
5846// This prototype is deprecated.
50235847static inline __ATTRS_o_ai vector unsigned long long
50245848vec_nor(vector unsigned long long __a, vector bool long long __b) {
50255849 return ~(__a | __b);
50265850}
50275851
5852#if __ARCH__ >= 12
5853static inline __ATTRS_o_ai vector float
5854vec_nor(vector float __a, vector float __b) {
5855 return (vector float)~((vector unsigned int)__a |
5856 (vector unsigned int)__b);
5857}
5858#endif
5859
50285860static inline __ATTRS_o_ai vector double
50295861vec_nor(vector double __a, vector double __b) {
50305862 return (vector double)~((vector unsigned long long)__a |
50315863 (vector unsigned long long)__b);
50325864}
50335865
5866// This prototype is deprecated.
50345867static inline __ATTRS_o_ai vector double
50355868vec_nor(vector bool long long __a, vector double __b) {
50365869 return (vector double)~((vector unsigned long long)__a |
50375870 (vector unsigned long long)__b);
50385871}
50395872
5873// This prototype is deprecated.
50405874static inline __ATTRS_o_ai vector double
50415875vec_nor(vector double __a, vector bool long long __b) {
50425876 return (vector double)~((vector unsigned long long)__a |
50435877 (vector unsigned long long)__b);
50445878}
50455879
5880/*-- vec_orc ----------------------------------------------------------------*/
5881
5882#if __ARCH__ >= 12
5883static inline __ATTRS_o_ai vector bool char
5884vec_orc(vector bool char __a, vector bool char __b) {
5885 return __a | ~__b;
5886}
5887
5888static inline __ATTRS_o_ai vector signed char
5889vec_orc(vector signed char __a, vector signed char __b) {
5890 return __a | ~__b;
5891}
5892
5893static inline __ATTRS_o_ai vector unsigned char
5894vec_orc(vector unsigned char __a, vector unsigned char __b) {
5895 return __a | ~__b;
5896}
5897
5898static inline __ATTRS_o_ai vector bool short
5899vec_orc(vector bool short __a, vector bool short __b) {
5900 return __a | ~__b;
5901}
5902
5903static inline __ATTRS_o_ai vector signed short
5904vec_orc(vector signed short __a, vector signed short __b) {
5905 return __a | ~__b;
5906}
5907
5908static inline __ATTRS_o_ai vector unsigned short
5909vec_orc(vector unsigned short __a, vector unsigned short __b) {
5910 return __a | ~__b;
5911}
5912
5913static inline __ATTRS_o_ai vector bool int
5914vec_orc(vector bool int __a, vector bool int __b) {
5915 return __a | ~__b;
5916}
5917
5918static inline __ATTRS_o_ai vector signed int
5919vec_orc(vector signed int __a, vector signed int __b) {
5920 return __a | ~__b;
5921}
5922
5923static inline __ATTRS_o_ai vector unsigned int
5924vec_orc(vector unsigned int __a, vector unsigned int __b) {
5925 return __a | ~__b;
5926}
5927
5928static inline __ATTRS_o_ai vector bool long long
5929vec_orc(vector bool long long __a, vector bool long long __b) {
5930 return __a | ~__b;
5931}
5932
5933static inline __ATTRS_o_ai vector signed long long
5934vec_orc(vector signed long long __a, vector signed long long __b) {
5935 return __a | ~__b;
5936}
5937
5938static inline __ATTRS_o_ai vector unsigned long long
5939vec_orc(vector unsigned long long __a, vector unsigned long long __b) {
5940 return __a | ~__b;
5941}
5942
5943static inline __ATTRS_o_ai vector float
5944vec_orc(vector float __a, vector float __b) {
5945 return (vector float)((vector unsigned int)__a &
5946 ~(vector unsigned int)__b);
5947}
5948
5949static inline __ATTRS_o_ai vector double
5950vec_orc(vector double __a, vector double __b) {
5951 return (vector double)((vector unsigned long long)__a &
5952 ~(vector unsigned long long)__b);
5953}
5954#endif
5955
5956/*-- vec_nand ---------------------------------------------------------------*/
5957
5958#if __ARCH__ >= 12
5959static inline __ATTRS_o_ai vector bool char
5960vec_nand(vector bool char __a, vector bool char __b) {
5961 return ~(__a & __b);
5962}
5963
5964static inline __ATTRS_o_ai vector signed char
5965vec_nand(vector signed char __a, vector signed char __b) {
5966 return ~(__a & __b);
5967}
5968
5969static inline __ATTRS_o_ai vector unsigned char
5970vec_nand(vector unsigned char __a, vector unsigned char __b) {
5971 return ~(__a & __b);
5972}
5973
5974static inline __ATTRS_o_ai vector bool short
5975vec_nand(vector bool short __a, vector bool short __b) {
5976 return ~(__a & __b);
5977}
5978
5979static inline __ATTRS_o_ai vector signed short
5980vec_nand(vector signed short __a, vector signed short __b) {
5981 return ~(__a & __b);
5982}
5983
5984static inline __ATTRS_o_ai vector unsigned short
5985vec_nand(vector unsigned short __a, vector unsigned short __b) {
5986 return ~(__a & __b);
5987}
5988
5989static inline __ATTRS_o_ai vector bool int
5990vec_nand(vector bool int __a, vector bool int __b) {
5991 return ~(__a & __b);
5992}
5993
5994static inline __ATTRS_o_ai vector signed int
5995vec_nand(vector signed int __a, vector signed int __b) {
5996 return ~(__a & __b);
5997}
5998
5999static inline __ATTRS_o_ai vector unsigned int
6000vec_nand(vector unsigned int __a, vector unsigned int __b) {
6001 return ~(__a & __b);
6002}
6003
6004static inline __ATTRS_o_ai vector bool long long
6005vec_nand(vector bool long long __a, vector bool long long __b) {
6006 return ~(__a & __b);
6007}
6008
6009static inline __ATTRS_o_ai vector signed long long
6010vec_nand(vector signed long long __a, vector signed long long __b) {
6011 return ~(__a & __b);
6012}
6013
6014static inline __ATTRS_o_ai vector unsigned long long
6015vec_nand(vector unsigned long long __a, vector unsigned long long __b) {
6016 return ~(__a & __b);
6017}
6018
6019static inline __ATTRS_o_ai vector float
6020vec_nand(vector float __a, vector float __b) {
6021 return (vector float)~((vector unsigned int)__a &
6022 (vector unsigned int)__b);
6023}
6024
6025static inline __ATTRS_o_ai vector double
6026vec_nand(vector double __a, vector double __b) {
6027 return (vector double)~((vector unsigned long long)__a &
6028 (vector unsigned long long)__b);
6029}
6030#endif
6031
6032/*-- vec_eqv ----------------------------------------------------------------*/
6033
6034#if __ARCH__ >= 12
6035static inline __ATTRS_o_ai vector bool char
6036vec_eqv(vector bool char __a, vector bool char __b) {
6037 return ~(__a ^ __b);
6038}
6039
6040static inline __ATTRS_o_ai vector signed char
6041vec_eqv(vector signed char __a, vector signed char __b) {
6042 return ~(__a ^ __b);
6043}
6044
6045static inline __ATTRS_o_ai vector unsigned char
6046vec_eqv(vector unsigned char __a, vector unsigned char __b) {
6047 return ~(__a ^ __b);
6048}
6049
6050static inline __ATTRS_o_ai vector bool short
6051vec_eqv(vector bool short __a, vector bool short __b) {
6052 return ~(__a ^ __b);
6053}
6054
6055static inline __ATTRS_o_ai vector signed short
6056vec_eqv(vector signed short __a, vector signed short __b) {
6057 return ~(__a ^ __b);
6058}
6059
6060static inline __ATTRS_o_ai vector unsigned short
6061vec_eqv(vector unsigned short __a, vector unsigned short __b) {
6062 return ~(__a ^ __b);
6063}
6064
6065static inline __ATTRS_o_ai vector bool int
6066vec_eqv(vector bool int __a, vector bool int __b) {
6067 return ~(__a ^ __b);
6068}
6069
6070static inline __ATTRS_o_ai vector signed int
6071vec_eqv(vector signed int __a, vector signed int __b) {
6072 return ~(__a ^ __b);
6073}
6074
6075static inline __ATTRS_o_ai vector unsigned int
6076vec_eqv(vector unsigned int __a, vector unsigned int __b) {
6077 return ~(__a ^ __b);
6078}
6079
6080static inline __ATTRS_o_ai vector bool long long
6081vec_eqv(vector bool long long __a, vector bool long long __b) {
6082 return ~(__a ^ __b);
6083}
6084
6085static inline __ATTRS_o_ai vector signed long long
6086vec_eqv(vector signed long long __a, vector signed long long __b) {
6087 return ~(__a ^ __b);
6088}
6089
6090static inline __ATTRS_o_ai vector unsigned long long
6091vec_eqv(vector unsigned long long __a, vector unsigned long long __b) {
6092 return ~(__a ^ __b);
6093}
6094
6095static inline __ATTRS_o_ai vector float
6096vec_eqv(vector float __a, vector float __b) {
6097 return (vector float)~((vector unsigned int)__a ^
6098 (vector unsigned int)__b);
6099}
6100
6101static inline __ATTRS_o_ai vector double
6102vec_eqv(vector double __a, vector double __b) {
6103 return (vector double)~((vector unsigned long long)__a ^
6104 (vector unsigned long long)__b);
6105}
6106#endif
6107
50466108/*-- vec_cntlz --------------------------------------------------------------*/
50476109
50486110static inline __ATTRS_o_ai vector unsigned char
......@@ -5323,30 +6385,35 @@ vec_sll(vector signed char __a, vector unsigned char __b) {
53236385 (vector unsigned char)__a, __b);
53246386}
53256387
6388// This prototype is deprecated.
53266389static inline __ATTRS_o_ai vector signed char
53276390vec_sll(vector signed char __a, vector unsigned short __b) {
53286391 return (vector signed char)__builtin_s390_vsl(
53296392 (vector unsigned char)__a, (vector unsigned char)__b);
53306393}
53316394
6395// This prototype is deprecated.
53326396static inline __ATTRS_o_ai vector signed char
53336397vec_sll(vector signed char __a, vector unsigned int __b) {
53346398 return (vector signed char)__builtin_s390_vsl(
53356399 (vector unsigned char)__a, (vector unsigned char)__b);
53366400}
53376401
6402// This prototype is deprecated.
53386403static inline __ATTRS_o_ai vector bool char
53396404vec_sll(vector bool char __a, vector unsigned char __b) {
53406405 return (vector bool char)__builtin_s390_vsl(
53416406 (vector unsigned char)__a, __b);
53426407}
53436408
6409// This prototype is deprecated.
53446410static inline __ATTRS_o_ai vector bool char
53456411vec_sll(vector bool char __a, vector unsigned short __b) {
53466412 return (vector bool char)__builtin_s390_vsl(
53476413 (vector unsigned char)__a, (vector unsigned char)__b);
53486414}
53496415
6416// This prototype is deprecated.
53506417static inline __ATTRS_o_ai vector bool char
53516418vec_sll(vector bool char __a, vector unsigned int __b) {
53526419 return (vector bool char)__builtin_s390_vsl(
......@@ -5358,11 +6425,13 @@ vec_sll(vector unsigned char __a, vector unsigned char __b) {
53586425 return __builtin_s390_vsl(__a, __b);
53596426}
53606427
6428// This prototype is deprecated.
53616429static inline __ATTRS_o_ai vector unsigned char
53626430vec_sll(vector unsigned char __a, vector unsigned short __b) {
53636431 return __builtin_s390_vsl(__a, (vector unsigned char)__b);
53646432}
53656433
6434// This prototype is deprecated.
53666435static inline __ATTRS_o_ai vector unsigned char
53676436vec_sll(vector unsigned char __a, vector unsigned int __b) {
53686437 return __builtin_s390_vsl(__a, (vector unsigned char)__b);
......@@ -5374,30 +6443,35 @@ vec_sll(vector signed short __a, vector unsigned char __b) {
53746443 (vector unsigned char)__a, __b);
53756444}
53766445
6446// This prototype is deprecated.
53776447static inline __ATTRS_o_ai vector signed short
53786448vec_sll(vector signed short __a, vector unsigned short __b) {
53796449 return (vector signed short)__builtin_s390_vsl(
53806450 (vector unsigned char)__a, (vector unsigned char)__b);
53816451}
53826452
6453// This prototype is deprecated.
53836454static inline __ATTRS_o_ai vector signed short
53846455vec_sll(vector signed short __a, vector unsigned int __b) {
53856456 return (vector signed short)__builtin_s390_vsl(
53866457 (vector unsigned char)__a, (vector unsigned char)__b);
53876458}
53886459
6460// This prototype is deprecated.
53896461static inline __ATTRS_o_ai vector bool short
53906462vec_sll(vector bool short __a, vector unsigned char __b) {
53916463 return (vector bool short)__builtin_s390_vsl(
53926464 (vector unsigned char)__a, __b);
53936465}
53946466
6467// This prototype is deprecated.
53956468static inline __ATTRS_o_ai vector bool short
53966469vec_sll(vector bool short __a, vector unsigned short __b) {
53976470 return (vector bool short)__builtin_s390_vsl(
53986471 (vector unsigned char)__a, (vector unsigned char)__b);
53996472}
54006473
6474// This prototype is deprecated.
54016475static inline __ATTRS_o_ai vector bool short
54026476vec_sll(vector bool short __a, vector unsigned int __b) {
54036477 return (vector bool short)__builtin_s390_vsl(
......@@ -5410,12 +6484,14 @@ vec_sll(vector unsigned short __a, vector unsigned char __b) {
54106484 (vector unsigned char)__a, __b);
54116485}
54126486
6487// This prototype is deprecated.
54136488static inline __ATTRS_o_ai vector unsigned short
54146489vec_sll(vector unsigned short __a, vector unsigned short __b) {
54156490 return (vector unsigned short)__builtin_s390_vsl(
54166491 (vector unsigned char)__a, (vector unsigned char)__b);
54176492}
54186493
6494// This prototype is deprecated.
54196495static inline __ATTRS_o_ai vector unsigned short
54206496vec_sll(vector unsigned short __a, vector unsigned int __b) {
54216497 return (vector unsigned short)__builtin_s390_vsl(
......@@ -5428,30 +6504,35 @@ vec_sll(vector signed int __a, vector unsigned char __b) {
54286504 (vector unsigned char)__a, __b);
54296505}
54306506
6507// This prototype is deprecated.
54316508static inline __ATTRS_o_ai vector signed int
54326509vec_sll(vector signed int __a, vector unsigned short __b) {
54336510 return (vector signed int)__builtin_s390_vsl(
54346511 (vector unsigned char)__a, (vector unsigned char)__b);
54356512}
54366513
6514// This prototype is deprecated.
54376515static inline __ATTRS_o_ai vector signed int
54386516vec_sll(vector signed int __a, vector unsigned int __b) {
54396517 return (vector signed int)__builtin_s390_vsl(
54406518 (vector unsigned char)__a, (vector unsigned char)__b);
54416519}
54426520
6521// This prototype is deprecated.
54436522static inline __ATTRS_o_ai vector bool int
54446523vec_sll(vector bool int __a, vector unsigned char __b) {
54456524 return (vector bool int)__builtin_s390_vsl(
54466525 (vector unsigned char)__a, __b);
54476526}
54486527
6528// This prototype is deprecated.
54496529static inline __ATTRS_o_ai vector bool int
54506530vec_sll(vector bool int __a, vector unsigned short __b) {
54516531 return (vector bool int)__builtin_s390_vsl(
54526532 (vector unsigned char)__a, (vector unsigned char)__b);
54536533}
54546534
6535// This prototype is deprecated.
54556536static inline __ATTRS_o_ai vector bool int
54566537vec_sll(vector bool int __a, vector unsigned int __b) {
54576538 return (vector bool int)__builtin_s390_vsl(
......@@ -5464,12 +6545,14 @@ vec_sll(vector unsigned int __a, vector unsigned char __b) {
54646545 (vector unsigned char)__a, __b);
54656546}
54666547
6548// This prototype is deprecated.
54676549static inline __ATTRS_o_ai vector unsigned int
54686550vec_sll(vector unsigned int __a, vector unsigned short __b) {
54696551 return (vector unsigned int)__builtin_s390_vsl(
54706552 (vector unsigned char)__a, (vector unsigned char)__b);
54716553}
54726554
6555// This prototype is deprecated.
54736556static inline __ATTRS_o_ai vector unsigned int
54746557vec_sll(vector unsigned int __a, vector unsigned int __b) {
54756558 return (vector unsigned int)__builtin_s390_vsl(
......@@ -5482,30 +6565,35 @@ vec_sll(vector signed long long __a, vector unsigned char __b) {
54826565 (vector unsigned char)__a, __b);
54836566}
54846567
6568// This prototype is deprecated.
54856569static inline __ATTRS_o_ai vector signed long long
54866570vec_sll(vector signed long long __a, vector unsigned short __b) {
54876571 return (vector signed long long)__builtin_s390_vsl(
54886572 (vector unsigned char)__a, (vector unsigned char)__b);
54896573}
54906574
6575// This prototype is deprecated.
54916576static inline __ATTRS_o_ai vector signed long long
54926577vec_sll(vector signed long long __a, vector unsigned int __b) {
54936578 return (vector signed long long)__builtin_s390_vsl(
54946579 (vector unsigned char)__a, (vector unsigned char)__b);
54956580}
54966581
6582// This prototype is deprecated.
54976583static inline __ATTRS_o_ai vector bool long long
54986584vec_sll(vector bool long long __a, vector unsigned char __b) {
54996585 return (vector bool long long)__builtin_s390_vsl(
55006586 (vector unsigned char)__a, __b);
55016587}
55026588
6589// This prototype is deprecated.
55036590static inline __ATTRS_o_ai vector bool long long
55046591vec_sll(vector bool long long __a, vector unsigned short __b) {
55056592 return (vector bool long long)__builtin_s390_vsl(
55066593 (vector unsigned char)__a, (vector unsigned char)__b);
55076594}
55086595
6596// This prototype is deprecated.
55096597static inline __ATTRS_o_ai vector bool long long
55106598vec_sll(vector bool long long __a, vector unsigned int __b) {
55116599 return (vector bool long long)__builtin_s390_vsl(
......@@ -5518,12 +6606,14 @@ vec_sll(vector unsigned long long __a, vector unsigned char __b) {
55186606 (vector unsigned char)__a, __b);
55196607}
55206608
6609// This prototype is deprecated.
55216610static inline __ATTRS_o_ai vector unsigned long long
55226611vec_sll(vector unsigned long long __a, vector unsigned short __b) {
55236612 return (vector unsigned long long)__builtin_s390_vsl(
55246613 (vector unsigned char)__a, (vector unsigned char)__b);
55256614}
55266615
6616// This prototype is deprecated.
55276617static inline __ATTRS_o_ai vector unsigned long long
55286618vec_sll(vector unsigned long long __a, vector unsigned int __b) {
55296619 return (vector unsigned long long)__builtin_s390_vsl(
......@@ -5626,6 +6716,20 @@ vec_slb(vector unsigned long long __a, vector unsigned long long __b) {
56266716 (vector unsigned char)__a, (vector unsigned char)__b);
56276717}
56286718
6719#if __ARCH__ >= 12
6720static inline __ATTRS_o_ai vector float
6721vec_slb(vector float __a, vector signed int __b) {
6722 return (vector float)__builtin_s390_vslb(
6723 (vector unsigned char)__a, (vector unsigned char)__b);
6724}
6725
6726static inline __ATTRS_o_ai vector float
6727vec_slb(vector float __a, vector unsigned int __b) {
6728 return (vector float)__builtin_s390_vslb(
6729 (vector unsigned char)__a, (vector unsigned char)__b);
6730}
6731#endif
6732
56296733static inline __ATTRS_o_ai vector double
56306734vec_slb(vector double __a, vector signed long long __b) {
56316735 return (vector double)__builtin_s390_vslb(
......@@ -5644,6 +6748,10 @@ extern __ATTRS_o vector signed char
56446748vec_sld(vector signed char __a, vector signed char __b, int __c)
56456749 __constant_range(__c, 0, 15);
56466750
6751extern __ATTRS_o vector bool char
6752vec_sld(vector bool char __a, vector bool char __b, int __c)
6753 __constant_range(__c, 0, 15);
6754
56476755extern __ATTRS_o vector unsigned char
56486756vec_sld(vector unsigned char __a, vector unsigned char __b, int __c)
56496757 __constant_range(__c, 0, 15);
......@@ -5652,6 +6760,10 @@ extern __ATTRS_o vector signed short
56526760vec_sld(vector signed short __a, vector signed short __b, int __c)
56536761 __constant_range(__c, 0, 15);
56546762
6763extern __ATTRS_o vector bool short
6764vec_sld(vector bool short __a, vector bool short __b, int __c)
6765 __constant_range(__c, 0, 15);
6766
56556767extern __ATTRS_o vector unsigned short
56566768vec_sld(vector unsigned short __a, vector unsigned short __b, int __c)
56576769 __constant_range(__c, 0, 15);
......@@ -5660,6 +6772,10 @@ extern __ATTRS_o vector signed int
56606772vec_sld(vector signed int __a, vector signed int __b, int __c)
56616773 __constant_range(__c, 0, 15);
56626774
6775extern __ATTRS_o vector bool int
6776vec_sld(vector bool int __a, vector bool int __b, int __c)
6777 __constant_range(__c, 0, 15);
6778
56636779extern __ATTRS_o vector unsigned int
56646780vec_sld(vector unsigned int __a, vector unsigned int __b, int __c)
56656781 __constant_range(__c, 0, 15);
......@@ -5668,10 +6784,20 @@ extern __ATTRS_o vector signed long long
56686784vec_sld(vector signed long long __a, vector signed long long __b, int __c)
56696785 __constant_range(__c, 0, 15);
56706786
6787extern __ATTRS_o vector bool long long
6788vec_sld(vector bool long long __a, vector bool long long __b, int __c)
6789 __constant_range(__c, 0, 15);
6790
56716791extern __ATTRS_o vector unsigned long long
56726792vec_sld(vector unsigned long long __a, vector unsigned long long __b, int __c)
56736793 __constant_range(__c, 0, 15);
56746794
6795#if __ARCH__ >= 12
6796extern __ATTRS_o vector float
6797vec_sld(vector float __a, vector float __b, int __c)
6798 __constant_range(__c, 0, 15);
6799#endif
6800
56756801extern __ATTRS_o vector double
56766802vec_sld(vector double __a, vector double __b, int __c)
56776803 __constant_range(__c, 0, 15);
......@@ -5714,6 +6840,7 @@ extern __ATTRS_o vector unsigned long long
57146840vec_sldw(vector unsigned long long __a, vector unsigned long long __b, int __c)
57156841 __constant_range(__c, 0, 3);
57166842
6843// This prototype is deprecated.
57176844extern __ATTRS_o vector double
57186845vec_sldw(vector double __a, vector double __b, int __c)
57196846 __constant_range(__c, 0, 3);
......@@ -5730,30 +6857,35 @@ vec_sral(vector signed char __a, vector unsigned char __b) {
57306857 (vector unsigned char)__a, __b);
57316858}
57326859
6860// This prototype is deprecated.
57336861static inline __ATTRS_o_ai vector signed char
57346862vec_sral(vector signed char __a, vector unsigned short __b) {
57356863 return (vector signed char)__builtin_s390_vsra(
57366864 (vector unsigned char)__a, (vector unsigned char)__b);
57376865}
57386866
6867// This prototype is deprecated.
57396868static inline __ATTRS_o_ai vector signed char
57406869vec_sral(vector signed char __a, vector unsigned int __b) {
57416870 return (vector signed char)__builtin_s390_vsra(
57426871 (vector unsigned char)__a, (vector unsigned char)__b);
57436872}
57446873
6874// This prototype is deprecated.
57456875static inline __ATTRS_o_ai vector bool char
57466876vec_sral(vector bool char __a, vector unsigned char __b) {
57476877 return (vector bool char)__builtin_s390_vsra(
57486878 (vector unsigned char)__a, __b);
57496879}
57506880
6881// This prototype is deprecated.
57516882static inline __ATTRS_o_ai vector bool char
57526883vec_sral(vector bool char __a, vector unsigned short __b) {
57536884 return (vector bool char)__builtin_s390_vsra(
57546885 (vector unsigned char)__a, (vector unsigned char)__b);
57556886}
57566887
6888// This prototype is deprecated.
57576889static inline __ATTRS_o_ai vector bool char
57586890vec_sral(vector bool char __a, vector unsigned int __b) {
57596891 return (vector bool char)__builtin_s390_vsra(
......@@ -5765,11 +6897,13 @@ vec_sral(vector unsigned char __a, vector unsigned char __b) {
57656897 return __builtin_s390_vsra(__a, __b);
57666898}
57676899
6900// This prototype is deprecated.
57686901static inline __ATTRS_o_ai vector unsigned char
57696902vec_sral(vector unsigned char __a, vector unsigned short __b) {
57706903 return __builtin_s390_vsra(__a, (vector unsigned char)__b);
57716904}
57726905
6906// This prototype is deprecated.
57736907static inline __ATTRS_o_ai vector unsigned char
57746908vec_sral(vector unsigned char __a, vector unsigned int __b) {
57756909 return __builtin_s390_vsra(__a, (vector unsigned char)__b);
......@@ -5781,30 +6915,35 @@ vec_sral(vector signed short __a, vector unsigned char __b) {
57816915 (vector unsigned char)__a, __b);
57826916}
57836917
6918// This prototype is deprecated.
57846919static inline __ATTRS_o_ai vector signed short
57856920vec_sral(vector signed short __a, vector unsigned short __b) {
57866921 return (vector signed short)__builtin_s390_vsra(
57876922 (vector unsigned char)__a, (vector unsigned char)__b);
57886923}
57896924
6925// This prototype is deprecated.
57906926static inline __ATTRS_o_ai vector signed short
57916927vec_sral(vector signed short __a, vector unsigned int __b) {
57926928 return (vector signed short)__builtin_s390_vsra(
57936929 (vector unsigned char)__a, (vector unsigned char)__b);
57946930}
57956931
6932// This prototype is deprecated.
57966933static inline __ATTRS_o_ai vector bool short
57976934vec_sral(vector bool short __a, vector unsigned char __b) {
57986935 return (vector bool short)__builtin_s390_vsra(
57996936 (vector unsigned char)__a, __b);
58006937}
58016938
6939// This prototype is deprecated.
58026940static inline __ATTRS_o_ai vector bool short
58036941vec_sral(vector bool short __a, vector unsigned short __b) {
58046942 return (vector bool short)__builtin_s390_vsra(
58056943 (vector unsigned char)__a, (vector unsigned char)__b);
58066944}
58076945
6946// This prototype is deprecated.
58086947static inline __ATTRS_o_ai vector bool short
58096948vec_sral(vector bool short __a, vector unsigned int __b) {
58106949 return (vector bool short)__builtin_s390_vsra(
......@@ -5817,12 +6956,14 @@ vec_sral(vector unsigned short __a, vector unsigned char __b) {
58176956 (vector unsigned char)__a, __b);
58186957}
58196958
6959// This prototype is deprecated.
58206960static inline __ATTRS_o_ai vector unsigned short
58216961vec_sral(vector unsigned short __a, vector unsigned short __b) {
58226962 return (vector unsigned short)__builtin_s390_vsra(
58236963 (vector unsigned char)__a, (vector unsigned char)__b);
58246964}
58256965
6966// This prototype is deprecated.
58266967static inline __ATTRS_o_ai vector unsigned short
58276968vec_sral(vector unsigned short __a, vector unsigned int __b) {
58286969 return (vector unsigned short)__builtin_s390_vsra(
......@@ -5835,30 +6976,35 @@ vec_sral(vector signed int __a, vector unsigned char __b) {
58356976 (vector unsigned char)__a, __b);
58366977}
58376978
6979// This prototype is deprecated.
58386980static inline __ATTRS_o_ai vector signed int
58396981vec_sral(vector signed int __a, vector unsigned short __b) {
58406982 return (vector signed int)__builtin_s390_vsra(
58416983 (vector unsigned char)__a, (vector unsigned char)__b);
58426984}
58436985
6986// This prototype is deprecated.
58446987static inline __ATTRS_o_ai vector signed int
58456988vec_sral(vector signed int __a, vector unsigned int __b) {
58466989 return (vector signed int)__builtin_s390_vsra(
58476990 (vector unsigned char)__a, (vector unsigned char)__b);
58486991}
58496992
6993// This prototype is deprecated.
58506994static inline __ATTRS_o_ai vector bool int
58516995vec_sral(vector bool int __a, vector unsigned char __b) {
58526996 return (vector bool int)__builtin_s390_vsra(
58536997 (vector unsigned char)__a, __b);
58546998}
58556999
7000// This prototype is deprecated.
58567001static inline __ATTRS_o_ai vector bool int
58577002vec_sral(vector bool int __a, vector unsigned short __b) {
58587003 return (vector bool int)__builtin_s390_vsra(
58597004 (vector unsigned char)__a, (vector unsigned char)__b);
58607005}
58617006
7007// This prototype is deprecated.
58627008static inline __ATTRS_o_ai vector bool int
58637009vec_sral(vector bool int __a, vector unsigned int __b) {
58647010 return (vector bool int)__builtin_s390_vsra(
......@@ -5871,12 +7017,14 @@ vec_sral(vector unsigned int __a, vector unsigned char __b) {
58717017 (vector unsigned char)__a, __b);
58727018}
58737019
7020// This prototype is deprecated.
58747021static inline __ATTRS_o_ai vector unsigned int
58757022vec_sral(vector unsigned int __a, vector unsigned short __b) {
58767023 return (vector unsigned int)__builtin_s390_vsra(
58777024 (vector unsigned char)__a, (vector unsigned char)__b);
58787025}
58797026
7027// This prototype is deprecated.
58807028static inline __ATTRS_o_ai vector unsigned int
58817029vec_sral(vector unsigned int __a, vector unsigned int __b) {
58827030 return (vector unsigned int)__builtin_s390_vsra(
......@@ -5889,30 +7037,35 @@ vec_sral(vector signed long long __a, vector unsigned char __b) {
58897037 (vector unsigned char)__a, __b);
58907038}
58917039
7040// This prototype is deprecated.
58927041static inline __ATTRS_o_ai vector signed long long
58937042vec_sral(vector signed long long __a, vector unsigned short __b) {
58947043 return (vector signed long long)__builtin_s390_vsra(
58957044 (vector unsigned char)__a, (vector unsigned char)__b);
58967045}
58977046
7047// This prototype is deprecated.
58987048static inline __ATTRS_o_ai vector signed long long
58997049vec_sral(vector signed long long __a, vector unsigned int __b) {
59007050 return (vector signed long long)__builtin_s390_vsra(
59017051 (vector unsigned char)__a, (vector unsigned char)__b);
59027052}
59037053
7054// This prototype is deprecated.
59047055static inline __ATTRS_o_ai vector bool long long
59057056vec_sral(vector bool long long __a, vector unsigned char __b) {
59067057 return (vector bool long long)__builtin_s390_vsra(
59077058 (vector unsigned char)__a, __b);
59087059}
59097060
7061// This prototype is deprecated.
59107062static inline __ATTRS_o_ai vector bool long long
59117063vec_sral(vector bool long long __a, vector unsigned short __b) {
59127064 return (vector bool long long)__builtin_s390_vsra(
59137065 (vector unsigned char)__a, (vector unsigned char)__b);
59147066}
59157067
7068// This prototype is deprecated.
59167069static inline __ATTRS_o_ai vector bool long long
59177070vec_sral(vector bool long long __a, vector unsigned int __b) {
59187071 return (vector bool long long)__builtin_s390_vsra(
......@@ -5925,12 +7078,14 @@ vec_sral(vector unsigned long long __a, vector unsigned char __b) {
59257078 (vector unsigned char)__a, __b);
59267079}
59277080
7081// This prototype is deprecated.
59287082static inline __ATTRS_o_ai vector unsigned long long
59297083vec_sral(vector unsigned long long __a, vector unsigned short __b) {
59307084 return (vector unsigned long long)__builtin_s390_vsra(
59317085 (vector unsigned char)__a, (vector unsigned char)__b);
59327086}
59337087
7088// This prototype is deprecated.
59347089static inline __ATTRS_o_ai vector unsigned long long
59357090vec_sral(vector unsigned long long __a, vector unsigned int __b) {
59367091 return (vector unsigned long long)__builtin_s390_vsra(
......@@ -6033,6 +7188,20 @@ vec_srab(vector unsigned long long __a, vector unsigned long long __b) {
60337188 (vector unsigned char)__a, (vector unsigned char)__b);
60347189}
60357190
7191#if __ARCH__ >= 12
7192static inline __ATTRS_o_ai vector float
7193vec_srab(vector float __a, vector signed int __b) {
7194 return (vector float)__builtin_s390_vsrab(
7195 (vector unsigned char)__a, (vector unsigned char)__b);
7196}
7197
7198static inline __ATTRS_o_ai vector float
7199vec_srab(vector float __a, vector unsigned int __b) {
7200 return (vector float)__builtin_s390_vsrab(
7201 (vector unsigned char)__a, (vector unsigned char)__b);
7202}
7203#endif
7204
60367205static inline __ATTRS_o_ai vector double
60377206vec_srab(vector double __a, vector signed long long __b) {
60387207 return (vector double)__builtin_s390_vsrab(
......@@ -6053,30 +7222,35 @@ vec_srl(vector signed char __a, vector unsigned char __b) {
60537222 (vector unsigned char)__a, __b);
60547223}
60557224
7225// This prototype is deprecated.
60567226static inline __ATTRS_o_ai vector signed char
60577227vec_srl(vector signed char __a, vector unsigned short __b) {
60587228 return (vector signed char)__builtin_s390_vsrl(
60597229 (vector unsigned char)__a, (vector unsigned char)__b);
60607230}
60617231
7232// This prototype is deprecated.
60627233static inline __ATTRS_o_ai vector signed char
60637234vec_srl(vector signed char __a, vector unsigned int __b) {
60647235 return (vector signed char)__builtin_s390_vsrl(
60657236 (vector unsigned char)__a, (vector unsigned char)__b);
60667237}
60677238
7239// This prototype is deprecated.
60687240static inline __ATTRS_o_ai vector bool char
60697241vec_srl(vector bool char __a, vector unsigned char __b) {
60707242 return (vector bool char)__builtin_s390_vsrl(
60717243 (vector unsigned char)__a, __b);
60727244}
60737245
7246// This prototype is deprecated.
60747247static inline __ATTRS_o_ai vector bool char
60757248vec_srl(vector bool char __a, vector unsigned short __b) {
60767249 return (vector bool char)__builtin_s390_vsrl(
60777250 (vector unsigned char)__a, (vector unsigned char)__b);
60787251}
60797252
7253// This prototype is deprecated.
60807254static inline __ATTRS_o_ai vector bool char
60817255vec_srl(vector bool char __a, vector unsigned int __b) {
60827256 return (vector bool char)__builtin_s390_vsrl(
......@@ -6088,11 +7262,13 @@ vec_srl(vector unsigned char __a, vector unsigned char __b) {
60887262 return __builtin_s390_vsrl(__a, __b);
60897263}
60907264
7265// This prototype is deprecated.
60917266static inline __ATTRS_o_ai vector unsigned char
60927267vec_srl(vector unsigned char __a, vector unsigned short __b) {
60937268 return __builtin_s390_vsrl(__a, (vector unsigned char)__b);
60947269}
60957270
7271// This prototype is deprecated.
60967272static inline __ATTRS_o_ai vector unsigned char
60977273vec_srl(vector unsigned char __a, vector unsigned int __b) {
60987274 return __builtin_s390_vsrl(__a, (vector unsigned char)__b);
......@@ -6104,30 +7280,35 @@ vec_srl(vector signed short __a, vector unsigned char __b) {
61047280 (vector unsigned char)__a, __b);
61057281}
61067282
7283// This prototype is deprecated.
61077284static inline __ATTRS_o_ai vector signed short
61087285vec_srl(vector signed short __a, vector unsigned short __b) {
61097286 return (vector signed short)__builtin_s390_vsrl(
61107287 (vector unsigned char)__a, (vector unsigned char)__b);
61117288}
61127289
7290// This prototype is deprecated.
61137291static inline __ATTRS_o_ai vector signed short
61147292vec_srl(vector signed short __a, vector unsigned int __b) {
61157293 return (vector signed short)__builtin_s390_vsrl(
61167294 (vector unsigned char)__a, (vector unsigned char)__b);
61177295}
61187296
7297// This prototype is deprecated.
61197298static inline __ATTRS_o_ai vector bool short
61207299vec_srl(vector bool short __a, vector unsigned char __b) {
61217300 return (vector bool short)__builtin_s390_vsrl(
61227301 (vector unsigned char)__a, __b);
61237302}
61247303
7304// This prototype is deprecated.
61257305static inline __ATTRS_o_ai vector bool short
61267306vec_srl(vector bool short __a, vector unsigned short __b) {
61277307 return (vector bool short)__builtin_s390_vsrl(
61287308 (vector unsigned char)__a, (vector unsigned char)__b);
61297309}
61307310
7311// This prototype is deprecated.
61317312static inline __ATTRS_o_ai vector bool short
61327313vec_srl(vector bool short __a, vector unsigned int __b) {
61337314 return (vector bool short)__builtin_s390_vsrl(
......@@ -6140,12 +7321,14 @@ vec_srl(vector unsigned short __a, vector unsigned char __b) {
61407321 (vector unsigned char)__a, __b);
61417322}
61427323
7324// This prototype is deprecated.
61437325static inline __ATTRS_o_ai vector unsigned short
61447326vec_srl(vector unsigned short __a, vector unsigned short __b) {
61457327 return (vector unsigned short)__builtin_s390_vsrl(
61467328 (vector unsigned char)__a, (vector unsigned char)__b);
61477329}
61487330
7331// This prototype is deprecated.
61497332static inline __ATTRS_o_ai vector unsigned short
61507333vec_srl(vector unsigned short __a, vector unsigned int __b) {
61517334 return (vector unsigned short)__builtin_s390_vsrl(
......@@ -6158,30 +7341,35 @@ vec_srl(vector signed int __a, vector unsigned char __b) {
61587341 (vector unsigned char)__a, __b);
61597342}
61607343
7344// This prototype is deprecated.
61617345static inline __ATTRS_o_ai vector signed int
61627346vec_srl(vector signed int __a, vector unsigned short __b) {
61637347 return (vector signed int)__builtin_s390_vsrl(
61647348 (vector unsigned char)__a, (vector unsigned char)__b);
61657349}
61667350
7351// This prototype is deprecated.
61677352static inline __ATTRS_o_ai vector signed int
61687353vec_srl(vector signed int __a, vector unsigned int __b) {
61697354 return (vector signed int)__builtin_s390_vsrl(
61707355 (vector unsigned char)__a, (vector unsigned char)__b);
61717356}
61727357
7358// This prototype is deprecated.
61737359static inline __ATTRS_o_ai vector bool int
61747360vec_srl(vector bool int __a, vector unsigned char __b) {
61757361 return (vector bool int)__builtin_s390_vsrl(
61767362 (vector unsigned char)__a, __b);
61777363}
61787364
7365// This prototype is deprecated.
61797366static inline __ATTRS_o_ai vector bool int
61807367vec_srl(vector bool int __a, vector unsigned short __b) {
61817368 return (vector bool int)__builtin_s390_vsrl(
61827369 (vector unsigned char)__a, (vector unsigned char)__b);
61837370}
61847371
7372// This prototype is deprecated.
61857373static inline __ATTRS_o_ai vector bool int
61867374vec_srl(vector bool int __a, vector unsigned int __b) {
61877375 return (vector bool int)__builtin_s390_vsrl(
......@@ -6194,12 +7382,14 @@ vec_srl(vector unsigned int __a, vector unsigned char __b) {
61947382 (vector unsigned char)__a, __b);
61957383}
61967384
7385// This prototype is deprecated.
61977386static inline __ATTRS_o_ai vector unsigned int
61987387vec_srl(vector unsigned int __a, vector unsigned short __b) {
61997388 return (vector unsigned int)__builtin_s390_vsrl(
62007389 (vector unsigned char)__a, (vector unsigned char)__b);
62017390}
62027391
7392// This prototype is deprecated.
62037393static inline __ATTRS_o_ai vector unsigned int
62047394vec_srl(vector unsigned int __a, vector unsigned int __b) {
62057395 return (vector unsigned int)__builtin_s390_vsrl(
......@@ -6212,30 +7402,35 @@ vec_srl(vector signed long long __a, vector unsigned char __b) {
62127402 (vector unsigned char)__a, __b);
62137403}
62147404
7405// This prototype is deprecated.
62157406static inline __ATTRS_o_ai vector signed long long
62167407vec_srl(vector signed long long __a, vector unsigned short __b) {
62177408 return (vector signed long long)__builtin_s390_vsrl(
62187409 (vector unsigned char)__a, (vector unsigned char)__b);
62197410}
62207411
7412// This prototype is deprecated.
62217413static inline __ATTRS_o_ai vector signed long long
62227414vec_srl(vector signed long long __a, vector unsigned int __b) {
62237415 return (vector signed long long)__builtin_s390_vsrl(
62247416 (vector unsigned char)__a, (vector unsigned char)__b);
62257417}
62267418
7419// This prototype is deprecated.
62277420static inline __ATTRS_o_ai vector bool long long
62287421vec_srl(vector bool long long __a, vector unsigned char __b) {
62297422 return (vector bool long long)__builtin_s390_vsrl(
62307423 (vector unsigned char)__a, __b);
62317424}
62327425
7426// This prototype is deprecated.
62337427static inline __ATTRS_o_ai vector bool long long
62347428vec_srl(vector bool long long __a, vector unsigned short __b) {
62357429 return (vector bool long long)__builtin_s390_vsrl(
62367430 (vector unsigned char)__a, (vector unsigned char)__b);
62377431}
62387432
7433// This prototype is deprecated.
62397434static inline __ATTRS_o_ai vector bool long long
62407435vec_srl(vector bool long long __a, vector unsigned int __b) {
62417436 return (vector bool long long)__builtin_s390_vsrl(
......@@ -6248,12 +7443,14 @@ vec_srl(vector unsigned long long __a, vector unsigned char __b) {
62487443 (vector unsigned char)__a, __b);
62497444}
62507445
7446// This prototype is deprecated.
62517447static inline __ATTRS_o_ai vector unsigned long long
62527448vec_srl(vector unsigned long long __a, vector unsigned short __b) {
62537449 return (vector unsigned long long)__builtin_s390_vsrl(
62547450 (vector unsigned char)__a, (vector unsigned char)__b);
62557451}
62567452
7453// This prototype is deprecated.
62577454static inline __ATTRS_o_ai vector unsigned long long
62587455vec_srl(vector unsigned long long __a, vector unsigned int __b) {
62597456 return (vector unsigned long long)__builtin_s390_vsrl(
......@@ -6356,6 +7553,20 @@ vec_srb(vector unsigned long long __a, vector unsigned long long __b) {
63567553 (vector unsigned char)__a, (vector unsigned char)__b);
63577554}
63587555
7556#if __ARCH__ >= 12
7557static inline __ATTRS_o_ai vector float
7558vec_srb(vector float __a, vector signed int __b) {
7559 return (vector float)__builtin_s390_vsrlb(
7560 (vector unsigned char)__a, (vector unsigned char)__b);
7561}
7562
7563static inline __ATTRS_o_ai vector float
7564vec_srb(vector float __a, vector unsigned int __b) {
7565 return (vector float)__builtin_s390_vsrlb(
7566 (vector unsigned char)__a, (vector unsigned char)__b);
7567}
7568#endif
7569
63597570static inline __ATTRS_o_ai vector double
63607571vec_srb(vector double __a, vector signed long long __b) {
63617572 return (vector double)__builtin_s390_vsrlb(
......@@ -6390,6 +7601,13 @@ vec_abs(vector signed long long __a) {
63907601 return vec_sel(__a, -__a, vec_cmplt(__a, (vector signed long long)0));
63917602}
63927603
7604#if __ARCH__ >= 12
7605static inline __ATTRS_o_ai vector float
7606vec_abs(vector float __a) {
7607 return __builtin_s390_vflpsb(__a);
7608}
7609#endif
7610
63937611static inline __ATTRS_o_ai vector double
63947612vec_abs(vector double __a) {
63957613 return __builtin_s390_vflpdb(__a);
......@@ -6397,7 +7615,14 @@ vec_abs(vector double __a) {
63977615
63987616/*-- vec_nabs ---------------------------------------------------------------*/
63997617
6400static inline __ATTRS_ai vector double
7618#if __ARCH__ >= 12
7619static inline __ATTRS_o_ai vector float
7620vec_nabs(vector float __a) {
7621 return __builtin_s390_vflnsb(__a);
7622}
7623#endif
7624
7625static inline __ATTRS_o_ai vector double
64017626vec_nabs(vector double __a) {
64027627 return __builtin_s390_vflndb(__a);
64037628}
......@@ -6409,12 +7634,14 @@ vec_max(vector signed char __a, vector signed char __b) {
64097634 return vec_sel(__b, __a, vec_cmpgt(__a, __b));
64107635}
64117636
7637// This prototype is deprecated.
64127638static inline __ATTRS_o_ai vector signed char
64137639vec_max(vector signed char __a, vector bool char __b) {
64147640 vector signed char __bc = (vector signed char)__b;
64157641 return vec_sel(__bc, __a, vec_cmpgt(__a, __bc));
64167642}
64177643
7644// This prototype is deprecated.
64187645static inline __ATTRS_o_ai vector signed char
64197646vec_max(vector bool char __a, vector signed char __b) {
64207647 vector signed char __ac = (vector signed char)__a;
......@@ -6426,12 +7653,14 @@ vec_max(vector unsigned char __a, vector unsigned char __b) {
64267653 return vec_sel(__b, __a, vec_cmpgt(__a, __b));
64277654}
64287655
7656// This prototype is deprecated.
64297657static inline __ATTRS_o_ai vector unsigned char
64307658vec_max(vector unsigned char __a, vector bool char __b) {
64317659 vector unsigned char __bc = (vector unsigned char)__b;
64327660 return vec_sel(__bc, __a, vec_cmpgt(__a, __bc));
64337661}
64347662
7663// This prototype is deprecated.
64357664static inline __ATTRS_o_ai vector unsigned char
64367665vec_max(vector bool char __a, vector unsigned char __b) {
64377666 vector unsigned char __ac = (vector unsigned char)__a;
......@@ -6443,12 +7672,14 @@ vec_max(vector signed short __a, vector signed short __b) {
64437672 return vec_sel(__b, __a, vec_cmpgt(__a, __b));
64447673}
64457674
7675// This prototype is deprecated.
64467676static inline __ATTRS_o_ai vector signed short
64477677vec_max(vector signed short __a, vector bool short __b) {
64487678 vector signed short __bc = (vector signed short)__b;
64497679 return vec_sel(__bc, __a, vec_cmpgt(__a, __bc));
64507680}
64517681
7682// This prototype is deprecated.
64527683static inline __ATTRS_o_ai vector signed short
64537684vec_max(vector bool short __a, vector signed short __b) {
64547685 vector signed short __ac = (vector signed short)__a;
......@@ -6460,12 +7691,14 @@ vec_max(vector unsigned short __a, vector unsigned short __b) {
64607691 return vec_sel(__b, __a, vec_cmpgt(__a, __b));
64617692}
64627693
7694// This prototype is deprecated.
64637695static inline __ATTRS_o_ai vector unsigned short
64647696vec_max(vector unsigned short __a, vector bool short __b) {
64657697 vector unsigned short __bc = (vector unsigned short)__b;
64667698 return vec_sel(__bc, __a, vec_cmpgt(__a, __bc));
64677699}
64687700
7701// This prototype is deprecated.
64697702static inline __ATTRS_o_ai vector unsigned short
64707703vec_max(vector bool short __a, vector unsigned short __b) {
64717704 vector unsigned short __ac = (vector unsigned short)__a;
......@@ -6477,12 +7710,14 @@ vec_max(vector signed int __a, vector signed int __b) {
64777710 return vec_sel(__b, __a, vec_cmpgt(__a, __b));
64787711}
64797712
7713// This prototype is deprecated.
64807714static inline __ATTRS_o_ai vector signed int
64817715vec_max(vector signed int __a, vector bool int __b) {
64827716 vector signed int __bc = (vector signed int)__b;
64837717 return vec_sel(__bc, __a, vec_cmpgt(__a, __bc));
64847718}
64857719
7720// This prototype is deprecated.
64867721static inline __ATTRS_o_ai vector signed int
64877722vec_max(vector bool int __a, vector signed int __b) {
64887723 vector signed int __ac = (vector signed int)__a;
......@@ -6494,12 +7729,14 @@ vec_max(vector unsigned int __a, vector unsigned int __b) {
64947729 return vec_sel(__b, __a, vec_cmpgt(__a, __b));
64957730}
64967731
7732// This prototype is deprecated.
64977733static inline __ATTRS_o_ai vector unsigned int
64987734vec_max(vector unsigned int __a, vector bool int __b) {
64997735 vector unsigned int __bc = (vector unsigned int)__b;
65007736 return vec_sel(__bc, __a, vec_cmpgt(__a, __bc));
65017737}
65027738
7739// This prototype is deprecated.
65037740static inline __ATTRS_o_ai vector unsigned int
65047741vec_max(vector bool int __a, vector unsigned int __b) {
65057742 vector unsigned int __ac = (vector unsigned int)__a;
......@@ -6511,12 +7748,14 @@ vec_max(vector signed long long __a, vector signed long long __b) {
65117748 return vec_sel(__b, __a, vec_cmpgt(__a, __b));
65127749}
65137750
7751// This prototype is deprecated.
65147752static inline __ATTRS_o_ai vector signed long long
65157753vec_max(vector signed long long __a, vector bool long long __b) {
65167754 vector signed long long __bc = (vector signed long long)__b;
65177755 return vec_sel(__bc, __a, vec_cmpgt(__a, __bc));
65187756}
65197757
7758// This prototype is deprecated.
65207759static inline __ATTRS_o_ai vector signed long long
65217760vec_max(vector bool long long __a, vector signed long long __b) {
65227761 vector signed long long __ac = (vector signed long long)__a;
......@@ -6528,21 +7767,34 @@ vec_max(vector unsigned long long __a, vector unsigned long long __b) {
65287767 return vec_sel(__b, __a, vec_cmpgt(__a, __b));
65297768}
65307769
7770// This prototype is deprecated.
65317771static inline __ATTRS_o_ai vector unsigned long long
65327772vec_max(vector unsigned long long __a, vector bool long long __b) {
65337773 vector unsigned long long __bc = (vector unsigned long long)__b;
65347774 return vec_sel(__bc, __a, vec_cmpgt(__a, __bc));
65357775}
65367776
7777// This prototype is deprecated.
65377778static inline __ATTRS_o_ai vector unsigned long long
65387779vec_max(vector bool long long __a, vector unsigned long long __b) {
65397780 vector unsigned long long __ac = (vector unsigned long long)__a;
65407781 return vec_sel(__b, __ac, vec_cmpgt(__ac, __b));
65417782}
65427783
7784#if __ARCH__ >= 12
7785static inline __ATTRS_o_ai vector float
7786vec_max(vector float __a, vector float __b) {
7787 return __builtin_s390_vfmaxsb(__a, __b, 0);
7788}
7789#endif
7790
65437791static inline __ATTRS_o_ai vector double
65447792vec_max(vector double __a, vector double __b) {
7793#if __ARCH__ >= 12
7794 return __builtin_s390_vfmaxdb(__a, __b, 0);
7795#else
65457796 return vec_sel(__b, __a, vec_cmpgt(__a, __b));
7797#endif
65467798}
65477799
65487800/*-- vec_min ----------------------------------------------------------------*/
......@@ -6552,12 +7804,14 @@ vec_min(vector signed char __a, vector signed char __b) {
65527804 return vec_sel(__a, __b, vec_cmpgt(__a, __b));
65537805}
65547806
7807// This prototype is deprecated.
65557808static inline __ATTRS_o_ai vector signed char
65567809vec_min(vector signed char __a, vector bool char __b) {
65577810 vector signed char __bc = (vector signed char)__b;
65587811 return vec_sel(__a, __bc, vec_cmpgt(__a, __bc));
65597812}
65607813
7814// This prototype is deprecated.
65617815static inline __ATTRS_o_ai vector signed char
65627816vec_min(vector bool char __a, vector signed char __b) {
65637817 vector signed char __ac = (vector signed char)__a;
......@@ -6569,12 +7823,14 @@ vec_min(vector unsigned char __a, vector unsigned char __b) {
65697823 return vec_sel(__a, __b, vec_cmpgt(__a, __b));
65707824}
65717825
7826// This prototype is deprecated.
65727827static inline __ATTRS_o_ai vector unsigned char
65737828vec_min(vector unsigned char __a, vector bool char __b) {
65747829 vector unsigned char __bc = (vector unsigned char)__b;
65757830 return vec_sel(__a, __bc, vec_cmpgt(__a, __bc));
65767831}
65777832
7833// This prototype is deprecated.
65787834static inline __ATTRS_o_ai vector unsigned char
65797835vec_min(vector bool char __a, vector unsigned char __b) {
65807836 vector unsigned char __ac = (vector unsigned char)__a;
......@@ -6586,12 +7842,14 @@ vec_min(vector signed short __a, vector signed short __b) {
65867842 return vec_sel(__a, __b, vec_cmpgt(__a, __b));
65877843}
65887844
7845// This prototype is deprecated.
65897846static inline __ATTRS_o_ai vector signed short
65907847vec_min(vector signed short __a, vector bool short __b) {
65917848 vector signed short __bc = (vector signed short)__b;
65927849 return vec_sel(__a, __bc, vec_cmpgt(__a, __bc));
65937850}
65947851
7852// This prototype is deprecated.
65957853static inline __ATTRS_o_ai vector signed short
65967854vec_min(vector bool short __a, vector signed short __b) {
65977855 vector signed short __ac = (vector signed short)__a;
......@@ -6603,12 +7861,14 @@ vec_min(vector unsigned short __a, vector unsigned short __b) {
66037861 return vec_sel(__a, __b, vec_cmpgt(__a, __b));
66047862}
66057863
7864// This prototype is deprecated.
66067865static inline __ATTRS_o_ai vector unsigned short
66077866vec_min(vector unsigned short __a, vector bool short __b) {
66087867 vector unsigned short __bc = (vector unsigned short)__b;
66097868 return vec_sel(__a, __bc, vec_cmpgt(__a, __bc));
66107869}
66117870
7871// This prototype is deprecated.
66127872static inline __ATTRS_o_ai vector unsigned short
66137873vec_min(vector bool short __a, vector unsigned short __b) {
66147874 vector unsigned short __ac = (vector unsigned short)__a;
......@@ -6620,12 +7880,14 @@ vec_min(vector signed int __a, vector signed int __b) {
66207880 return vec_sel(__a, __b, vec_cmpgt(__a, __b));
66217881}
66227882
7883// This prototype is deprecated.
66237884static inline __ATTRS_o_ai vector signed int
66247885vec_min(vector signed int __a, vector bool int __b) {
66257886 vector signed int __bc = (vector signed int)__b;
66267887 return vec_sel(__a, __bc, vec_cmpgt(__a, __bc));
66277888}
66287889
7890// This prototype is deprecated.
66297891static inline __ATTRS_o_ai vector signed int
66307892vec_min(vector bool int __a, vector signed int __b) {
66317893 vector signed int __ac = (vector signed int)__a;
......@@ -6637,12 +7899,14 @@ vec_min(vector unsigned int __a, vector unsigned int __b) {
66377899 return vec_sel(__a, __b, vec_cmpgt(__a, __b));
66387900}
66397901
7902// This prototype is deprecated.
66407903static inline __ATTRS_o_ai vector unsigned int
66417904vec_min(vector unsigned int __a, vector bool int __b) {
66427905 vector unsigned int __bc = (vector unsigned int)__b;
66437906 return vec_sel(__a, __bc, vec_cmpgt(__a, __bc));
66447907}
66457908
7909// This prototype is deprecated.
66467910static inline __ATTRS_o_ai vector unsigned int
66477911vec_min(vector bool int __a, vector unsigned int __b) {
66487912 vector unsigned int __ac = (vector unsigned int)__a;
......@@ -6654,12 +7918,14 @@ vec_min(vector signed long long __a, vector signed long long __b) {
66547918 return vec_sel(__a, __b, vec_cmpgt(__a, __b));
66557919}
66567920
7921// This prototype is deprecated.
66577922static inline __ATTRS_o_ai vector signed long long
66587923vec_min(vector signed long long __a, vector bool long long __b) {
66597924 vector signed long long __bc = (vector signed long long)__b;
66607925 return vec_sel(__a, __bc, vec_cmpgt(__a, __bc));
66617926}
66627927
7928// This prototype is deprecated.
66637929static inline __ATTRS_o_ai vector signed long long
66647930vec_min(vector bool long long __a, vector signed long long __b) {
66657931 vector signed long long __ac = (vector signed long long)__a;
......@@ -6671,21 +7937,34 @@ vec_min(vector unsigned long long __a, vector unsigned long long __b) {
66717937 return vec_sel(__a, __b, vec_cmpgt(__a, __b));
66727938}
66737939
7940// This prototype is deprecated.
66747941static inline __ATTRS_o_ai vector unsigned long long
66757942vec_min(vector unsigned long long __a, vector bool long long __b) {
66767943 vector unsigned long long __bc = (vector unsigned long long)__b;
66777944 return vec_sel(__a, __bc, vec_cmpgt(__a, __bc));
66787945}
66797946
7947// This prototype is deprecated.
66807948static inline __ATTRS_o_ai vector unsigned long long
66817949vec_min(vector bool long long __a, vector unsigned long long __b) {
66827950 vector unsigned long long __ac = (vector unsigned long long)__a;
66837951 return vec_sel(__ac, __b, vec_cmpgt(__ac, __b));
66847952}
66857953
7954#if __ARCH__ >= 12
7955static inline __ATTRS_o_ai vector float
7956vec_min(vector float __a, vector float __b) {
7957 return __builtin_s390_vfminsb(__a, __b, 0);
7958}
7959#endif
7960
66867961static inline __ATTRS_o_ai vector double
66877962vec_min(vector double __a, vector double __b) {
7963#if __ARCH__ >= 12
7964 return __builtin_s390_vfmindb(__a, __b, 0);
7965#else
66887966 return vec_sel(__a, __b, vec_cmpgt(__a, __b));
7967#endif
66897968}
66907969
66917970/*-- vec_add_u128 -----------------------------------------------------------*/
......@@ -7126,6 +8405,13 @@ vec_mulo(vector unsigned int __a, vector unsigned int __b) {
71268405 return __builtin_s390_vmlof(__a, __b);
71278406}
71288407
8408/*-- vec_msum_u128 ----------------------------------------------------------*/
8409
8410#if __ARCH__ >= 12
8411#define vec_msum_u128(X, Y, Z, W) \
8412 ((vector unsigned char)__builtin_s390_vmslg((X), (Y), (Z), (W)));
8413#endif
8414
71298415/*-- vec_sub_u128 -----------------------------------------------------------*/
71308416
71318417static inline __ATTRS_ai vector unsigned char
......@@ -7263,6 +8549,14 @@ vec_test_mask(vector unsigned long long __a, vector unsigned long long __b) {
72638549 (vector unsigned char)__b);
72648550}
72658551
8552#if __ARCH__ >= 12
8553static inline __ATTRS_o_ai int
8554vec_test_mask(vector float __a, vector unsigned int __b) {
8555 return __builtin_s390_vtm((vector unsigned char)__a,
8556 (vector unsigned char)__b);
8557}
8558#endif
8559
72668560static inline __ATTRS_o_ai int
72678561vec_test_mask(vector double __a, vector unsigned long long __b) {
72688562 return __builtin_s390_vtm((vector unsigned char)__a,
......@@ -7271,27 +8565,77 @@ vec_test_mask(vector double __a, vector unsigned long long __b) {
72718565
72728566/*-- vec_madd ---------------------------------------------------------------*/
72738567
7274static inline __ATTRS_ai vector double
8568#if __ARCH__ >= 12
8569static inline __ATTRS_o_ai vector float
8570vec_madd(vector float __a, vector float __b, vector float __c) {
8571 return __builtin_s390_vfmasb(__a, __b, __c);
8572}
8573#endif
8574
8575static inline __ATTRS_o_ai vector double
72758576vec_madd(vector double __a, vector double __b, vector double __c) {
72768577 return __builtin_s390_vfmadb(__a, __b, __c);
72778578}
72788579
72798580/*-- vec_msub ---------------------------------------------------------------*/
72808581
7281static inline __ATTRS_ai vector double
8582#if __ARCH__ >= 12
8583static inline __ATTRS_o_ai vector float
8584vec_msub(vector float __a, vector float __b, vector float __c) {
8585 return __builtin_s390_vfmssb(__a, __b, __c);
8586}
8587#endif
8588
8589static inline __ATTRS_o_ai vector double
72828590vec_msub(vector double __a, vector double __b, vector double __c) {
72838591 return __builtin_s390_vfmsdb(__a, __b, __c);
72848592}
72858593
8594/*-- vec_nmadd ---------------------------------------------------------------*/
8595
8596#if __ARCH__ >= 12
8597static inline __ATTRS_o_ai vector float
8598vec_nmadd(vector float __a, vector float __b, vector float __c) {
8599 return __builtin_s390_vfnmasb(__a, __b, __c);
8600}
8601
8602static inline __ATTRS_o_ai vector double
8603vec_nmadd(vector double __a, vector double __b, vector double __c) {
8604 return __builtin_s390_vfnmadb(__a, __b, __c);
8605}
8606#endif
8607
8608/*-- vec_nmsub ---------------------------------------------------------------*/
8609
8610#if __ARCH__ >= 12
8611static inline __ATTRS_o_ai vector float
8612vec_nmsub(vector float __a, vector float __b, vector float __c) {
8613 return __builtin_s390_vfnmssb(__a, __b, __c);
8614}
8615
8616static inline __ATTRS_o_ai vector double
8617vec_nmsub(vector double __a, vector double __b, vector double __c) {
8618 return __builtin_s390_vfnmsdb(__a, __b, __c);
8619}
8620#endif
8621
72868622/*-- vec_sqrt ---------------------------------------------------------------*/
72878623
7288static inline __ATTRS_ai vector double
8624#if __ARCH__ >= 12
8625static inline __ATTRS_o_ai vector float
8626vec_sqrt(vector float __a) {
8627 return __builtin_s390_vfsqsb(__a);
8628}
8629#endif
8630
8631static inline __ATTRS_o_ai vector double
72898632vec_sqrt(vector double __a) {
72908633 return __builtin_s390_vfsqdb(__a);
72918634}
72928635
72938636/*-- vec_ld2f ---------------------------------------------------------------*/
72948637
8638// This prototype is deprecated.
72958639static inline __ATTRS_ai vector double
72968640vec_ld2f(const float *__ptr) {
72978641 typedef float __v2f32 __attribute__((__vector_size__(8)));
......@@ -7300,6 +8644,7 @@ vec_ld2f(const float *__ptr) {
73008644
73018645/*-- vec_st2f ---------------------------------------------------------------*/
73028646
8647// This prototype is deprecated.
73038648static inline __ATTRS_ai void
73048649vec_st2f(vector double __a, float *__ptr) {
73058650 typedef float __v2f32 __attribute__((__vector_size__(8)));
......@@ -7308,6 +8653,7 @@ vec_st2f(vector double __a, float *__ptr) {
73088653
73098654/*-- vec_ctd ----------------------------------------------------------------*/
73108655
8656// This prototype is deprecated.
73118657static inline __ATTRS_o_ai vector double
73128658vec_ctd(vector signed long long __a, int __b)
73138659 __constant_range(__b, 0, 31) {
......@@ -7316,6 +8662,7 @@ vec_ctd(vector signed long long __a, int __b)
73168662 return __conv;
73178663}
73188664
8665// This prototype is deprecated.
73198666static inline __ATTRS_o_ai vector double
73208667vec_ctd(vector unsigned long long __a, int __b)
73218668 __constant_range(__b, 0, 31) {
......@@ -7326,6 +8673,7 @@ vec_ctd(vector unsigned long long __a, int __b)
73268673
73278674/*-- vec_ctsl ---------------------------------------------------------------*/
73288675
8676// This prototype is deprecated.
73298677static inline __ATTRS_o_ai vector signed long long
73308678vec_ctsl(vector double __a, int __b)
73318679 __constant_range(__b, 0, 31) {
......@@ -7335,6 +8683,7 @@ vec_ctsl(vector double __a, int __b)
73358683
73368684/*-- vec_ctul ---------------------------------------------------------------*/
73378685
8686// This prototype is deprecated.
73388687static inline __ATTRS_o_ai vector unsigned long long
73398688vec_ctul(vector double __a, int __b)
73408689 __constant_range(__b, 0, 31) {
......@@ -7342,16 +8691,79 @@ vec_ctul(vector double __a, int __b)
73428691 return __builtin_convertvector(__a, vector unsigned long long);
73438692}
73448693
7345/*-- vec_roundp -------------------------------------------------------------*/
8694/*-- vec_doublee ------------------------------------------------------------*/
73468695
8696#if __ARCH__ >= 12
73478697static inline __ATTRS_ai vector double
8698vec_doublee(vector float __a) {
8699 typedef float __v2f32 __attribute__((__vector_size__(8)));
8700 __v2f32 __pack = __builtin_shufflevector(__a, __a, 0, 2);
8701 return __builtin_convertvector(__pack, vector double);
8702}
8703#endif
8704
8705/*-- vec_floate -------------------------------------------------------------*/
8706
8707#if __ARCH__ >= 12
8708static inline __ATTRS_ai vector float
8709vec_floate(vector double __a) {
8710 typedef float __v2f32 __attribute__((__vector_size__(8)));
8711 __v2f32 __pack = __builtin_convertvector(__a, __v2f32);
8712 return __builtin_shufflevector(__pack, __pack, 0, -1, 1, -1);
8713}
8714#endif
8715
8716/*-- vec_double -------------------------------------------------------------*/
8717
8718static inline __ATTRS_o_ai vector double
8719vec_double(vector signed long long __a) {
8720 return __builtin_convertvector(__a, vector double);
8721}
8722
8723static inline __ATTRS_o_ai vector double
8724vec_double(vector unsigned long long __a) {
8725 return __builtin_convertvector(__a, vector double);
8726}
8727
8728/*-- vec_signed -------------------------------------------------------------*/
8729
8730static inline __ATTRS_o_ai vector signed long long
8731vec_signed(vector double __a) {
8732 return __builtin_convertvector(__a, vector signed long long);
8733}
8734
8735/*-- vec_unsigned -----------------------------------------------------------*/
8736
8737static inline __ATTRS_o_ai vector unsigned long long
8738vec_unsigned(vector double __a) {
8739 return __builtin_convertvector(__a, vector unsigned long long);
8740}
8741
8742/*-- vec_roundp -------------------------------------------------------------*/
8743
8744#if __ARCH__ >= 12
8745static inline __ATTRS_o_ai vector float
8746vec_roundp(vector float __a) {
8747 return __builtin_s390_vfisb(__a, 4, 6);
8748}
8749#endif
8750
8751static inline __ATTRS_o_ai vector double
73488752vec_roundp(vector double __a) {
73498753 return __builtin_s390_vfidb(__a, 4, 6);
73508754}
73518755
73528756/*-- vec_ceil ---------------------------------------------------------------*/
73538757
7354static inline __ATTRS_ai vector double
8758#if __ARCH__ >= 12
8759static inline __ATTRS_o_ai vector float
8760vec_ceil(vector float __a) {
8761 // On this platform, vec_ceil never triggers the IEEE-inexact exception.
8762 return __builtin_s390_vfisb(__a, 4, 6);
8763}
8764#endif
8765
8766static inline __ATTRS_o_ai vector double
73558767vec_ceil(vector double __a) {
73568768 // On this platform, vec_ceil never triggers the IEEE-inexact exception.
73578769 return __builtin_s390_vfidb(__a, 4, 6);
......@@ -7359,14 +8771,29 @@ vec_ceil(vector double __a) {
73598771
73608772/*-- vec_roundm -------------------------------------------------------------*/
73618773
7362static inline __ATTRS_ai vector double
8774#if __ARCH__ >= 12
8775static inline __ATTRS_o_ai vector float
8776vec_roundm(vector float __a) {
8777 return __builtin_s390_vfisb(__a, 4, 7);
8778}
8779#endif
8780
8781static inline __ATTRS_o_ai vector double
73638782vec_roundm(vector double __a) {
73648783 return __builtin_s390_vfidb(__a, 4, 7);
73658784}
73668785
73678786/*-- vec_floor --------------------------------------------------------------*/
73688787
7369static inline __ATTRS_ai vector double
8788#if __ARCH__ >= 12
8789static inline __ATTRS_o_ai vector float
8790vec_floor(vector float __a) {
8791 // On this platform, vec_floor never triggers the IEEE-inexact exception.
8792 return __builtin_s390_vfisb(__a, 4, 7);
8793}
8794#endif
8795
8796static inline __ATTRS_o_ai vector double
73708797vec_floor(vector double __a) {
73718798 // On this platform, vec_floor never triggers the IEEE-inexact exception.
73728799 return __builtin_s390_vfidb(__a, 4, 7);
......@@ -7374,14 +8801,29 @@ vec_floor(vector double __a) {
73748801
73758802/*-- vec_roundz -------------------------------------------------------------*/
73768803
7377static inline __ATTRS_ai vector double
8804#if __ARCH__ >= 12
8805static inline __ATTRS_o_ai vector float
8806vec_roundz(vector float __a) {
8807 return __builtin_s390_vfisb(__a, 4, 5);
8808}
8809#endif
8810
8811static inline __ATTRS_o_ai vector double
73788812vec_roundz(vector double __a) {
73798813 return __builtin_s390_vfidb(__a, 4, 5);
73808814}
73818815
73828816/*-- vec_trunc --------------------------------------------------------------*/
73838817
7384static inline __ATTRS_ai vector double
8818#if __ARCH__ >= 12
8819static inline __ATTRS_o_ai vector float
8820vec_trunc(vector float __a) {
8821 // On this platform, vec_trunc never triggers the IEEE-inexact exception.
8822 return __builtin_s390_vfisb(__a, 4, 5);
8823}
8824#endif
8825
8826static inline __ATTRS_o_ai vector double
73858827vec_trunc(vector double __a) {
73868828 // On this platform, vec_trunc never triggers the IEEE-inexact exception.
73878829 return __builtin_s390_vfidb(__a, 4, 5);
......@@ -7389,22 +8831,104 @@ vec_trunc(vector double __a) {
73898831
73908832/*-- vec_roundc -------------------------------------------------------------*/
73918833
7392static inline __ATTRS_ai vector double
8834#if __ARCH__ >= 12
8835static inline __ATTRS_o_ai vector float
8836vec_roundc(vector float __a) {
8837 return __builtin_s390_vfisb(__a, 4, 0);
8838}
8839#endif
8840
8841static inline __ATTRS_o_ai vector double
73938842vec_roundc(vector double __a) {
73948843 return __builtin_s390_vfidb(__a, 4, 0);
73958844}
73968845
8846/*-- vec_rint ---------------------------------------------------------------*/
8847
8848#if __ARCH__ >= 12
8849static inline __ATTRS_o_ai vector float
8850vec_rint(vector float __a) {
8851 // vec_rint may trigger the IEEE-inexact exception.
8852 return __builtin_s390_vfisb(__a, 0, 0);
8853}
8854#endif
8855
8856static inline __ATTRS_o_ai vector double
8857vec_rint(vector double __a) {
8858 // vec_rint may trigger the IEEE-inexact exception.
8859 return __builtin_s390_vfidb(__a, 0, 0);
8860}
8861
73978862/*-- vec_round --------------------------------------------------------------*/
73988863
7399static inline __ATTRS_ai vector double
8864#if __ARCH__ >= 12
8865static inline __ATTRS_o_ai vector float
8866vec_round(vector float __a) {
8867 return __builtin_s390_vfisb(__a, 4, 4);
8868}
8869#endif
8870
8871static inline __ATTRS_o_ai vector double
74008872vec_round(vector double __a) {
74018873 return __builtin_s390_vfidb(__a, 4, 4);
74028874}
74038875
74048876/*-- vec_fp_test_data_class -------------------------------------------------*/
74058877
8878#if __ARCH__ >= 12
8879extern __ATTRS_o vector bool int
8880vec_fp_test_data_class(vector float __a, int __b, int *__c)
8881 __constant_range(__b, 0, 4095);
8882
8883extern __ATTRS_o vector bool long long
8884vec_fp_test_data_class(vector double __a, int __b, int *__c)
8885 __constant_range(__b, 0, 4095);
8886
8887#define vec_fp_test_data_class(X, Y, Z) \
8888 ((__typeof__((vec_fp_test_data_class)((X), (Y), (Z)))) \
8889 __extension__ ({ \
8890 vector unsigned char __res; \
8891 vector unsigned char __x = (vector unsigned char)(X); \
8892 int *__z = (Z); \
8893 switch (sizeof ((X)[0])) { \
8894 case 4: __res = (vector unsigned char) \
8895 __builtin_s390_vftcisb((vector float)__x, (Y), __z); \
8896 break; \
8897 default: __res = (vector unsigned char) \
8898 __builtin_s390_vftcidb((vector double)__x, (Y), __z); \
8899 break; \
8900 } __res; }))
8901#else
74068902#define vec_fp_test_data_class(X, Y, Z) \
74078903 ((vector bool long long)__builtin_s390_vftcidb((X), (Y), (Z)))
8904#endif
8905
8906#define __VEC_CLASS_FP_ZERO_P (1 << 11)
8907#define __VEC_CLASS_FP_ZERO_N (1 << 10)
8908#define __VEC_CLASS_FP_ZERO (__VEC_CLASS_FP_ZERO_P | __VEC_CLASS_FP_ZERO_N)
8909#define __VEC_CLASS_FP_NORMAL_P (1 << 9)
8910#define __VEC_CLASS_FP_NORMAL_N (1 << 8)
8911#define __VEC_CLASS_FP_NORMAL (__VEC_CLASS_FP_NORMAL_P | \
8912 __VEC_CLASS_FP_NORMAL_N)
8913#define __VEC_CLASS_FP_SUBNORMAL_P (1 << 7)
8914#define __VEC_CLASS_FP_SUBNORMAL_N (1 << 6)
8915#define __VEC_CLASS_FP_SUBNORMAL (__VEC_CLASS_FP_SUBNORMAL_P | \
8916 __VEC_CLASS_FP_SUBNORMAL_N)
8917#define __VEC_CLASS_FP_INFINITY_P (1 << 5)
8918#define __VEC_CLASS_FP_INFINITY_N (1 << 4)
8919#define __VEC_CLASS_FP_INFINITY (__VEC_CLASS_FP_INFINITY_P | \
8920 __VEC_CLASS_FP_INFINITY_N)
8921#define __VEC_CLASS_FP_QNAN_P (1 << 3)
8922#define __VEC_CLASS_FP_QNAN_N (1 << 2)
8923#define __VEC_CLASS_FP_QNAN (__VEC_CLASS_FP_QNAN_P | __VEC_CLASS_FP_QNAN_N)
8924#define __VEC_CLASS_FP_SNAN_P (1 << 1)
8925#define __VEC_CLASS_FP_SNAN_N (1 << 0)
8926#define __VEC_CLASS_FP_SNAN (__VEC_CLASS_FP_SNAN_P | __VEC_CLASS_FP_SNAN_N)
8927#define __VEC_CLASS_FP_NAN (__VEC_CLASS_FP_QNAN | __VEC_CLASS_FP_SNAN)
8928#define __VEC_CLASS_FP_NOT_NORMAL (__VEC_CLASS_FP_NAN | \
8929 __VEC_CLASS_FP_SUBNORMAL | \
8930 __VEC_CLASS_FP_ZERO | \
8931 __VEC_CLASS_FP_INFINITY)
74088932
74098933/*-- vec_cp_until_zero ------------------------------------------------------*/
74108934
c_headers/x86intrin.h+7-1
......@@ -72,6 +72,10 @@
7272#include <tbmintrin.h>
7373#endif
7474
75#if !defined(_MSC_VER) || __has_feature(modules) || defined(__LWP__)
76#include <lwpintrin.h>
77#endif
78
7579#if !defined(_MSC_VER) || __has_feature(modules) || defined(__F16C__)
7680#include <f16cintrin.h>
7781#endif
......@@ -80,6 +84,8 @@
8084#include <mwaitxintrin.h>
8185#endif
8286
83/* FIXME: LWP */
87#if !defined(_MSC_VER) || __has_feature(modules) || defined(__CLZERO__)
88#include <clzerointrin.h>
89#endif
8490
8591#endif /* __X86INTRIN_H */
c_headers/xmmintrin.h+34-37
......@@ -2067,7 +2067,7 @@ _mm_storer_ps(float *__p, __m128 __a)
20672067/// _MM_HINT_T1: Move data using the T1 hint. The PREFETCHT1 instruction will
20682068/// be generated. \n
20692069/// _MM_HINT_T2: Move data using the T2 hint. The PREFETCHT2 instruction will
2070/// be generated.
2070/// be generated.
20712071#define _mm_prefetch(a, sel) (__builtin_prefetch((void *)(a), 0, (sel)))
20722072#endif
20732073
......@@ -2099,7 +2099,7 @@ _mm_stream_pi(__m64 *__p, __m64 __a)
20992099///
21002100/// \param __p
21012101/// A pointer to a 128-bit aligned memory location that will receive the
2102/// integer values.
2102/// single-precision floating-point values.
21032103/// \param __a
21042104/// A 128-bit vector of [4 x float] containing the values to be moved.
21052105static __inline__ void __DEFAULT_FN_ATTRS
......@@ -2133,7 +2133,7 @@ void _mm_sfence(void);
21332133/// \headerfile <x86intrin.h>
21342134///
21352135/// \code
2136/// void _mm_extract_pi(__m64 a, int n);
2136/// int _mm_extract_pi16(__m64 a, int n);
21372137/// \endcode
21382138///
21392139/// This intrinsic corresponds to the <c> VPEXTRW / PEXTRW </c> instruction.
......@@ -2157,7 +2157,7 @@ void _mm_sfence(void);
21572157/// \headerfile <x86intrin.h>
21582158///
21592159/// \code
2160/// void _mm_insert_pi(__m64 a, int d, int n);
2160/// __m64 _mm_insert_pi16(__m64 a, int d, int n);
21612161/// \endcode
21622162///
21632163/// This intrinsic corresponds to the <c> VPINSRW / PINSRW </c> instruction.
......@@ -2331,8 +2331,10 @@ _mm_mulhi_pu16(__m64 __a, __m64 __b)
23312331/// \brief Conditionally copies the values from each 8-bit element in the first
23322332/// 64-bit integer vector operand to the specified memory location, as
23332333/// specified by the most significant bit in the corresponding element in the
2334/// second 64-bit integer vector operand. To minimize caching, the data is
2335/// flagged as non-temporal (unlikely to be used again soon).
2334/// second 64-bit integer vector operand.
2335///
2336/// To minimize caching, the data is flagged as non-temporal
2337/// (unlikely to be used again soon).
23362338///
23372339/// \headerfile <x86intrin.h>
23382340///
......@@ -2435,17 +2437,17 @@ extern "C" {
24352437/// For checking exception masks: _MM_MASK_UNDERFLOW, _MM_MASK_OVERFLOW,
24362438/// _MM_MASK_INVALID, _MM_MASK_DENORM, _MM_MASK_DIV_ZERO, _MM_MASK_INEXACT.
24372439/// There is a convenience wrapper _MM_GET_EXCEPTION_MASK().
2438/// </li>
2440/// </li>
24392441/// <li>
24402442/// For checking rounding modes: _MM_ROUND_NEAREST, _MM_ROUND_DOWN,
24412443/// _MM_ROUND_UP, _MM_ROUND_TOWARD_ZERO. There is a convenience wrapper
24422444/// _MM_GET_ROUNDING_MODE(x) where x is one of these macros.
24432445/// </li>
2444/// <li>
2446/// <li>
24452447/// For checking flush-to-zero mode: _MM_FLUSH_ZERO_ON, _MM_FLUSH_ZERO_OFF.
24462448/// There is a convenience wrapper _MM_GET_FLUSH_ZERO_MODE().
24472449/// </li>
2448/// <li>
2450/// <li>
24492451/// For checking denormals-are-zero mode: _MM_DENORMALS_ZERO_ON,
24502452/// _MM_DENORMALS_ZERO_OFF. There is a convenience wrapper
24512453/// _MM_GET_DENORMALS_ZERO_MODE().
......@@ -2468,11 +2470,11 @@ extern "C" {
24682470unsigned int _mm_getcsr(void);
24692471
24702472/// \brief Sets the MXCSR register with the 32-bit unsigned integer value.
2471///
2473///
24722474/// There are several groups of macros associated with this intrinsic,
24732475/// including:
24742476/// <ul>
2475/// <li>
2477/// <li>
24762478/// For setting exception states: _MM_EXCEPT_INVALID, _MM_EXCEPT_DIV_ZERO,
24772479/// _MM_EXCEPT_DENORM, _MM_EXCEPT_OVERFLOW, _MM_EXCEPT_UNDERFLOW,
24782480/// _MM_EXCEPT_INEXACT. There is a convenience wrapper
......@@ -2517,7 +2519,7 @@ unsigned int _mm_getcsr(void);
25172519///
25182520/// \param __i
25192521/// A 32-bit unsigned integer value to be written to the MXCSR register.
2520void _mm_setcsr(unsigned int);
2522void _mm_setcsr(unsigned int __i);
25212523
25222524#if defined(__cplusplus)
25232525} // extern "C"
......@@ -2540,7 +2542,7 @@ void _mm_setcsr(unsigned int);
25402542/// A 128-bit vector of [4 x float].
25412543/// \param mask
25422544/// An immediate value containing an 8-bit value specifying which elements to
2543/// copy from \ a and \a b. \n
2545/// copy from \a a and \a b. \n
25442546/// Bits [3:0] specify the values copied from operand \a a. \n
25452547/// Bits [7:4] specify the values copied from operand \a b. \n
25462548/// The destinations within the 128-bit destination are assigned values as
......@@ -2678,8 +2680,7 @@ _mm_movelh_ps(__m128 __a, __m128 __b)
26782680///
26792681/// \headerfile <x86intrin.h>
26802682///
2681/// This intrinsic corresponds to the <c> CVTPI2PS + \c COMPOSITE </c>
2682/// instruction.
2683/// This intrinsic corresponds to the <c> CVTPI2PS + COMPOSITE </c> instruction.
26832684///
26842685/// \param __a
26852686/// A 64-bit vector of [4 x i16]. The elements of the destination are copied
......@@ -2709,8 +2710,7 @@ _mm_cvtpi16_ps(__m64 __a)
27092710///
27102711/// \headerfile <x86intrin.h>
27112712///
2712/// This intrinsic corresponds to the <c> CVTPI2PS + \c COMPOSITE </c>
2713/// instruction.
2713/// This intrinsic corresponds to the <c> CVTPI2PS + COMPOSITE </c> instruction.
27142714///
27152715/// \param __a
27162716/// A 64-bit vector of 16-bit unsigned integer values. The elements of the
......@@ -2739,8 +2739,7 @@ _mm_cvtpu16_ps(__m64 __a)
27392739///
27402740/// \headerfile <x86intrin.h>
27412741///
2742/// This intrinsic corresponds to the <c> CVTPI2PS + \c COMPOSITE </c>
2743/// instruction.
2742/// This intrinsic corresponds to the <c> CVTPI2PS + COMPOSITE </c> instruction.
27442743///
27452744/// \param __a
27462745/// A 64-bit vector of [8 x i8]. The elements of the destination are copied
......@@ -2764,8 +2763,7 @@ _mm_cvtpi8_ps(__m64 __a)
27642763///
27652764/// \headerfile <x86intrin.h>
27662765///
2767/// This intrinsic corresponds to the <c> CVTPI2PS + \c COMPOSITE </c>
2768/// instruction.
2766/// This intrinsic corresponds to the <c> CVTPI2PS + COMPOSITE </c> instruction.
27692767///
27702768/// \param __a
27712769/// A 64-bit vector of unsigned 8-bit integer values. The elements of the
......@@ -2789,8 +2787,7 @@ _mm_cvtpu8_ps(__m64 __a)
27892787///
27902788/// \headerfile <x86intrin.h>
27912789///
2792/// This intrinsic corresponds to the <c> CVTPI2PS + \c COMPOSITE </c>
2793/// instruction.
2790/// This intrinsic corresponds to the <c> CVTPI2PS + COMPOSITE </c> instruction.
27942791///
27952792/// \param __a
27962793/// A 64-bit vector of [2 x i32]. The lower elements of the destination are
......@@ -2815,16 +2812,16 @@ _mm_cvtpi32x2_ps(__m64 __a, __m64 __b)
28152812
28162813/// \brief Converts each single-precision floating-point element of a 128-bit
28172814/// floating-point vector of [4 x float] into a 16-bit signed integer, and
2818/// packs the results into a 64-bit integer vector of [4 x i16]. If the
2819/// floating-point element is NaN or infinity, or if the floating-point
2820/// element is greater than 0x7FFFFFFF or less than -0x8000, it is converted
2821/// to 0x8000. Otherwise if the floating-point element is greater than
2822/// 0x7FFF, it is converted to 0x7FFF.
2815/// packs the results into a 64-bit integer vector of [4 x i16].
2816///
2817/// If the floating-point element is NaN or infinity, or if the
2818/// floating-point element is greater than 0x7FFFFFFF or less than -0x8000,
2819/// it is converted to 0x8000. Otherwise if the floating-point element is
2820/// greater than 0x7FFF, it is converted to 0x7FFF.
28232821///
28242822/// \headerfile <x86intrin.h>
28252823///
2826/// This intrinsic corresponds to the <c> CVTPS2PI + \c COMPOSITE </c>
2827/// instruction.
2824/// This intrinsic corresponds to the <c> CVTPS2PI + COMPOSITE </c> instruction.
28282825///
28292826/// \param __a
28302827/// A 128-bit floating-point vector of [4 x float].
......@@ -2845,16 +2842,16 @@ _mm_cvtps_pi16(__m128 __a)
28452842/// \brief Converts each single-precision floating-point element of a 128-bit
28462843/// floating-point vector of [4 x float] into an 8-bit signed integer, and
28472844/// packs the results into the lower 32 bits of a 64-bit integer vector of
2848/// [8 x i8]. The upper 32 bits of the vector are set to 0. If the
2849/// floating-point element is NaN or infinity, or if the floating-point
2850/// element is greater than 0x7FFFFFFF or less than -0x80, it is converted
2851/// to 0x80. Otherwise if the floating-point element is greater than 0x7F,
2852/// it is converted to 0x7F.
2845/// [8 x i8]. The upper 32 bits of the vector are set to 0.
2846///
2847/// If the floating-point element is NaN or infinity, or if the
2848/// floating-point element is greater than 0x7FFFFFFF or less than -0x80, it
2849/// is converted to 0x80. Otherwise if the floating-point element is greater
2850/// than 0x7F, it is converted to 0x7F.
28532851///
28542852/// \headerfile <x86intrin.h>
28552853///
2856/// This intrinsic corresponds to the <c> CVTPS2PI + \c COMPOSITE </c>
2857/// instruction.
2854/// This intrinsic corresponds to the <c> CVTPS2PI + COMPOSITE </c> instruction.
28582855///
28592856/// \param __a
28602857/// 128-bit floating-point vector of [4 x float].
c_headers/xopintrin.h+2-2
......@@ -198,13 +198,13 @@ _mm_hsubq_epi32(__m128i __A)
198198static __inline__ __m128i __DEFAULT_FN_ATTRS
199199_mm_cmov_si128(__m128i __A, __m128i __B, __m128i __C)
200200{
201 return (__m128i)__builtin_ia32_vpcmov((__v2di)__A, (__v2di)__B, (__v2di)__C);
201 return (__m128i)(((__v2du)__A & (__v2du)__C) | ((__v2du)__B & ~(__v2du)__C));
202202}
203203
204204static __inline__ __m256i __DEFAULT_FN_ATTRS
205205_mm256_cmov_si256(__m256i __A, __m256i __B, __m256i __C)
206206{
207 return (__m256i)__builtin_ia32_vpcmov_256((__v4di)__A, (__v4di)__B, (__v4di)__C);
207 return (__m256i)(((__v4du)__A & (__v4du)__C) | ((__v4du)__B & ~(__v4du)__C));
208208}
209209
210210static __inline__ __m128i __DEFAULT_FN_ATTRS
doc/targets.md+1-1
......@@ -2,7 +2,7 @@
22
33Create bootstrap code in std/bootstrap.zig and add conditional compilation
44logic. This code is responsible for the real executable entry point, calling
5main(argc, argv, env) and making the exit syscall when main returns.
5main() and making the exit syscall when main returns.
66
77How to pass a byvalue struct parameter in the C calling convention is
88target-specific. Add logic for how to do function prototypes and function calls