clang 19.0.0git
velintrin.h
Go to the documentation of this file.
1/*===---- velintrin.h - VEL intrinsics for VE ------------------------------===
2 *
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
6 *
7 *===-----------------------------------------------------------------------===
8 */
9#ifndef __VEL_INTRIN_H__
10#define __VEL_INTRIN_H__
11
12// Vector registers
13typedef double __vr __attribute__((__vector_size__(2048)));
14
15// Vector mask registers
16#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
17// For C99
18typedef _Bool __vm __attribute__((ext_vector_type(256)));
19typedef _Bool __vm256 __attribute__((ext_vector_type(256)));
20typedef _Bool __vm512 __attribute__((ext_vector_type(512)));
21#else
22#ifdef __cplusplus
23// For C++
24typedef bool __vm __attribute__((ext_vector_type(256)));
25typedef bool __vm256 __attribute__((ext_vector_type(256)));
26typedef bool __vm512 __attribute__((ext_vector_type(512)));
27#else
28#error need C++ or C99 to use vector intrinsics for VE
29#endif
30#endif
31
49};
50
51// Use generated intrinsic name definitions
52#include <velintrin_gen.h>
53
54// Use helper functions
55#include <velintrin_approx.h>
56
57// pack
58
59#define _vel_pack_f32p __builtin_ve_vl_pack_f32p
60#define _vel_pack_f32a __builtin_ve_vl_pack_f32a
61
62static inline unsigned long int _vel_pack_i32(unsigned int a, unsigned int b) {
63 return (((unsigned long int)a) << 32) | b;
64}
65
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)
70
71#endif
__device__ __2f16 b
static unsigned long int _vel_pack_i32(unsigned int a, unsigned int b)
Definition: velintrin.h:62
VShuffleCodes
Definition: velintrin.h:32
@ VE_VSHUFFLE_YLYU
Definition: velintrin.h:37
@ VE_VSHUFFLE_ZUZL
Definition: velintrin.h:44
@ VE_VSHUFFLE_ZUYL
Definition: velintrin.h:42
@ VE_VSHUFFLE_YLZU
Definition: velintrin.h:39
@ VE_VSHUFFLE_ZUYU
Definition: velintrin.h:41
@ VE_VSHUFFLE_ZLZU
Definition: velintrin.h:47
@ VE_VSHUFFLE_YUYU
Definition: velintrin.h:33
@ VE_VSHUFFLE_YLYL
Definition: velintrin.h:38
@ VE_VSHUFFLE_ZLZL
Definition: velintrin.h:48
@ VE_VSHUFFLE_ZLYL
Definition: velintrin.h:46
@ VE_VSHUFFLE_YUYL
Definition: velintrin.h:34
@ VE_VSHUFFLE_YUZU
Definition: velintrin.h:35
@ VE_VSHUFFLE_ZLYU
Definition: velintrin.h:45
@ VE_VSHUFFLE_YUZL
Definition: velintrin.h:36
@ VE_VSHUFFLE_ZUZU
Definition: velintrin.h:43
@ VE_VSHUFFLE_YLZL
Definition: velintrin.h:40
double __vr __attribute__((__vector_size__(2048)))
Definition: velintrin.h:13