1 /* SPDX-License-Identifier: BSD-3-Clause
2 * Copyright 2016 6WIND S.A.
12 * This file defines types to use vector instructions with generic C code.
17 /* Unsigned vector types */
20 * 64 bits vector size to use with unsigned 8 bits elements.
22 * a = (rte_v64u8_t){ a0, a1, a2, a3, a4, a5, a6, a7 }
24 typedef uint8_t rte_v64u8_t __attribute__((vector_size(8), aligned(8)));
27 * 64 bits vector size to use with unsigned 16 bits elements.
29 * a = (rte_v64u16_t){ a0, a1, a2, a3 }
31 typedef uint16_t rte_v64u16_t __attribute__((vector_size(8), aligned(8)));
34 * 64 bits vector size to use with unsigned 32 bits elements.
36 * a = (rte_v64u32_t){ a0, a1 }
38 typedef uint32_t rte_v64u32_t __attribute__((vector_size(8), aligned(8)));
41 * 128 bits vector size to use with unsigned 8 bits elements.
43 * a = (rte_v128u8_t){ a00, a01, a02, a03, a04, a05, a06, a07,
44 * a08, a09, a10, a11, a12, a13, a14, a15 }
46 typedef uint8_t rte_v128u8_t __attribute__((vector_size(16), aligned(16)));
49 * 128 bits vector size to use with unsigned 16 bits elements.
51 * a = (rte_v128u16_t){ a0, a1, a2, a3, a4, a5, a6, a7 }
53 typedef uint16_t rte_v128u16_t __attribute__((vector_size(16), aligned(16)));
56 * 128 bits vector size to use with unsigned 32 bits elements.
58 * a = (rte_v128u32_t){ a0, a1, a2, a3 }
60 typedef uint32_t rte_v128u32_t __attribute__((vector_size(16), aligned(16)));
63 * 128 bits vector size to use with unsigned 64 bits elements.
65 * a = (rte_v128u64_t){ a0, a1 }
67 typedef uint64_t rte_v128u64_t __attribute__((vector_size(16), aligned(16)));
70 * 256 bits vector size to use with unsigned 8 bits elements.
72 * a = (rte_v256u8_t){ a00, a01, a02, a03, a04, a05, a06, a07,
73 * a08, a09, a10, a11, a12, a13, a14, a15,
74 * a16, a17, a18, a19, a20, a21, a22, a23,
75 * a24, a25, a26, a27, a28, a29, a30, a31 }
77 typedef uint8_t rte_v256u8_t __attribute__((vector_size(32), aligned(32)));
80 * 256 bits vector size to use with unsigned 16 bits elements.
82 * a = (rte_v256u16_t){ a00, a01, a02, a03, a04, a05, a06, a07,
83 * a08, a09, a10, a11, a12, a13, a14, a15 }
85 typedef uint16_t rte_v256u16_t __attribute__((vector_size(32), aligned(32)));
88 * 256 bits vector size to use with unsigned 32 bits elements.
90 * a = (rte_v256u32_t){ a0, a1, a2, a3, a4, a5, a6, a7 }
92 typedef uint32_t rte_v256u32_t __attribute__((vector_size(32), aligned(32)));
95 * 256 bits vector size to use with unsigned 64 bits elements.
97 * a = (rte_v256u64_t){ a0, a1, a2, a3 }
99 typedef uint64_t rte_v256u64_t __attribute__((vector_size(32), aligned(32)));
102 /* Signed vector types */
105 * 64 bits vector size to use with 8 bits elements.
107 * a = (rte_v64s8_t){ a0, a1, a2, a3, a4, a5, a6, a7 }
109 typedef int8_t rte_v64s8_t __attribute__((vector_size(8), aligned(8)));
112 * 64 bits vector size to use with 16 bits elements.
114 * a = (rte_v64s16_t){ a0, a1, a2, a3 }
116 typedef int16_t rte_v64s16_t __attribute__((vector_size(8), aligned(8)));
119 * 64 bits vector size to use with 32 bits elements.
121 * a = (rte_v64s32_t){ a0, a1 }
123 typedef int32_t rte_v64s32_t __attribute__((vector_size(8), aligned(8)));
126 * 128 bits vector size to use with 8 bits elements.
128 * a = (rte_v128s8_t){ a00, a01, a02, a03, a04, a05, a06, a07,
129 * a08, a09, a10, a11, a12, a13, a14, a15 }
131 typedef int8_t rte_v128s8_t __attribute__((vector_size(16), aligned(16)));
134 * 128 bits vector size to use with 16 bits elements.
136 * a = (rte_v128s16_t){ a0, a1, a2, a3, a4, a5, a6, a7 }
138 typedef int16_t rte_v128s16_t __attribute__((vector_size(16), aligned(16)));
141 * 128 bits vector size to use with 32 bits elements.
143 * a = (rte_v128s32_t){ a0, a1, a2, a3 }
145 typedef int32_t rte_v128s32_t __attribute__((vector_size(16), aligned(16)));
148 * 128 bits vector size to use with 64 bits elements.
150 * a = (rte_v128s64_t){ a1, a2 }
152 typedef int64_t rte_v128s64_t __attribute__((vector_size(16), aligned(16)));
155 * 256 bits vector size to use with 8 bits elements.
157 * a = (rte_v256s8_t){ a00, a01, a02, a03, a04, a05, a06, a07,
158 * a08, a09, a10, a11, a12, a13, a14, a15,
159 * a16, a17, a18, a19, a20, a21, a22, a23,
160 * a24, a25, a26, a27, a28, a29, a30, a31 }
162 typedef int8_t rte_v256s8_t __attribute__((vector_size(32), aligned(32)));
165 * 256 bits vector size to use with 16 bits elements.
167 * a = (rte_v256s16_t){ a00, a01, a02, a03, a04, a05, a06, a07,
168 * a08, a09, a10, a11, a12, a13, a14, a15 }
170 typedef int16_t rte_v256s16_t __attribute__((vector_size(32), aligned(32)));
173 * 256 bits vector size to use with 32 bits elements.
175 * a = (rte_v256s32_t){ a0, a1, a2, a3, a4, a5, a6, a7 }
177 typedef int32_t rte_v256s32_t __attribute__((vector_size(32), aligned(32)));
180 * 256 bits vector size to use with 64 bits elements.
182 * a = (rte_v256s64_t){ a0, a1, a2, a3 }
184 typedef int64_t rte_v256s64_t __attribute__((vector_size(32), aligned(32)));
186 #endif /* _RTE_VECT_H_ */