1
+ /*===---- xtensa_defs.h - Xtensa definitions -------------------------------===
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 __XTENSAHIFI3_H
10
+ #define __XTENSAHIFI3_H
11
+
12
+ typedef __attribute__ ((ext_vector_type (1 ))) _Bool xtbool ;
13
+ typedef __attribute__ ((ext_vector_type (2 ))) _Bool xtbool2 ;
14
+ typedef __attribute__ ((ext_vector_type (4 ))) _Bool xtbool4 ;
15
+
16
+ typedef int ae_int32 __attribute__((vector_size (4 )));
17
+ typedef int ae_int32x2 __attribute__((vector_size (8 )));
18
+ typedef short ae_int16 __attribute__((vector_size (2 )));
19
+ typedef short ae_int16x2 __attribute__((vector_size (4 )));
20
+ typedef short ae_int16x4 __attribute__((vector_size (8 )));
21
+ typedef long long ae_int64 __attribute__((vector_size (8 )));
22
+ typedef unsigned char ae_valign __attribute__((vector_size (8 )));
23
+ typedef ae_int16x4 ae_f16x4 ;
24
+ typedef ae_int32x2 ae_f32x2 ;
25
+ typedef ae_int32 ae_f32 ;
26
+ typedef ae_int64 ae_f64 ;
27
+ typedef ae_int32 ae_f24 ;
28
+ typedef ae_int32x2 ae_f24x2 ;
29
+ typedef ae_int16 ae_f16 ;
30
+
31
+ #include <xtensa_protos.h>
32
+
33
+ #define AE_SETCBEGIN0 (x ) WUR_AE_CBEGIN0(x)
34
+ #define AE_SETCEND0 (x ) WUR_AE_CEND0(x)
35
+ #define AE_ZERO64 (x ) AE_MOVI(0)
36
+ #define AE_ZERO24 (x ) AE_MOVI(0)
37
+ #define AE_ZERO32 (x ) AE_MOVI(0)
38
+ #define AE_ZERO16 (x ) AE_MOVI(0)
39
+ #define AE_ZEROQ56 (x ) AE_ZERO64(x)
40
+
41
+ #define AE_SEL32_L (a ) \
42
+ ({ \
43
+ ae_int32x2 _a = a; \
44
+ __builtin_shufflevector(_a, _a, 0); \
45
+ })
46
+
47
+ #define AE_INT32 (a ) __builtin_xtensa_ae_int32(a);
48
+ #define AE_INT32X2 (a ) __builtin_xtensa_ae_int32x2(a);
49
+
50
+ #define AE_F32X2 AE_INT32X2
51
+ #define AE_F32 AE_INT32
52
+
53
+ #define AE_MOVINT16X4_FROMINT32X2 (a ) ((ae_int32x2)(a))
54
+
55
+ #define AE_F32_ADDS_F32 (s1 , s2 ) \
56
+ AE_F32(AE_ADD32S(AE_INT32X2(s1), AE_INT32X2(s2)))
57
+
58
+ typedef float xtfloat ;
59
+
60
+ #define XT_xtfloat_storeip (x , a , i ) ({ a = __builtin_xtensa_xt_ssip(x, a, i); })
61
+ #define XT_xtfloat_loadip (x , a , i ) \
62
+ ({ x = __builtin_xtensa_xt_lsip((xtfloat **)&a, i); })
63
+ #define XT_xtfloat_loadxp (x , a , i ) \
64
+ ({ x = __builtin_xtensa_xt_lsxp((xtfloat **)&a, i); })
65
+
66
+ #endif /* __XTENSAHIFI3_H */
0 commit comments