XCORE SDK
XCORE Software Development Kit
bfp_init.h
1 // Copyright 2020-2021 XMOS LIMITED.
2 // This Software is subject to the terms of the XMOS Public Licence: Version 1.
3 
4 #pragma once
5 
6 #include <stdlib.h>
7 #include <stdint.h>
8 
9 #include "xs3_math_types.h"
10 
55 C_API
56 void bfp_s16_init(
57  bfp_s16_t* a,
58  int16_t* data,
59  const exponent_t exp,
60  const unsigned length,
61  const unsigned calc_hr);
62 
85 C_API
86 void bfp_s32_init(
87  bfp_s32_t* a,
88  int32_t* data,
89  const exponent_t exp,
90  const unsigned length,
91  const unsigned calc_hr);
92 
122 C_API
124  bfp_complex_s16_t* a,
125  int16_t* real_data,
126  int16_t* imag_data,
127  const exponent_t exp,
128  const unsigned length,
129  const unsigned calc_hr);
130 
154 C_API
156  bfp_complex_s32_t* a,
157  complex_s32_t* data,
158  const exponent_t exp,
159  const unsigned length,
160  const unsigned calc_hr);
161 
162 
197 C_API
199  unsigned length);
200 
201 
232 C_API
234  const unsigned length);
235 
236 
268 C_API
270  const unsigned length);
271 
272 
309 C_API
311  const unsigned length);
312 
313 
335 C_API
336 void bfp_s32_dealloc(
337  bfp_s32_t* vector);
338 
339 
361 C_API
362 void bfp_s16_dealloc(
363  bfp_s16_t* vector);
364 
365 
387 C_API
389  bfp_complex_s32_t* vector);
390 
391 
413 C_API
415  bfp_complex_s16_t* vector);
void bfp_s16_init(bfp_s16_t *a, int16_t *data, const exponent_t exp, const unsigned length, const unsigned calc_hr)
Initialize a 16-bit BFP vector.
Definition: bfp_init.c:13
void bfp_s16_dealloc(bfp_s16_t *vector)
Deallocate a 16-bit BFP vector allocated by bfp_s16_alloc().
Definition: bfp_alloc.c:95
void bfp_complex_s16_dealloc(bfp_complex_s16_t *vector)
Deallocate a complex 16-bit BFP vector allocated by bfp_complex_s16_alloc().
Definition: bfp_alloc.c:121
bfp_complex_s16_t bfp_complex_s16_alloc(const unsigned length)
Dynamically allocate a complex 16-bit BFP vector from the heap.
Definition: bfp_alloc.c:61
void bfp_complex_s16_init(bfp_complex_s16_t *a, int16_t *real_data, int16_t *imag_data, const exponent_t exp, const unsigned length, const unsigned calc_hr)
Initialize a complex 16-bit BFP vector.
Definition: bfp_init.c:48
bfp_s16_t bfp_s16_alloc(const unsigned length)
Dynamically allocate a 16-bit BFP vector from the heap.
Definition: bfp_alloc.c:29
void bfp_s32_init(bfp_s32_t *a, int32_t *data, const exponent_t exp, const unsigned length, const unsigned calc_hr)
Initialize a 32-bit BFP vector.
Definition: bfp_init.c:31
bfp_s32_t bfp_s32_alloc(unsigned length)
Dynamically allocate a 32-bit BFP vector from the heap.
Definition: bfp_alloc.c:13
void bfp_s32_dealloc(bfp_s32_t *vector)
Deallocate a 32-bit BFP vector allocated by bfp_s32_alloc().
Definition: bfp_alloc.c:82
void bfp_complex_s32_dealloc(bfp_complex_s32_t *vector)
Deallocate a complex 32-bit BFP vector allocated by bfp_complex_s32_alloc().
Definition: bfp_alloc.c:108
bfp_complex_s32_t bfp_complex_s32_alloc(const unsigned length)
Dynamically allocate a complex 32-bit BFP vector from the heap.
Definition: bfp_alloc.c:45
void bfp_complex_s32_init(bfp_complex_s32_t *a, complex_s32_t *data, const exponent_t exp, const unsigned length, const unsigned calc_hr)
Initialize a 32-bit complex BFP vector.
Definition: bfp_init.c:67
int exponent_t
An exponent.
Definition: xs3_math_types.h:76
[bfp_complex_s32_t]
Definition: xs3_math_types.h:371
[bfp_s16_t]
Definition: xs3_math_types.h:340
[bfp_s32_t]
Definition: xs3_math_types.h:309
A block floating-point vector of 32-bit elements.
Definition: xs3_math_types.h:276
A complex number with a 32-bit real part and 32-bit imaginary part.
Definition: xs3_math_types.h:49