1 /*===---- velintrin.h - VEL intrinsics for VE ------------------------------===
3 * Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 * See https://llvm.org/LICENSE.txt for license information.
5 * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 *===-----------------------------------------------------------------------===
9 #ifndef __VEL_INTRIN_H__
10 #define __VEL_INTRIN_H__
13 typedef double __vr
__attribute__((__vector_size__(2048)));
15 // Vector mask registers
16 #if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
18 typedef _Bool __vm
__attribute__((ext_vector_type(256)));
19 typedef _Bool __vm256
__attribute__((ext_vector_type(256)));
20 typedef _Bool __vm512
__attribute__((ext_vector_type(512)));
24 typedef bool __vm
__attribute__((ext_vector_type(256)));
25 typedef bool __vm256
__attribute__((ext_vector_type(256)));
26 typedef bool __vm512
__attribute__((ext_vector_type(512)));
28 #error need C++ or C99 to use vector intrinsics for VE
43 VE_VSHUFFLE_ZUZU
= 10,
44 VE_VSHUFFLE_ZUZL
= 11,
45 VE_VSHUFFLE_ZLYU
= 12,
46 VE_VSHUFFLE_ZLYL
= 13,
47 VE_VSHUFFLE_ZLZU
= 14,
48 VE_VSHUFFLE_ZLZL
= 15,
51 // Use generated intrinsic name definitions
52 #include <velintrin_gen.h>
54 // Use helper functions
55 #include <velintrin_approx.h>
59 #define _vel_pack_f32p __builtin_ve_vl_pack_f32p
60 #define _vel_pack_f32a __builtin_ve_vl_pack_f32a
62 static inline unsigned long int _vel_pack_i32(unsigned int a
, unsigned int b
) {
63 return (((unsigned long int)a
) << 32) | b
;
66 #define _vel_extract_vm512u(vm) __builtin_ve_vl_extract_vm512u(vm)
67 #define _vel_extract_vm512l(vm) __builtin_ve_vl_extract_vm512l(vm)
68 #define _vel_insert_vm512u(vm512, vm) __builtin_ve_vl_insert_vm512u(vm512, vm)
69 #define _vel_insert_vm512l(vm512, vm) __builtin_ve_vl_insert_vm512l(vm512, vm)