XCORE SDK
XCORE Software Development Kit
xs3_vpu_scalar_ops.h
1 // Copyright 2020-2021 XMOS LIMITED.
2 // This Software is subject to the terms of the XMOS Public Licence: Version 1.
3 
4 
5 #ifndef XS3_VPU_SCALAR_OPS_H_
6 #define XS3_VPU_SCALAR_OPS_H_
7 
8 #include <stdint.h>
9 
10 #include "xs3_math_types.h"
11 #include "xs3_vpu_info.h"
12 
31 int8_t vladd8(
32  const int8_t x,
33  const int8_t y);
34 
38 int8_t vlsub8(
39  const int8_t x,
40  const int8_t y);
41 
45 int8_t vlashr8(
46  const int8_t x,
47  const right_shift_t shr);
48 
52 int8_t vpos8(
53  const int8_t x);
54 
58 int8_t vsign8(
59  const int8_t x);
60 
64 unsigned vdepth1_8(
65  const int8_t x);
66 
70 int8_t vlmul8(
71  const int8_t x,
72  const int8_t y);
73 
77 vpu_int8_acc_t vlmacc8(
78  const vpu_int8_acc_t acc,
79  const int8_t x,
80  const int8_t y);
81 
85 vpu_int8_acc_t vlmaccr8(
86  const vpu_int8_acc_t acc,
87  const int8_t x[VPU_INT8_EPV],
88  const int8_t y[VPU_INT8_EPV]);
89 
93 int8_t vlsat8(
94  const vpu_int8_acc_t acc,
95  const unsigned sat);
96 
97 
98 
99 
100 
101 
105 int16_t vladd16(
106  const int16_t x,
107  const int16_t y);
108 
112 int16_t vlsub16(
113  const int16_t x,
114  const int16_t y);
115 
119 int16_t vlashr16(
120  const int16_t x,
121  const right_shift_t shr);
122 
126 int16_t vpos16(
127  const int16_t x);
128 
132 int16_t vsign16(
133  const int16_t x);
134 
138 unsigned vdepth1_16(
139  const int16_t x);
140 
144 int8_t vdepth8_16(
145  const int16_t x);
146 
150 int16_t vlmul16(
151  const int16_t x,
152  const int16_t y);
153 
157 vpu_int16_acc_t vlmacc16(
158  const vpu_int16_acc_t acc,
159  const int16_t x,
160  const int16_t y);
161 
165 vpu_int16_acc_t vlmaccr16(
166  const vpu_int16_acc_t acc,
167  const int16_t x[VPU_INT16_EPV],
168  const int16_t y[VPU_INT16_EPV]);
169 
173 int16_t vlsat16(
174  const vpu_int16_acc_t acc,
175  const unsigned sat);
176 
180 vpu_int16_acc_t vadddr16(
181  const vpu_int16_acc_t acc[VPU_INT16_ACC_PERIOD]);
182 
183 
184 
185 
186 
187 
191 int32_t vladd32(
192  const int32_t x,
193  const int32_t y);
194 
198 int32_t vlsub32(
199  const int32_t x,
200  const int32_t y);
201 
205 int32_t vlashr32(
206  const int32_t x,
207  const right_shift_t shr);
208 
212 int32_t vpos32(
213  const int32_t x);
214 
218 int32_t vsign32(
219  const int32_t x);
220 
224 unsigned vdepth1_32(
225  const int32_t x);
226 
230 int8_t vdepth8_32(
231  const int32_t x);
232 
236 int16_t vdepth16_32(
237  const int32_t x);
238 
242 int32_t vlmul32(
243  const int32_t x,
244  const int32_t y);
245 
249 vpu_int32_acc_t vlmacc32(
250  const vpu_int32_acc_t acc,
251  const int32_t x,
252  const int32_t y);
253 
257 vpu_int32_acc_t vlmaccr32(
258  const vpu_int32_acc_t acc,
259  const int32_t x[VPU_INT32_EPV],
260  const int32_t y[VPU_INT32_EPV]);
261 
265 int32_t vlsat32(
266  const vpu_int32_acc_t acc,
267  const unsigned sat);
268 
272 int32_t vcmr32(
273  const complex_s32_t vD,
274  const complex_s32_t vC);
275 
279 int32_t vcmi32(
280  const complex_s32_t vD,
281  const complex_s32_t vC);
282 
286 int32_t vcmcr32(
287  const complex_s32_t vD,
288  const complex_s32_t vC);
289 
293 int32_t vcmci32(
294  const complex_s32_t vD,
295  const complex_s32_t vC);
296 
297 
298 
303 float fmacc(
304  const float acc,
305  const float b,
306  const float c);
307 
308 
309 
310 #endif //XS3_VPU_SCALAR_OPS_H_
int right_shift_t
A rightwards arithmetic bit-shift.
Definition: xs3_math_types.h:98
int32_t vpu_int8_acc_t
Definition: xs3_vpu_info.h:143
int32_t vpu_int16_acc_t
Definition: xs3_vpu_info.h:150
int64_t vpu_int32_acc_t
Definition: xs3_vpu_info.h:157
A complex number with a 32-bit real part and 32-bit imaginary part.
Definition: xs3_math_types.h:49